LOCA::Epetra::LowRankUpdateRowMatrix Class Reference

An Epetra row matrix for implementing the operator $P = J + U V^T$. More...

#include <LOCA_Epetra_LowRankUpdateRowMatrix.H>

Inheritance diagram for LOCA::Epetra::LowRankUpdateRowMatrix:

Inheritance graph
[legend]
Collaboration diagram for LOCA::Epetra::LowRankUpdateRowMatrix:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 LowRankUpdateRowMatrix (const Teuchos::RCP< LOCA::GlobalData > &global_data, const Teuchos::RCP< Epetra_RowMatrix > &jacRowMatrix, const Teuchos::RCP< Epetra_MultiVector > &U_multiVec, const Teuchos::RCP< Epetra_MultiVector > &V_multiVec, bool setup_for_solve, bool include_UV_terms)
 Constructor.
virtual ~LowRankUpdateRowMatrix ()
 Destructor.
virtual const Epetra_BlockMap & Map () const
 Returns a reference to the Epetra_BlockMap for this object.
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.
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.
virtual int InvRowSums (Epetra_Vector &x) const
 Computes the sum of absolute values of the rows of the Epetra_RowMatrix, results returned in x.
virtual int LeftScale (const Epetra_Vector &x)
 Scales the Epetra_RowMatrix on the left with a Epetra_Vector x.
virtual int InvColSums (Epetra_Vector &x) const
 Computes the sum of absolute values of the columns of the Epetra_RowMatrix, results returned in x.
virtual int RightScale (const Epetra_Vector &x)
 Scales the Epetra_RowMatrix on the right with a Epetra_Vector x.
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_Map & RowMatrixRowMap () const
 Returns the Epetra_Map object associated with the rows of this matrix.
virtual const Epetra_Map & RowMatrixColMap () const
 Returns the Epetra_Map object associated with the columns of this matrix.
virtual const Epetra_Import * RowMatrixImporter () const
 Returns the Epetra_Import object that contains the import operations for distributed operations.

Protected Member Functions

double computeUV (int MyRow, int MyCol) const
 Compute MyRow, MyCol entry of $U V^T$.

Protected Attributes

Teuchos::RCP< Epetra_RowMatrix > J_rowMatrix
 Stores row matrix representing J.
Teuchos::RCP< Epetra_MultiVector > nonconst_U
 Stores pointer to non-const U.
Teuchos::RCP< Epetra_MultiVector > nonconst_V
 Stores pointer to non-const V.
bool includeUV
 Flag indicating whether to include U*V^T terms.
int m
 Number of columns in U and V.
const Epetra_BlockMap & U_map
 Map for U.
const Epetra_BlockMap & V_map
 Map for V.
const Epetra_BlockMap & row_map
 Row map for J.

Private Member Functions

 LowRankUpdateRowMatrix (const LowRankUpdateRowMatrix &)
 Private to prohibit copying.
LowRankUpdateRowMatrixoperator= (const LowRankUpdateRowMatrix &)
 Private to prohibit copying.


Detailed Description

An Epetra row matrix for implementing the operator $P = J + U V^T$.

This class implements the Epetra_RowMatrix interface for $P = J + U V^T$ where $J$ is an Epetra_RowMatrix and $U$ and $V$ are Epetra_MultiVectors. It is derived from LOCA::Epetra::LowRankUpdateOp to implement the Epetra_Operator interface. The interface here implements the Epetra_RowMatrix interface when the matrix $J$ is itself a row matrix. This allows preconditioners to be computed and scaling in linear systems to be performed when using this operator. The implementation here merely adds the corresponding entries for $U V^T$ to the rows of $J$. Note however this is only an approximation to the true matrix $J + U V^T$.

This class assumes $U$ and $V$ have the same distribution as the rows of $J$.

Definition at line 74 of file LOCA_Epetra_LowRankUpdateRowMatrix.H.


Constructor & Destructor Documentation

LOCA::Epetra::LowRankUpdateRowMatrix::LowRankUpdateRowMatrix ( const Teuchos::RCP< LOCA::GlobalData > &  global_data,
const Teuchos::RCP< Epetra_RowMatrix > &  jacRowMatrix,
const Teuchos::RCP< Epetra_MultiVector > &  U_multiVec,
const Teuchos::RCP< Epetra_MultiVector > &  V_multiVec,
bool  setup_for_solve,
bool  include_UV_terms 
)

Constructor.

Parameters:
global_data [in] The global data object
jacRowMatrix [in] Jacobian operator J as a row matrix
U_multiVec [in] Multivector representing U
V_multiVec [in] Multivector representing V
setup_for_solve [in] Setup data structures for ApplyInverse()
include_UV_terms [in] Include $U V^T$ terms in RowMatrix routines ExtractRowCopy(), ExtactDiagonalCopy(), InvRowSums(), InvColSums(), NormInf() and NormOne().

Definition at line 52 of file LOCA_Epetra_LowRankUpdateRowMatrix.C.

LOCA::Epetra::LowRankUpdateRowMatrix::~LowRankUpdateRowMatrix (  )  [virtual]

Destructor.

Definition at line 73 of file LOCA_Epetra_LowRankUpdateRowMatrix.C.

LOCA::Epetra::LowRankUpdateRowMatrix::LowRankUpdateRowMatrix ( const LowRankUpdateRowMatrix  )  [private]

Private to prohibit copying.


Member Function Documentation

const Epetra_BlockMap & LOCA::Epetra::LowRankUpdateRowMatrix::Map (  )  const [virtual]

Returns a reference to the Epetra_BlockMap for this object.

Definition at line 79 of file LOCA_Epetra_LowRankUpdateRowMatrix.C.

References J_rowMatrix.

int LOCA::Epetra::LowRankUpdateRowMatrix::NumMyRowEntries ( int  MyRow,
int &  NumEntries 
) const [virtual]

Returns the number of nonzero entries in MyRow.

Definition at line 86 of file LOCA_Epetra_LowRankUpdateRowMatrix.C.

References J_rowMatrix.

int LOCA::Epetra::LowRankUpdateRowMatrix::MaxNumEntries (  )  const [virtual]

Returns the maximum of NumMyRowEntries() over all rows.

Definition at line 93 of file LOCA_Epetra_LowRankUpdateRowMatrix.C.

References J_rowMatrix.

int LOCA::Epetra::LowRankUpdateRowMatrix::ExtractMyRowCopy ( int  MyRow,
int  Length,
int &  NumEntries,
double *  Values,
int *  Indices 
) const [virtual]

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

Definition at line 100 of file LOCA_Epetra_LowRankUpdateRowMatrix.C.

References computeUV(), includeUV, J_rowMatrix, row_map, U_map, and V_map.

int LOCA::Epetra::LowRankUpdateRowMatrix::ExtractDiagonalCopy ( Epetra_Vector &  Diagonal  )  const [virtual]

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

Definition at line 126 of file LOCA_Epetra_LowRankUpdateRowMatrix.C.

References computeUV(), includeUV, J_rowMatrix, row_map, U_map, and V_map.

int LOCA::Epetra::LowRankUpdateRowMatrix::Multiply ( bool  TransA,
const Epetra_MultiVector &  X,
Epetra_MultiVector &  Y 
) const [virtual]

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

Definition at line 148 of file LOCA_Epetra_LowRankUpdateRowMatrix.C.

References J_rowMatrix, LOCA::Epetra::LowRankUpdateOp::localMap, LOCA::Epetra::LowRankUpdateOp::tmpMat, LOCA::Epetra::LowRankUpdateOp::U, and LOCA::Epetra::LowRankUpdateOp::V.

Referenced by InvColSums(), InvRowSums(), LeftScale(), and RightScale().

int LOCA::Epetra::LowRankUpdateRowMatrix::Solve ( bool  Upper,
bool  Trans,
bool  UnitDiagonal,
const Epetra_MultiVector &  X,
Epetra_MultiVector &  Y 
) const [virtual]

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

Definition at line 185 of file LOCA_Epetra_LowRankUpdateRowMatrix.C.

References J_rowMatrix.

int LOCA::Epetra::LowRankUpdateRowMatrix::InvRowSums ( Epetra_Vector &  x  )  const [virtual]

Computes the sum of absolute values of the rows of the Epetra_RowMatrix, results returned in x.

Definition at line 194 of file LOCA_Epetra_LowRankUpdateRowMatrix.C.

References includeUV, J_rowMatrix, Multiply(), and V_map.

Referenced by NormInf().

int LOCA::Epetra::LowRankUpdateRowMatrix::LeftScale ( const Epetra_Vector &  x  )  [virtual]

Scales the Epetra_RowMatrix on the left with a Epetra_Vector x.

Definition at line 234 of file LOCA_Epetra_LowRankUpdateRowMatrix.C.

References J_rowMatrix, m, Multiply(), and nonconst_U.

int LOCA::Epetra::LowRankUpdateRowMatrix::InvColSums ( Epetra_Vector &  x  )  const [virtual]

Computes the sum of absolute values of the columns of the Epetra_RowMatrix, results returned in x.

Definition at line 253 of file LOCA_Epetra_LowRankUpdateRowMatrix.C.

References includeUV, J_rowMatrix, Multiply(), and V_map.

Referenced by NormOne().

int LOCA::Epetra::LowRankUpdateRowMatrix::RightScale ( const Epetra_Vector &  x  )  [virtual]

Scales the Epetra_RowMatrix on the right with a Epetra_Vector x.

Definition at line 293 of file LOCA_Epetra_LowRankUpdateRowMatrix.C.

References J_rowMatrix, m, Multiply(), and nonconst_V.

bool LOCA::Epetra::LowRankUpdateRowMatrix::Filled (  )  const [virtual]

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

Definition at line 311 of file LOCA_Epetra_LowRankUpdateRowMatrix.C.

References J_rowMatrix.

double LOCA::Epetra::LowRankUpdateRowMatrix::NormInf (  )  const [virtual]

Returns the infinity norm of the global matrix.

Reimplemented from LOCA::Epetra::LowRankUpdateOp.

Definition at line 318 of file LOCA_Epetra_LowRankUpdateRowMatrix.C.

References includeUV, InvRowSums(), J_rowMatrix, and row_map.

double LOCA::Epetra::LowRankUpdateRowMatrix::NormOne (  )  const [virtual]

Returns the one norm of the global matrix.

Definition at line 335 of file LOCA_Epetra_LowRankUpdateRowMatrix.C.

References includeUV, InvColSums(), J_rowMatrix, and row_map.

int LOCA::Epetra::LowRankUpdateRowMatrix::NumGlobalNonzeros (  )  const [virtual]

Returns the number of nonzero entries in the global matrix.

Definition at line 352 of file LOCA_Epetra_LowRankUpdateRowMatrix.C.

References J_rowMatrix.

int LOCA::Epetra::LowRankUpdateRowMatrix::NumGlobalRows (  )  const [virtual]

Returns the number of global matrix rows.

Definition at line 359 of file LOCA_Epetra_LowRankUpdateRowMatrix.C.

References J_rowMatrix.

int LOCA::Epetra::LowRankUpdateRowMatrix::NumGlobalCols (  )  const [virtual]

Returns the number of global matrix columns.

Definition at line 366 of file LOCA_Epetra_LowRankUpdateRowMatrix.C.

References J_rowMatrix.

int LOCA::Epetra::LowRankUpdateRowMatrix::NumGlobalDiagonals (  )  const [virtual]

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

Definition at line 373 of file LOCA_Epetra_LowRankUpdateRowMatrix.C.

References J_rowMatrix.

int LOCA::Epetra::LowRankUpdateRowMatrix::NumMyNonzeros (  )  const [virtual]

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

Definition at line 380 of file LOCA_Epetra_LowRankUpdateRowMatrix.C.

References J_rowMatrix.

int LOCA::Epetra::LowRankUpdateRowMatrix::NumMyRows (  )  const [virtual]

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

Definition at line 387 of file LOCA_Epetra_LowRankUpdateRowMatrix.C.

References J_rowMatrix.

int LOCA::Epetra::LowRankUpdateRowMatrix::NumMyCols (  )  const [virtual]

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

Definition at line 394 of file LOCA_Epetra_LowRankUpdateRowMatrix.C.

References J_rowMatrix.

int LOCA::Epetra::LowRankUpdateRowMatrix::NumMyDiagonals (  )  const [virtual]

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

Definition at line 401 of file LOCA_Epetra_LowRankUpdateRowMatrix.C.

References J_rowMatrix.

bool LOCA::Epetra::LowRankUpdateRowMatrix::LowerTriangular (  )  const [virtual]

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

Definition at line 408 of file LOCA_Epetra_LowRankUpdateRowMatrix.C.

References J_rowMatrix.

bool LOCA::Epetra::LowRankUpdateRowMatrix::UpperTriangular (  )  const [virtual]

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

Definition at line 415 of file LOCA_Epetra_LowRankUpdateRowMatrix.C.

References J_rowMatrix.

const Epetra_Map & LOCA::Epetra::LowRankUpdateRowMatrix::RowMatrixRowMap (  )  const [virtual]

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

Definition at line 422 of file LOCA_Epetra_LowRankUpdateRowMatrix.C.

References J_rowMatrix.

const Epetra_Map & LOCA::Epetra::LowRankUpdateRowMatrix::RowMatrixColMap (  )  const [virtual]

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

Definition at line 429 of file LOCA_Epetra_LowRankUpdateRowMatrix.C.

References J_rowMatrix.

const Epetra_Import * LOCA::Epetra::LowRankUpdateRowMatrix::RowMatrixImporter (  )  const [virtual]

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

Definition at line 436 of file LOCA_Epetra_LowRankUpdateRowMatrix.C.

References J_rowMatrix.

double LOCA::Epetra::LowRankUpdateRowMatrix::computeUV ( int  MyRow,
int  MyCol 
) const [protected]

Compute MyRow, MyCol entry of $U V^T$.

Definition at line 443 of file LOCA_Epetra_LowRankUpdateRowMatrix.C.

References m, and LOCA::Epetra::LowRankUpdateOp::U.

Referenced by ExtractDiagonalCopy(), and ExtractMyRowCopy().

LowRankUpdateRowMatrix& LOCA::Epetra::LowRankUpdateRowMatrix::operator= ( const LowRankUpdateRowMatrix  )  [private]

Private to prohibit copying.


Member Data Documentation

Teuchos::RCP<Epetra_RowMatrix> LOCA::Epetra::LowRankUpdateRowMatrix::J_rowMatrix [protected]

Teuchos::RCP<Epetra_MultiVector> LOCA::Epetra::LowRankUpdateRowMatrix::nonconst_U [protected]

Stores pointer to non-const U.

Definition at line 258 of file LOCA_Epetra_LowRankUpdateRowMatrix.H.

Referenced by LeftScale().

Teuchos::RCP<Epetra_MultiVector> LOCA::Epetra::LowRankUpdateRowMatrix::nonconst_V [protected]

Stores pointer to non-const V.

Definition at line 261 of file LOCA_Epetra_LowRankUpdateRowMatrix.H.

Referenced by RightScale().

Flag indicating whether to include U*V^T terms.

Definition at line 264 of file LOCA_Epetra_LowRankUpdateRowMatrix.H.

Referenced by ExtractDiagonalCopy(), ExtractMyRowCopy(), InvColSums(), InvRowSums(), NormInf(), and NormOne().

Number of columns in U and V.

Definition at line 267 of file LOCA_Epetra_LowRankUpdateRowMatrix.H.

Referenced by computeUV(), LeftScale(), and RightScale().

const Epetra_BlockMap& LOCA::Epetra::LowRankUpdateRowMatrix::U_map [protected]

Map for U.

Definition at line 270 of file LOCA_Epetra_LowRankUpdateRowMatrix.H.

Referenced by ExtractDiagonalCopy(), and ExtractMyRowCopy().

const Epetra_BlockMap& LOCA::Epetra::LowRankUpdateRowMatrix::V_map [protected]

Map for V.

Definition at line 273 of file LOCA_Epetra_LowRankUpdateRowMatrix.H.

Referenced by ExtractDiagonalCopy(), ExtractMyRowCopy(), InvColSums(), and InvRowSums().

const Epetra_BlockMap& LOCA::Epetra::LowRankUpdateRowMatrix::row_map [protected]

Row map for J.

Definition at line 276 of file LOCA_Epetra_LowRankUpdateRowMatrix.H.

Referenced by ExtractDiagonalCopy(), ExtractMyRowCopy(), NormInf(), and NormOne().


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

Generated on Wed Oct 21 14:28:30 2009 for Nonlinear Solver Project by  doxygen 1.5.9