59 int NumRowEntries = 0;
60 double *RowValues = 0;
66 std::vector <int> Ap( numcols+1 );
67 std::vector <int> nextAp( numcols+1 );
68 #ifdef EPETRA_NO_32BIT_GLOBAL_INDICES
69 std::vector <long long> Ai(
EPETRA_MAX( numcols, numentries) ) ;
71 std::vector <int> Ai(
EPETRA_MAX( numcols, numentries) ) ;
73 std::vector <double> Aval(
EPETRA_MAX( numcols, numentries) ) ;
81 std::vector <int>RowsPerCol( numcols ) ;
82 for (
int i = 0 ; i < numcols ; i++ ) RowsPerCol[i] = 0 ;
83 for (
int MyRow = 0; MyRow <numrows; MyRow++ ) {
89 for (
int j = 0; j < NumRowEntries; j++ ) {
90 RowsPerCol[ ColIndices[j] ] ++ ;
97 for (
int i = 0 ; i < numcols ; i++ ) {
98 Ap[i+1]= Ap[i] + RowsPerCol[i] ;
104 for (
int MyRow = 0; MyRow <numrows; MyRow++ ) {
109 assert( ierr == 0 ) ;
110 for (
int j = 0; j < NumRowEntries; j++ ) {
111 Ai[ nextAp[ ColIndices[j] ] ] = MyRow ;
112 Aval[ nextAp[ ColIndices[j] ] ] = RowValues[j] ;
113 nextAp[ ColIndices[j] ] ++ ;
120 for (
int MyRow = 0; MyRow <numrows; MyRow++ ) {
121 int NumInCol = Ap[MyRow+1] - Ap[MyRow] ;
122 #if !defined(EPETRA_NO_32BIT_GLOBAL_INDICES) || !defined(EPETRA_NO_64BIT_GLOBAL_INDICES)
long long NumGlobalRows64() const
long long NumGlobalCols64() const
virtual int InsertGlobalValues(int GlobalRow, int NumEntries, const double *Values, const int *Indices)
int CrsMatrixTranspose(Epetra_CrsMatrix *In, Epetra_CrsMatrix *Out)
virtual int MyPID() const =0
int FillComplete(bool OptimizeDataStorage=true)
int ExtractMyRowView(int MyRow, int &NumEntries, double *&Values, int *&Indices) const
long long NumGlobalNonzeros64() const
bool IndicesAreGlobal() const
const Epetra_Comm & Comm() const