Compose the coordinate sums and then average them (to compute the origin).
| 513 | // Compose the coordinate sums and then average them (to |
| 514 | // compute the origin). |
| 515 | void Reduce() |
| 516 | { |
| 517 | double sum[3] = { 0, 0, 0 }; |
| 518 | auto iEnd = this->Sum.end(); |
| 519 | for (auto itr = this->Sum.begin(); itr != iEnd; ++itr) |
| 520 | { |
| 521 | vtkMath::Add(sum, (*itr).data(), sum); |
| 522 | } |
| 523 | |
| 524 | vtkIdType npts = this->Points->GetNumberOfPoints(); |
| 525 | vtkMath::Add(this->Origin, sum, this->Origin); |
| 526 | vtkMath::MultiplyScalar(this->Origin, (1.0 / npts)); |
| 527 | } |
| 528 | }; |
| 529 | |
| 530 | // Determine the points covariance matrix |
nothing calls this directly
no test coverage detected