| 1134 | } |
| 1135 | |
| 1136 | void vtkPKdTree::DoTransfer(int from, int to, int fromIndex, int toIndex, int count) |
| 1137 | { |
| 1138 | float *fromPt, *toPt; |
| 1139 | |
| 1140 | vtkCommunicator* comm = this->Controller->GetCommunicator(); |
| 1141 | |
| 1142 | int nitems = count * 3; |
| 1143 | |
| 1144 | int me = this->MyId; |
| 1145 | |
| 1146 | int tag = this->SubGroup->tag; |
| 1147 | |
| 1148 | if ((from == me) && (to == me)) |
| 1149 | { |
| 1150 | fromPt = this->GetLocalVal(fromIndex); |
| 1151 | toPt = this->GetLocalValNext(toIndex); |
| 1152 | |
| 1153 | memcpy(toPt, fromPt, nitems * sizeof(float)); |
| 1154 | } |
| 1155 | else if (from == me) |
| 1156 | { |
| 1157 | fromPt = this->GetLocalVal(fromIndex); |
| 1158 | |
| 1159 | comm->Send(fromPt, nitems, to, tag); |
| 1160 | } |
| 1161 | else if (to == me) |
| 1162 | { |
| 1163 | toPt = this->GetLocalValNext(toIndex); |
| 1164 | |
| 1165 | comm->Receive(toPt, nitems, from, tag); |
| 1166 | } |
| 1167 | } |
| 1168 | |
| 1169 | // Partition global array into three intervals, the first all values < T, |
| 1170 | // the second all values = T, the third all values > T. Return two |
no test coverage detected