105 if(!orig.RowMap().
template GlobalIndicesIsType<int_type>())
106 throw "EpetraExt::TCrsGraph_MapColoringIndex::operator(): Global indices mismatch.";
108 Base::origObj_ = &orig;
113 int NumColors = ColorMap_.NumColors();
114 int * ListOfColors = ColorMap_.ListOfColors();
116 std::map<int,int> MapOfColors;
117 for(
int i = 0; i < NumColors; ++i ) MapOfColors[ ListOfColors[i] ] = i;
120 std::vector<int_type> dummy( nRows, -1 );
123 int MaxNumIndices = orig.MaxNumIndices();
125 std::vector<int_type> Indices( MaxNumIndices );
127 for(
int i = 0; i < nRows; ++i )
129 orig.ExtractGlobalRowCopy( (int_type) orig.GRID64(i), MaxNumIndices, NumIndices, &Indices[0] );
131 for(
int j = 0; j < NumIndices; ++j )
132 (*IndexVec)[ MapOfColors[ColorMap_(Indices[j])] ][i] = Indices[j];
135 Base::newObj_ = IndexVec;