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 >:

[legend]
List of all members.

Constructors/Initializers

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

Overridden from OpBase

Teuchos::RefCountPtr< const
VectorSpaceBase< Scalar > > 
range () const
 
Teuchos::RefCountPtr< const
VectorSpaceBase< Scalar > > 
domain () const
 

Overridden from MultiVectorBase

Teuchos::RefCountPtr< VectorBase<
Scalar > > 
col (Index j)
 
Teuchos::RefCountPtr< MultiVectorBase<
Scalar > > 
subView (const Range1D &col_rng)
 

Overridden from SingleRhsLinearOpBase

bool opSupported (ETransp 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 ETransp 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 46 of file Thyra_DefaultColumnwiseMultiVector.hpp.

template<class Scalar>
Thyra::DefaultColumnwiseMultiVector< Scalar >::DefaultColumnwiseMultiVector const Teuchos::RefCountPtr< VectorBase< Scalar > > &  col_vec  ) 
 

Calls initialize().

Definition at line 50 of file Thyra_DefaultColumnwiseMultiVector.hpp.

template<class Scalar>
Thyra::DefaultColumnwiseMultiVector< Scalar >::DefaultColumnwiseMultiVector const Teuchos::RefCountPtr< const VectorSpaceBase< Scalar > > &  range,
const Teuchos::RefCountPtr< const VectorSpaceBase< Scalar > > &  domain,
const Teuchos::RefCountPtr< VectorBase< Scalar > >  col_vecs[] = NULL
 

Calls initialize().

Definition at line 58 of file Thyra_DefaultColumnwiseMultiVector.hpp.


Member Function Documentation

template<class Scalar>
void Thyra::DefaultColumnwiseMultiVector< Scalar >::initialize const Teuchos::RefCountPtr< 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:
  • 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 68 of file Thyra_DefaultColumnwiseMultiVector.hpp.

template<class Scalar>
void Thyra::DefaultColumnwiseMultiVector< Scalar >::initialize const Teuchos::RefCountPtr< const VectorSpaceBase< Scalar > > &  range,
const Teuchos::RefCountPtr< const VectorSpaceBase< Scalar > > &  domain,
const Teuchos::RefCountPtr< VectorBase< Scalar > >  col_vecs[] = 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:
  • 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 85 of file Thyra_DefaultColumnwiseMultiVector.hpp.

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

Set uninitialized.

Definition at line 114 of file Thyra_DefaultColumnwiseMultiVector.hpp.

template<class Scalar>
Teuchos::RefCountPtr< const VectorSpaceBase< Scalar > > Thyra::DefaultColumnwiseMultiVector< Scalar >::range  )  const
 

Definition at line 125 of file Thyra_DefaultColumnwiseMultiVector.hpp.

template<class Scalar>
Teuchos::RefCountPtr< const VectorSpaceBase< Scalar > > Thyra::DefaultColumnwiseMultiVector< Scalar >::domain  )  const
 

Definition at line 132 of file Thyra_DefaultColumnwiseMultiVector.hpp.

template<class Scalar>
Teuchos::RefCountPtr< VectorBase< Scalar > > Thyra::DefaultColumnwiseMultiVector< Scalar >::col Index  j  ) 
 

Definition at line 197 of file Thyra_DefaultColumnwiseMultiVector.hpp.

template<class Scalar>
Teuchos::RefCountPtr< MultiVectorBase< Scalar > > Thyra::DefaultColumnwiseMultiVector< Scalar >::subView const Range1D col_rng  ) 
 

Reimplemented from Thyra::MultiVectorDefaultBase< Scalar >.

Definition at line 208 of file Thyra_DefaultColumnwiseMultiVector.hpp.

template<class Scalar>
bool Thyra::DefaultColumnwiseMultiVector< Scalar >::opSupported ETransp  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 140 of file Thyra_DefaultColumnwiseMultiVector.hpp.

template<class Scalar>
void Thyra::DefaultColumnwiseMultiVector< Scalar >::apply const ETransp  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 147 of file Thyra_DefaultColumnwiseMultiVector.hpp.


The documentation for this class was generated from the following files:
Generated on Thu Sep 18 12:32:34 2008 for Thyra Operator/Vector Support by doxygen 1.3.9.1