61 template<
typename int_type>
68 assert( !orig.IndicesAreGlobal() );
72 const Epetra_Map & DomainMap = orig.DomainMap();
75 int NumMyRows = RowMap.NumMyElements();
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();
137 for(
int i = 0; i < numMyRows; ++i )
139 orig.ExtractMyRowView( i, indicesCnt, myValues, myIndices );
157 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
158 if(orig.RowMap().GlobalIndicesInt()) {
159 return construct<int>(orig);
163 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
164 if(orig.RowMap().GlobalIndicesLongLong()) {
165 return construct<long long>(orig);
169 throw "CrsMatrix_SolverMap::operator(): GlobalIndices type unknown";
NewTypeRef operator()(OriginalTypeRef orig)
Constructs fixed view of Epetra_CrsMatrix as necessary.
long long IndexBase64() const
int InsertGlobalIndices(int_type GlobalRow, int NumIndices, int_type *Indices)
int FillComplete(bool OptimizeDataStorage=true)
virtual int SumAll(double *PartialSums, double *GlobalSums, int Count) const =0
int NumMyElements() const
long long GID64(int LID) const
bool MyGID(int GID_in) const
int ExtractMyRowView(int LocalRow, int &NumIndices, int *&Indices) const
~CrsMatrix_SolverMap()
Destructor.
int InsertMyValues(int MyRow, int NumEntries, const double *Values, const int *Indices)
Epetra_CrsGraph * NewGraph_