ML Version of the Day
Loading...
Searching...
No Matches
Public Member Functions | List of all members
ML_Epetra::CrsGraphWrapper Class Reference

ML_Epetra::CrsGraphWrapper: a class to wrap an Epetra_CrsGraph as Epetra_RowMatrix. More...

#include <ml_Epetra_wrap_CrsGraph_as_RowMatrix.H>

Inheritance diagram for ML_Epetra::CrsGraphWrapper:
Inheritance graph
[legend]
Collaboration diagram for ML_Epetra::CrsGraphWrapper:
Collaboration graph
[legend]

Public Member Functions

 CrsGraphWrapper (const Epetra_CrsGraph &graph, const Epetra_Map &dm, const Epetra_Map &rm, const Epetra_Comm &comm)
 Constructs a CrsGraphWrapper class.
 
virtual ~CrsGraphWrapper ()
 Destructor.
 
int NumMyRowEntries (int MyRow, int &NumEntries) const
 Returns the number of nonzero entries in MyRow.
 
int MaxNumEntries () const
 Returns the maximum of NumMyRowEntries() over all rows.
 
int ExtractMyRowCopy (int MyRow, int Length, int &NumEntries, double *Values, int *Indices) const
 Returns a copy of the specified local row in user-provided arrays.
 
int ExtractDiagonalCopy (Epetra_Vector &Diagonal) const
 not implemented, method will throw error and terminate execution.
 
int Multiply (bool TransA, const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
 not implemented, method will throw error and terminate execution.
 
int Solve (bool Upper, bool Trans, bool UnitDiagonal, const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
 not implemented, method will throw error and terminate execution.
 
int InvRowSums (Epetra_Vector &x) const
 not implemented, method will throw error and terminate execution.
 
int LeftScale (const Epetra_Vector &x)
 not implemented, method will throw error and terminate execution.
 
int InvColSums (Epetra_Vector &x) const
 not implemented, method will throw error and terminate execution.
 
int RightScale (const Epetra_Vector &x)
 not implemented, method will throw error and terminate execution.
 
bool Filled () const
 If FillComplete() has been called, this query returns true, otherwise it returns false.
 
double NormInf () const
 not implemented, method will throw error and terminate execution.
 
double NormOne () const
 not implemented, method will throw error and terminate execution.
 
long long NumGlobalNonzeros () const
 Returns the number of nonzero entries in the global matrix.
 
long long NumGlobalRows () const
 Returns the number of global matrix rows.
 
long long NumGlobalCols () const
 Returns the number of global matrix columns.
 
long long NumGlobalDiagonals () const
 Returns the number of global nonzero diagonal entries, based on global row/column index comparisons.
 
int NumMyNonzeros () const
 Returns the number of nonzero entries in the calling processor's portion of the matrix.
 
int NumMyRows () const
 Returns the number of matrix rows owned by the calling processor.
 
int NumMyCols () const
 Returns the number of matrix columns owned by the calling processor.
 
int NumMyDiagonals () const
 Returns the number of local nonzero diagonal entries, based on global row/column index comparisons.
 
bool LowerTriangular () const
 If matrix is lower triangular in local index space, this query returns true, otherwise it returns false.
 
bool UpperTriangular () const
 If matrix is upper triangular in local index space, this query returns true, otherwise it returns false.
 
const Epetra_MapRowMatrixRowMap () const
 Returns the Epetra_Map object associated with the rows of this matrix.
 
const Epetra_MapRowMatrixColMap () const
 Returns the Epetra_Map object associated with the columns of this matrix.
 
const Epetra_ImportRowMatrixImporter () const
 Returns the Epetra_Import object that contains the import operations for distributed operations.
 
const Epetra_BlockMapMap () const
 Returns the Epetra_Map object associated with the rows of this matrix, derived from Epetra_Operator.
 
int SetUseTranspose (bool UseTranspose)
 not implemented, method will always return -1
 
int Apply (const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
 not implemented, method will throw error and terminate execution.
 
int ApplyInverse (const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
 not implemented, method will throw error and terminate execution.
 
const char * Label () const
 returns the label of this class
 
bool UseTranspose () const
 returns the usetranspose_ flag
 
bool HasNormInf () const
 always returns false
 
const Epetra_CommComm () const
 returns ref to the Epetra_Comm associated with this class
 
const Epetra_MapOperatorDomainMap () const
 returns ref to the OperatorDomainMap associated with this class
 
const Epetra_MapOperatorRangeMap () const
 returns ref to the OperatorRangeMap associated with this class
 
virtual int NumMyRowEntries (int MyRow, int &NumEntries) const=0
 
virtual int MaxNumEntries () const=0
 
virtual int ExtractMyRowCopy (int MyRow, int Length, int &NumEntries, double *Values, int *Indices) const=0
 
virtual int ExtractDiagonalCopy (Epetra_Vector &Diagonal) const=0
 
virtual int Multiply (bool TransA, const Epetra_MultiVector &X, Epetra_MultiVector &Y) const=0
 
virtual int Solve (bool Upper, bool Trans, bool UnitDiagonal, const Epetra_MultiVector &X, Epetra_MultiVector &Y) const=0
 
virtual int InvRowSums (Epetra_Vector &x) const=0
 
virtual int LeftScale (const Epetra_Vector &x)=0
 
virtual int InvColSums (Epetra_Vector &x) const=0
 
virtual int RightScale (const Epetra_Vector &x)=0
 
virtual bool Filled () const=0
 
virtual double NormInf () const=0
 
virtual double NormOne () const=0
 
virtual int NumGlobalNonzeros () const=0
 
virtual int NumGlobalRows () const=0
 
virtual int NumGlobalCols () const=0
 
virtual int NumGlobalDiagonals () const=0
 
virtual int NumMyNonzeros () const=0
 
virtual int NumMyRows () const=0
 
virtual int NumMyCols () const=0
 
virtual int NumMyDiagonals () const=0
 
virtual bool LowerTriangular () const=0
 
virtual bool UpperTriangular () const=0
 
virtual const Epetra_MapRowMatrixRowMap () const=0
 
virtual const Epetra_MapRowMatrixColMap () const=0
 
virtual const Epetra_ImportRowMatrixImporter () const=0
 
virtual int NumMyRowEntries (int MyRow, int &NumEntries) const=0
 
virtual int MaxNumEntries () const=0
 
virtual int ExtractMyRowCopy (int MyRow, int Length, int &NumEntries, double *Values, int *Indices) const=0
 
virtual int ExtractDiagonalCopy (Epetra_Vector &Diagonal) const=0
 
virtual int Multiply (bool TransA, const Epetra_MultiVector &X, Epetra_MultiVector &Y) const=0
 
virtual int Solve (bool Upper, bool Trans, bool UnitDiagonal, const Epetra_MultiVector &X, Epetra_MultiVector &Y) const=0
 
virtual int InvRowSums (Epetra_Vector &x) const=0
 
virtual int LeftScale (const Epetra_Vector &x)=0
 
virtual int InvColSums (Epetra_Vector &x) const=0
 
virtual int RightScale (const Epetra_Vector &x)=0
 
virtual bool Filled () const=0
 
virtual double NormInf () const=0
 
virtual double NormOne () const=0
 
virtual int NumGlobalNonzeros () const=0
 
virtual int NumGlobalRows () const=0
 
virtual int NumGlobalCols () const=0
 
virtual int NumGlobalDiagonals () const=0
 
virtual int NumMyNonzeros () const=0
 
virtual int NumMyRows () const=0
 
virtual int NumMyCols () const=0
 
virtual int NumMyDiagonals () const=0
 
virtual bool LowerTriangular () const=0
 
virtual bool UpperTriangular () const=0
 
virtual const Epetra_MapRowMatrixRowMap () const=0
 
virtual const Epetra_MapRowMatrixColMap () const=0
 
virtual const Epetra_ImportRowMatrixImporter () const=0
 
virtual int SetUseTranspose (bool UseTranspose)=0
 
virtual int Apply (const Epetra_MultiVector &X, Epetra_MultiVector &Y) const=0
 
virtual int ApplyInverse (const Epetra_MultiVector &X, Epetra_MultiVector &Y) const=0
 
virtual double NormInf () const=0
 
virtual const char * Label () const=0
 
virtual bool UseTranspose () const=0
 
virtual bool HasNormInf () const=0
 
virtual const Epetra_CommComm () const=0
 
virtual const Epetra_MapOperatorDomainMap () const=0
 
virtual const Epetra_MapOperatorRangeMap () const=0
 
virtual int SetUseTranspose (bool UseTranspose)=0
 
virtual int Apply (const Epetra_MultiVector &X, Epetra_MultiVector &Y) const=0
 
virtual int ApplyInverse (const Epetra_MultiVector &X, Epetra_MultiVector &Y) const=0
 
virtual double NormInf () const=0
 
virtual const char * Label () const=0
 
virtual bool UseTranspose () const=0
 
virtual bool HasNormInf () const=0
 
virtual const Epetra_CommComm () const=0
 
virtual const Epetra_MapOperatorDomainMap () const=0
 
virtual const Epetra_MapOperatorRangeMap () const=0
 
virtual const Epetra_BlockMapMap () const=0
 
virtual const Epetra_BlockMapMap () const=0
 

Detailed Description

ML_Epetra::CrsGraphWrapper: a class to wrap an Epetra_CrsGraph as Epetra_RowMatrix.

Wraps a Epetra_CrsGraph as an Epetra_RowMatrix.

Class ML_Epetra::CrsGraphWrapper takes an Epetra_CrsGraph object and wraps it as an Epetra_RowMatrix. It can then be used as input to ML to generate a plain aggegration MG hierarchy. Note that the resulting coarse grid operators are rubbish and need to be replaced before actually applying this hierarchy to something. This class' destructor does not destoy any of the passed objects, so they need to be destoyed separately.

To make use of the full functionality of this class it requires ML to be configured with the following options:

Author
Michael Gee, SNL 9214
Date
Last update to Doxygen: 01-Apr-05

Constructor & Destructor Documentation

◆ CrsGraphWrapper()

ML_Epetra::CrsGraphWrapper::CrsGraphWrapper ( const Epetra_CrsGraph graph,
const Epetra_Map dm,
const Epetra_Map rm,
const Epetra_Comm comm 
)
inline

Constructs a CrsGraphWrapper class.

Constructs a CrsGraphWrapper class. As this wrapper implements an Epetra_RowMatrix, it can then be used as input to ML to generate a plain aggegration MG hierarchy. Note that the resulting coarse grid operators are rubbish and need to be replaced before actually applying this hierarchy to something.

Parameters
graph(In) : ref to Epetra_CrsGraph
dm(In) : ref to the DomainMap
rm(In) : ref to the RangeMap
comm(In) : the Epetra_Comm to be used

Member Function Documentation

◆ Apply()

int ML_Epetra::CrsGraphWrapper::Apply ( const Epetra_MultiVector X,
Epetra_MultiVector Y 
) const
inlinevirtual

not implemented, method will throw error and terminate execution.

Implements Epetra_Operator.

◆ ApplyInverse()

int ML_Epetra::CrsGraphWrapper::ApplyInverse ( const Epetra_MultiVector X,
Epetra_MultiVector Y 
) const
inlinevirtual

not implemented, method will throw error and terminate execution.

Implements Epetra_Operator.

◆ Comm()

const Epetra_Comm & ML_Epetra::CrsGraphWrapper::Comm ( ) const
inlinevirtual

returns ref to the Epetra_Comm associated with this class

Implements Epetra_Operator.

◆ ExtractDiagonalCopy()

int ML_Epetra::CrsGraphWrapper::ExtractDiagonalCopy ( Epetra_Vector Diagonal) const
inlinevirtual

not implemented, method will throw error and terminate execution.

Implements Epetra_RowMatrix.

◆ ExtractMyRowCopy()

int ML_Epetra::CrsGraphWrapper::ExtractMyRowCopy ( int  MyRow,
int  Length,
int &  NumEntries,
double *  Values,
int *  Indices 
) const
inlinevirtual

Returns a copy of the specified local row in user-provided arrays.

As this class wraps a graph and implements an Epetra_RowMatrix, int-values are taken from the graph and converted to double values.

Parameters
InMyRow - Local row to extract.
InLength - Length of Values and Indices.
OutNumEntries - Number of nonzero entries extracted.
OutValues - Extracted values for this row.
OutIndices - Extracted global column indices for the corresponding values.
Returns
Integer error code, set to 0 if successful.

Implements Epetra_RowMatrix.

References Epetra_CrsGraph::ExtractMyRowCopy().

◆ Filled()

bool ML_Epetra::CrsGraphWrapper::Filled ( ) const
inlinevirtual

If FillComplete() has been called, this query returns true, otherwise it returns false.

Implements Epetra_RowMatrix.

References Epetra_CrsGraph::Filled().

◆ HasNormInf()

bool ML_Epetra::CrsGraphWrapper::HasNormInf ( ) const
inlinevirtual

always returns false

Implements Epetra_Operator.

◆ InvColSums()

int ML_Epetra::CrsGraphWrapper::InvColSums ( Epetra_Vector x) const
inlinevirtual

not implemented, method will throw error and terminate execution.

Implements Epetra_RowMatrix.

◆ InvRowSums()

int ML_Epetra::CrsGraphWrapper::InvRowSums ( Epetra_Vector x) const
inlinevirtual

not implemented, method will throw error and terminate execution.

Implements Epetra_RowMatrix.

◆ Label()

const char * ML_Epetra::CrsGraphWrapper::Label ( ) const
inlinevirtual

returns the label of this class

Implements Epetra_Operator.

◆ LeftScale()

int ML_Epetra::CrsGraphWrapper::LeftScale ( const Epetra_Vector x)
inlinevirtual

not implemented, method will throw error and terminate execution.

Implements Epetra_RowMatrix.

◆ LowerTriangular()

bool ML_Epetra::CrsGraphWrapper::LowerTriangular ( ) const
inlinevirtual

If matrix is lower triangular in local index space, this query returns true, otherwise it returns false.

Implements Epetra_RowMatrix.

References Epetra_CrsGraph::LowerTriangular().

◆ Map()

const Epetra_BlockMap & ML_Epetra::CrsGraphWrapper::Map ( ) const
inlinevirtual

Returns the Epetra_Map object associated with the rows of this matrix, derived from Epetra_Operator.

Implements Epetra_SrcDistObject.

References Epetra_CrsGraph::RowMap().

◆ MaxNumEntries()

int ML_Epetra::CrsGraphWrapper::MaxNumEntries ( ) const
inlinevirtual

Returns the maximum of NumMyRowEntries() over all rows.

Implements Epetra_RowMatrix.

References Epetra_CrsGraph::MaxNumIndices().

◆ Multiply()

int ML_Epetra::CrsGraphWrapper::Multiply ( bool  TransA,
const Epetra_MultiVector X,
Epetra_MultiVector Y 
) const
inlinevirtual

not implemented, method will throw error and terminate execution.

Implements Epetra_RowMatrix.

◆ NormInf()

double ML_Epetra::CrsGraphWrapper::NormInf ( ) const
inlinevirtual

not implemented, method will throw error and terminate execution.

Implements Epetra_RowMatrix.

◆ NormOne()

double ML_Epetra::CrsGraphWrapper::NormOne ( ) const
inlinevirtual

not implemented, method will throw error and terminate execution.

Implements Epetra_RowMatrix.

◆ NumGlobalCols()

long long ML_Epetra::CrsGraphWrapper::NumGlobalCols ( ) const
inlinevirtual

Returns the number of global matrix columns.

Implements Epetra_RowMatrix.

References Epetra_CrsGraph::NumGlobalCols().

◆ NumGlobalDiagonals()

long long ML_Epetra::CrsGraphWrapper::NumGlobalDiagonals ( ) const
inlinevirtual

Returns the number of global nonzero diagonal entries, based on global row/column index comparisons.

Implements Epetra_RowMatrix.

References Epetra_CrsGraph::NumGlobalDiagonals().

◆ NumGlobalNonzeros()

long long ML_Epetra::CrsGraphWrapper::NumGlobalNonzeros ( ) const
inlinevirtual

Returns the number of nonzero entries in the global matrix.

Implements Epetra_RowMatrix.

References Epetra_CrsGraph::NumGlobalNonzeros().

◆ NumGlobalRows()

long long ML_Epetra::CrsGraphWrapper::NumGlobalRows ( ) const
inlinevirtual

Returns the number of global matrix rows.

Implements Epetra_RowMatrix.

References Epetra_CrsGraph::NumGlobalRows().

◆ NumMyCols()

int ML_Epetra::CrsGraphWrapper::NumMyCols ( ) const
inlinevirtual

Returns the number of matrix columns owned by the calling processor.

Implements Epetra_RowMatrix.

References Epetra_CrsGraph::NumMyCols().

◆ NumMyDiagonals()

int ML_Epetra::CrsGraphWrapper::NumMyDiagonals ( ) const
inlinevirtual

Returns the number of local nonzero diagonal entries, based on global row/column index comparisons.

Implements Epetra_RowMatrix.

References Epetra_CrsGraph::NumMyDiagonals().

◆ NumMyNonzeros()

int ML_Epetra::CrsGraphWrapper::NumMyNonzeros ( ) const
inlinevirtual

Returns the number of nonzero entries in the calling processor's portion of the matrix.

Implements Epetra_RowMatrix.

References Epetra_CrsGraph::NumMyNonzeros().

◆ NumMyRowEntries()

int ML_Epetra::CrsGraphWrapper::NumMyRowEntries ( int  MyRow,
int &  NumEntries 
) const
inlinevirtual

Returns the number of nonzero entries in MyRow.

Parameters
InMyRow - Local row.
OutNumEntries - Number of nonzero values present.
Returns
Integer error code, set to 0 if successful.

Implements Epetra_RowMatrix.

References Epetra_CrsGraph::NumMyIndices().

◆ NumMyRows()

int ML_Epetra::CrsGraphWrapper::NumMyRows ( ) const
inlinevirtual

Returns the number of matrix rows owned by the calling processor.

Implements Epetra_RowMatrix.

References Epetra_CrsGraph::NumMyRows().

◆ OperatorDomainMap()

const Epetra_Map & ML_Epetra::CrsGraphWrapper::OperatorDomainMap ( ) const
inlinevirtual

returns ref to the OperatorDomainMap associated with this class

Implements Epetra_Operator.

◆ OperatorRangeMap()

const Epetra_Map & ML_Epetra::CrsGraphWrapper::OperatorRangeMap ( ) const
inlinevirtual

returns ref to the OperatorRangeMap associated with this class

Implements Epetra_Operator.

◆ RightScale()

int ML_Epetra::CrsGraphWrapper::RightScale ( const Epetra_Vector x)
inlinevirtual

not implemented, method will throw error and terminate execution.

Implements Epetra_RowMatrix.

◆ RowMatrixColMap()

const Epetra_Map & ML_Epetra::CrsGraphWrapper::RowMatrixColMap ( ) const
inlinevirtual

Returns the Epetra_Map object associated with the columns of this matrix.

Implements Epetra_RowMatrix.

References Epetra_CrsGraph::ColMap().

◆ RowMatrixImporter()

const Epetra_Import * ML_Epetra::CrsGraphWrapper::RowMatrixImporter ( ) const
inlinevirtual

Returns the Epetra_Import object that contains the import operations for distributed operations.

Implements Epetra_RowMatrix.

References Epetra_CrsGraph::Importer().

◆ RowMatrixRowMap()

const Epetra_Map & ML_Epetra::CrsGraphWrapper::RowMatrixRowMap ( ) const
inlinevirtual

Returns the Epetra_Map object associated with the rows of this matrix.

Implements Epetra_RowMatrix.

References Epetra_CrsGraph::RowMap().

◆ SetUseTranspose()

int ML_Epetra::CrsGraphWrapper::SetUseTranspose ( bool  UseTranspose)
inlinevirtual

not implemented, method will always return -1

Implements Epetra_Operator.

References UseTranspose().

◆ Solve()

int ML_Epetra::CrsGraphWrapper::Solve ( bool  Upper,
bool  Trans,
bool  UnitDiagonal,
const Epetra_MultiVector X,
Epetra_MultiVector Y 
) const
inlinevirtual

not implemented, method will throw error and terminate execution.

Implements Epetra_RowMatrix.

◆ UpperTriangular()

bool ML_Epetra::CrsGraphWrapper::UpperTriangular ( ) const
inlinevirtual

If matrix is upper triangular in local index space, this query returns true, otherwise it returns false.

Implements Epetra_RowMatrix.

References Epetra_CrsGraph::UpperTriangular().

◆ UseTranspose()

bool ML_Epetra::CrsGraphWrapper::UseTranspose ( ) const
inlinevirtual

returns the usetranspose_ flag

Implements Epetra_Operator.

Referenced by SetUseTranspose().


The documentation for this class was generated from the following file: