ML  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
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. More...
 
virtual ~CrsGraphWrapper ()
 Destructor.
 
int NumMyRowEntries (int MyRow, int &NumEntries) const
 Returns the number of nonzero entries in MyRow. More...
 
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. More...
 
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
 

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

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

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().

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().


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