# Komplex_RowMatrix Class Reference

`#include <Komplex_RowMatrix.h>`

Inheritance diagram for Komplex_RowMatrix:

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

## Public Member Functions

Constructors/Destructor.
Komplex_RowMatrix (void)
Default Komplex_RowMatrix constuctor.
Komplex_RowMatrix (double c0r, double c0i, Epetra_VbrMatrix A0, double c1r, double c1i, Epetra_VbrMatrix A1)
General Komplex_RowMatrix constructor.
Komplex_RowMatrix (const Komplex_RowMatrix &Matrix)
Copy constructor.
virtual ~Komplex_RowMatrix ()
Komplex_RowMatrix Destructor.
Equivalence and querying methods.
Komplex_RowMatrixoperator= (const Komplex_RowMatrix &src)
bool Filled () const
If this matrix has been filled, this query returns true; otherwise it returns false.
Computational methods.
int Multiply (bool TransA, const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
Returns the result of a Komplex_RowMatrix 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 solve using the Komplex_RowMatrix on a Epetra_Vector x in y.
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 Komplex_RowMatrix with Epetra_MultiVectors X and Y.
int InvRowSums (Epetra_Vector &x) const
Computes the sum of absolute values of the rows of the Komplex_RowMatrix, results returned in x.
int LeftScale (const Epetra_Vector &x)
Scales the Komplex_RowMatrix 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 Komplex_RowMatrix, results returned in x.
int RightScale (const Epetra_Vector &x)
Scales the Komplex_RowMatrix on the right with a Epetra_Vector x.
Matrix Properties Query Methods.
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.
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 NumMyNonzeros () const
Returns the number of nonzero entries owned by the calling processor.
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 NumGlobalRows () const
Returns the number of global matrix rows.
int NumGlobalCols () const
Returns the number of global matrix columns.
int NumGlobalNonzeros () const
Returns the number of nonzero entries in the global matrix.
int NumMyDiagonals () const
Returns the number of local nonzero diagonal entries, based on global row/column index comparisons.
int NumGlobalDiagonals () const
Returns the number of global nonzero diagonal entries, based on global row/column index comparisons.
Additional methods required to implement the Epetra_RowMatrix interface.
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 NumMyRowEntries (int MyRow, int &NumEntries) const
Return the current number of values stored for the specified local row.
int ExtractDiagonalCopy (Epetra_Vector &Diagonal) const
Returns a copy of the main diagonal in a user-provided vector.
int MaxNumEntries () const
Returns the maximum of NumMyRowEntries() over all rows.
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.
Non-interface Required Methods
int GenerateVbrMatrix (Epetra_VbrMatrix &Matrix)
Returns the this matrix as a Epetra_VbrMatrix object.

## Detailed Description

Komplex_RowMatrix: A class for the construction and use of complex-valued matrices stored in the equivalent real Komplex format. This class implements the pure virtual Epetra_RowMatrix class.

Constructing Komplex_RowMatrix objects

Constructing the Komplex_RowMatrix: The user defines the complex-valued matrix C = (c0r+i*c0i)*A0 +(c1r+i*c1i)*A1. Using this general expression for the complex matrix allows easy formulation of a variety of common complex problems. A0 and A1 are stored in Epetra_VbrMatrix format.

The different K forms (K1, K2, K3, K4, K14, and K23) can easily convert back and forth by going from one K form to the canonical form to another K form. The Komplex_Ordering that each Komplex_RowMatrix object has is what determines the conversions. Let Kanon stand for the canonical form of a complex matrix in equivalent real formulation. Then any K form is equivalent to: P_l * Kanon * P_r * D_r, where P_l, P_r are specific permutation matrices and D_r is a specific right diagonal scaling matrix.

This is helpful because certain forms are advantageous in certain conditions. To be able to convert back and forth during preconditioning and solving should allow for faster, more accurate solutions.

## Constructor & Destructor Documentation

 Komplex_RowMatrix::Komplex_RowMatrix ( void )
 Default Komplex_RowMatrix constuctor. Creates a Komplex_RowMatrix object and allocates storage.

 Komplex_RowMatrix::Komplex_RowMatrix ( double c0r, double c0i, Epetra_VbrMatrix A0, double c1r, double c1i, Epetra_VbrMatrix A1 )

General Komplex_RowMatrix constructor.

Creates a Komplex_RowMatrix object and fills it.

Parameters:
 In c0r - The real part of the complex coefficient multiplying A0. In c0i - The imag part of the complex coefficient multiplying A0. In A0 - An Epetra_RowMatrix that is one of the matrices used to define the true complex matrix. In c1r - The real part of the complex coefficient multiplying A1. In c1i - The imag part of the complex coefficient multiplying A1. In A1 - An Epetra_RowMatrix that is the second of the matrices used to define the true complex matrix.

## Member Function Documentation

 int Komplex_RowMatrix::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 Komplex_RowMatrix::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 Komplex_RowMatrix::InvColSums ( Epetra_Vector & x ) const` [virtual]`

Computes the sum of absolute values of the columns of the Komplex_RowMatrix, 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 and 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. Using the resulting vector from this function as input to RightScale() 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 the same as the rows of this.
Returns:
Integer error code, set to 0 if successful.

Implements Epetra_RowMatrix.

 int Komplex_RowMatrix::InvRowSums ( Epetra_Vector & x ) const` [virtual]`

Computes the sum of absolute values of the rows of the Komplex_RowMatrix, 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 and 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 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 Komplex_RowMatrix::LeftScale ( const Epetra_Vector & x ) ` [virtual]`

Scales the Komplex_RowMatrix 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 Komplex_RowMatrix::Multiply ( bool TransA, const Epetra_MultiVector & X, Epetra_MultiVector & Y ) const` [virtual]`

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

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

Implements Epetra_RowMatrix.

 int Komplex_RowMatrix::NumMyRowEntries ( int MyRow, int & NumEntries ) const` [virtual]`

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

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

Implements Epetra_RowMatrix.

 int Komplex_RowMatrix::RightScale ( const Epetra_Vector & x ) ` [virtual]`

Scales the Komplex_RowMatrix 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 Komplex_RowMatrix::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 Komplex_RowMatrix with Epetra_MultiVectors X and Y.

This method will perform a triangular solve independently on each processor of the parallel machine. No communication is performed.

Parameters:
 In Upper - If true, solve Ux = y, otherwise solve Lx = y. 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 Komplex_RowMatrix::Solve ( bool Upper, bool Trans, bool UnitDiagonal, const Epetra_Vector & x, Epetra_Vector & y ) const

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

Parameters:
 In Upper - If true, solve Ux = y, otherwise solve Lx = y. In Trans - If true, solve the 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 the result.
Returns:
Integer error code, set to 0 if successful.

The documentation for this class was generated from the following file:
• Komplex_RowMatrix.h

Generated on Thu Sep 18 12:42:09 2008 for Komplex by  1.3.9.1