Thyra Package Browser (Single Doxygen Collection) Version of the Day
Private Attributes | Related Functions
Thyra::DefaultDiagonalLinearOp< Scalar > Class Template Reference

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

#include <Thyra_DefaultDiagonalLinearOp_decl.hpp>

Inheritance diagram for Thyra::DefaultDiagonalLinearOp< Scalar >:
Inheritance graph
[legend]

List of all members.

Private Attributes

Teuchos::ConstNonconstObjectContainer
< VectorBase< Scalar > > 
diag_

Related Functions

(Note that these are not member functions.)

template<class Scalar >
RCP< const LinearOpBase< Scalar > > diagonal (const RCP< VectorBase< Scalar > > &diag, const std::string &label="")
 Nonmember constructor function.

Constructors/initializers/accessors

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

Overridden from DiagonalLinearOpBase

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

Overridden from LinearOpBase

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

Protected functions overridden from LinearOpBase

bool opSupportedImpl (EOpTransp M_trans) const
 
void applyImpl (const EOpTransp M_trans, const MultiVectorBase< Scalar > &X, const Ptr< MultiVectorBase< 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 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().

Definition at line 69 of file Thyra_DefaultDiagonalLinearOp_decl.hpp.


Constructor & Destructor Documentation

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

Constructs to uninitialized.

Postconditions:

Definition at line 47 of file Thyra_DefaultDiagonalLinearOp_def.hpp.

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

Calls initialize() to construct given a vector space.

Definition at line 52 of file Thyra_DefaultDiagonalLinearOp_def.hpp.

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

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

Definition at line 61 of file Thyra_DefaultDiagonalLinearOp_def.hpp.

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

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

Definition at line 70 of file Thyra_DefaultDiagonalLinearOp_def.hpp.


Member Function Documentation

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

Initialize given a vector space which allocates a vector internally.

Parameters:
space[in] Smart pointer to vector space

Preconditions:

  • space.get()!=NULL

Postconditions:

Definition at line 79 of file Thyra_DefaultDiagonalLinearOp_def.hpp.

Referenced by Thyra::DiagonalEpetraLinearOpWithSolveFactory::initializeOp().

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

Initialize given a non-const diagonal vector.

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

Preconditions:

  • diag.get()!=NULL

Postconditions:

Definition at line 91 of file Thyra_DefaultDiagonalLinearOp_def.hpp.

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

Initialize given a const diagonal vector.

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

Preconditions:

  • diag.get()!=NULL

Postconditions:

Definition at line 100 of file Thyra_DefaultDiagonalLinearOp_def.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 109 of file Thyra_DefaultDiagonalLinearOp_def.hpp.

template<class Scalar >
bool Thyra::DefaultDiagonalLinearOp< Scalar >::isDiagConst ( ) const [virtual]
template<class Scalar >
RCP< VectorBase< Scalar > > Thyra::DefaultDiagonalLinearOp< Scalar >::getNonconstDiag ( ) [virtual]
template<class Scalar >
RCP< const VectorBase< Scalar > > Thyra::DefaultDiagonalLinearOp< Scalar >::getDiag ( ) const [virtual]
template<class Scalar >
RCP< const VectorSpaceBase< Scalar > > Thyra::DefaultDiagonalLinearOp< Scalar >::range ( ) const [virtual]

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

Preconditions:

Implements Thyra::LinearOpBase< Scalar >.

Definition at line 146 of file Thyra_DefaultDiagonalLinearOp_def.hpp.

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

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

Preconditions:

Implements Thyra::LinearOpBase< Scalar >.

Definition at line 154 of file Thyra_DefaultDiagonalLinearOp_def.hpp.

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

Reimplemented from Thyra::LinearOpBase< Scalar >.

Definition at line 162 of file Thyra_DefaultDiagonalLinearOp_def.hpp.

References Teuchos::rcp().

template<class Scalar >
bool Thyra::DefaultDiagonalLinearOp< Scalar >::opSupportedImpl ( EOpTransp  M_trans) const [protected, virtual]
template<class Scalar >
void Thyra::DefaultDiagonalLinearOp< Scalar >::applyImpl ( const EOpTransp  M_trans,
const MultiVectorBase< Scalar > &  X,
const Ptr< MultiVectorBase< Scalar > > &  Y,
const Scalar  alpha,
const Scalar  beta 
) const [protected, virtual]

Friends And Related Function Documentation

template<class Scalar >
RCP< const LinearOpBase< Scalar > > diagonal ( const RCP< VectorBase< Scalar > > &  diag,
const std::string &  label = "" 
) [related]

Nonmember constructor function.

Definition at line 238 of file Thyra_DefaultDiagonalLinearOp_decl.hpp.

References Teuchos::rcp().

Referenced by exampleImplicitlyComposedLinearOperators().


Member Data Documentation

template<class Scalar >
Teuchos::ConstNonconstObjectContainer<VectorBase<Scalar> > Thyra::DefaultDiagonalLinearOp< Scalar >::diag_ [private]

Definition at line 227 of file Thyra_DefaultDiagonalLinearOp_decl.hpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines