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>

List of all members.

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.
int NumGlobalNonzeros () const
 Returns the number of nonzero entries in the global matrix.
int NumGlobalRows () const
 Returns the number of global matrix rows.
int NumGlobalCols () const
 Returns the number of global matrix columns.
int 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_Map & RowMatrixRowMap () const
 Returns the Epetra_Map object associated with the rows of this matrix.
const Epetra_Map & RowMatrixColMap () const
 Returns the Epetra_Map object associated with the columns of this matrix.
const Epetra_Import * RowMatrixImporter () const
 Returns the Epetra_Import object that contains the import operations for distributed operations.
const Epetra_BlockMap & Map () 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_Comm & Comm () const
 returns ref to the Epetra_Comm associated with this class
const Epetra_Map & OperatorDomainMap () const
 returns ref to the OperatorDomainMap associated with this class
const Epetra_Map & OperatorRangeMap () const
 returns ref to the OperatorRangeMap associated with this class

Private Attributes

const Epetra_CrsGraph & graph_
bool usetranspose_
const char * name_
Epetra_Map DomainMap_
Epetra_Map RangeMap_
const Epetra_Comm & comm_


Detailed Description

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

virtual ML_Epetra::CrsGraphWrapper::~CrsGraphWrapper (  )  [inline, virtual]


Member Function Documentation

int ML_Epetra::CrsGraphWrapper::Apply ( const Epetra_MultiVector &  X,
Epetra_MultiVector &  Y 
) const [inline]

int ML_Epetra::CrsGraphWrapper::ApplyInverse ( const Epetra_MultiVector &  X,
Epetra_MultiVector &  Y 
) const [inline]

const Epetra_Comm& ML_Epetra::CrsGraphWrapper::Comm (  )  const [inline]

int ML_Epetra::CrsGraphWrapper::ExtractDiagonalCopy ( Epetra_Vector &  Diagonal  )  const [inline]

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

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

Parameters:
In MyRow - Local row to extract.
In Length - Length of Values and Indices.
Out NumEntries - Number of nonzero entries extracted.
Out Values - Extracted values for this row.
Out Indices - Extracted global column indices for the corresponding values.
Returns:
Integer error code, set to 0 if successful.

bool ML_Epetra::CrsGraphWrapper::Filled (  )  const [inline]

bool ML_Epetra::CrsGraphWrapper::HasNormInf (  )  const [inline]

int ML_Epetra::CrsGraphWrapper::InvColSums ( Epetra_Vector &  x  )  const [inline]

int ML_Epetra::CrsGraphWrapper::InvRowSums ( Epetra_Vector &  x  )  const [inline]

const char* ML_Epetra::CrsGraphWrapper::Label (  )  const [inline]

int ML_Epetra::CrsGraphWrapper::LeftScale ( const Epetra_Vector &  x  )  [inline]

bool ML_Epetra::CrsGraphWrapper::LowerTriangular (  )  const [inline]

const Epetra_BlockMap& ML_Epetra::CrsGraphWrapper::Map (  )  const [inline]

int ML_Epetra::CrsGraphWrapper::MaxNumEntries (  )  const [inline]

int ML_Epetra::CrsGraphWrapper::Multiply ( bool  TransA,
const Epetra_MultiVector &  X,
Epetra_MultiVector &  Y 
) const [inline]

double ML_Epetra::CrsGraphWrapper::NormInf (  )  const [inline]

double ML_Epetra::CrsGraphWrapper::NormOne (  )  const [inline]

int ML_Epetra::CrsGraphWrapper::NumGlobalCols (  )  const [inline]

int ML_Epetra::CrsGraphWrapper::NumGlobalDiagonals (  )  const [inline]

int ML_Epetra::CrsGraphWrapper::NumGlobalNonzeros (  )  const [inline]

int ML_Epetra::CrsGraphWrapper::NumGlobalRows (  )  const [inline]

int ML_Epetra::CrsGraphWrapper::NumMyCols (  )  const [inline]

int ML_Epetra::CrsGraphWrapper::NumMyDiagonals (  )  const [inline]

int ML_Epetra::CrsGraphWrapper::NumMyNonzeros (  )  const [inline]

int ML_Epetra::CrsGraphWrapper::NumMyRowEntries ( int  MyRow,
int &  NumEntries 
) const [inline]

Parameters:
In MyRow - Local row.
Out NumEntries - Number of nonzero values present.
Returns:
Integer error code, set to 0 if successful.

int ML_Epetra::CrsGraphWrapper::NumMyRows (  )  const [inline]

const Epetra_Map& ML_Epetra::CrsGraphWrapper::OperatorDomainMap (  )  const [inline]

const Epetra_Map& ML_Epetra::CrsGraphWrapper::OperatorRangeMap (  )  const [inline]

int ML_Epetra::CrsGraphWrapper::RightScale ( const Epetra_Vector &  x  )  [inline]

const Epetra_Map& ML_Epetra::CrsGraphWrapper::RowMatrixColMap (  )  const [inline]

const Epetra_Import* ML_Epetra::CrsGraphWrapper::RowMatrixImporter (  )  const [inline]

const Epetra_Map& ML_Epetra::CrsGraphWrapper::RowMatrixRowMap (  )  const [inline]

int ML_Epetra::CrsGraphWrapper::SetUseTranspose ( bool  UseTranspose  )  [inline]

int ML_Epetra::CrsGraphWrapper::Solve ( bool  Upper,
bool  Trans,
bool  UnitDiagonal,
const Epetra_MultiVector &  X,
Epetra_MultiVector &  Y 
) const [inline]

bool ML_Epetra::CrsGraphWrapper::UpperTriangular (  )  const [inline]

bool ML_Epetra::CrsGraphWrapper::UseTranspose (  )  const [inline]


Member Data Documentation

const Epetra_Comm& ML_Epetra::CrsGraphWrapper::comm_ [private]

const Epetra_CrsGraph& ML_Epetra::CrsGraphWrapper::graph_ [private]

const char* ML_Epetra::CrsGraphWrapper::name_ [private]


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