Ifpack_LocalFilter Class Reference

Ifpack_LocalFilter a class for light-weight extraction of the submatrix corresponding to local rows and columns. More...

#include <Ifpack_LocalFilter.h>

Inheritance diagram for Ifpack_LocalFilter:

[legend]
List of all members.

Constructor.

 Ifpack_LocalFilter (const Epetra_RowMatrix *Matrix)
 Constructor.

Destructor.

virtual ~Ifpack_LocalFilter ()
 Destructor.

Matrix data extraction routines

virtual int NumMyRowEntries (int MyRow, int &NumEntries) const
 Returns the number of nonzero entries in MyRow.
virtual int MaxNumEntries () const
 Returns the maximum of NumMyRowEntries() over all rows.
virtual 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.
virtual int ExtractDiagonalCopy (Epetra_Vector &Diagonal) const
 Returns a copy of the main diagonal in a user-provided vector.

Mathematical functions.

virtual int Multiply (bool TransA, const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
 Returns the result of a Epetra_RowMatrix multiplied by a Epetra_MultiVector X in Y.
virtual int Solve (bool Upper, bool Trans, bool UnitDiagonal, const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
 Returns result of a local-only solve using a triangular Epetra_RowMatrix with Epetra_MultiVectors X and Y (NOT IMPLEMENTED).
virtual int Apply (const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
virtual int ApplyInverse (const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
virtual int InvRowSums (Epetra_Vector &x) const
 Computes the sum of absolute values of the rows of the Epetra_RowMatrix, results returned in x (NOT IMPLEMENTED).
virtual int LeftScale (const Epetra_Vector &x)
 Scales the Epetra_RowMatrix on the left with a Epetra_Vector x (NOT IMPLEMENTED).
virtual int InvColSums (Epetra_Vector &x) const
 Computes the sum of absolute values of the columns of the Epetra_RowMatrix, results returned in x (NOT IMPLEMENTED).
virtual int RightScale (const Epetra_Vector &x)
 Scales the Epetra_RowMatrix on the right with a Epetra_Vector x (NOT IMPLEMENTED).

Atribute access functions

virtual bool Filled () const
 If FillComplete() has been called, this query returns true, otherwise it returns false.
virtual double NormInf () const
 Returns the infinity norm of the global matrix.
virtual double NormOne () const
 Returns the one norm of the global matrix.
virtual int NumGlobalNonzeros () const
 Returns the number of nonzero entries in the global matrix.
virtual int NumGlobalRows () const
 Returns the number of global matrix rows.
virtual int NumGlobalCols () const
 Returns the number of global matrix columns.
virtual int NumGlobalDiagonals () const
 Returns the number of global nonzero diagonal entries, based on global row/column index comparisons.
virtual int NumMyNonzeros () const
 Returns the number of nonzero entries in the calling processor's portion of the matrix.
virtual int NumMyRows () const
 Returns the number of matrix rows owned by the calling processor.
virtual int NumMyCols () const
 Returns the number of matrix columns owned by the calling processor.
virtual int NumMyDiagonals () const
 Returns the number of local nonzero diagonal entries, based on global row/column index comparisons.
virtual bool LowerTriangular () const
 If matrix is lower triangular in local index space, this query returns true, otherwise it returns false.
virtual bool UpperTriangular () const
 If matrix is upper triangular in local index space, this query returns true, otherwise it returns false.
virtual const Epetra_MapRowMatrixRowMap () const
 Returns the Epetra_Map object associated with the rows of this matrix.
virtual const Epetra_MapRowMatrixColMap () const
 Returns the Epetra_Map object associated with the columns of this matrix.
virtual const Epetra_ImportRowMatrixImporter () const
 Returns the Epetra_Import object that contains the import operations for distributed operations.

Public Member Functions

int SetOwnership (bool ownership)
 Sets ownership.
int SetUseTranspose (bool UseTranspose)
 Sets use transpose (not implemented).
bool UseTranspose () const
 Returns the current UseTranspose setting.
bool HasNormInf () const
 Returns true if the this object can provide an approximate Inf-norm, false otherwise.
const Epetra_CommComm () const
 Returns a pointer to the Epetra_Comm communicator associated with this operator.
const Epetra_MapOperatorDomainMap () const
 Returns the Epetra_Map object associated with the domain of this operator.
const Epetra_MapOperatorRangeMap () const
 Returns the Epetra_Map object associated with the range of this operator.
const Epetra_BlockMapMap () const
const char * Label () const

Private Attributes

const Epetra_RowMatrixMatrix_
 Pointer to the matrix to be preconditioned.
Epetra_SerialCommSerialComm_
 Communicator containing this process only.
Epetra_MapMap_
 Map based on SerialComm_, containing the local rows only.
int NumRows_
 Number of rows in the local matrix.
int NumNonzeros_
 Number of nonzeros in the local matrix.
int MaxNumEntries_
 Maximum number of nonzero entries in a row for the filtered matrix.
int MaxNumEntriesA_
 Maximum number of nonzero entries in a row for Matrix_.
vector< int > NumEntries_
 NumEntries_[i] contains the nonzero entries in row `i'.
vector< int > Indices_
 Used in ExtractMyRowCopy, to avoid allocation each time.
vector< double > Values_
 Used in ExtractMyRowCopy, to avoid allocation each time.
bool UseTranspose_
 If true, the tranpose of the local matrix will be used.
char Label_ [80]
 Label for this object.
Epetra_VectorDiagonal_
double NormOne_
double NormInf_

Detailed Description

Ifpack_LocalFilter a class for light-weight extraction of the submatrix corresponding to local rows and columns.

Class Ifpack_LocalFilter enables a light-weight contruction of an Epetra_RowMatrix-derived object, containing only the elements of the original, distributed matrix with local row and column ID. The local submatrix is based on a communicator containing the local process only. Each process will have its local object, corresponding to the local submatrix. Submatrices may or may not overlap.

The following instructions can be used to create "localized" matrices:

 #include "Ifpack_LocalFilter.h"
 ...
 Epetra_RowMatrix* A;             // fill the elements of A,
 A->FillComplete();

 Ifpack_LocalFilter LocalA(A);

Once created, LocalA defined, on each process, the submatrix corresponding to local rows and columns only. The creation and use of LocalA is "cheap", as the elements of the local matrix are obtained through calls to ExtractMyRowCopy on the original, distributed matrix, say A. This means that A must remain in scope every time LocalA is accessed.

A very convenient use of this class is to use Ifpack solvers to compute the LU factorizations of local blocks. If applied to a localized matrix, several Ifpack objects can operator in the same phase in a safe way, without non-required data exchange.

Author:
Marzio Sala, SNL 9214
Date:
Sep-04

Definition at line 54 of file Ifpack_LocalFilter.h.


Constructor & Destructor Documentation

Ifpack_LocalFilter::Ifpack_LocalFilter const Epetra_RowMatrix Matrix  ) 
 

Constructor.

Definition at line 11 of file Ifpack_LocalFilter.cpp.

Ifpack_LocalFilter::~Ifpack_LocalFilter  )  [virtual]
 

Destructor.

Definition at line 91 of file Ifpack_LocalFilter.cpp.


Member Function Documentation

virtual int Ifpack_LocalFilter::NumMyRowEntries int  MyRow,
int &  NumEntries
const [inline, virtual]
 

Returns the number of nonzero entries in MyRow.

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

Implements Epetra_RowMatrix.

Definition at line 79 of file Ifpack_LocalFilter.h.

virtual int Ifpack_LocalFilter::MaxNumEntries  )  const [inline, virtual]
 

Returns the maximum of NumMyRowEntries() over all rows.

Implements Epetra_RowMatrix.

Definition at line 86 of file Ifpack_LocalFilter.h.

int Ifpack_LocalFilter::ExtractMyRowCopy int  MyRow,
int  Length,
int &  NumEntries,
double *  Values,
int *  Indices
const [inline, virtual]
 

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

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

Implements Epetra_RowMatrix.

Definition at line 103 of file Ifpack_LocalFilter.cpp.

int Ifpack_LocalFilter::ExtractDiagonalCopy Epetra_Vector Diagonal  )  const [virtual]
 

Returns a copy of the main diagonal in a user-provided vector.

Parameters:
Diagonal - (Out) Extracted main diagonal.
Returns:
Integer error code, set to 0 if successful.

Implements Epetra_RowMatrix.

Definition at line 139 of file Ifpack_LocalFilter.cpp.

virtual int Ifpack_LocalFilter::Multiply bool  TransA,
const Epetra_MultiVector X,
Epetra_MultiVector Y
const [inline, virtual]
 

Returns the result of a Epetra_RowMatrix multiplied by a Epetra_MultiVector X in Y.

Parameters:
TransA -(In) If true, multiply by the transpose of matrix, otherwise just use matrix.
X - (In) A Epetra_MultiVector of dimension NumVectors to multiply with matrix.
Y -(Out) A Epetra_MultiVector of dimension NumVectorscontaining result.
Returns:
Integer error code, set to 0 if successful.

Implements Epetra_RowMatrix.

Definition at line 131 of file Ifpack_LocalFilter.h.

virtual int Ifpack_LocalFilter::Solve bool  Upper,
bool  Trans,
bool  UnitDiagonal,
const Epetra_MultiVector X,
Epetra_MultiVector Y
const [inline, virtual]
 

Returns result of a local-only solve using a triangular Epetra_RowMatrix with Epetra_MultiVectors X and Y (NOT IMPLEMENTED).

Implements Epetra_RowMatrix.

Definition at line 142 of file Ifpack_LocalFilter.h.

int Ifpack_LocalFilter::Apply const Epetra_MultiVector X,
Epetra_MultiVector Y
const [virtual]
 

Implements Epetra_Operator.

Definition at line 148 of file Ifpack_LocalFilter.cpp.

int Ifpack_LocalFilter::ApplyInverse const Epetra_MultiVector X,
Epetra_MultiVector Y
const [virtual]
 

Implements Epetra_Operator.

Definition at line 181 of file Ifpack_LocalFilter.cpp.

virtual int Ifpack_LocalFilter::InvRowSums Epetra_Vector x  )  const [inline, virtual]
 

Computes the sum of absolute values of the rows of the Epetra_RowMatrix, results returned in x (NOT IMPLEMENTED).

Implements Epetra_RowMatrix.

Definition at line 154 of file Ifpack_LocalFilter.h.

virtual int Ifpack_LocalFilter::LeftScale const Epetra_Vector x  )  [inline, virtual]
 

Scales the Epetra_RowMatrix on the left with a Epetra_Vector x (NOT IMPLEMENTED).

Implements Epetra_RowMatrix.

Definition at line 160 of file Ifpack_LocalFilter.h.

virtual int Ifpack_LocalFilter::InvColSums Epetra_Vector x  )  const [inline, virtual]
 

Computes the sum of absolute values of the columns of the Epetra_RowMatrix, results returned in x (NOT IMPLEMENTED).

Implements Epetra_RowMatrix.

Definition at line 166 of file Ifpack_LocalFilter.h.

virtual int Ifpack_LocalFilter::RightScale const Epetra_Vector x  )  [inline, virtual]
 

Scales the Epetra_RowMatrix on the right with a Epetra_Vector x (NOT IMPLEMENTED).

Implements Epetra_RowMatrix.

Definition at line 173 of file Ifpack_LocalFilter.h.

virtual bool Ifpack_LocalFilter::Filled  )  const [inline, virtual]
 

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

Implements Epetra_RowMatrix.

Definition at line 183 of file Ifpack_LocalFilter.h.

virtual double Ifpack_LocalFilter::NormInf  )  const [inline, virtual]
 

Returns the infinity norm of the global matrix.

Implements Epetra_RowMatrix.

Definition at line 192 of file Ifpack_LocalFilter.h.

virtual double Ifpack_LocalFilter::NormOne  )  const [inline, virtual]
 

Returns the one norm of the global matrix.

Implements Epetra_RowMatrix.

Definition at line 201 of file Ifpack_LocalFilter.h.

virtual int Ifpack_LocalFilter::NumGlobalNonzeros  )  const [inline, virtual]
 

Returns the number of nonzero entries in the global matrix.

Implements Epetra_RowMatrix.

Definition at line 207 of file Ifpack_LocalFilter.h.

virtual int Ifpack_LocalFilter::NumGlobalRows  )  const [inline, virtual]
 

Returns the number of global matrix rows.

Implements Epetra_RowMatrix.

Definition at line 213 of file Ifpack_LocalFilter.h.

virtual int Ifpack_LocalFilter::NumGlobalCols  )  const [inline, virtual]
 

Returns the number of global matrix columns.

Implements Epetra_RowMatrix.

Definition at line 219 of file Ifpack_LocalFilter.h.

virtual int Ifpack_LocalFilter::NumGlobalDiagonals  )  const [inline, virtual]
 

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

Implements Epetra_RowMatrix.

Definition at line 225 of file Ifpack_LocalFilter.h.

virtual int Ifpack_LocalFilter::NumMyNonzeros  )  const [inline, virtual]
 

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

Implements Epetra_RowMatrix.

Definition at line 231 of file Ifpack_LocalFilter.h.

virtual int Ifpack_LocalFilter::NumMyRows  )  const [inline, virtual]
 

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

Implements Epetra_RowMatrix.

Definition at line 237 of file Ifpack_LocalFilter.h.

virtual int Ifpack_LocalFilter::NumMyCols  )  const [inline, virtual]
 

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

Implements Epetra_RowMatrix.

Definition at line 243 of file Ifpack_LocalFilter.h.

virtual int Ifpack_LocalFilter::NumMyDiagonals  )  const [inline, virtual]
 

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

Implements Epetra_RowMatrix.

Definition at line 249 of file Ifpack_LocalFilter.h.

virtual bool Ifpack_LocalFilter::LowerTriangular  )  const [inline, virtual]
 

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

Implements Epetra_RowMatrix.

Definition at line 255 of file Ifpack_LocalFilter.h.

virtual bool Ifpack_LocalFilter::UpperTriangular  )  const [inline, virtual]
 

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

Implements Epetra_RowMatrix.

Definition at line 261 of file Ifpack_LocalFilter.h.

virtual const Epetra_Map& Ifpack_LocalFilter::RowMatrixRowMap  )  const [inline, virtual]
 

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

Implements Epetra_RowMatrix.

Definition at line 267 of file Ifpack_LocalFilter.h.

virtual const Epetra_Map& Ifpack_LocalFilter::RowMatrixColMap  )  const [inline, virtual]
 

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

Implements Epetra_RowMatrix.

Definition at line 273 of file Ifpack_LocalFilter.h.

virtual const Epetra_Import* Ifpack_LocalFilter::RowMatrixImporter  )  const [inline, virtual]
 

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

Implements Epetra_RowMatrix.

Definition at line 279 of file Ifpack_LocalFilter.h.

int Ifpack_LocalFilter::SetOwnership bool  ownership  )  [inline]
 

Sets ownership.

Definition at line 288 of file Ifpack_LocalFilter.h.

int Ifpack_LocalFilter::SetUseTranspose bool  UseTranspose  )  [inline, virtual]
 

Sets use transpose (not implemented).

Implements Epetra_Operator.

Definition at line 294 of file Ifpack_LocalFilter.h.

bool Ifpack_LocalFilter::UseTranspose  )  const [inline, virtual]
 

Returns the current UseTranspose setting.

Implements Epetra_Operator.

Definition at line 301 of file Ifpack_LocalFilter.h.

bool Ifpack_LocalFilter::HasNormInf  )  const [inline, virtual]
 

Returns true if the this object can provide an approximate Inf-norm, false otherwise.

Implements Epetra_Operator.

Definition at line 307 of file Ifpack_LocalFilter.h.

const Epetra_Comm& Ifpack_LocalFilter::Comm  )  const [inline, virtual]
 

Returns a pointer to the Epetra_Comm communicator associated with this operator.

Implements Epetra_Operator.

Definition at line 313 of file Ifpack_LocalFilter.h.

const Epetra_Map& Ifpack_LocalFilter::OperatorDomainMap  )  const [inline, virtual]
 

Returns the Epetra_Map object associated with the domain of this operator.

Implements Epetra_Operator.

Definition at line 319 of file Ifpack_LocalFilter.h.

const Epetra_Map& Ifpack_LocalFilter::OperatorRangeMap  )  const [inline, virtual]
 

Returns the Epetra_Map object associated with the range of this operator.

Implements Epetra_Operator.

Definition at line 325 of file Ifpack_LocalFilter.h.

const Epetra_BlockMap & Ifpack_LocalFilter::Map  )  const [virtual]
 

Implements Epetra_SrcDistObject.

Definition at line 188 of file Ifpack_LocalFilter.cpp.

const char* Ifpack_LocalFilter::Label  )  const [inline, virtual]
 

Implements Epetra_Operator.

Definition at line 333 of file Ifpack_LocalFilter.h.


Member Data Documentation

const Epetra_RowMatrix* Ifpack_LocalFilter::Matrix_ [private]
 

Pointer to the matrix to be preconditioned.

Definition at line 340 of file Ifpack_LocalFilter.h.

Epetra_SerialComm* Ifpack_LocalFilter::SerialComm_ [private]
 

Communicator containing this process only.

Definition at line 346 of file Ifpack_LocalFilter.h.

Epetra_Map* Ifpack_LocalFilter::Map_ [private]
 

Map based on SerialComm_, containing the local rows only.

Definition at line 349 of file Ifpack_LocalFilter.h.

int Ifpack_LocalFilter::NumRows_ [private]
 

Number of rows in the local matrix.

Definition at line 351 of file Ifpack_LocalFilter.h.

int Ifpack_LocalFilter::NumNonzeros_ [private]
 

Number of nonzeros in the local matrix.

Definition at line 353 of file Ifpack_LocalFilter.h.

int Ifpack_LocalFilter::MaxNumEntries_ [private]
 

Maximum number of nonzero entries in a row for the filtered matrix.

Definition at line 355 of file Ifpack_LocalFilter.h.

int Ifpack_LocalFilter::MaxNumEntriesA_ [private]
 

Maximum number of nonzero entries in a row for Matrix_.

Definition at line 357 of file Ifpack_LocalFilter.h.

vector<int> Ifpack_LocalFilter::NumEntries_ [private]
 

NumEntries_[i] contains the nonzero entries in row `i'.

Definition at line 359 of file Ifpack_LocalFilter.h.

vector<int> Ifpack_LocalFilter::Indices_ [mutable, private]
 

Used in ExtractMyRowCopy, to avoid allocation each time.

Definition at line 361 of file Ifpack_LocalFilter.h.

vector<double> Ifpack_LocalFilter::Values_ [mutable, private]
 

Used in ExtractMyRowCopy, to avoid allocation each time.

Definition at line 363 of file Ifpack_LocalFilter.h.

bool Ifpack_LocalFilter::UseTranspose_ [private]
 

If true, the tranpose of the local matrix will be used.

Definition at line 365 of file Ifpack_LocalFilter.h.

char Ifpack_LocalFilter::Label_[80] [private]
 

Label for this object.

Definition at line 367 of file Ifpack_LocalFilter.h.

Epetra_Vector* Ifpack_LocalFilter::Diagonal_ [private]
 

Definition at line 368 of file Ifpack_LocalFilter.h.

double Ifpack_LocalFilter::NormOne_ [private]
 

Definition at line 369 of file Ifpack_LocalFilter.h.

double Ifpack_LocalFilter::NormInf_ [private]
 

Definition at line 370 of file Ifpack_LocalFilter.h.


The documentation for this class was generated from the following files:
Generated on Thu Sep 18 12:37:31 2008 for Ifpack Package Browser (Single Doxygen Collection) by doxygen 1.3.9.1