Thyra::DefaultColumnwiseMultiVector< Scalar > Class Template Reference

Default subclass for MultiVectorBase implemented using columns of separate abstract vectors. More...

#include <Thyra_DefaultColumnwiseMultiVectorDecl.hpp>

Inheritance diagram for Thyra::DefaultColumnwiseMultiVector< Scalar >:

Inheritance graph
[legend]
List of all members.

Constructors/Initializers

 DefaultColumnwiseMultiVector ()
 Construct to initialized.
 DefaultColumnwiseMultiVector (const RCP< VectorBase< Scalar > > &col_vec)
 Calls initialize().
 DefaultColumnwiseMultiVector (const RCP< const VectorSpaceBase< Scalar > > &range, const RCP< const VectorSpaceBase< Scalar > > &domain, const ArrayView< const RCP< VectorBase< Scalar > > > &col_vecs=Teuchos::null)
 Calls initialize().
void initialize (const RCP< VectorBase< Scalar > > &col_vec)
 Initialize given a single vector object.
void initialize (const RCP< const VectorSpaceBase< Scalar > > &range, const RCP< const VectorSpaceBase< Scalar > > &domain, const ArrayView< const RCP< VectorBase< Scalar > > > &col_vecs=Teuchos::null)
 Initialize given the spaces for the columns and rows and possibly the column vectors.
void set_uninitialized ()
 Set uninitialized.

Overridden from OpBase

RCP< const VectorSpaceBase<
Scalar > > 
range () const
 
RCP< const VectorSpaceBase<
Scalar > > 
domain () const
 

Overridden from MultiVectorBase

RCP< VectorBase< Scalar > > nonconstColImpl (Index j)
 
RCP< MultiVectorBase< Scalar > > nonconstContigSubViewImpl (const Range1D &col_rng)
 

Overridden from SingleRhsLinearOpBase

bool opSupported (EOpTransp M_trans) const
 For complex Scalar types returns true for NOTRANS and CONJTRANS and for real types returns true for all values of M_trans.
void apply (const EOpTransp M_trans, const VectorBase< Scalar > &x, VectorBase< Scalar > *y, const Scalar alpha, const Scalar beta) const
 This function is implemented in terms of the multi-vector applyOp() function.

Detailed Description

template<class Scalar>
class Thyra::DefaultColumnwiseMultiVector< Scalar >

Default subclass for MultiVectorBase implemented using columns of separate abstract vectors.

This is a very bad implementation of a multi-vector but this will work in situations where you need a multi-vector but some underlying linear algebra library does not directly support them.

This subclass can be used to represent a MultiVectorBase wrapper around a single VectorBase object so that a single vector can be passed to a method that expects a MultiVectorBase object.

Definition at line 52 of file Thyra_DefaultColumnwiseMultiVectorDecl.hpp.


Constructor & Destructor Documentation

template<class Scalar>
Thyra::DefaultColumnwiseMultiVector< Scalar >::DefaultColumnwiseMultiVector (  ) 

Construct to initialized.

Postconditions:

this->range().get() == NULL this->domain().get() == NULL

Definition at line 49 of file Thyra_DefaultColumnwiseMultiVector.hpp.

template<class Scalar>
Thyra::DefaultColumnwiseMultiVector< Scalar >::DefaultColumnwiseMultiVector ( const RCP< VectorBase< Scalar > > &  col_vec  ) 

Calls initialize().

Definition at line 54 of file Thyra_DefaultColumnwiseMultiVector.hpp.

template<class Scalar>
Thyra::DefaultColumnwiseMultiVector< Scalar >::DefaultColumnwiseMultiVector ( const RCP< const VectorSpaceBase< Scalar > > &  range,
const RCP< const VectorSpaceBase< Scalar > > &  domain,
const ArrayView< const RCP< VectorBase< Scalar > > > &  col_vecs = Teuchos::null 
)

Calls initialize().

Definition at line 63 of file Thyra_DefaultColumnwiseMultiVector.hpp.


Member Function Documentation

template<class Scalar>
void Thyra::DefaultColumnwiseMultiVector< Scalar >::initialize ( const RCP< VectorBase< Scalar > > &  col_vec  ) 

Initialize given a single vector object.

Parameters:
col_vec [in] A single column vector. It is not allowed for col_vecs==NULL.
Preconditions:

Postconditions:

this->range().get() == col_vec.space().get() this->domain()->dim() == 1 this->col(0).get() == col_vec.get()

Definition at line 74 of file Thyra_DefaultColumnwiseMultiVector.hpp.

template<class Scalar>
void Thyra::DefaultColumnwiseMultiVector< Scalar >::initialize ( const RCP< const VectorSpaceBase< Scalar > > &  range,
const RCP< const VectorSpaceBase< Scalar > > &  domain,
const ArrayView< const RCP< VectorBase< Scalar > > > &  col_vecs = Teuchos::null 
)

Initialize given the spaces for the columns and rows and possibly the column vectors.

Parameters:
range [in] The space that the columns must lie in. The underlying vector space must not be changed while this is in use.
domain [in] The space that the rows must lie in. The underlying vector space must not be changed while this is in use. What this argument really specifies is what vector type will be compatible with the vectors that the client may try to use to interact with the rows of this multivector.
col_vecs [in] Array (size domain->dim()) of column vectors to use for the columns of this. It is allowed for col_vecs==NULL in which case range->createMember() will be used to create the columns of this.
Preconditions:

Postconditions:

this->range().get() == range.get() this->domain().get() == domain.get() [col_vecs != NULL] this->col(j).get() == col_vecs[j].get(), for j=0..domain->dim()-1

Definition at line 92 of file Thyra_DefaultColumnwiseMultiVector.hpp.

template<class Scalar>
void Thyra::DefaultColumnwiseMultiVector< Scalar >::set_uninitialized (  ) 

Set uninitialized.

Definition at line 124 of file Thyra_DefaultColumnwiseMultiVector.hpp.

template<class Scalar>
RCP< const VectorSpaceBase< Scalar > > Thyra::DefaultColumnwiseMultiVector< Scalar >::range (  )  const [virtual]

Implements Thyra::LinearOpBase< RangeScalar, DomainScalar >.

Definition at line 137 of file Thyra_DefaultColumnwiseMultiVector.hpp.

template<class Scalar>
RCP< const VectorSpaceBase< Scalar > > Thyra::DefaultColumnwiseMultiVector< Scalar >::domain (  )  const [virtual]

Implements Thyra::LinearOpBase< RangeScalar, DomainScalar >.

Definition at line 145 of file Thyra_DefaultColumnwiseMultiVector.hpp.

template<class Scalar>
RCP< VectorBase< Scalar > > Thyra::DefaultColumnwiseMultiVector< Scalar >::nonconstColImpl ( Index  j  )  [virtual]

Implements Thyra::MultiVectorBase< Scalar >.

Definition at line 216 of file Thyra_DefaultColumnwiseMultiVector.hpp.

template<class Scalar>
RCP< MultiVectorBase< Scalar > > Thyra::DefaultColumnwiseMultiVector< Scalar >::nonconstContigSubViewImpl ( const Range1D col_rng  )  [virtual]

Reimplemented from Thyra::MultiVectorDefaultBase< Scalar >.

Definition at line 230 of file Thyra_DefaultColumnwiseMultiVector.hpp.

template<class Scalar>
bool Thyra::DefaultColumnwiseMultiVector< Scalar >::opSupported ( EOpTransp  M_trans  )  const [protected, virtual]

For complex Scalar types returns true for NOTRANS and CONJTRANS and for real types returns true for all values of M_trans.

Implements Thyra::SingleScalarLinearOpBase< Scalar >.

Definition at line 155 of file Thyra_DefaultColumnwiseMultiVector.hpp.

template<class Scalar>
void Thyra::DefaultColumnwiseMultiVector< Scalar >::apply ( const EOpTransp  M_trans,
const VectorBase< Scalar > &  x,
VectorBase< Scalar > *  y,
const Scalar  alpha,
const Scalar  beta 
) const [protected, virtual]

This function is implemented in terms of the multi-vector applyOp() function.

The implementation takes care of two types of operations. One (M_trans==TRANS) is the block dot product of two vectors to form scalar (stored as the vector y which as one component). The other (M_trans==NOTRANS) is essentially an axpy operation where x is a vector with one element. Both of these operations are performed using reduction/transformation operators.

This implementation is near optimal but the default implementation of the multi-vector version of apply() as implemented in the base class LinearOpBase will not be a near optimal implementation in its current form do to multiple, sequential reductions but it could be made to be with a little work.

Implements Thyra::SingleRhsLinearOpBase< Scalar >.

Definition at line 163 of file Thyra_DefaultColumnwiseMultiVector.hpp.


The documentation for this class was generated from the following files:
Generated on Wed May 12 21:42:32 2010 for Thyra Operator/Vector Support by  doxygen 1.4.7