Public Member Functions | Protected Member Functions | Protected Attributes
TSFExtended::LAPACKGeneralMatrix Class Reference

Linear operator implemented as a LAPACK dense matrix. More...

List of all members.

Public Member Functions

 LAPACKGeneralMatrix (int nRow, int nCol)
 Construct with domain and range spaces, which should be DenseSerialVectorSpace objects.
 LAPACKGeneralMatrix ()
 Empty Ctor.
double & operator[] (int i)
const double & operator[] (int i) const
double & operator() (int i, int j)
const double & operator() (int i, int j) const
int getNumRows () const
int getNumCols () const
void apply (const DenseSerialVector &in, DenseSerialVector &out) const
 apply operator to dense serial vector.
void applyInverse (const DenseSerialVector &in, DenseSerialVector &out) const
 apply inverse operator to a vector in the range space, returning its preimage as a vector in the domain space.
void applyAdjoint (const DenseSerialVector &in, DenseSerialVector &out) const
 apply adjoint operator to a vector in the domain space, returning a vector in the range space.
void applyInverseAdjoint (const DenseSerialVector &in, DenseSerialVector &out) const
 apply inverse adjoint operator
void setElement (int i, int j, const double &aij)
void zero ()
 set all elements to zero
void factor () const
 factor with a call to LAPACK's getrf() function
void print (std::ostream &os) const
 write to a stream

Protected Member Functions

void mvMult (bool transpose, const DenseSerialVector &in, DenseSerialVector &out) const
 low-level matrix-vector multiply
void solve (bool transpose, const DenseSerialVector &in, DenseSerialVector &out) const
 low-level solve

Protected Attributes

int nRows_
int nCols_
DenseSerialVector data_
Teuchos::Array< int > iPiv_
bool isFactored_
DenseSerialVector factorData_

Detailed Description

Linear operator implemented as a LAPACK dense matrix.

Definition at line 14 of file TSFLAPACKGeneralMatrix.hpp.


Constructor & Destructor Documentation

LAPACKGeneralMatrix::LAPACKGeneralMatrix ( int  nRow,
int  nCol 
)

Construct with domain and range spaces, which should be DenseSerialVectorSpace objects.

Definition at line 16 of file TSFLAPACKGeneralMatrix.cpp.

LAPACKGeneralMatrix::LAPACKGeneralMatrix ( )

Empty Ctor.

Definition at line 7 of file TSFLAPACKGeneralMatrix.cpp.


Member Function Documentation

void LAPACKGeneralMatrix::apply ( const DenseSerialVector in,
DenseSerialVector out 
) const

apply operator to dense serial vector.

in the range space

Definition at line 26 of file TSFLAPACKGeneralMatrix.cpp.

References mvMult().

void LAPACKGeneralMatrix::applyAdjoint ( const DenseSerialVector in,
DenseSerialVector out 
) const

apply adjoint operator to a vector in the domain space, returning a vector in the range space.

The default implementation throws an exception

Definition at line 32 of file TSFLAPACKGeneralMatrix.cpp.

References mvMult().

void LAPACKGeneralMatrix::applyInverse ( const DenseSerialVector in,
DenseSerialVector out 
) const

apply inverse operator to a vector in the range space, returning its preimage as a vector in the domain space.

The solve is done by factoring and backsolving.

Definition at line 38 of file TSFLAPACKGeneralMatrix.cpp.

References solve().

void LAPACKGeneralMatrix::applyInverseAdjoint ( const DenseSerialVector in,
DenseSerialVector out 
) const

apply inverse adjoint operator

Definition at line 44 of file TSFLAPACKGeneralMatrix.cpp.

References solve().

void LAPACKGeneralMatrix::factor ( ) const

factor with a call to LAPACK's getrf() function

Definition at line 127 of file TSFLAPACKGeneralMatrix.cpp.

References data_, factorData_, iPiv_, isFactored_, nCols_, and nRows_.

Referenced by solve().

int TSFExtended::LAPACKGeneralMatrix::getNumCols ( ) const [inline]

Definition at line 38 of file TSFLAPACKGeneralMatrix.hpp.

References nCols_.

int TSFExtended::LAPACKGeneralMatrix::getNumRows ( ) const [inline]

Definition at line 33 of file TSFLAPACKGeneralMatrix.hpp.

References nRows_.

void LAPACKGeneralMatrix::mvMult ( bool  transpose,
const DenseSerialVector in,
DenseSerialVector out 
) const [protected]

low-level matrix-vector multiply

Definition at line 53 of file TSFLAPACKGeneralMatrix.cpp.

References TSFExtended::DenseSerialVector::blasObject(), data_, nCols_, and nRows_.

Referenced by apply(), and applyAdjoint().

double& TSFExtended::LAPACKGeneralMatrix::operator() ( int  i,
int  j 
) [inline]

Definition at line 28 of file TSFLAPACKGeneralMatrix.hpp.

References data_, and nRows_.

const double& TSFExtended::LAPACKGeneralMatrix::operator() ( int  i,
int  j 
) const [inline]

Definition at line 30 of file TSFLAPACKGeneralMatrix.hpp.

References data_, and nRows_.

const double& TSFExtended::LAPACKGeneralMatrix::operator[] ( int  i) const [inline]

Definition at line 26 of file TSFLAPACKGeneralMatrix.hpp.

References data_.

double& TSFExtended::LAPACKGeneralMatrix::operator[] ( int  i) [inline]

Definition at line 25 of file TSFLAPACKGeneralMatrix.hpp.

References data_.

void LAPACKGeneralMatrix::print ( std::ostream &  os) const

write to a stream

Definition at line 152 of file TSFLAPACKGeneralMatrix.cpp.

References data_, nCols_, and nRows_.

void LAPACKGeneralMatrix::setElement ( int  i,
int  j,
const double &  aij 
)

Definition at line 115 of file TSFLAPACKGeneralMatrix.cpp.

References data_, isFactored_, and nRows_.

void LAPACKGeneralMatrix::solve ( bool  transpose,
const DenseSerialVector in,
DenseSerialVector out 
) const [protected]
void LAPACKGeneralMatrix::zero ( )

set all elements to zero

Definition at line 121 of file TSFLAPACKGeneralMatrix.cpp.

References data_, isFactored_, and TSFExtended::DenseSerialVector::zero().


Member Data Documentation

Definition at line 99 of file TSFLAPACKGeneralMatrix.hpp.

Referenced by factor(), mvMult(), operator()(), operator[](), print(), setElement(), and zero().

Definition at line 105 of file TSFLAPACKGeneralMatrix.hpp.

Referenced by factor(), and solve().

Teuchos::Array<int> TSFExtended::LAPACKGeneralMatrix::iPiv_ [mutable, protected]

Definition at line 101 of file TSFLAPACKGeneralMatrix.hpp.

Referenced by factor(), and solve().

Definition at line 103 of file TSFLAPACKGeneralMatrix.hpp.

Referenced by factor(), setElement(), solve(), and zero().

Definition at line 97 of file TSFLAPACKGeneralMatrix.hpp.

Referenced by factor(), getNumCols(), mvMult(), and print().

Definition at line 95 of file TSFLAPACKGeneralMatrix.hpp.

Referenced by factor(), getNumRows(), mvMult(), operator()(), print(), setElement(), and solve().

Site Contact