Public Member Functions | Private Attributes | Related Functions
TSFExtended::DenseSerialMatrix Class Reference

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

Inheritance diagram for TSFExtended::DenseSerialMatrix:
TSFExtended::SimplifiedLinearOpBase< double > TSFExtended::LoadableMatrix< double > Sundance::Printable TSFExtended::OpWithBackwardsCompatibleApply< double > LinearOpBase Sundance::DefaultObjectWithVerbosity Sundance::ObjectWithVerbosityBase

List of all members.

Public Member Functions

 DenseSerialMatrix (const RCP< const SerialVectorSpace > &domain, const RCP< const SerialVectorSpace > &range)
 Construct with domain and range spaces, which should be DenseSerialVectorSpace objects.
 ~DenseSerialMatrix ()
 Virtual dtor.
virtual void applyOp (const Thyra::EOpTransp M_trans, const Vector< double > &in, Vector< double > out) const
 Apply either the operator or its transpose.
virtual void addToRow (int globalRowIndex, int nElemsToInsert, const int *globalColumnIndices, const double *elementValues)
 Insert a set of elements in a row, adding to any previously existing values.
virtual void zero ()
 Set all elements to zero, preserving the existing structure.
void print (std::ostream &os) const
 write to a stream
RCP< const VectorSpaceBase
< double > > 
range () const
 Return a smart pointer for the range space for this operator.
RCP< const VectorSpaceBase
< double > > 
domain () const
 Return a smart pointer for the domain space for this operator.
const double *const dataPtr () const
double * dataPtr ()
int numRows () const
int numCols () const
void setRow (int row, const Array< double > &rowVals)

Private Attributes

RCP< const SerialVectorSpacedomain_
RCP< const SerialVectorSpacerange_
int nRows_
int nCols_
Array< double > data_

Related Functions

(Note that these are not member functions.)

void denseSVD (const LinearOperator< double > &A, LinearOperator< double > &U, Vector< double > &Sigma, LinearOperator< double > &Vt)
SolverState< double > denseSolve (const LinearOperator< double > &A, const Vector< double > &b, Vector< double > &x)

Detailed Description

Linear operator implemented as a dense matrix.

Definition at line 24 of file TSFDenseSerialMatrix.hpp.


Constructor & Destructor Documentation

DenseSerialMatrix::DenseSerialMatrix ( const RCP< const SerialVectorSpace > &  domain,
const RCP< const SerialVectorSpace > &  range 
)

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

Definition at line 59 of file TSFDenseSerialMatrix.cpp.

TSFExtended::DenseSerialMatrix::~DenseSerialMatrix ( ) [inline]

Virtual dtor.

Definition at line 36 of file TSFDenseSerialMatrix.hpp.


Member Function Documentation

void DenseSerialMatrix::addToRow ( int  globalRowIndex,
int  nElemsToInsert,
const int *  globalColumnIndices,
const double *  elementValues 
) [virtual]

Insert a set of elements in a row, adding to any previously existing values.

The nonzero structure of the matrix must have been determined at construction time.

Parameters:
globalRowIndexthe global index of the row to which these elements belong.
nElemsToInsertthe number of elements being inserted in this step
globalColumnIndicesarray of column indices. Must be nElemsToInsert in length.
elementsarray of element values. Must be nElemsToInsert in length

Implements TSFExtended::LoadableMatrix< double >.

Definition at line 101 of file TSFDenseSerialMatrix.cpp.

References data_, and numRows().

void DenseSerialMatrix::applyOp ( const Thyra::EOpTransp  M_trans,
const Vector< double > &  in,
Vector< double >  out 
) const [virtual]
double* TSFExtended::DenseSerialMatrix::dataPtr ( ) [inline]

Definition at line 87 of file TSFDenseSerialMatrix.hpp.

References data_.

const double* const TSFExtended::DenseSerialMatrix::dataPtr ( ) const [inline]

Definition at line 84 of file TSFDenseSerialMatrix.hpp.

References data_.

Referenced by applyOp(), TSFExtended::denseSolve(), and TSFExtended::denseSVD().

RCP< const VectorSpaceBase<double> > TSFExtended::DenseSerialMatrix::domain ( ) const [inline]

Return a smart pointer for the domain space for this operator.

Definition at line 80 of file TSFDenseSerialMatrix.hpp.

References domain_.

int TSFExtended::DenseSerialMatrix::numCols ( ) const [inline]

Definition at line 93 of file TSFDenseSerialMatrix.hpp.

References nCols_.

Referenced by applyOp(), TSFExtended::denseSVD(), print(), and setRow().

int TSFExtended::DenseSerialMatrix::numRows ( ) const [inline]
void DenseSerialMatrix::print ( std::ostream &  os) const [virtual]

write to a stream

Implements Sundance::Printable.

Definition at line 121 of file TSFDenseSerialMatrix.cpp.

References data_, numCols(), and numRows().

RCP< const VectorSpaceBase<double> > TSFExtended::DenseSerialMatrix::range ( ) const [inline]

Return a smart pointer for the range space for this operator.

Definition at line 75 of file TSFDenseSerialMatrix.hpp.

References range_.

void DenseSerialMatrix::setRow ( int  row,
const Array< double > &  rowVals 
)

Definition at line 147 of file TSFDenseSerialMatrix.cpp.

References data_, numCols(), and numRows().

void DenseSerialMatrix::zero ( ) [virtual]

Set all elements to zero, preserving the existing structure.

Implements TSFExtended::LoadableMatrix< double >.

Definition at line 115 of file TSFDenseSerialMatrix.cpp.

References data_.


Friends And Related Function Documentation

SolverState< double > denseSolve ( const LinearOperator< double > &  A,
const Vector< double > &  b,
Vector< double > &  x 
) [related]

Definition at line 164 of file TSFDenseSerialMatrix.cpp.

void denseSVD ( const LinearOperator< double > &  A,
LinearOperator< double > &  U,
Vector< double > &  Sigma,
LinearOperator< double > &  Vt 
) [related]

Definition at line 201 of file TSFDenseSerialMatrix.cpp.


Member Data Documentation

Array<double> TSFExtended::DenseSerialMatrix::data_ [private]

Definition at line 106 of file TSFDenseSerialMatrix.hpp.

Referenced by addToRow(), dataPtr(), print(), setRow(), and zero().

Definition at line 101 of file TSFDenseSerialMatrix.hpp.

Referenced by domain().

Definition at line 105 of file TSFDenseSerialMatrix.hpp.

Referenced by numCols().

Definition at line 104 of file TSFDenseSerialMatrix.hpp.

Referenced by numRows().

Definition at line 102 of file TSFDenseSerialMatrix.hpp.

Referenced by range().

Site Contact