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 <<
" ";
void UpdateImportVector(int NumVectors) const
Epetra_MultiVector: A class for constructing and using dense multi-vectors, vectors and matrices in p...
virtual const Epetra_Map & RowMatrixRowMap() const
Returns the Row Map object needed for implementing Epetra_RowMatrix.
Epetra_Map: A class for partitioning vectors and matrices.
bool DistributedGlobal() const
Returns true if map is defined across more than one processor.
virtual int InvColSums(Epetra_Vector &x) const
Computes the sum of absolute values of the columns of the Epetra_BasicRowMatrix, results returned in ...
Epetra_IntSerialDenseVector: A class for constructing and using dense vectors.
virtual const Epetra_Map & OperatorDomainMap() const
Returns the Epetra_Map object associated with the domain of this operator.
virtual int LeftScale(const Epetra_Vector &x)
Scales the Epetra_BasicRowMatrix on the left with a Epetra_Vector x.
void SetMaps(const Epetra_Map &RowMap, const Epetra_Map &ColMap)
Set maps (Version 1); call this function or the next, but not both.
int MaxValue(double *Result) const
Compute maximum value of each vector in multi-vector.
virtual long long NumGlobalDiagonals64() const
bool HaveNumericConstants_
virtual int NumMyDiagonals() const
Returns the number of local nonzero diagonal entries.
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...
bool SameAs(const Epetra_BlockMap &Map) const
Returns true if this and Map are identical maps.
virtual void ComputeNumericConstants() const
Update the constants associated with the values of the matrix: Call only if values changes from the i...
virtual int ExtractDiagonalCopy(Epetra_Vector &Diagonal) const
Returns a copy of the main diagonal in a user-provided vector.
const Epetra_BlockMap & SourceMap() const
Returns the SourceMap used to construct this exporter.
virtual const Epetra_Comm & Comm() const
Returns a pointer to the Epetra_Comm communicator associated with this matrix.
virtual long long NumGlobalNonzeros64() const
int PutScalar(double ScalarConstant)
Initialize all values in a multi-vector with constant value.
int MyLength() const
Returns the local vector length on the calling processor of vectors in the multi-vector.
virtual void SetLabel(const char *const Label)
Epetra_Object Label definition using char *.
double ** Pointers() const
Get pointer to individual vector pointers.
#define EPETRA_CHK_ERR(a)
virtual int InvRowSums(Epetra_Vector &x) const
Computes the sum of absolute values of the rows of the Epetra_BasicRowMatrix, results returned in x...
Epetra_Export: This class builds an export object for efficient exporting of off-processor elements...
Epetra_Vector: A class for constructing and using dense vectors on a parallel computer.
Epetra_Import: This class builds an import object for efficient importing of off-processor elements...
virtual void Barrier() const =0
Epetra_Comm Barrier function.
virtual int RightScale(const Epetra_Vector &x)
Scales the Epetra_BasicRowMatrix on the right with a Epetra_Vector x.
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.
int NumVectors() const
Returns the number of vectors in the multi-vector.
virtual int MyPID() const =0
Return my process ID.
virtual void Print(std::ostream &os) const
Print method.
void UpdateExportVector(int NumVectors) const
bool HaveStructureConstants_
Epetra_SerialDenseVector: A class for constructing and using dense vectors.
virtual int SumAll(double *PartialSums, double *GlobalSums, int Count) const =0
Epetra_Comm Global Sum function.
int NumMyElements() const
Number of elements on the calling processor.
long long GID64(int LID) const
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.
virtual int MaxNumEntries() const
Returns the maximum number of nonzero entries across all rows on this processor.
Epetra_Comm: The Epetra Communication Abstract Base Class.
virtual int NumMyRowEntries(int MyRow, int &NumEntries) const =0
Return the current number of values stored for the specified local row.
Epetra_Map RowMatrixColMap_
const Epetra_BlockMap & TargetMap() const
Returns the TargetMap used to construct this importer.
Epetra_MultiVector * ExportVector_
const double Epetra_MaxDouble
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...
Epetra_Import * Importer_
virtual const Epetra_Map & RowMatrixColMap() const
Returns the Column Map object needed for implementing Epetra_RowMatrix.
const Epetra_Comm & Comm() const
Access function for Epetra_Comm communicator.
virtual ~Epetra_BasicRowMatrix()
Epetra_BasicRowMatrix Destructor.
virtual void ComputeStructureConstants() const
Update the constants associated with the structure of the matrix: Call only if structure changes from...
const double Epetra_MinDouble
double * Values() const
Get pointer to MultiVector values.
Epetra_Map RowMatrixRowMap_
virtual const Epetra_Import * Importer() const
Returns the Epetra_Import object that contains the import operations for distributed operations...
virtual const Epetra_Map & OperatorRangeMap() const
Returns the Epetra_Map object associated with the range of this operator (same as domain)...
virtual int NumProc() const =0
Returns total number of processes.
Epetra_Map OperatorDomainMap_
virtual const Epetra_Export * Exporter() const
Returns the Epetra_Export object that contains the export operations for distributed operations...
Epetra_BasicRowMatrix(const Epetra_Comm &Comm)
Epetra_BasicRowMatrix constructor.
virtual long long NumGlobalCols64() const
virtual long long NumGlobalRows64() const
virtual int ReportError(const std::string Message, int ErrorCode) const
Error reporting method.
Epetra_Map OperatorRangeMap_
int NumMyPoints() const
Number of local points for this map; equals the sum of all element sizes on the calling processor...
double * Values() const
Returns pointer to the values in vector.
int * Values()
Returns pointer to the values in vector.
Epetra_Export * Exporter_
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.
void UpdateFlops(int Flops_in) const
Increment Flop count for this object.
long long NumGlobalNonzeros_
Epetra_MultiVector * ImportVector_
const Epetra_BlockMap & Map() const
Returns the address of the Epetra_BlockMap for this multi-vector.