Thyra::DefaultDiagonalLinearOp< Scalar > Class Template Reference
[Development of linear Abstract Numerical Algorithms (ANAs)]

Default concrete LinearOpBase subclass for diagonal linear operators. More...

#include <Thyra_DefaultDiagonalLinearOpDecl.hpp>

Inheritance diagram for Thyra::DefaultDiagonalLinearOp< Scalar >:

[legend]
List of all members.

Constructors/initializers/accessors

 DefaultDiagonalLinearOp ()
 Constructs to uninitialized.
 DefaultDiagonalLinearOp (const Teuchos::RCP< const VectorSpaceBase< Scalar > > &space)
 Calls initialize() to construct given a vector space.
 DefaultDiagonalLinearOp (const Teuchos::RCP< VectorBase< Scalar > > &diag)
 Calls initialize() to construct for a non-const diagonal vector.
 DefaultDiagonalLinearOp (const Teuchos::RCP< const VectorBase< Scalar > > &diag)
 Calls initialize() to construct for a const diagonal vector.
void initialize (const Teuchos::RCP< const VectorSpaceBase< Scalar > > &space)
 Initialize given a vector space which allocates a vector internally.
void initialize (const Teuchos::RCP< VectorBase< Scalar > > &diag)
 Initialize given a non-const diagonal vector.
void initialize (const Teuchos::RCP< const VectorBase< Scalar > > &diag)
 Initialize given a const diagonal vector.
void uninitialize ()
 Uninitialize.

Overridden from DiagonalLinearOpBase

bool isDiagConst () const
 
Teuchos::RCP< VectorBase<
Scalar > > 
getNonconstDiag ()
 
Teuchos::RCP< const VectorBase<
Scalar > > 
getDiag () const
 

Overridden from LinearOpBase

Teuchos::RCP< const VectorSpaceBase<
Scalar > > 
range () const
 Returns this->getDiag()->space().
Teuchos::RCP< const VectorSpaceBase<
Scalar > > 
domain () const
 Returns this->getDiag()->space().
Teuchos::RCP< const LinearOpBase<
Scalar > > 
clone () const
 

Overridden from SingleScalarLinearOpBase

bool opSupported (ETransp M_trans) const
 

Overridden from SingleRhsLinearOpBase

void apply (const ETransp M_trans, const VectorBase< Scalar > &x, VectorBase< Scalar > *y, const Scalar alpha, const Scalar beta) const
 

Detailed Description

template<class Scalar>
class Thyra::DefaultDiagonalLinearOp< Scalar >

Default concrete LinearOpBase subclass for diagonal linear operators.

This class represents a diagonal linear operator M of the form:

 M = diag(diag)

 

where diag is a VectorBase object.

The defined operator implements <tt>this->apply() as follows:

 y = alpha*op(M)*x + beta*y
 
 =>

 y(i) = alpha*diag(i)*x(i) + beta*y(i), for i = 0 ... n-1

 

where n = this->domain()->dim().

Examples:

test_scalar_product.cpp.

Definition at line 68 of file Thyra_DefaultDiagonalLinearOpDecl.hpp.


Constructor & Destructor Documentation

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

Constructs to uninitialized.

Postconditions:

Definition at line 41 of file Thyra_DefaultDiagonalLinearOp.hpp.

template<class Scalar>
Thyra::DefaultDiagonalLinearOp< Scalar >::DefaultDiagonalLinearOp ( const Teuchos::RCP< const VectorSpaceBase< Scalar > > &  space  ) 

Calls initialize() to construct given a vector space.

Definition at line 45 of file Thyra_DefaultDiagonalLinearOp.hpp.

template<class Scalar>
Thyra::DefaultDiagonalLinearOp< Scalar >::DefaultDiagonalLinearOp ( const Teuchos::RCP< VectorBase< Scalar > > &  diag  ) 

Calls initialize() to construct for a non-const diagonal vector.

Definition at line 53 of file Thyra_DefaultDiagonalLinearOp.hpp.

template<class Scalar>
Thyra::DefaultDiagonalLinearOp< Scalar >::DefaultDiagonalLinearOp ( const Teuchos::RCP< const VectorBase< Scalar > > &  diag  ) 

Calls initialize() to construct for a const diagonal vector.

Definition at line 61 of file Thyra_DefaultDiagonalLinearOp.hpp.


Member Function Documentation

template<class Scalar>
void Thyra::DefaultDiagonalLinearOp< Scalar >::initialize ( const Teuchos::RCP< const VectorSpaceBase< Scalar > > &  space  ) 

Initialize given a vector space which allocates a vector internally.

Parameters:
space [in] Smart pointer to vector space
Preconditions:

Postconditions:

Definition at line 69 of file Thyra_DefaultDiagonalLinearOp.hpp.

template<class Scalar>
void Thyra::DefaultDiagonalLinearOp< Scalar >::initialize ( const Teuchos::RCP< VectorBase< Scalar > > &  diag  ) 

Initialize given a non-const diagonal vector.

Parameters:
diag [in] Smart pointer to diagonal vector.
Preconditions:

Postconditions:

Definition at line 80 of file Thyra_DefaultDiagonalLinearOp.hpp.

template<class Scalar>
void Thyra::DefaultDiagonalLinearOp< Scalar >::initialize ( const Teuchos::RCP< const VectorBase< Scalar > > &  diag  ) 

Initialize given a const diagonal vector.

Parameters:
diag [in] Smart pointer to diagonal vector.
Preconditions:

Postconditions:

Definition at line 88 of file Thyra_DefaultDiagonalLinearOp.hpp.

template<class Scalar>
void Thyra::DefaultDiagonalLinearOp< Scalar >::uninitialize (  ) 

Uninitialize.

Postconditions:

Note: If the client wants to hold on to the underlying wrapped diagonal vector then they had better grab it using this->getDiag() or this->getNonconstDiag() before calling this function!

Definition at line 96 of file Thyra_DefaultDiagonalLinearOp.hpp.

template<class Scalar>
bool Thyra::DefaultDiagonalLinearOp< Scalar >::isDiagConst (  )  const [virtual]

Implements Thyra::DiagonalLinearOpBase< Scalar >.

Definition at line 104 of file Thyra_DefaultDiagonalLinearOp.hpp.

template<class Scalar>
Teuchos::RCP< VectorBase< Scalar > > Thyra::DefaultDiagonalLinearOp< Scalar >::getNonconstDiag (  )  [virtual]

Implements Thyra::DiagonalLinearOpBase< Scalar >.

Definition at line 111 of file Thyra_DefaultDiagonalLinearOp.hpp.

template<class Scalar>
Teuchos::RCP< const VectorBase< Scalar > > Thyra::DefaultDiagonalLinearOp< Scalar >::getDiag (  )  const [virtual]

Implements Thyra::DiagonalLinearOpBase< Scalar >.

Definition at line 118 of file Thyra_DefaultDiagonalLinearOp.hpp.

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

Returns this->getDiag()->space().

Preconditions:

Implements Thyra::LinearOpBase< Scalar >.

Definition at line 127 of file Thyra_DefaultDiagonalLinearOp.hpp.

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

Returns this->getDiag()->space().

Preconditions:

Implements Thyra::LinearOpBase< Scalar >.

Definition at line 134 of file Thyra_DefaultDiagonalLinearOp.hpp.

template<class Scalar>
Teuchos::RCP< const LinearOpBase< Scalar > > Thyra::DefaultDiagonalLinearOp< Scalar >::clone (  )  const [virtual]

Reimplemented from Thyra::LinearOpBase< Scalar >.

Definition at line 141 of file Thyra_DefaultDiagonalLinearOp.hpp.

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

Implements Thyra::SingleScalarLinearOpBase< Scalar >.

Definition at line 151 of file Thyra_DefaultDiagonalLinearOp.hpp.

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

Implements Thyra::SingleRhsLinearOpBase< Scalar >.

Definition at line 163 of file Thyra_DefaultDiagonalLinearOp.hpp.


The documentation for this class was generated from the following files:
Generated on Tue Oct 20 12:47:00 2009 for Thyra Operator/Vector Support by doxygen 1.4.7