59 : Comm_(comm.Clone()),
60#if !defined(EPETRA_NO_32BIT_GLOBAL_INDICES) || !defined(EPETRA_NO_64BIT_GLOBAL_INDICES)
67 NumGlobalNonzeros_(0),
73 LowerTriangular_(true),
74 UpperTriangular_(true),
75 HaveStructureConstants_(false),
76 HaveNumericConstants_(false),
103 SetMaps(RowMap, ColMap, RowMap, RowMap);
162 for(
int j = 0; j < NumEntries; j++) {
163 x1[i] += std::abs(Values[j]);
164 x2[Indices[j]] += std::abs(Values[j]);
208 for(
int j = 0; j < NumEntries; j++) {
210 Diagonal[i] = Values[j];
225 double * xp = (
double*)x.
Values();
229 double * x_tmp_p = (
double*)x_tmp.
Values();
232 for (j=0; j < NumEntries; j++) x_tmp_p[i] += std::abs(Values[j]);
236 for (i=0; i<myLength; i++) {
238 if (xp[i]==0.0) ierr = 1;
239 else if (ierr!=1) ierr = 2;
250 for (j=0; j < NumEntries; j++) scale += std::abs(Values[j]);
252 if (scale==0.0) ierr = 1;
253 else if (ierr!=1) ierr = 2;
270 int curRowIndex, curColIndex;
276 *curValue *= xtmp[curRowIndex];
282 *curValue *= x[curRowIndex];
300 double* xp = (
double*)x.
Values();
304 double * x_tmp_p = (
double*)x_tmp.
Values();
307 for(j = 0; j < NumEntries; j++)
308 x_tmp_p[Indices[j]] += std::abs(Values[j]);
315 for(j = 0; j < NumEntries; j++)
316 xp[Indices[j]] += std::abs(Values[j]);
324 for(i = 0; i < MapNumMyElements; i++) {
325 double scale = xp[i];
344 int curRowIndex, curColIndex;
350 *curValue *= xtmp[curColIndex];
356 *curValue *= x[curColIndex];
383 double ** Xp = (
double**) X.
Pointers();
384 double ** Yp = (
double**) Y.
Pointers();
402 for (
int k=0; k<NumVectors; k++) {
404 for(
int j = 0; j < NumEntries; j++)
405 sum += Values[j]*Xp[k][Indices[j]];
437 for (
int k=0; k<NumVectors; k++) {
438 double xtmp = Xp[k][i];
439 for(
int j = 0; j < NumEntries; j++)
440 Yp[k][Indices[j]] += Values[j]*xtmp;
490 for (
int iproc=0; iproc < NumProc; iproc++) {
493 os <<
"\nNumber of Global Rows = "; os <<
NumGlobalRows64(); os << std::endl;
494 os <<
"Number of Global Cols = "; os <<
NumGlobalCols64(); os << std::endl;
499 os <<
"\nNumber of My Rows = "; os <<
NumMyRows_; os << std::endl;
500 os <<
"Number of My Cols = "; os <<
NumMyCols_; os << std::endl;
501 os <<
"Number of My Diagonals = "; os <<
NumMyDiagonals(); os << std::endl;
502 os <<
"Number of My Nonzeros = "; os <<
NumMyNonzeros_; os << std::endl;
503 os <<
"My Maximum Num Entries = "; os <<
MaxNumEntries_; os << std::endl; os << std::endl;
513 for (
int iproc=0; iproc < NumProc; iproc++) {
534 for (
int j = 0; j < NumEntries ; j++) {
537 os << MyPID ; os <<
" ";
539 os << Row ; os <<
" ";
541 os << Index; os <<
" ";
543 os << Values[j]; os <<
" ";
#define EPETRA_CHK_ERR(a)
const double Epetra_MinDouble
const double Epetra_MaxDouble
virtual int InvColSums(Epetra_Vector &x) const
Computes the sum of absolute values of the columns of the Epetra_BasicRowMatrix, results returned in ...
void SetMaps(const Epetra_Map &RowMap, const Epetra_Map &ColMap)
Set maps (Version 1); call this function or the next, but not both.
virtual const Epetra_Map & OperatorDomainMap() const
Returns the Epetra_Map object associated with the domain of this operator.
Epetra_MultiVector * ImportVector_
bool HaveNumericConstants_
virtual int NumMyDiagonals() const
Returns the number of local nonzero diagonal entries.
virtual int ExtractDiagonalCopy(Epetra_Vector &Diagonal) const
Returns a copy of the main diagonal in a user-provided vector.
virtual void ComputeStructureConstants() const
Update the constants associated with the structure of the matrix: Call only if structure changes from...
virtual const Epetra_Map & RowMatrixColMap() const
Returns the Column Map object needed for implementing Epetra_RowMatrix.
virtual int Multiply(bool TransA, const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
Returns the result of a Epetra_BasicRowMatrix multiplied by a Epetra_MultiVector X in Y.
virtual int InvRowSums(Epetra_Vector &x) const
Computes the sum of absolute values of the rows of the Epetra_BasicRowMatrix, results returned in x.
virtual const Epetra_Export * Exporter() const
Returns the Epetra_Export object that contains the export operations for distributed operations,...
virtual int LeftScale(const Epetra_Vector &x)
Scales the Epetra_BasicRowMatrix on the left with a Epetra_Vector x.
virtual int RightScale(const Epetra_Vector &x)
Scales the Epetra_BasicRowMatrix on the right with a Epetra_Vector x.
virtual const Epetra_Map & OperatorRangeMap() const
Returns the Epetra_Map object associated with the range of this operator (same as domain).
bool HaveStructureConstants_
virtual int MaxNumEntries() const
Returns the maximum number of nonzero entries across all rows on this processor.
virtual long long NumGlobalCols64() const
virtual long long NumGlobalDiagonals64() const
virtual long long NumGlobalNonzeros64() const
virtual int NumMyRowEntries(int MyRow, int &NumEntries) const =0
Return the current number of values stored for the specified local row.
virtual ~Epetra_BasicRowMatrix()
Epetra_BasicRowMatrix Destructor.
Epetra_Import * Importer_
virtual int ExtractMyEntryView(int CurEntry, double *&Value, int &RowIndex, int &ColIndex)=0
Returns a reference to the ith entry in the matrix, along with its row and column index.
Epetra_Map OperatorRangeMap_
long long NumGlobalNonzeros_
Epetra_BasicRowMatrix(const Epetra_Comm &Comm)
Epetra_BasicRowMatrix constructor.
virtual const Epetra_Comm & Comm() const
Returns a pointer to the Epetra_Comm communicator associated with this matrix.
virtual void Print(std::ostream &os) const
Print method.
virtual long long NumGlobalRows64() const
virtual const Epetra_Import * Importer() const
Returns the Epetra_Import object that contains the import operations for distributed operations,...
Epetra_Map RowMatrixRowMap_
void UpdateExportVector(int NumVectors) const
virtual void ComputeNumericConstants() const
Update the constants associated with the values of the matrix: Call only if values changes from the i...
void UpdateImportVector(int NumVectors) const
virtual int ExtractMyRowCopy(int MyRow, int Length, int &NumEntries, double *Values, int *Indices) const =0
Returns a copy of the specified local row in user-provided arrays.
Epetra_Export * Exporter_
virtual const Epetra_Map & RowMatrixRowMap() const
Returns the Row Map object needed for implementing Epetra_RowMatrix.
Epetra_MultiVector * ExportVector_
Epetra_Map OperatorDomainMap_
Epetra_Map RowMatrixColMap_
int NumMyPoints() const
Number of local points for this map; equals the sum of all element sizes on the calling processor.
long long GID64(int LID) const
bool SameAs(const Epetra_BlockMap &Map) const
Returns true if this and Map are identical maps.
const Epetra_Comm & Comm() const
Access function for Epetra_Comm communicator.
int NumMyElements() const
Number of elements on the calling processor.
Epetra_Comm: The Epetra Communication Abstract Base Class.
virtual int NumProc() const =0
Returns total number of processes.
virtual int MyPID() const =0
Return my process ID.
virtual void Barrier() const =0
Epetra_Comm Barrier function.
virtual int SumAll(double *PartialSums, double *GlobalSums, int Count) const =0
Epetra_Comm Global Sum function.
void UpdateFlops(int Flops_in) const
Increment Flop count for this object.
const Epetra_BlockMap & Map() const
Returns the address of the Epetra_BlockMap for this multi-vector.
int Import(const Epetra_SrcDistObject &A, const Epetra_Import &Importer, Epetra_CombineMode CombineMode, const Epetra_OffsetIndex *Indexor=0)
Imports an Epetra_DistObject using the Epetra_Import object.
int Export(const Epetra_SrcDistObject &A, const Epetra_Import &Importer, Epetra_CombineMode CombineMode, const Epetra_OffsetIndex *Indexor=0)
Exports an Epetra_DistObject using the Epetra_Import object.
Epetra_Export: This class builds an export object for efficient exporting of off-processor elements.
const Epetra_BlockMap & SourceMap() const
Returns the SourceMap used to construct this exporter.
Epetra_Import: This class builds an import object for efficient importing of off-processor elements.
const Epetra_BlockMap & TargetMap() const
Returns the TargetMap used to construct this importer.
Epetra_IntSerialDenseVector: A class for constructing and using dense vectors.
int * Values()
Returns pointer to the values in vector.
Epetra_Map: A class for partitioning vectors and matrices.
Epetra_MultiVector: A class for constructing and using dense multi-vectors, vectors and matrices in p...
int NumVectors() const
Returns the number of vectors in the multi-vector.
int MyLength() const
Returns the local vector length on the calling processor of vectors in the multi-vector.
double * Values() const
Get pointer to MultiVector values.
double ** Pointers() const
Get pointer to individual vector pointers.
int MaxValue(double *Result) const
Compute maximum value of each vector in multi-vector.
int PutScalar(double ScalarConstant)
Initialize all values in a multi-vector with constant value.
virtual int ReportError(const std::string Message, int ErrorCode) const
Error reporting method.
virtual void SetLabel(const char *const Label)
Epetra_Object Label definition using char *.
Epetra_SerialDenseVector: A class for constructing and using dense vectors.
double * Values() const
Returns pointer to the values in vector.
Epetra_Vector: A class for constructing and using dense vectors on a parallel computer.