Epetra_SerialDenseSVD Class Reference

Epetra_SerialDenseSVD: A class for SVDing dense linear problems. More...

#include <Epetra_SerialDenseSVD.h>

Inheritance diagram for Epetra_SerialDenseSVD:

Inheritance graph
[legend]

List of all members.

Public Member Functions

void AllocateWORK ()
void AllocateIWORK ()
void InitPointers ()
void DeleteArrays ()
void ResetMatrix ()
void ResetVectors ()

Public Attributes

bool Transpose_
bool Factored_
bool Solved_
bool Inverted_
char TRANS_
int M_
int N_
int Min_MN_
int NRHS_
int LDA_
int LDAI_
int LDB_
int LDX_
int INFO_
int LWORK_
int * IWORK_
double ANORM_
Epetra_SerialDenseMatrixMatrix_
Epetra_SerialDenseMatrixLHS_
Epetra_SerialDenseMatrixRHS_
Epetra_SerialDenseMatrixInverse_
double * A_
double * AI_
double * WORK_
double * U_
double * S_
double * Vt_
double * B_
double * X_
bool UseTranspose_

Private Member Functions

 Epetra_SerialDenseSVD (const Epetra_SerialDenseSVD &Source)
Epetra_SerialDenseSVDoperator= (const Epetra_SerialDenseSVD &Source)

Constructor/Destructor Methods

 Epetra_SerialDenseSVD ()
 Default constructor; matrix should be set using SetMatrix(), LHS and RHS set with SetVectors().
virtual ~Epetra_SerialDenseSVD ()
 Epetra_SerialDenseSVD destructor.

Set Methods

int SetMatrix (Epetra_SerialDenseMatrix &A)
 Sets the pointers for coefficient matrix.
int SetVectors (Epetra_SerialDenseMatrix &X, Epetra_SerialDenseMatrix &B)
 Sets the pointers for left and right hand side vector(s).

Strategy modifying Methods

void SolveWithTranspose (bool Flag)
 Causes equilibration to be called just before the matrix factorization as part of the call to Factor.

Factor/Solve/Invert Methods

Causes all solves to compute solution to best ability using iterative refinement.

virtual int Factor (void)
virtual int Solve (void)
 Computes the solution X to AX = B for the this matrix and the B provided to SetVectors()..
virtual int Invert (double rthresh=0.0, double athresh=0.0)
 Inverts the this matrix.

Query methods

bool Transpose ()
 Returns true if transpose of this matrix has and will be used.
bool Factored ()
 Returns true if matrix is factored (factor available via AF() and LDAF()).
bool Inverted ()
 Returns true if matrix inverse has been computed (inverse available via AF() and LDAF()).
bool Solved ()
 Returns true if the current set of vectors has been solved.

Data Accessor methods

Epetra_SerialDenseMatrixMatrix () const
 Returns pointer to current matrix.
Epetra_SerialDenseMatrixInvertedMatrix () const
 Returns pointer to inverted matrix (assuming inverse has been performed).
Epetra_SerialDenseMatrixLHS () const
 Returns pointer to current LHS.
Epetra_SerialDenseMatrixRHS () const
 Returns pointer to current RHS.
int M () const
 Returns row dimension of system.
int N () const
 Returns column dimension of system.
double * A () const
 Returns pointer to the this matrix.
int LDA () const
 Returns the leading dimension of the this matrix.
double * B () const
 Returns pointer to current RHS.
int LDB () const
 Returns the leading dimension of the RHS.
int NRHS () const
 Returns the number of current right hand sides and solution vectors.
double * X () const
 Returns pointer to current solution.
int LDX () const
 Returns the leading dimension of the solution.
double * S () const
double * AI () const
 Returns pointer to the inverted matrix (may be the same as A() if factorization done in place).
int LDAI () const
 Returns the leading dimension of the inverted matrix.
double ANORM () const
 Returns the 1-Norm of the this matrix (returns -1 if not yet computed).

I/O methods

virtual void Print (ostream &os) const
 Print service methods; defines behavior of ostream << operator.

Additional methods for support of Epetra_SerialDenseOperator interface

virtual int SetUseTranspose (bool UseTranspose)
 If set true, transpose of this operator will be applied.
virtual int Apply (const Epetra_SerialDenseMatrix &X, Epetra_SerialDenseMatrix &Y)
 Returns the result of a Epetra_SerialDenseOperator applied to a Epetra_SerialDenseMatrix X in Y.
virtual int ApplyInverse (const Epetra_SerialDenseMatrix &X, Epetra_SerialDenseMatrix &Y)
 Returns the result of a Epetra_SerialDenseOperator inverse applied to an Epetra_SerialDenseMatrix X in Y.
virtual double NormInf () const
 Returns the infinity norm of the global matrix.
virtual const char * Label () const
 Returns a character string describing the operator.
virtual bool UseTranspose () const
 Returns the current UseTranspose setting.
virtual bool HasNormInf () const
 Returns true if the this object can provide an approximate Inf-norm, false otherwise.
virtual int RowDim () const
 Returns the row dimension of operator.
virtual int ColDim () const
 Returns the column dimension of operator.


Detailed Description

Epetra_SerialDenseSVD: A class for SVDing dense linear problems.

The Epetra_SerialDenseSVD class enables the definition, in terms of Epetra_SerialDenseMatrix and Epetra_SerialDenseVector objects, of a dense linear problem, followed by the solution of that problem via the most sophisticated techniques available in LAPACK.

The Epetra_SerialDenseSVD class is intended to provide full-featured support for solving linear problems for general dense rectangular (or square) 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_SerialDenseSVD vs. Epetra_LAPACK

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

Constructing Epetra_SerialDenseSVD Objects

There is a single Epetra_SerialDenseSVD constructor. However, the matrix, right hand side and solution vectors must be set prior to executing most methods in this class.

Setting vectors used for linear solves

The matrix A, the left hand side X and the right hand side B (when solving AX = B, for X), can be set by appropriate set methods. Each of these three objects must be an Epetra_SerialDenseMatrix or and Epetra_SerialDenseVector object. The set methods are as follows:

Vector and Utility Functions

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

Counting floating point operations The Epetra_SerialDenseSVD 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.

Examples using Epetra_SerialDenseSVD can be found in the Epetra test directories.

Definition at line 96 of file Epetra_SerialDenseSVD.h.


Constructor & Destructor Documentation

Epetra_SerialDenseSVD::Epetra_SerialDenseSVD (  ) 

Default constructor; matrix should be set using SetMatrix(), LHS and RHS set with SetVectors().

Definition at line 30 of file Epetra_SerialDenseSVD.cpp.

Epetra_SerialDenseSVD::~Epetra_SerialDenseSVD (  )  [virtual]

Epetra_SerialDenseSVD destructor.

Definition at line 71 of file Epetra_SerialDenseSVD.cpp.

Epetra_SerialDenseSVD::Epetra_SerialDenseSVD ( const Epetra_SerialDenseSVD Source  )  [private]


Member Function Documentation

int Epetra_SerialDenseSVD::SetMatrix ( Epetra_SerialDenseMatrix A  ) 

Sets the pointers for coefficient matrix.

Definition at line 146 of file Epetra_SerialDenseSVD.cpp.

int Epetra_SerialDenseSVD::SetVectors ( Epetra_SerialDenseMatrix X,
Epetra_SerialDenseMatrix B 
)

Sets the pointers for left and right hand side vector(s).

Row dimension of X must match column dimension of matrix A, row dimension of B must match row dimension of A. X and B must have the same dimensions.

Definition at line 176 of file Epetra_SerialDenseSVD.cpp.

void Epetra_SerialDenseSVD::SolveWithTranspose ( bool  Flag  )  [inline]

Causes equilibration to be called just before the matrix factorization as part of the call to Factor.

This function must be called before the factorization is performed. If Flag is true, causes all subsequent function calls to work with the transpose of this matrix, otherwise not.

Definition at line 130 of file Epetra_SerialDenseSVD.h.

int Epetra_SerialDenseSVD::Factor ( void   )  [virtual]

Definition at line 196 of file Epetra_SerialDenseSVD.cpp.

int Epetra_SerialDenseSVD::Solve ( void   )  [virtual]

Computes the solution X to AX = B for the this matrix and the B provided to SetVectors()..

Inverse of Matrix must be formed

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

Definition at line 243 of file Epetra_SerialDenseSVD.cpp.

int Epetra_SerialDenseSVD::Invert ( double  rthresh = 0.0,
double  athresh = 0.0 
) [virtual]

Inverts the this matrix.

Returns:
Integer error code, set to 0 if successful. Otherwise returns the LAPACK error code INFO.

Definition at line 462 of file Epetra_SerialDenseSVD.cpp.

bool Epetra_SerialDenseSVD::Transpose (  )  [inline]

Returns true if transpose of this matrix has and will be used.

Definition at line 217 of file Epetra_SerialDenseSVD.h.

bool Epetra_SerialDenseSVD::Factored (  )  [inline]

Returns true if matrix is factored (factor available via AF() and LDAF()).

Definition at line 220 of file Epetra_SerialDenseSVD.h.

bool Epetra_SerialDenseSVD::Inverted (  )  [inline]

Returns true if matrix inverse has been computed (inverse available via AF() and LDAF()).

Definition at line 239 of file Epetra_SerialDenseSVD.h.

bool Epetra_SerialDenseSVD::Solved (  )  [inline]

Returns true if the current set of vectors has been solved.

Definition at line 246 of file Epetra_SerialDenseSVD.h.

Epetra_SerialDenseMatrix* Epetra_SerialDenseSVD::Matrix (  )  const [inline]

Returns pointer to current matrix.

Definition at line 257 of file Epetra_SerialDenseSVD.h.

Epetra_SerialDenseMatrix* Epetra_SerialDenseSVD::InvertedMatrix (  )  const [inline]

Returns pointer to inverted matrix (assuming inverse has been performed).

Definition at line 264 of file Epetra_SerialDenseSVD.h.

Epetra_SerialDenseMatrix* Epetra_SerialDenseSVD::LHS (  )  const [inline]

Returns pointer to current LHS.

Definition at line 267 of file Epetra_SerialDenseSVD.h.

Epetra_SerialDenseMatrix* Epetra_SerialDenseSVD::RHS (  )  const [inline]

Returns pointer to current RHS.

Definition at line 270 of file Epetra_SerialDenseSVD.h.

int Epetra_SerialDenseSVD::M (  )  const [inline]

Returns row dimension of system.

Definition at line 273 of file Epetra_SerialDenseSVD.h.

int Epetra_SerialDenseSVD::N (  )  const [inline]

Returns column dimension of system.

Definition at line 276 of file Epetra_SerialDenseSVD.h.

double* Epetra_SerialDenseSVD::A (  )  const [inline]

Returns pointer to the this matrix.

Definition at line 279 of file Epetra_SerialDenseSVD.h.

int Epetra_SerialDenseSVD::LDA (  )  const [inline]

Returns the leading dimension of the this matrix.

Definition at line 282 of file Epetra_SerialDenseSVD.h.

double* Epetra_SerialDenseSVD::B (  )  const [inline]

Returns pointer to current RHS.

Definition at line 285 of file Epetra_SerialDenseSVD.h.

int Epetra_SerialDenseSVD::LDB (  )  const [inline]

Returns the leading dimension of the RHS.

Definition at line 288 of file Epetra_SerialDenseSVD.h.

int Epetra_SerialDenseSVD::NRHS (  )  const [inline]

Returns the number of current right hand sides and solution vectors.

Definition at line 291 of file Epetra_SerialDenseSVD.h.

double* Epetra_SerialDenseSVD::X (  )  const [inline]

Returns pointer to current solution.

Definition at line 294 of file Epetra_SerialDenseSVD.h.

int Epetra_SerialDenseSVD::LDX (  )  const [inline]

Returns the leading dimension of the solution.

Definition at line 297 of file Epetra_SerialDenseSVD.h.

double* Epetra_SerialDenseSVD::S (  )  const [inline]

Definition at line 299 of file Epetra_SerialDenseSVD.h.

double* Epetra_SerialDenseSVD::AI (  )  const [inline]

Returns pointer to the inverted matrix (may be the same as A() if factorization done in place).

Definition at line 310 of file Epetra_SerialDenseSVD.h.

int Epetra_SerialDenseSVD::LDAI (  )  const [inline]

Returns the leading dimension of the inverted matrix.

Definition at line 313 of file Epetra_SerialDenseSVD.h.

double Epetra_SerialDenseSVD::ANORM (  )  const [inline]

Returns the 1-Norm of the this matrix (returns -1 if not yet computed).

Definition at line 320 of file Epetra_SerialDenseSVD.h.

void Epetra_SerialDenseSVD::Print ( ostream &  os  )  const [virtual]

Print service methods; defines behavior of ostream << operator.

Reimplemented from Epetra_Object.

Definition at line 542 of file Epetra_SerialDenseSVD.cpp.

virtual int Epetra_SerialDenseSVD::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:
Integer error code, set to 0 if successful. Set to -1 if this implementation does not support transpose.

Implements Epetra_SerialDenseOperator.

Definition at line 378 of file Epetra_SerialDenseSVD.h.

virtual int Epetra_SerialDenseSVD::Apply ( const Epetra_SerialDenseMatrix X,
Epetra_SerialDenseMatrix Y 
) [inline, virtual]

Returns the result of a Epetra_SerialDenseOperator applied to a Epetra_SerialDenseMatrix X in Y.

Parameters:
In X - A Epetra_SerialDenseMatrix to multiply with operator.
Out Y -A Epetra_SerialDenseMatrix containing result.
Returns:
Integer error code, set to 0 if successful.

Implements Epetra_SerialDenseOperator.

Definition at line 389 of file Epetra_SerialDenseSVD.h.

virtual int Epetra_SerialDenseSVD::ApplyInverse ( const Epetra_SerialDenseMatrix X,
Epetra_SerialDenseMatrix Y 
) [inline, virtual]

Returns the result of a Epetra_SerialDenseOperator inverse applied to an Epetra_SerialDenseMatrix X in Y.

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

Implements Epetra_SerialDenseOperator.

Definition at line 402 of file Epetra_SerialDenseSVD.h.

virtual double Epetra_SerialDenseSVD::NormInf ( void   )  const [inline, virtual]

Returns the infinity norm of the global matrix.

Implements Epetra_SerialDenseOperator.

Definition at line 413 of file Epetra_SerialDenseSVD.h.

virtual const char* Epetra_SerialDenseSVD::Label (  )  const [inline, virtual]

Returns a character string describing the operator.

Reimplemented from Epetra_Object.

Definition at line 416 of file Epetra_SerialDenseSVD.h.

virtual bool Epetra_SerialDenseSVD::UseTranspose (  )  const [inline, virtual]

Returns the current UseTranspose setting.

Implements Epetra_SerialDenseOperator.

Definition at line 419 of file Epetra_SerialDenseSVD.h.

virtual bool Epetra_SerialDenseSVD::HasNormInf (  )  const [inline, virtual]

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

Implements Epetra_SerialDenseOperator.

Definition at line 422 of file Epetra_SerialDenseSVD.h.

virtual int Epetra_SerialDenseSVD::RowDim (  )  const [inline, virtual]

Returns the row dimension of operator.

Implements Epetra_SerialDenseOperator.

Definition at line 425 of file Epetra_SerialDenseSVD.h.

virtual int Epetra_SerialDenseSVD::ColDim (  )  const [inline, virtual]

Returns the column dimension of operator.

Implements Epetra_SerialDenseOperator.

Definition at line 428 of file Epetra_SerialDenseSVD.h.

void Epetra_SerialDenseSVD::AllocateWORK (  )  [inline]

Definition at line 432 of file Epetra_SerialDenseSVD.h.

void Epetra_SerialDenseSVD::AllocateIWORK (  )  [inline]

Definition at line 433 of file Epetra_SerialDenseSVD.h.

void Epetra_SerialDenseSVD::InitPointers (  ) 

Definition at line 76 of file Epetra_SerialDenseSVD.cpp.

void Epetra_SerialDenseSVD::DeleteArrays (  ) 

Definition at line 96 of file Epetra_SerialDenseSVD.cpp.

void Epetra_SerialDenseSVD::ResetMatrix (  ) 

Definition at line 118 of file Epetra_SerialDenseSVD.cpp.

void Epetra_SerialDenseSVD::ResetVectors (  ) 

Definition at line 160 of file Epetra_SerialDenseSVD.cpp.

Epetra_SerialDenseSVD& Epetra_SerialDenseSVD::operator= ( const Epetra_SerialDenseSVD Source  )  [private]


Member Data Documentation

Definition at line 444 of file Epetra_SerialDenseSVD.h.

Definition at line 445 of file Epetra_SerialDenseSVD.h.

Definition at line 448 of file Epetra_SerialDenseSVD.h.

Definition at line 449 of file Epetra_SerialDenseSVD.h.

Definition at line 454 of file Epetra_SerialDenseSVD.h.

Definition at line 456 of file Epetra_SerialDenseSVD.h.

Definition at line 457 of file Epetra_SerialDenseSVD.h.

Definition at line 458 of file Epetra_SerialDenseSVD.h.

Definition at line 459 of file Epetra_SerialDenseSVD.h.

Definition at line 460 of file Epetra_SerialDenseSVD.h.

Definition at line 462 of file Epetra_SerialDenseSVD.h.

Definition at line 463 of file Epetra_SerialDenseSVD.h.

Definition at line 464 of file Epetra_SerialDenseSVD.h.

Definition at line 465 of file Epetra_SerialDenseSVD.h.

Definition at line 466 of file Epetra_SerialDenseSVD.h.

Definition at line 469 of file Epetra_SerialDenseSVD.h.

Definition at line 471 of file Epetra_SerialDenseSVD.h.

Definition at line 477 of file Epetra_SerialDenseSVD.h.

Definition at line 478 of file Epetra_SerialDenseSVD.h.

Definition at line 479 of file Epetra_SerialDenseSVD.h.

Definition at line 481 of file Epetra_SerialDenseSVD.h.

Definition at line 483 of file Epetra_SerialDenseSVD.h.

Definition at line 487 of file Epetra_SerialDenseSVD.h.

Definition at line 488 of file Epetra_SerialDenseSVD.h.

Definition at line 491 of file Epetra_SerialDenseSVD.h.

Definition at line 492 of file Epetra_SerialDenseSVD.h.

Definition at line 493 of file Epetra_SerialDenseSVD.h.

Definition at line 495 of file Epetra_SerialDenseSVD.h.

Definition at line 496 of file Epetra_SerialDenseSVD.h.

Definition at line 498 of file Epetra_SerialDenseSVD.h.


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

Generated on Wed Jul 22 13:22:01 2009 for Epetra Package Browser (Single Doxygen Collection) by doxygen 1.5.8