58 int NumRowEntries = 0;
59 double *RowValues = 0;
65 std::vector <int> Ap( numcols+1 );
66 std::vector <int> nextAp( numcols+1 );
67 #ifdef EPETRA_NO_32BIT_GLOBAL_INDICES
68 std::vector <long long> Ai(
EPETRA_MAX( numcols, numentries) ) ;
70 std::vector <int> Ai(
EPETRA_MAX( numcols, numentries) ) ;
72 std::vector <double> Aval(
EPETRA_MAX( numcols, numentries) ) ;
80 std::vector <int>RowsPerCol( numcols ) ;
81 for (
int i = 0 ; i < numcols ; i++ ) RowsPerCol[i] = 0 ;
82 for (
int MyRow = 0; MyRow <numrows; MyRow++ ) {
85 for (
int j = 0; j < NumRowEntries; j++ ) {
86 RowsPerCol[ ColIndices[j] ] ++ ;
93 for (
int i = 0 ; i < numcols ; i++ ) {
94 Ap[i+1]= Ap[i] + RowsPerCol[i] ;
100 for (
int MyRow = 0; MyRow <numrows; MyRow++ ) {
102 assert( ierr == 0 ) ;
103 for (
int j = 0; j < NumRowEntries; j++ ) {
104 Ai[ nextAp[ ColIndices[j] ] ] = MyRow ;
105 Aval[ nextAp[ ColIndices[j] ] ] = RowValues[j] ;
106 nextAp[ ColIndices[j] ] ++ ;
113 for (
int MyRow = 0; MyRow <numrows; MyRow++ ) {
114 int NumInCol = Ap[MyRow+1] - Ap[MyRow] ;
115 #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