44#ifndef EPETRA_BASICROWMATRIX_H
45#define EPETRA_BASICROWMATRIX_H
176 virtual int ExtractMyRowCopy(
int MyRow,
int Length,
int & NumEntries,
double *Values,
int * Indices)
const = 0;
198 virtual int ExtractMyEntryView(
int CurEntry,
double const * & Value,
int & RowIndex,
int & ColIndex)
const = 0;
234 virtual int Solve(
bool Upper,
bool Trans,
bool UnitDiagonal,
302 virtual bool Filled()
const {
return(
true);}
305 bool LowerTriangular()
const {
if (!HaveNumericConstants_) ComputeNumericConstants();
return(LowerTriangular_);}
308 virtual bool UpperTriangular()
const {
if (!HaveNumericConstants_) ComputeNumericConstants();
return(UpperTriangular_);}
323 virtual double NormInf()
const{
if (!HaveNumericConstants_) ComputeNumericConstants();
return(NormInf_);}
333 virtual double NormOne()
const{
if (!HaveNumericConstants_) ComputeNumericConstants();
return(NormOne_);}
341#ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
344 if (!HaveStructureConstants_)
345 ComputeStructureConstants();
346 return (
int) NumGlobalNonzeros_;
349 throw "Epetra_BasicRowMatrix::NumGlobalNonzeros: GlobalIndices not int.";
352 virtual long long NumGlobalNonzeros64()
const{
if (!HaveStructureConstants_) ComputeStructureConstants();
return(NumGlobalNonzeros_);}
355#ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
361 throw "Epetra_BasicRowMatrix::NumGlobalRows: GlobalIndices not int.";
367#ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
373 throw "Epetra_BasicRowMatrix::NumGlobalCols: GlobalIndices not int.";
379#ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
385 throw "Epetra_BasicRowMatrix::NumGlobalDiagonals: GlobalIndices not int.";
391 virtual int NumMyNonzeros()
const{
if (!HaveStructureConstants_) ComputeStructureConstants();
return(NumMyNonzeros_);}
403 virtual int MaxNumEntries()
const{
if (!HaveStructureConstants_) ComputeStructureConstants();
return(MaxNumEntries_);}
432 virtual void Print(std::ostream & os)
const;
447 virtual int SetUseTranspose(
bool use_transpose) {UseTranspose_ = use_transpose;
return(0);}
524 virtual void ComputeStructureConstants()
const;
529 virtual void ComputeNumericConstants()
const;
533 void UpdateImportVector(
int NumVectors)
const;
534 void UpdateExportVector(
int NumVectors)
const;
535 void SetImportExport();
Epetra_BasicRowMatrix: A class for simplifying the development of Epetra_RowMatrix adapters.
virtual int NumGlobalDiagonals() const
Returns the number of global nonzero diagonal entries.
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 NumMyNonzeros() const
Returns the number of nonzero entries in the calling processor's portion of the matrix.
virtual const Epetra_Import * RowMatrixImporter() const
Returns the Epetra_Import object that contains the import operations for distributed operations.
virtual const Epetra_Map & RowMatrixColMap() const
Returns the Column Map object needed for implementing Epetra_RowMatrix.
virtual bool UseTranspose() const
Returns the current UseTranspose setting.
virtual const Epetra_Export * Exporter() const
Returns the Epetra_Export object that contains the export operations for distributed operations,...
virtual int NumMyCols() const
Returns the number of matrix columns owned by the calling processor.
virtual const Epetra_Map & OperatorRangeMap() const
Returns the Epetra_Map object associated with the range of this operator (same as domain).
bool HasNormInf() const
Returns true because this class can compute an Inf-norm.
bool HaveStructureConstants_
virtual double NormInf() const
Returns the infinity norm of the global matrix.
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.
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_
virtual int NumGlobalCols() const
Returns the number of global matrix columns.
long long NumGlobalNonzeros_
virtual int Apply(const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
Returns the result of a Epetra_RowMatrix applied to a Epetra_MultiVector X in Y.
virtual const Epetra_Comm & Comm() const
Returns a pointer to the Epetra_Comm communicator associated with this matrix.
virtual int NumMyRows() const
Returns the number of matrix rows owned by the calling processor.
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_
virtual int ApplyInverse(const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
Returns the result of a Epetra_RowMatrix inverse applied to an Epetra_MultiVector X in Y.
virtual int SetUseTranspose(bool use_transpose)
If set true, transpose of this operator will be applied.
virtual double NormOne() const
Returns the one norm of the global matrix.
virtual int ExtractMyEntryView(int CurEntry, double const *&Value, int &RowIndex, int &ColIndex) const =0
Returns a const reference to the ith entry in the matrix, along with its row and column index.
virtual int NumGlobalRows() const
Returns the number of global matrix rows.
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.
bool LowerTriangular() const
If matrix is lower triangular, this query returns true, otherwise it returns false.
Epetra_Export * Exporter_
virtual const Epetra_Map & RowMatrixRowMap() const
Returns the Row Map object needed for implementing Epetra_RowMatrix.
Epetra_MultiVector * ExportVector_
virtual bool Filled() const
If FillComplete() has been called, this query returns true, otherwise it returns false,...
virtual int Solve(bool Upper, bool Trans, bool UnitDiagonal, const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
Returns the result of a Epetra_BasicRowMatrix solve with a Epetra_MultiVector X in Y (not implemented...
virtual int NumGlobalNonzeros() const
Returns the number of nonzero entries in the global matrix.
Epetra_Map OperatorDomainMap_
virtual const char * Label() const
Returns a character string describing the operator.
virtual const Epetra_BlockMap & Map() const
Implement the Epetra_SrcDistObjec::Map() function.
virtual bool UpperTriangular() const
If matrix is upper triangular, this query returns true, otherwise it returns false.
Epetra_Map RowMatrixColMap_
Epetra_BlockMap: A class for partitioning block element vectors and matrices.
Epetra_Comm: The Epetra Communication Abstract Base Class.
Epetra_CompObject: Functionality and data that is common to all computational classes.
Epetra_Export: This class builds an export object for efficient exporting of off-processor elements.
Epetra_Import: This class builds an import object for efficient importing of off-processor elements.
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...
Epetra_Object: The base Epetra class.
virtual void Print(std::ostream &os) const
Print object to an output stream Print method.
virtual const char * Label() const
Epetra_Object Label access funtion.
virtual const Epetra_Map & OperatorDomainMap() const =0
Returns the Epetra_Map object associated with the domain of this operator.
virtual const Epetra_Map & OperatorRangeMap() const =0
Returns the Epetra_Map object associated with the range of this operator.
Epetra_RowMatrix: A pure virtual class for using real-valued double-precision row matrices.
virtual int Multiply(bool TransA, const Epetra_MultiVector &X, Epetra_MultiVector &Y) const =0
Returns the result of a Epetra_RowMatrix multiplied by a Epetra_MultiVector X in Y.
virtual int ExtractDiagonalCopy(Epetra_Vector &Diagonal) const =0
Returns a copy of the main diagonal in a user-provided vector.
virtual long long NumGlobalRows64() const =0
virtual const Epetra_Map & RowMatrixColMap() const =0
Returns the Epetra_Map object associated with the columns of this matrix.
virtual const Epetra_Map & RowMatrixRowMap() const =0
Returns the Epetra_Map object associated with the rows of this matrix.
virtual long long NumGlobalCols64() const =0
virtual int InvRowSums(Epetra_Vector &x) const =0
Computes the sum of absolute values of the rows of the Epetra_RowMatrix, results returned in x.
virtual int RightScale(const Epetra_Vector &x)=0
Scales the Epetra_RowMatrix on the right with a Epetra_Vector x.
virtual int InvColSums(Epetra_Vector &x) const =0
Computes the sum of absolute values of the columns of the Epetra_RowMatrix, results returned in x.
virtual long long NumGlobalDiagonals64() const =0
virtual int LeftScale(const Epetra_Vector &x)=0
Scales the Epetra_RowMatrix on the left with a Epetra_Vector x.
Epetra_Vector: A class for constructing and using dense vectors on a parallel computer.