Thyra::DefaultColumnwiseMultiVector< Scalar > Class Template Reference

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

#include <Thyra_DefaultColumnwiseMultiVector_decl.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 uninitialize ()
 Set uninitialized.

Overridden from LinearOpBase



RCP< const VectorSpaceBase
< Scalar > > 
range () const
 
RCP< const VectorSpaceBase
< Scalar > > 
domain () const
 
bool opSupportedImpl (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 applyImpl (const EOpTransp M_trans, const MultiVectorBase< Scalar > &X, const Ptr< MultiVectorBase< Scalar > > &Y, const Scalar alpha, const Scalar beta) const
 This function is implemented in terms of the multi-vector applyOp() function.

Overridden from MultiVectorBase



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

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 53 of file Thyra_DefaultColumnwiseMultiVector_decl.hpp.


Constructor & Destructor Documentation

template<class Scalar >
Thyra::DefaultColumnwiseMultiVector< Scalar >::DefaultColumnwiseMultiVector (  )  [inline]

Construct to initialized.

Postconditions:

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

Definition at line 50 of file Thyra_DefaultColumnwiseMultiVector_def.hpp.

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

Calls initialize().

Definition at line 55 of file Thyra_DefaultColumnwiseMultiVector_def.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 
) [inline]

Calls initialize().

Definition at line 64 of file Thyra_DefaultColumnwiseMultiVector_def.hpp.


Member Function Documentation

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

Initialize given a single vector object.

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

Preconditions:

  • col_vec.get() != NULL (throw std::invalid_argument)
  • col_vec->dim() > 0 (throw std::invalid_argument)

Postconditions:

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

Definition at line 75 of file Thyra_DefaultColumnwiseMultiVector_def.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 
) [inline]

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:

  • range.get() != NULL (throw std::invalid_argument)
  • domain.get() != NULL (throw std::invalid_argument)
  • range->dim() > 0 (throw std::invalid_argument)
  • domain->dim() > 0 (throw std::invalid_argument)
  • [col_vecs != NULL] col_vecs[j].get() != NULL && col_vecs[j]->space()->is_compatible(*range) == true, for j=0..domain->dim()-1

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 93 of file Thyra_DefaultColumnwiseMultiVector_def.hpp.

template<class Scalar >
void Thyra::DefaultColumnwiseMultiVector< Scalar >::uninitialize (  )  [inline]

Set uninitialized.

Definition at line 125 of file Thyra_DefaultColumnwiseMultiVector_def.hpp.

template<class Scalar >
RCP< const VectorSpaceBase< Scalar > > Thyra::DefaultColumnwiseMultiVector< Scalar >::range (  )  const [inline, virtual]
template<class Scalar >
RCP< const VectorSpaceBase< Scalar > > Thyra::DefaultColumnwiseMultiVector< Scalar >::domain (  )  const [inline, virtual]
template<class Scalar >
RCP< VectorBase< Scalar > > Thyra::DefaultColumnwiseMultiVector< Scalar >::nonconstColImpl ( Ordinal  j  )  [inline, virtual]
template<class Scalar >
RCP< MultiVectorBase< Scalar > > Thyra::DefaultColumnwiseMultiVector< Scalar >::nonconstContigSubViewImpl ( const Range1D col_rng  )  [inline, virtual]
template<class Scalar >
bool Thyra::DefaultColumnwiseMultiVector< Scalar >::opSupportedImpl ( EOpTransp  M_trans  )  const [inline, 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::LinearOpBase< Scalar >.

Definition at line 156 of file Thyra_DefaultColumnwiseMultiVector_def.hpp.

template<class Scalar >
void Thyra::DefaultColumnwiseMultiVector< Scalar >::applyImpl ( const EOpTransp  M_trans,
const MultiVectorBase< Scalar > &  X,
const Ptr< MultiVectorBase< Scalar > > &  Y,
const Scalar  alpha,
const Scalar  beta 
) const [inline, 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::LinearOpBase< Scalar >.

Definition at line 164 of file Thyra_DefaultColumnwiseMultiVector_def.hpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Generated on Wed Apr 13 10:00:45 2011 for Thyra by  doxygen 1.6.3