99 if(!orig.RowMap().
template GlobalIndicesIsType<int_type>())
100 throw "EpetraExt::TCrsGraph_MapColoringIndex::operator(): Global indices mismatch.";
102 Base::origObj_ = &orig;
107 int NumColors = ColorMap_.NumColors();
108 int * ListOfColors = ColorMap_.ListOfColors();
110 std::map<int,int> MapOfColors;
111 for(
int i = 0; i < NumColors; ++i ) MapOfColors[ ListOfColors[i] ] = i;
114 std::vector<int_type> dummy( nRows, -1 );
117 int MaxNumIndices = orig.MaxNumIndices();
119 std::vector<int_type> Indices( MaxNumIndices );
121 for(
int i = 0; i < nRows; ++i )
123 orig.ExtractGlobalRowCopy( (int_type) orig.GRID64(i), MaxNumIndices, NumIndices, &Indices[0] );
125 for(
int j = 0; j < NumIndices; ++j )
126 (*IndexVec)[ MapOfColors[ColorMap_(Indices[j])] ][i] = Indices[j];
129 Base::newObj_ = IndexVec;