Thyra::DiagonalLinearOp< Scalar > Class Template Reference
[Thyra Operator/Vector Interfaces as an API for the Development of Abstract Numerical Algorithms (ANAs)]

Concrete LinearOpBase subclass for diagonal linear operators. More...

#include <Thyra_DiagonalLinearOpDecl.hpp>

Inheritance diagram for Thyra::DiagonalLinearOp< Scalar >:

[legend]
List of all members.

Constructors/initializers/accessors

 DiagonalLinearOp ()
 Constructs to uninitialized.
 DiagonalLinearOp (const Teuchos::RefCountPtr< const VectorBase< Scalar > > &diag, const Scalar &gamma=Teuchos::ScalarTraits< Scalar >::one())
 Calls initialize().
void initialize (const Teuchos::RefCountPtr< const VectorBase< Scalar > > &diag, const Scalar &gamma=Teuchos::ScalarTraits< Scalar >::one())
 Initialize given the diagonal.
Teuchos::RefCountPtr< const
VectorBase< Scalar > > 
diag () const
 Returns the diagonal vector diag.
Scalar gamma () const
 Returns the scalar multiplier gamma.
void uninitialize (Teuchos::RefCountPtr< const VectorBase< Scalar > > *diag=NULL, Scalar *gamma=NULL)
 Set to uninitialized.

Overridden from LinearOpBase

Teuchos::RefCountPtr< const
VectorSpaceBase< Scalar > > 
range () const
 Returns this->getDiag()->space().
Teuchos::RefCountPtr< const
VectorSpaceBase< Scalar > > 
domain () const
 Returns this->getDiag()->space().
Teuchos::RefCountPtr< 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
 

Overridden from SingleScalarLinearOpWithSolveBase

bool solveSupportsTrans (ETransp M_trans) const
 
bool solveSupportsSolveTolType (ETransp M_trans, ESolveTolType solveTolType) const
 

Overridden from SingleRhsLinearOpWithSolveBase

SolveStatus< Scalar > solve (const ETransp M_trans, const VectorBase< Scalar > &b, VectorBase< Scalar > *x, const SolveCriteria< Scalar > *solveCriteria) const
 

Detailed Description

template<class Scalar>
class Thyra::DiagonalLinearOp< Scalar >

Concrete LinearOpBase subclass for diagonal linear operators.

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


 M = gamma*diag(diag)
 

where diag is a VectorBase object and gamma is a Scalar.

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


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

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

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

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


 x = inv(op(M))*b
 
 =>

 x(i) = (1/gamma)*b(i)/diag(i), for i = 1 ... n
 

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

That is all there is to this subclass.

Definition at line 80 of file Thyra_DiagonalLinearOpDecl.hpp.


Constructor & Destructor Documentation

template<class Scalar>
Thyra::DiagonalLinearOp< Scalar >::DiagonalLinearOp  ) 
 

Constructs to uninitialized.

Postconditions:

  • this->getDiag().get()==NULL

Definition at line 42 of file Thyra_DiagonalLinearOp.hpp.

template<class Scalar>
Thyra::DiagonalLinearOp< Scalar >::DiagonalLinearOp const Teuchos::RefCountPtr< const VectorBase< Scalar > > &  diag,
const Scalar &  gamma = Teuchos::ScalarTraits< Scalar >::one()
 

Calls initialize().

Definition at line 46 of file Thyra_DiagonalLinearOp.hpp.


Member Function Documentation

template<class Scalar>
void Thyra::DiagonalLinearOp< Scalar >::initialize const Teuchos::RefCountPtr< const VectorBase< Scalar > > &  diag,
const Scalar &  gamma = Teuchos::ScalarTraits< Scalar >::one()
 

Initialize given the diagonal.

Parameters:
diag [in] Smart pointer to diagonal vector.
gamma [in] Scalar multiplier.
Preconditions:
  • diag.get()!=NULL

Postconditions:

  • this->diag().get()==diag.get()
  • this->gamma()==gamma
  • this->this->domain().get() == diag->space().get()
  • this->this->range().get() == diag->space().get()

Definition at line 55 of file Thyra_DiagonalLinearOp.hpp.

template<class Scalar>
Teuchos::RefCountPtr< const VectorBase< Scalar > > Thyra::DiagonalLinearOp< Scalar >::diag  )  const [inline]
 

Returns the diagonal vector diag.

A return value of return.get()==NULL indicates that this is not fully initialized.

Definition at line 227 of file Thyra_DiagonalLinearOpDecl.hpp.

template<class Scalar>
Scalar Thyra::DiagonalLinearOp< Scalar >::gamma  )  const [inline]
 

Returns the scalar multiplier gamma.

Definition at line 234 of file Thyra_DiagonalLinearOpDecl.hpp.

template<class Scalar>
void Thyra::DiagonalLinearOp< Scalar >::uninitialize Teuchos::RefCountPtr< const VectorBase< Scalar > > *  diag = NULL,
Scalar *  gamma = NULL
 

Set to uninitialized.

Parameters:
diag [out] Optional pointer to smart pointer for diagonal. If diag!=NULL then on output *diag is set to this->diag() (before call).
gamma [out] Optional pointer to scalar gamma. If gamma!=NULL then on output *gamma is set to this->gamma() (before call).
Postconditions:
  • this->getDiag().get()==NULL

Definition at line 68 of file Thyra_DiagonalLinearOp.hpp.

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

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

Preconditions:

  • this->getDiag().get()!=NULL

Definition at line 82 of file Thyra_DiagonalLinearOp.hpp.

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

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

Preconditions:

  • this->getDiag().get()!=NULL

Definition at line 89 of file Thyra_DiagonalLinearOp.hpp.

template<class Scalar>
Teuchos::RefCountPtr< const LinearOpBase< Scalar > > Thyra::DiagonalLinearOp< Scalar >::clone  )  const
 

Definition at line 96 of file Thyra_DiagonalLinearOp.hpp.

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

Implements Thyra::SingleScalarLinearOpBase< Scalar >.

Definition at line 106 of file Thyra_DiagonalLinearOp.hpp.

template<class Scalar>
void Thyra::DiagonalLinearOp< 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 114 of file Thyra_DiagonalLinearOp.hpp.

template<class Scalar>
bool Thyra::DiagonalLinearOp< Scalar >::solveSupportsTrans ETransp  M_trans  )  const [protected, virtual]
 

Implements Thyra::SingleScalarLinearOpWithSolveBase< Scalar >.

Definition at line 132 of file Thyra_DiagonalLinearOp.hpp.

template<class Scalar>
bool Thyra::DiagonalLinearOp< Scalar >::solveSupportsSolveTolType ETransp  M_trans,
ESolveTolType  solveTolType
const [protected, virtual]
 

Implements Thyra::SingleScalarLinearOpWithSolveBase< Scalar >.

Definition at line 138 of file Thyra_DiagonalLinearOp.hpp.

template<class Scalar>
SolveStatus< Scalar > Thyra::DiagonalLinearOp< Scalar >::solve const ETransp  M_trans,
const VectorBase< Scalar > &  b,
VectorBase< Scalar > *  x,
const SolveCriteria< Scalar > *  solveCriteria
const [protected, virtual]
 

Implements Thyra::SingleRhsLinearOpWithSolveBase< Scalar >.

Definition at line 146 of file Thyra_DiagonalLinearOp.hpp.


The documentation for this class was generated from the following files:
Generated on Thu Sep 18 12:39:54 2008 for Thyra ANA Operator/VectorBase Interfaces and Related Software by doxygen 1.3.9.1