------------------------------------------------------------------------------
| 145 | |
| 146 | //------------------------------------------------------------------------------ |
| 147 | void vtkDistributedGraphHelper::AttachToGraph(vtkGraph* graph) |
| 148 | { |
| 149 | this->Graph = graph; |
| 150 | |
| 151 | // Some factors and masks to help speed up encoding/decoding {owner,index} |
| 152 | int numProcs = this->Graph->GetInformation()->Get(vtkDataObject::DATA_NUMBER_OF_PIECES()); |
| 153 | int tmp = numProcs - 1; |
| 154 | // The following is integer arith equiv of ceil(log2(numProcs)): |
| 155 | int numProcBits = 0; |
| 156 | while (tmp != 0) |
| 157 | { |
| 158 | tmp >>= 1; |
| 159 | numProcBits++; |
| 160 | } |
| 161 | if (numProcs == 1) |
| 162 | numProcBits = 1; |
| 163 | |
| 164 | this->signBitMask = VTK_ID_MIN; |
| 165 | this->highBitShiftMask = static_cast<vtkIdType>(1) << numProcBits; |
| 166 | this->procBits = numProcBits + 1; |
| 167 | this->indexBits = (sizeof(vtkIdType) * CHAR_BIT) - (numProcBits + 1); |
| 168 | } |
| 169 | |
| 170 | //------------------------------------------------------------------------------ |
| 171 | void vtkDistributedGraphHelper::SetVertexPedigreeIdDistribution( |
no test coverage detected