Epetra_CrsMatrix Class Reference

Epetra_CrsMatrix: A class for constructing and using real-valued double-precision sparse compressed row matrices. More...

#include <Epetra_CrsMatrix.h>

Inheritance diagram for Epetra_CrsMatrix:

[legend]
Collaboration diagram for Epetra_CrsMatrix:
[legend]
List of all members.

Public Member Functions

Constructors/Destructor.
 Epetra_CrsMatrix (Epetra_DataAccess CV, const Epetra_Map &RowMap, int *NumEntriesPerRow)
 Epetra_CrsMatrix constuctor with variable number of indices per row.
 Epetra_CrsMatrix (Epetra_DataAccess CV, const Epetra_Map &RowMap, int NumEntriesPerRow)
 Epetra_CrsMatrix constuctor with fixed number of indices per row.
 Epetra_CrsMatrix (Epetra_DataAccess CV, const Epetra_Map &RowMap, const Epetra_Map &ColMap, int *NumEntriesPerRow)
 Epetra_CrsMatrix constuctor with variable number of indices per row.
 Epetra_CrsMatrix (Epetra_DataAccess CV, const Epetra_Map &RowMap, const Epetra_Map &ColMap, int NumEntriesPerRow)
 Epetra_CrsMatrix constuctor with fixed number of indices per row.
 Epetra_CrsMatrix (Epetra_DataAccess CV, const Epetra_CrsGraph &Graph)
 Construct a matrix using an existing Epetra_CrsGraph object.
 Epetra_CrsMatrix (const Epetra_CrsMatrix &Matrix)
 Copy constructor.
virtual ~Epetra_CrsMatrix ()
 Epetra_CrsMatrix Destructor.
Insertion/Replace/SumInto methods.
Epetra_CrsMatrixoperator= (const Epetra_CrsMatrix &src)
int PutScalar (double ScalarConstant)
 Initialize all values in the matrix with constant value.
int Scale (double ScalarConstant)
 Multiply all values in the matrix by a constant value (in place: A <- ScalarConstant * A).
int InsertGlobalValues (int GlobalRow, int NumEntries, double *Values, int *Indices)
 Insert a list of elements in a given global row of the matrix.
int ReplaceGlobalValues (int GlobalRow, int NumEntries, double *Values, int *Indices)
 Replace current values with this list of entries for a given global row of the matrix.
int SumIntoGlobalValues (int GlobalRow, int NumEntries, double *Values, int *Indices)
 Add this list of entries to existing values for a given global row of the matrix.
int InsertMyValues (int MyRow, int NumEntries, double *Values, int *Indices)
 Insert a list of elements in a given local row of the matrix.
int ReplaceMyValues (int MyRow, int NumEntries, double *Values, int *Indices)
 Replace current values with this list of entries for a given local row of the matrix.
int SumIntoMyValues (int MyRow, int NumEntries, double *Values, int *Indices)
 Add this list of entries to existing values for a given local row of the matrix.
int ReplaceDiagonalValues (const Epetra_Vector &Diagonal)
 Replaces diagonal values of the with those in the user-provided vector.
Transformation methods
int FillComplete ()
 Signal that data entry is complete. Perform transformations to local index space.
int FillComplete (const Epetra_Map &DomainMap, const Epetra_Map &RangeMap)
 Signal that data entry is complete. Perform transformations to local index space.
int SortEntries ()
 Sort column entries, row-by-row, in ascending order.
int MergeRedundantEntries ()
 Add entries that have the same column index. Remove redundant entries from list.
int OptimizeStorage ()
 Analyzes matrix and attempts to optimize storage for matrix operations.
int MakeDataContiguous ()
 Eliminates memory that is used for construction. Make consecutive row index sections contiguous.
Extraction methods.
int ExtractGlobalRowCopy (int GlobalRow, int Length, int &NumEntries, double *Values, int *Indices) const
 Returns a copy of the specified global row in user-provided arrays.
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 ExtractGlobalRowCopy (int GlobalRow, int Length, int &NumEntries, double *Values) const
 Returns a copy of the specified global row values in user-provided array.
int ExtractMyRowCopy (int MyRow, int Length, int &NumEntries, double *Values) const
 Returns a copy of the specified local row values in user-provided array.
int ExtractDiagonalCopy (Epetra_Vector &Diagonal) const
 Returns a copy of the main diagonal in a user-provided vector.
int ExtractGlobalRowView (int GlobalRow, int &NumEntries, double *&Values, int *&Indices) const
 Returns a view of the specified global row values via pointers to internal data.
int ExtractMyRowView (int MyRow, int &NumEntries, double *&Values, int *&Indices) const
 Returns a view of the specified local row values via pointers to internal data.
int ExtractGlobalRowView (int GlobalRow, int &NumEntries, double *&Values) const
 Returns a view of the specified global row values via pointers to internal data.
int ExtractMyRowView (int MyRow, int &NumEntries, double *&Values) const
 Returns a view of the specified local row values via pointers to internal data.
Computational methods.
int Multiply (bool TransA, const Epetra_Vector &x, Epetra_Vector &y) const
 Returns the result of a Epetra_CrsMatrix multiplied by a Epetra_Vector x in y.
int Multiply (bool TransA, const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
 Returns the result of a Epetra_CrsMatrix multiplied by a Epetra_MultiVector X in Y.
int Solve (bool Upper, bool Trans, bool UnitDiagonal, const Epetra_Vector &x, Epetra_Vector &y) const
 Returns the result of a local solve using the Epetra_CrsMatrix on a Epetra_Vector x in y.
int Solve (bool Upper, bool Trans, bool UnitDiagonal, const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
 Returns the result of a local solve using the Epetra_CrsMatrix a Epetra_MultiVector X in Y.
int InvRowSums (Epetra_Vector &x) const
 Computes the sum of absolute values of the rows of the Epetra_CrsMatrix, results returned in x.
int InvRowMaxs (Epetra_Vector &x) const
 Computes the max of absolute values of the rows of the Epetra_CrsMatrix, results returned in x.
int LeftScale (const Epetra_Vector &x)
 Scales the Epetra_CrsMatrix on the left with a Epetra_Vector x.
int InvColSums (Epetra_Vector &x) const
 Computes the sum of absolute values of the columns of the Epetra_CrsMatrix, results returned in x.
int InvColMaxs (Epetra_Vector &x) const
 Computes the max of absolute values of the columns of the Epetra_CrsMatrix, results returned in x.
int RightScale (const Epetra_Vector &x)
 Scales the Epetra_CrsMatrix on the right with a Epetra_Vector x.
Matrix Properties Query Methods.
bool NoRedundancies () const
 If MergeRedundantEntries() has been called, this query returns true, otherwise it returns false.
bool Sorted () const
 If SortEntries() has been called, this query returns true, otherwise it returns false.
bool Filled () const
 If FillComplete() has been called, this query returns true, otherwise it returns false.
bool StorageOptimized () const
 If OptimizeStorage() has been called, this query returns true, otherwise it returns false.
bool IndicesAreGlobal () const
 If matrix indices has not been transformed to local, this query returns true, otherwise it returns false.
bool IndicesAreLocal () const
 If matrix indices has been transformed to local, this query returns true, otherwise it returns false.
bool IndicesAreContiguous () const
 If matrix indices are packed into single array (done in OptimizeStorage()) return true, otherwise false.
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.
bool NoDiagonal () const
 If matrix has no diagonal entries in global index space, this query returns true, otherwise it returns false.
Atribute access functions
double NormInf () const
 Returns the infinity norm of the global matrix.
double NormOne () const
 Returns the one norm of the global matrix.
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.
int NumGlobalEntries (int Row) const
 Returns the current number of nonzero entries in specified global row on this processor.
int NumAllocatedGlobalEntries (int Row) const
 Returns the allocated number of nonzero entries in specified global row on this processor.
int MaxNumEntries () const
 Returns the maximum number of nonzero entries across all rows on this processor.
int GlobalMaxNumEntries () const
 Returns the maximum number of nonzero entries across all rows on all processors.
int NumMyEntries (int Row) const
 Returns the current number of nonzero entries in specified local row on this processor.
int NumAllocatedMyEntries (int Row) const
 Returns the allocated number of nonzero entries in specified local row on this processor.
int IndexBase () const
 Returns the index base for row and column indices for this graph.
bool StaticGraph ()
 Returns true if the graph associated with this matrix was pre-constructed and therefore not changeable.
const Epetra_CrsGraphGraph () const
 Returns a pointer to the Epetra_CrsGraph object associated with this matrix.
const Epetra_MapRowMap () const
 Returns the Epetra_Map object associated with the rows of this matrix.
int ReplaceRowMap (const Epetra_BlockMap &newmap)
 Replaces the current RowMap with the user-specified map object.
const Epetra_MapColMap () const
 Returns the Epetra_Map object that describes the column distribution across processors.
const Epetra_MapDomainMap () const
 Returns the Epetra_Map object associated with the domain of this matrix operator.
const Epetra_MapRangeMap () const
 Returns the Epetra_Map object associated with the range of this matrix operator.
const Epetra_ImportImporter () const
 Returns the Epetra_Import object that contains the import operations for distributed operations.
const Epetra_ExportExporter () const
 Returns the Epetra_Export object that contains the export operations for distributed operations.
const Epetra_CommComm () const
 Returns a pointer to the Epetra_Comm communicator associated with this matrix.
Local/Global ID methods
int LRID (int GRID) const
 Returns the local row index for given global row index, returns -1 if no local row for this global row.
int GRID (int LRID) const
 Returns the global row index for give local row index, returns IndexBase-1 if we don't have this local row.
int LCID (int GCID) const
 Returns the local column index for given global column index, returns -1 if no local column for this global column.
int GCID (int LCID) const
 Returns the global column index for give local column index, returns IndexBase-1 if we don't have this local column.
bool MyGRID (int GRID) const
 Returns true if the GRID passed in belongs to the calling processor in this map, otherwise returns false.
bool MyLRID (int LRID) const
 Returns true if the LRID passed in belongs to the calling processor in this map, otherwise returns false.
bool MyGCID (int GCID) const
 Returns true if the GCID passed in belongs to the calling processor in this map, otherwise returns false.
bool MyLCID (int LCID) const
 Returns true if the LRID passed in belongs to the calling processor in this map, otherwise returns false.
bool MyGlobalRow (int GID) const
 Returns true of GID is owned by the calling processor, otherwise it returns false.
I/O Methods.
virtual void Print (ostream &os) const
 Print method.
Additional methods required to support the Epetra_Operator interface.
char * Label () const
 Returns a character string describing the operator.
int SetUseTranspose (bool UseTranspose)
 If set true, transpose of this operator will be applied.
int Apply (const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
 Returns the result of a Epetra_Operator applied to a Epetra_MultiVector X in Y.
int ApplyInverse (const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
 Returns the result of a Epetra_Operator inverse applied to an Epetra_MultiVector X in Y.
bool HasNormInf () const
 Returns true because this class can compute an Inf-norm.
bool UseTranspose () const
 Returns the current UseTranspose setting.
const Epetra_MapOperatorDomainMap () const
 Returns the Epetra_Map object associated with the domain of this matrix operator.
const Epetra_MapOperatorRangeMap () const
 Returns the Epetra_Map object associated with the range of this matrix operator.
Additional methods required to implement RowMatrix interface.
int NumMyRowEntries (int MyRow, int &NumEntries) const
 Return the current number of values stored for the specified local row.
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 columns of this matrix.
const Epetra_ImportRowMatrixImporter () const
 Returns the Epetra_Import object that contains the import operations for distributed operations.
Inlined Operator Methods.
double *& operator[] (int Loc)
 Inlined bracket operator for fast access to data. (Const and Non-const versions).
double *const & operator[] (int Loc) const
Deprecated methods: These methods still work, but will be removed in a future version.
const Epetra_MapImportMap () const
 Use ColMap() instead.
int TransformToLocal ()
 Use FillComplete() instead.
int TransformToLocal (const Epetra_Map *DomainMap, const Epetra_Map *RangeMap)
 Use FillComplete(const Epetra_Map& DomainMap, const Epetra_Map& RangeMap) instead.

Protected Member Functions

bool Allocated () const
int SetAllocated (bool Flag)
double ** Values () const
void InitializeDefaults ()
int Allocate ()
int InsertValues (int LocalRow, int NumEntries, double *Values, int *Indices)
int InsertOffsetValues (int GlobalRow, int NumEntries, double *Values, int *Indices)
int ReplaceOffsetValues (int GlobalRow, int NumEntries, double *Values, int *Indices)
int SumIntoOffsetValues (int GlobalRow, int NumEntries, double *Values, int *Indices)
void SetStaticGraph (bool Flag)
int CheckSizes (const Epetra_SrcDistObject &A)
 Allows the source and target (this) objects to be compared for compatibility, return nonzero if not.
int CopyAndPermute (const Epetra_SrcDistObject &Source, int NumSameIDs, int NumPermuteIDs, int *PermuteToLIDs, int *PermuteFromLIDs, const Epetra_OffsetIndex *Indexor)
 Perform ID copies and permutations that are on processor.
int CopyAndPermuteCrsMatrix (const Epetra_CrsMatrix &A, int NumSameIDs, int NumPermuteIDs, int *PermuteToLIDs, int *PermuteFromLIDs, const Epetra_OffsetIndex *Indexor)
int CopyAndPermuteRowMatrix (const Epetra_RowMatrix &A, int NumSameIDs, int NumPermuteIDs, int *PermuteToLIDs, int *PermuteFromLIDs, const Epetra_OffsetIndex *Indexor)
int PackAndPrepare (const Epetra_SrcDistObject &Source, int NumExportIDs, int *ExportLIDs, int &LenExports, char *&Exports, int &SizeOfPacket, int *Sizes, bool &VarSizes, Epetra_Distributor &Distor)
 Perform any packing or preparation required for call to DoTransfer().
int UnpackAndCombine (const Epetra_SrcDistObject &Source, int NumImportIDs, int *ImportLIDs, int LenImports, char *Imports, int &SizeOfPacket, Epetra_Distributor &Distor, Epetra_CombineMode CombineMode, const Epetra_OffsetIndex *Indexor)
 Perform any unpacking and combining after call to DoTransfer().
void DeleteMemory ()

Protected Attributes

Epetra_CrsGraphGraph_
bool Allocated_
bool StaticGraph_
bool UseTranspose_
double ** Values_
double * All_Values_
double NormInf_
double NormOne_
int NumMyRows_
int * NumEntriesPerRow_
int * NumAllocatedEntriesPerRow_
int ** Indices_
Epetra_MultiVectorImportVector_
Epetra_MultiVectorExportVector_
Epetra_DataAccess CV_

Detailed Description

Epetra_CrsMatrix: A class for constructing and using real-valued double-precision sparse compressed row matrices.

The Epetra_CrsMatrix enables the piecewise construction and use of real-valued double-precision sparse matrices where matrix entries are intended for row access.

At this time, the primary function provided by Epetra_CrsMatrix is matrix times vector and matrix times multi-vector multiplication. It is also possible to extract matrix rows from a constructed matrix.

Constructing Epetra_CrsMatrix objects

Constructing Epetra_CrsMatrix objects is a multi-step process. The basic steps are as follows:

  1. Create Epetra_CrsMatrix instance, including storage, via constructor.
  2. Enter values via one or more Put or SumInto functions.
  3. Complete construction via FillComplete call.

Note that, even after a matrix is constructed, it is possible to update existing matrix entries. It is not possible to create new entries.

Counting Floating Point Operations

Each Epetra_CrsMatrix object keeps track of the number of serial floating point operations performed using the specified object as the this argument to the function. The Flops() function returns this number as a double precision number. Using this information, in conjunction with the Epetra_Time class, one can get accurate parallel performance numbers. The ResetFlops() function resets the floating point counter.

Warning:
A Epetra_Map is required for the Epetra_CrsMatrix constructor.


Constructor & Destructor Documentation

Epetra_CrsMatrix::Epetra_CrsMatrix Epetra_DataAccess  CV,
const Epetra_Map RowMap,
int *  NumEntriesPerRow
 

Epetra_CrsMatrix constuctor with variable number of indices per row.

Creates a Epetra_CrsMatrix object and allocates storage.

Parameters:
In CV - A Epetra_DataAccess enumerated type set to Copy or View.
In RowMap - An Epetra_Map listing the rows that this processor will contribute to.
In NumEntriesPerRow - An integer array of length NumRows such that NumEntriesPerRow[i] indicates the (approximate) number of entries in the ith row.

Epetra_CrsMatrix::Epetra_CrsMatrix Epetra_DataAccess  CV,
const Epetra_Map RowMap,
int  NumEntriesPerRow
 

Epetra_CrsMatrix constuctor with fixed number of indices per row.

Creates a Epetra_CrsMatrix object and allocates storage.

Parameters:
In CV - A Epetra_DataAccess enumerated type set to Copy or View.
In RowMap - An Epetra_Map listing the rows that this processor will contribute to.
In NumEntriesPerRow - An integer that indicates the (approximate) number of entries in the each row. Note that it is possible to use 0 for this value and let fill occur during the insertion phase.

Epetra_CrsMatrix::Epetra_CrsMatrix Epetra_DataAccess  CV,
const Epetra_Map RowMap,
const Epetra_Map ColMap,
int *  NumEntriesPerRow
 

Epetra_CrsMatrix constuctor with variable number of indices per row.

Creates a Epetra_CrsMatrix object and allocates storage.

Parameters:
In CV - A Epetra_DataAccess enumerated type set to Copy or View.
In RowMap - An Epetra_Map listing the rows that this processor will contribute to.
In ColMap - An Epetra_Map listing the columns that this processor will contribute to.
In NumEntriesPerRow - An integer array of length NumRows such that NumEntriesPerRow[i] indicates the (approximate) number of entries in the ith row.

Epetra_CrsMatrix::Epetra_CrsMatrix Epetra_DataAccess  CV,
const Epetra_Map RowMap,
const Epetra_Map ColMap,
int  NumEntriesPerRow
 

Epetra_CrsMatrix constuctor with fixed number of indices per row.

Creates a Epetra_CrsMatrix object and allocates storage.

Parameters:
In CV - A Epetra_DataAccess enumerated type set to Copy or View.
In RowMap - An Epetra_Map listing the rows that this processor will contribute to.
In ColMap - An Epetra_Map listing the columns that this processor will contribute to.
In NumEntriesPerRow - An integer that indicates the (approximate) number of entries in the each row. Note that it is possible to use 0 for this value and let fill occur during the insertion phase.

Epetra_CrsMatrix::Epetra_CrsMatrix Epetra_DataAccess  CV,
const Epetra_CrsGraph Graph
 

Construct a matrix using an existing Epetra_CrsGraph object.

Allows the nonzero structure from another matrix, or a structure that was constructed independently, to be used for this matrix.

Parameters:
In CV - A Epetra_DataAccess enumerated type set to Copy or View.
In Graph - A Epetra_CrsGraph object, extracted from another Epetra matrix object or constructed directly from using the Epetra_CrsGraph constructors.


Member Function Documentation

int Epetra_CrsMatrix::Apply const Epetra_MultiVector X,
Epetra_MultiVector Y
const [inline, virtual]
 

Returns the result of a Epetra_Operator applied to a Epetra_MultiVector X in Y.

Parameters:
In X - A Epetra_MultiVector of dimension NumVectors to multiply with matrix.
Out Y -A Epetra_MultiVector of dimension NumVectors containing result.
Returns:
Integer error code, set to 0 if successful.

Implements Epetra_Operator.

int Epetra_CrsMatrix::ApplyInverse const Epetra_MultiVector X,
Epetra_MultiVector Y
const [inline, virtual]
 

Returns the result of a Epetra_Operator inverse applied to an Epetra_MultiVector X in Y.

In this implementation, we use several existing attributes to determine how virtual method ApplyInverse() should call the concrete method Solve(). We pass in the UpperTriangular(), the Epetra_CrsMatrix::UseTranspose(), and NoDiagonal() methods. The most notable warning is that if a matrix has no diagonal values we assume that there is an implicit unit diagonal that should be accounted for when doing a triangular solve.

Parameters:
In X - A Epetra_MultiVector of dimension NumVectors to solve for.
Out Y -A Epetra_MultiVector of dimension NumVectors containing result.
Returns:
Integer error code, set to 0 if successful.

Implements Epetra_Operator.

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

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

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

Implements Epetra_RowMatrix.

int Epetra_CrsMatrix::ExtractGlobalRowCopy int  GlobalRow,
int  Length,
int &  NumEntries,
double *  Values
const
 

Returns a copy of the specified global row values in user-provided array.

Parameters:
In GlobalRow - Global row to extract.
In Length - Length of Values.
Out NumEntries - Number of nonzero entries extracted.
Out Values - Extracted values for this row.
Returns:
Integer error code, set to 0 if successful.

int Epetra_CrsMatrix::ExtractGlobalRowCopy int  GlobalRow,
int  Length,
int &  NumEntries,
double *  Values,
int *  Indices
const
 

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

Parameters:
In GlobalRow - Global 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, non-zero if global row is not owned by calling process or if the number of entries in this row exceed the Length parameter.

int Epetra_CrsMatrix::ExtractGlobalRowView int  GlobalRow,
int &  NumEntries,
double *&  Values
const
 

Returns a view of the specified global row values via pointers to internal data.

Parameters:
In GlobalRow - Global row to extract.
Out NumEntries - Number of nonzero entries extracted.
Out Values - Extracted values for this row.
Returns:
Integer error code, set to 0 if successful.

int Epetra_CrsMatrix::ExtractGlobalRowView int  GlobalRow,
int &  NumEntries,
double *&  Values,
int *&  Indices
const
 

Returns a view of the specified global row values via pointers to internal data.

Parameters:
In GlobalRow - Global row to view.
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. Returns -1 of row not on this processor. Returns -2 if matrix is not in global form (if FillComplete() has already been called).

int Epetra_CrsMatrix::ExtractMyRowCopy int  MyRow,
int  Length,
int &  NumEntries,
double *  Values
const
 

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

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

int Epetra_CrsMatrix::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.

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 local column indices for the corresponding values.
Returns:
Integer error code, set to 0 if successful.

Implements Epetra_RowMatrix.

int Epetra_CrsMatrix::ExtractMyRowView int  MyRow,
int &  NumEntries,
double *&  Values
const
 

Returns a view of the specified local row values via pointers to internal data.

Parameters:
In MyRow - Local row to extract.
Out NumEntries - Number of nonzero entries extracted.
Out Values - Extracted values for this row.
Returns:
Integer error code, set to 0 if successful.

int Epetra_CrsMatrix::ExtractMyRowView int  MyRow,
int &  NumEntries,
double *&  Values,
int *&  Indices
const
 

Returns a view of the specified local row values via pointers to internal data.

Parameters:
In MyRow - Local row to view.
Out NumEntries - Number of nonzero entries extracted.
Out Values - Extracted values for this row.
Out Indices - Extracted local column indices for the corresponding values.
Returns:
Integer error code, set to 0 if successful. Returns -1 of row not on this processor. Returns -2 if matrix is not in local form (if FillComplete() has not been called).

int Epetra_CrsMatrix::InsertGlobalValues int  GlobalRow,
int  NumEntries,
double *  Values,
int *  Indices
 

Insert a list of elements in a given global row of the matrix.

Parameters:
In GlobalRow - Row number (in global coordinates) to put elements.
In NumEntries - Number of entries.
In Values - Values to enter.
In Indices - Global column indices corresponding to values.
Returns:
Integer error code, set to 0 if successful. Note that if the allocated length of the row has to be expanded, a positive warning code will be returned.

int Epetra_CrsMatrix::InsertMyValues int  MyRow,
int  NumEntries,
double *  Values,
int *  Indices
 

Insert a list of elements in a given local row of the matrix.

Parameters:
In MyRow - Row number (in local coordinates) to put elements.
In NumEntries - Number of entries.
In Values - Values to enter.
In Indices - Local column indices corresponding to values.
Returns:
Integer error code, set to 0 if successful. Note that if the allocated length of the row has to be expanded, a positive warning code will be returned.

int Epetra_CrsMatrix::InvColMaxs Epetra_Vector x  )  const
 

Computes the max of absolute values of the columns of the Epetra_CrsMatrix, results returned in x.

The vector x will return such that x[j] will contain the inverse of max of the absolute values of the this matrix will be such that A(i,j) = x(j)*A(i,j) where i denotes the global row number of A and j denotes the global column number of A. Using the resulting vector from this function as input to RighttScale() will make the one norm of the resulting matrix exactly 1.

Parameters:
Out x -A Epetra_Vector containing the column maxs of the this matrix.
Warning:
It is assumed that the distribution of x is described by the DomainMap() of this.
Returns:
Integer error code, set to 0 if successful.

int Epetra_CrsMatrix::InvColSums Epetra_Vector x  )  const [virtual]
 

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

The vector x will return such that x[j] will contain the inverse of sum of the absolute values of the this matrix will be sca such that A(i,j) = x(j)*A(i,j) where i denotes the global row number of A and j denotes the global column number of A. Using the resulting vector from this function as input to RighttScale() will make the one norm of the resulting matrix exactly 1.

Parameters:
Out x -A Epetra_Vector containing the column sums of the this matrix.
Warning:
It is assumed that the distribution of x is described by the DomainMap() of this.
Returns:
Integer error code, set to 0 if successful.

Implements Epetra_RowMatrix.

int Epetra_CrsMatrix::InvRowMaxs Epetra_Vector x  )  const
 

Computes the max of absolute values of the rows of the Epetra_CrsMatrix, results returned in x.

The vector x will return such that x[i] will contain the inverse of max of the absolute values of the this matrix will be scaled such that A(i,j) = x(i)*A(i,j) where i denotes the global row number of A and j denotes the global column number of A. Using the resulting vector from this function as input to LeftScale() will make the infinity norm of the resulting matrix exactly 1.

Parameters:
Out x -A Epetra_Vector containing the row maxx of the this matrix.
Warning:
It is assumed that the distribution of x is the same as the rows of this.
Returns:
Integer error code, set to 0 if successful.

int Epetra_CrsMatrix::InvRowSums Epetra_Vector x  )  const [virtual]
 

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

The vector x will return such that x[i] will contain the inverse of sum of the absolute values of the this matrix will be scaled such that A(i,j) = x(i)*A(i,j) where i denotes the global row number of A and j denotes the global column number of A. Using the resulting vector from this function as input to LeftScale() will make the one norm of the resulting matrix exactly 1.

Parameters:
Out x -A Epetra_Vector containing the row sums of the this matrix.
Warning:
It is assumed that the distribution of x is the same as the rows of this.
Returns:
Integer error code, set to 0 if successful.

Implements Epetra_RowMatrix.

int Epetra_CrsMatrix::LeftScale const Epetra_Vector x  )  [virtual]
 

Scales the Epetra_CrsMatrix on the left with a Epetra_Vector x.

The this matrix will be scaled such that A(i,j) = x(i)*A(i,j) where i denotes the row number of A and j denotes the column number of A.

Parameters:
In x -A Epetra_Vector to solve for.
Returns:
Integer error code, set to 0 if successful.

Implements Epetra_RowMatrix.

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

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

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

Implements Epetra_RowMatrix.

int Epetra_CrsMatrix::Multiply bool  TransA,
const Epetra_Vector x,
Epetra_Vector y
const
 

Returns the result of a Epetra_CrsMatrix multiplied by a Epetra_Vector x in y.

Parameters:
In TransA -If true, multiply by the transpose of matrix, otherwise just use matrix.
In x -A Epetra_Vector to multiply by.
Out y -A Epetra_Vector containing result.
Returns:
Integer error code, set to 0 if successful.

int Epetra_CrsMatrix::NumMyRowEntries int  MyRow,
int &  NumEntries
const [virtual]
 

Return the current number of values stored for the specified local row.

Similar to NumMyEntries() except NumEntries is returned as an argument and error checking is done on the input value MyRow.

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

Implements Epetra_RowMatrix.

double*& Epetra_CrsMatrix::operator[] int  Loc  )  [inline]
 

Inlined bracket operator for fast access to data. (Const and Non-const versions).

No error checking and dangerous for optimization purposes.

Parameters:
In Loc - Local row.
Returns:
reference to pointer to locally indexed Loc row in matrix.

int Epetra_CrsMatrix::PutScalar double  ScalarConstant  ) 
 

Initialize all values in the matrix with constant value.

Parameters:
In ScalarConstant - Value to use.
Returns:
Integer error code, set to 0 if successful.

int Epetra_CrsMatrix::ReplaceDiagonalValues const Epetra_Vector Diagonal  ) 
 

Replaces diagonal values of the with those in the user-provided vector.

This routine is meant to allow replacement of { existing} diagonal values. If a diagonal value does not exist for a given row, the corresponding value in the input Epetra_Vector will be ignored and the return code will be set to 1.

The Epetra_Map associated with the input Epetra_Vector must be compatible with the RowMap of the matrix.

Parameters:
Diagonal (In) - New values to be placed in the main diagonal.
Returns:
Integer error code, set to 0 if successful, 1 of one or more diagonal entries not present in matrix.

int Epetra_CrsMatrix::ReplaceGlobalValues int  GlobalRow,
int  NumEntries,
double *  Values,
int *  Indices
 

Replace current values with this list of entries for a given global row of the matrix.

Parameters:
In GlobalRow - Row number (in global coordinates) to put elements.
In NumEntries - Number of entries.
In Values - Values to enter.
In Indices - Global column indices corresponding to values.
Returns:
Integer error code, set to 0 if successful. Note that if a value is not already present for the specified location in the matrix, the input value will be ignored and a positive warning code will be returned.

int Epetra_CrsMatrix::ReplaceMyValues int  MyRow,
int  NumEntries,
double *  Values,
int *  Indices
 

Replace current values with this list of entries for a given local row of the matrix.

Parameters:
In MyRow - Row number (in local coordinates) to put elements.
In NumEntries - Number of entries.
In Values - Values to enter.
In Indices - Local column indices corresponding to values.
Returns:
Integer error code, set to 0 if successful. Note that if a value is not already present for the specified location in the matrix, the input value will be ignored and a positive warning code will be returned.

int Epetra_CrsMatrix::RightScale const Epetra_Vector x  )  [virtual]
 

Scales the Epetra_CrsMatrix on the right with a Epetra_Vector x.

The this matrix will be scaled such that A(i,j) = x(j)*A(i,j) where i denotes the global row number of A and j denotes the global column number of A.

Parameters:
In x -The Epetra_Vector used for scaling this.
Returns:
Integer error code, set to 0 if successful.

Implements Epetra_RowMatrix.

int Epetra_CrsMatrix::Scale double  ScalarConstant  ) 
 

Multiply all values in the matrix by a constant value (in place: A <- ScalarConstant * A).

Parameters:
In ScalarConstant - Value to use.
Returns:
Integer error code, set to 0 if successful.

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

If set true, transpose of this operator will be applied.

This flag allows the transpose of the given operator to be used implicitly. Setting this flag affects only the Apply() and ApplyInverse() methods. If the implementation of this interface does not support transpose use, this method should return a value of -1.

Parameters:
In UseTranspose -If true, multiply by the transpose of operator, otherwise just use operator.
Returns:
Always returns 0.

Implements Epetra_Operator.

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

Returns the result of a local solve using the Epetra_CrsMatrix a Epetra_MultiVector X in Y.

This method solves a triangular system of equations asynchronously on each processor.

Parameters:
In Upper -If true, solve Uy = x, otherwise solve Ly = x.
In Trans -If true, solve transpose problem.
In UnitDiagonal -If true, assume diagonal is unit (whether it's stored or not).
In X - A Epetra_MultiVector of dimension NumVectors to solve for.
Out Y -A Epetra_MultiVector of dimension NumVectors containing result.
Returns:
Integer error code, set to 0 if successful.

Implements Epetra_RowMatrix.

int Epetra_CrsMatrix::Solve bool  Upper,
bool  Trans,
bool  UnitDiagonal,
const Epetra_Vector x,
Epetra_Vector y
const
 

Returns the result of a local solve using the Epetra_CrsMatrix on a Epetra_Vector x in y.

This method solves a triangular system of equations asynchronously on each processor.

Parameters:
In Upper -If true, solve Uy = x, otherwise solve Ly = x.
In Trans -If true, solve transpose problem.
In UnitDiagonal -If true, assume diagonal is unit (whether it's stored or not).
In x -A Epetra_Vector to solve for.
Out y -A Epetra_Vector containing result.
Returns:
Integer error code, set to 0 if successful.

int Epetra_CrsMatrix::SumIntoGlobalValues int  GlobalRow,
int  NumEntries,
double *  Values,
int *  Indices
 

Add this list of entries to existing values for a given global row of the matrix.

Parameters:
In GlobalRow - Row number (in global coordinates) to put elements.
In NumEntries - Number of entries.
In Values - Values to enter.
In Indices - Global column indices corresponding to values.
Returns:
Integer error code, set to 0 if successful. Note that if a value is not already present for the specified location in the matrix, the input value will be ignored and a positive warning code will be returned.

int Epetra_CrsMatrix::SumIntoMyValues int  MyRow,
int  NumEntries,
double *  Values,
int *  Indices
 

Add this list of entries to existing values for a given local row of the matrix.

Parameters:
In MyRow - Row number (in local coordinates) to put elements.
In NumEntries - Number of entries.
In Values - Values to enter.
In Indices - Local column indices corresponding to values.
Returns:
Integer error code, set to 0 if successful. Note that if the allocated length of the row has to be expanded, a positive warning code will be returned.


The documentation for this class was generated from the following file:
Generated on Thu Sep 18 12:43:15 2008 for Epetra by doxygen 1.3.9.1