68 assert( !orig.IndicesAreGlobal() );
72 const Epetra_Map & DomainMap = orig.DomainMap();
78 for(
int i = 0; i < NumCols; ++i )
86 Comm.
SumAll( &Match, &MatchAll, 1 );
95 std::vector<int_type> Cols(NumCols);
97 for(
int i = 0; i < NumCols; ++i )
98 Cols[i] = (int_type) DomainMap.
GID64(i);
102 for(
int i = 0; i < NumMyCols; ++i )
103 if( !DomainMap.
MyGID( ColMap.
GID64(i) ) ) Cols.push_back( (int_type) ColMap.
GID64(i) );
105 int NewNumMyCols = Cols.size();
106 int NewNumGlobalCols;
107 Comm.
SumAll( &NewNumMyCols, &NewNumGlobalCols, 1 );
112 std::vector<int> NumIndicesPerRow( NumMyRows );
113 for(
int i = 0; i < NumMyRows; ++i )
114 NumIndicesPerRow[i] = orig.NumMyEntries(i);
117 int MaxNumEntries = orig.MaxNumEntries();
119 std::vector<int_type> Indices( MaxNumEntries );
120 for(
int i = 0; i < NumMyRows; ++i )
122 int_type RowGID = (int_type) RowMap.
GID64(i);
123 orig.Graph().ExtractGlobalRowCopy( RowGID, MaxNumEntries, NumEntries, &Indices[0] );
126 const Epetra_Map & RangeMap = orig.RangeMap();
136 int numMyRows = NewMatrix->NumMyRows();
137 for(
int i = 0; i < numMyRows; ++i )
139 orig.ExtractMyRowView( i, indicesCnt, myValues, myIndices );
142 NewMatrix->InsertMyValues( i, indicesCnt, myValues, myIndices );
145 NewMatrix->FillComplete(DomainMap,RangeMap);