| 74 | |
| 75 | template <bool HaveGhosts, bool IsFloatingPt> |
| 76 | void Process(vtkIdType begin, vtkIdType end, double delta, vtkIdTypeArray* histo) |
| 77 | { |
| 78 | auto& localSamplesInRange = this->ThreadSamplesInRange.Local(); |
| 79 | vtkTypeInt64 count; |
| 80 | for (vtkIdType ii = begin; ii < end; ++ii) |
| 81 | { |
| 82 | if (HaveGhosts) |
| 83 | { |
| 84 | // Skip any entry with any ghost-bit marked: |
| 85 | if (!!this->Ghosts->GetValue(ii)) |
| 86 | { |
| 87 | continue; |
| 88 | } |
| 89 | } |
| 90 | double val = this->Data->GetTuple1(ii); |
| 91 | int bin; |
| 92 | if (IsFloatingPt) |
| 93 | { |
| 94 | if (vtkMath::IsNan(val)) |
| 95 | { |
| 96 | bin = this->NumberOfBins + 2; |
| 97 | } |
| 98 | else if (val < this->Lo) |
| 99 | { |
| 100 | bin = 0; |
| 101 | } |
| 102 | else if (val > this->Hi) |
| 103 | { |
| 104 | bin = this->NumberOfBins + 1; |
| 105 | } |
| 106 | else if (val == this->Hi) |
| 107 | { |
| 108 | bin = this->NumberOfBins; |
| 109 | ++localSamplesInRange; |
| 110 | } |
| 111 | else |
| 112 | { |
| 113 | bin = static_cast<int>((this->NumberOfBins * (val - this->Lo)) / delta) + 1; |
| 114 | ++localSamplesInRange; |
| 115 | } |
| 116 | } |
| 117 | else |
| 118 | { |
| 119 | if (val < this->Lo) |
| 120 | { |
| 121 | bin = 0; |
| 122 | } |
| 123 | else if (val > this->Hi) |
| 124 | { |
| 125 | bin = this->NumberOfBins + 1; |
| 126 | } |
| 127 | else if (val == this->Hi) |
| 128 | { |
| 129 | bin = this->NumberOfBins; |
| 130 | ++localSamplesInRange; |
| 131 | } |
| 132 | else |
| 133 | { |
nothing calls this directly
no test coverage detected