Epetra Development
Public Member Functions
Epetra_SerialSymDenseMatrix Class Reference

Epetra_SerialSymDenseMatrix: A class for constructing and using symmetric positive definite dense matrices. More...

#include <Epetra_SerialSymDenseMatrix.h>

Inheritance diagram for Epetra_SerialSymDenseMatrix:
Inheritance graph
[legend]
Collaboration diagram for Epetra_SerialSymDenseMatrix:
Collaboration graph
[legend]

List of all members.

Public Member Functions

void CopyUPLOMat (bool Upper, double *A, int LDA, int NumRows)
Constructor/Destructor Methods
 Epetra_SerialSymDenseMatrix (void)
 Default constructor; defines a zero size object.
 Epetra_SerialSymDenseMatrix (Epetra_DataAccess CV, double *A, int LDA, int NumRowsCols)
 Set object values from two-dimensional array.
 Epetra_SerialSymDenseMatrix (const Epetra_SerialSymDenseMatrix &Source)
 Epetra_SerialSymDenseMatrix copy constructor.
virtual ~Epetra_SerialSymDenseMatrix ()
 Epetra_SerialSymDenseMatrix destructor.
Set Methods
int Shape (int NumRowsCols)
 Set dimensions of a Epetra_SerialSymDenseMatrix object; init values to zero.
int Reshape (int NumRowsCols)
 Reshape a Epetra_SerialSymDenseMatrix object.
void SetLower ()
 Specify that the lower triangle of the this matrix should be used.
void SetUpper ()
 Specify that the upper triangle of the this matrix should be used.
Query methods
bool Upper () const
 Returns true if upper triangle of this matrix has and will be used.
char UPLO () const
 Returns character value of UPLO used by LAPACK routines.
Mathematical Methods
int Scale (double ScalarA)
 Inplace scalar-matrix product A = a A.
double NormOne () const
 Computes the 1-Norm of the this matrix.
double NormInf () const
 Computes the Infinity-Norm of the this matrix.
Deprecated methods (will be removed in later versions of this class)
double OneNorm () const
 Computes the 1-Norm of the this matrix (identical to NormOne() method).
double InfNorm () const
 Computes the Infinity-Norm of the this matrix (identical to NormInf() method).

Detailed Description

Epetra_SerialSymDenseMatrix: A class for constructing and using symmetric positive definite dense matrices.

The Epetra_SerialSymDenseMatrix class enables the construction and use of real-valued, symmetric positive definite, double-precision dense matrices. It is built on the Epetra_SerialDenseMatrix class which in turn is built on the BLAS via the Epetra_BLAS class.

The Epetra_SerialSymDenseMatrix class is intended to provide full-featured support for solving linear and eigen system problems for symmetric positive definite matrices. It is written on top of BLAS and LAPACK and thus has excellent performance and numerical capabilities. Using this class, one can either perform simple factorizations and solves or apply all the tricks available in LAPACK to get the best possible solution for very ill-conditioned problems.

Epetra_SerialSymDenseMatrix vs. Epetra_LAPACK

The Epetra_LAPACK class provides access to most of the same functionality as Epetra_SerialSymDenseMatrix. The primary difference is that Epetra_LAPACK is a "thin" layer on top of LAPACK and Epetra_SerialSymDenseMatrix attempts to provide easy access to the more sophisticated aspects of solving dense linear and eigensystems.

Constructing Epetra_SerialSymDenseMatrix Objects

There are three Epetra_DenseMatrix constructors. The first constructs a zero-sized object which should be made to appropriate length using the Shape() or Reshape() functions and then filled with the [] or () operators. The second is a constructor that accepts user data as a 2D array, the third is a copy constructor. The second constructor has two data access modes (specified by the Epetra_DataAccess argument):

  1. Copy mode - Allocates memory and makes a copy of the user-provided data. In this case, the user data is not needed after construction.
  2. View mode - Creates a "view" of the user data. In this case, the user data is required to remain intact for the life of the object.
Warning:
View mode is extremely dangerous from a data hiding perspective. Therefore, we strongly encourage users to develop code using Copy mode first and only use the View mode in a secondary optimization phase.

Extracting Data from Epetra_SerialSymDenseMatrix Objects

Once a Epetra_SerialSymDenseMatrix is constructed, it is possible to view the data via access functions.

Warning:
Use of these access functions cam be extremely dangerous from a data hiding perspective.

Vector and Utility Functions

Once a Epetra_SerialSymDenseMatrix is constructed, several mathematical functions can be applied to the object. Specifically:

Counting floating point operations The Epetra_SerialSymDenseMatrix class has Epetra_CompObject as a base class. Thus, floating point operations are counted and accumulated in the Epetra_Flop object (if any) that was set using the SetFlopCounter() method in the Epetra_CompObject base class.


Constructor & Destructor Documentation

Epetra_SerialSymDenseMatrix::Epetra_SerialSymDenseMatrix ( void  )

Default constructor; defines a zero size object.

Epetra_SerialSymDenseMatrix objects defined by the default constructor should be sized with the Shape() or Reshape() functions. Values should be defined by using the [] or ()operators.

Note: By default the active part of the matrix is assumed to be in the lower triangle. To set the upper part as active, call SetUpper(). See Detailed Description section for further discussion.

Epetra_SerialSymDenseMatrix::Epetra_SerialSymDenseMatrix ( Epetra_DataAccess  CV,
double *  A,
int  LDA,
int  NumRowsCols 
)

Set object values from two-dimensional array.

Parameters:
InEpetra_DataAccess - Enumerated type set to Copy or View.
InA - Pointer to an array of double precision numbers. The first vector starts at A. The second vector starts at A+LDA, the third at A+2*LDA, and so on.
InLDA - The "Leading Dimension", or stride between vectors in memory.
InNumRowsCols - Number of rows and columns in object.

Note: By default the active part of the matrix is assumed to be in the lower triangle. To set the upper part as active, call SetUpper(). See Detailed Description section for further discussion.


Member Function Documentation

double Epetra_SerialSymDenseMatrix::NormOne ( ) const [virtual]

Computes the 1-Norm of the this matrix.

Returns:
Integer error code, set to 0 if successful.

Reimplemented from Epetra_SerialDenseMatrix.

Referenced by OneNorm().

double Epetra_SerialSymDenseMatrix::OneNorm ( ) const [inline, virtual]

Computes the 1-Norm of the this matrix (identical to NormOne() method).

Returns:
Integer error code, set to 0 if successful.

Reimplemented from Epetra_SerialDenseMatrix.

References NormOne().

int Epetra_SerialSymDenseMatrix::Reshape ( int  NumRowsCols) [inline]

Reshape a Epetra_SerialSymDenseMatrix object.

Parameters:
InNumRowsCols - Number of rows and columns in object.

Allows user to define the dimensions of a Epetra_SerialSymDenseMatrix at any point. This function can be called at any point after construction. Any values that were previously in this object are copied into the new shape. If the new shape is smaller than the original, the upper left portion of the original matrix (the principal submatrix) is copied to the new matrix.

Returns:
Integer error code, set to 0 if successful.

References Epetra_SerialDenseMatrix::Reshape().

int Epetra_SerialSymDenseMatrix::Scale ( double  ScalarA)

Inplace scalar-matrix product A = a A.

Scale a matrix, entry-by-entry using the value ScalarA. This method is sensitive to the UPLO() parameter.

Parameters:
ScalarA(In) Scalar to multiply with A.
Returns:
Integer error code, set to 0 if successful.

Reimplemented from Epetra_SerialDenseMatrix.

int Epetra_SerialSymDenseMatrix::Shape ( int  NumRowsCols) [inline]

Set dimensions of a Epetra_SerialSymDenseMatrix object; init values to zero.

Parameters:
InNumRowsCols - Number of rows and columns in object.

Allows user to define the dimensions of a Epetra_DenseMatrix at any point. This function can be called at any point after construction. Any values that were previously in this object are destroyed and the resized matrix starts off with all zero values.

Returns:
Integer error code, set to 0 if successful.

References Epetra_SerialDenseMatrix::Shape().


The documentation for this class was generated from the following file:
 All Classes Files Functions Enumerations Enumerator