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

Concrete composite LinearOpBase subclass that creates an implicitly multiplied linear operator out of one or more constituent LinearOpBase objects. More...

#include <Thyra_DefaultMultipliedLinearOpDecl.hpp>

Inheritance diagram for Thyra::DefaultMultipliedLinearOp< Scalar >:

Inheritance graph
[legend]
List of all members.

Constructors/initializers/accessors

 DefaultMultipliedLinearOp ()
 Constructs to uninitialized.
 DefaultMultipliedLinearOp (const int numOps, const Teuchos::RCP< LinearOpBase< Scalar > > Ops[])
 DefaultMultipliedLinearOp (const int numOps, const Teuchos::RCP< const LinearOpBase< Scalar > > Ops[])
void initialize (const int numOps, const Teuchos::RCP< LinearOpBase< Scalar > > Ops[])
 Initialize given a list of non-const linear operators.
void initialize (const int numOps, const Teuchos::RCP< const LinearOpBase< Scalar > > Ops[])
 Initialize given a list of const linear operators.
void uninitialize ()
 Set to uninitialized.

Overridden from MultipliedLinearOpBase

int numOps () const
 
bool opIsConst (const int k) const
 
Teuchos::RCP< LinearOpBase<
Scalar > > 
getNonconstOp (const int k)
 
Teuchos::RCP< const LinearOpBase<
Scalar > > 
getOp (const int k) const
 

Overridden from LinearOpBase

Teuchos::RCP< const VectorSpaceBase<
Scalar > > 
range () const
 Returns this->getOp(0).range() if <t>this->numOps() > 0 and returns Teuchos::null otherwise.
Teuchos::RCP< const VectorSpaceBase<
Scalar > > 
domain () const
 Returns this->getOp(this->numOps()-1).domain() if <t>this->numOps() > 0 and returns Teuchos::null otherwise.
Teuchos::RCP< const LinearOpBase<
Scalar > > 
clone () const
 

Overridden from Teuchos::Describable

std::string description () const
 Prints just the name DefaultMultipliedLinearOp along with the overall dimensions and the number of constituent operators.
void describe (Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel) const
 Prints the details about the constituent linear operators.

Overridden from SingleScalarLinearOpBase

bool opSupported (EOpTransp M_trans) const
 Returns true only if all constituent operators support M_trans.
void apply (const EOpTransp M_trans, const MultiVectorBase< Scalar > &X, MultiVectorBase< Scalar > *Y, const Scalar alpha, const Scalar beta) const
 

Related Functions

(Note that these are not member functions.)

Teuchos::RCP< LinearOpBase<
Scalar > > 
nonconstMultiply (const Teuchos::RCP< LinearOpBase< Scalar > > &A, const Teuchos::RCP< LinearOpBase< Scalar > > &B, const std::string &M_label="")
 Form an implicit multiplication of two linear operators: M = A * B.
Teuchos::RCP< const LinearOpBase<
Scalar > > 
multiply (const Teuchos::RCP< const LinearOpBase< Scalar > > &A, const Teuchos::RCP< const LinearOpBase< Scalar > > &B, const std::string &M_label="")
 Form an implicit multiplication of two linear operators: M = A * B.
Teuchos::RCP< const LinearOpBase<
Scalar > > 
multiply (const Teuchos::RCP< const LinearOpBase< Scalar > > &A, const Teuchos::RCP< const LinearOpBase< Scalar > > &B, const Teuchos::RCP< const LinearOpBase< Scalar > > &C, const std::string &M_label="")
 Form an implicit multiplication of three linear operators: M = A * B * C.

Detailed Description

template<class Scalar>
class Thyra::DefaultMultipliedLinearOp< Scalar >

Concrete composite LinearOpBase subclass that creates an implicitly multiplied linear operator out of one or more constituent LinearOpBase objects.

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

 M = Op[0] * Op[1] * ... * Op[numOps-1]

 

where Op[] is an array of numOps LinearOp objects. Of course the operator M is not constructed explicitly but instead just applies the constituent linear operators accordingly using temporaries.

In other words, this class defines apply() as:

 y = alpha*M*x + beta*y
   = alpha * ( Op[0] * ( Op[1] * ( .... ( Op[numOps-1] * x ) ... ) ) ) + beta * y

 

for the case where M_trans==NOTRANS and as:

 y = alpha*M'*x + beta*y
   = alpha * ( Op[numOps-1]' * ( .... ( Op[1]' * ( Op[0]' * x ) ) ... ) ) + beta * y

 

for the case where real_trans(M_trans)!=NOTRANS (where the transpose ' either defines TRANS or CONJTRANS).

Constructing a multiplied operator is easy. For example, suppose one wants to construct the multiplied operator D = A * B' * C. To do so one would do:

 template<class Scalar>
 void constructD(
    const Teuchos::RCP<const Thyra::LinearOpBase<Scalar> >   &A
    ,const Teuchos::RCP<const Thyra::LinearOpBase<Scalar> >  &B
    ,const Teuchos::RCP<const Thyra::LinearOpBase<Scalar> >  &C
    ,Teuchos::RCP<const Thyra::LinearOpBase<Scalar> >        *D
    )
 {
   typedef Teuchos::RCP<const Thyra::LinearOpBase<Scalar> > LOB;
   *D = Teuchos::rcp(
     new Thyra::DefaultMultipliedLinearOp<Scalar>(
       3, Teuchos::arrayArg<LOB>(A,adjoin(B),C)()
       )
     );
 }

Rather than calling the constructor directly, consider using the non-member helper functions described here.

Definition at line 110 of file Thyra_DefaultMultipliedLinearOpDecl.hpp.


Constructor & Destructor Documentation

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

Constructs to uninitialized.

Postconditions:

Definition at line 44 of file Thyra_DefaultMultipliedLinearOp.hpp.

template<class Scalar>
Thyra::DefaultMultipliedLinearOp< Scalar >::DefaultMultipliedLinearOp ( const int  numOps,
const Teuchos::RCP< LinearOpBase< Scalar > >  Ops[] 
)

Calls initialize().

Rather than calling this constructor directly, consider using the non-member helper functions described here.

Definition at line 49 of file Thyra_DefaultMultipliedLinearOp.hpp.

template<class Scalar>
Thyra::DefaultMultipliedLinearOp< Scalar >::DefaultMultipliedLinearOp ( const int  numOps,
const Teuchos::RCP< const LinearOpBase< Scalar > >  Ops[] 
)

Calls initialize().

Rather than calling this constructor directly, consider using the non-member helper functions described here.


Member Function Documentation

template<class Scalar>
void Thyra::DefaultMultipliedLinearOp< Scalar >::initialize ( const int  numOps,
const Teuchos::RCP< LinearOpBase< Scalar > >  Ops[] 
)

Initialize given a list of non-const linear operators.

Parameters:
numOps [in] Number of constituent operators.
Ops [in] Array (length numOps) of constituent linear operators and their aggregated default definitions of the non-transposed operator.
Preconditions:

Postconditions:

Definition at line 69 of file Thyra_DefaultMultipliedLinearOp.hpp.

template<class Scalar>
void Thyra::DefaultMultipliedLinearOp< Scalar >::initialize ( const int  numOps,
const Teuchos::RCP< const LinearOpBase< Scalar > >  Ops[] 
)

Initialize given a list of const linear operators.

Parameters:
numOps [in] Number of constituent operators.
Ops [in] Array (length numOps) of constituent linear operators and their aggregated default definitions of the non-transposed operator.
Preconditions:

Postconditions:

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

Set to uninitialized.

Postconditions:

Definition at line 97 of file Thyra_DefaultMultipliedLinearOp.hpp.

template<class Scalar>
int Thyra::DefaultMultipliedLinearOp< Scalar >::numOps (  )  const [virtual]

Implements Thyra::MultipliedLinearOpBase< Scalar >.

Definition at line 108 of file Thyra_DefaultMultipliedLinearOp.hpp.

template<class Scalar>
bool Thyra::DefaultMultipliedLinearOp< Scalar >::opIsConst ( const int  k  )  const [virtual]

Implements Thyra::MultipliedLinearOpBase< Scalar >.

Definition at line 115 of file Thyra_DefaultMultipliedLinearOp.hpp.

template<class Scalar>
Teuchos::RCP< LinearOpBase< Scalar > > Thyra::DefaultMultipliedLinearOp< Scalar >::getNonconstOp ( const int  k  )  [virtual]

Implements Thyra::MultipliedLinearOpBase< Scalar >.

Definition at line 126 of file Thyra_DefaultMultipliedLinearOp.hpp.

template<class Scalar>
Teuchos::RCP< const LinearOpBase< Scalar > > Thyra::DefaultMultipliedLinearOp< Scalar >::getOp ( const int  k  )  const [virtual]

Implements Thyra::MultipliedLinearOpBase< Scalar >.

Definition at line 137 of file Thyra_DefaultMultipliedLinearOp.hpp.

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

Returns this->getOp(0).range() if <t>this->numOps() > 0 and returns Teuchos::null otherwise.

Implements Thyra::LinearOpBase< Scalar >.

Definition at line 151 of file Thyra_DefaultMultipliedLinearOp.hpp.

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

Returns this->getOp(this->numOps()-1).domain() if <t>this->numOps() > 0 and returns Teuchos::null otherwise.

Implements Thyra::LinearOpBase< Scalar >.

Definition at line 160 of file Thyra_DefaultMultipliedLinearOp.hpp.

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

Reimplemented from Thyra::LinearOpBase< Scalar >.

Definition at line 169 of file Thyra_DefaultMultipliedLinearOp.hpp.

template<class Scalar>
std::string Thyra::DefaultMultipliedLinearOp< Scalar >::description (  )  const [virtual]

Prints just the name DefaultMultipliedLinearOp along with the overall dimensions and the number of constituent operators.

Reimplemented from Thyra::LinearOpDefaultBase< Scalar >.

Definition at line 179 of file Thyra_DefaultMultipliedLinearOp.hpp.

template<class Scalar>
void Thyra::DefaultMultipliedLinearOp< Scalar >::describe ( Teuchos::FancyOStream out,
const Teuchos::EVerbosityLevel  verbLevel 
) const [virtual]

Prints the details about the constituent linear operators.

This function outputs different levels of detail based on the value passed in for verbLevel:

ToDo: Finish documentation!

Reimplemented from Thyra::LinearOpDefaultBase< Scalar >.

Definition at line 189 of file Thyra_DefaultMultipliedLinearOp.hpp.

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

Returns true only if all constituent operators support M_trans.

Implements Thyra::SingleScalarLinearOpBase< Scalar >.

Definition at line 238 of file Thyra_DefaultMultipliedLinearOp.hpp.

template<class Scalar>
void Thyra::DefaultMultipliedLinearOp< Scalar >::apply ( const EOpTransp  M_trans,
const MultiVectorBase< Scalar > &  X,
MultiVectorBase< Scalar > *  Y,
const Scalar  alpha,
const Scalar  beta 
) const [protected, virtual]

Implements Thyra::SingleScalarLinearOpBase< Scalar >.

Definition at line 249 of file Thyra_DefaultMultipliedLinearOp.hpp.


Friends And Related Function Documentation

template<class Scalar>
Teuchos::RCP< LinearOpBase< Scalar > > nonconstMultiply ( const Teuchos::RCP< LinearOpBase< Scalar > > &  A,
const Teuchos::RCP< LinearOpBase< Scalar > > &  B,
const std::string &  M_label = "" 
) [related]

Form an implicit multiplication of two linear operators: M = A * B.

Definition at line 359 of file Thyra_DefaultMultipliedLinearOp.hpp.

template<class Scalar>
Teuchos::RCP< const LinearOpBase< Scalar > > multiply ( const Teuchos::RCP< const LinearOpBase< Scalar > > &  A,
const Teuchos::RCP< const LinearOpBase< Scalar > > &  B,
const std::string &  M_label = "" 
) [related]

Form an implicit multiplication of two linear operators: M = A * B.

Definition at line 382 of file Thyra_DefaultMultipliedLinearOp.hpp.

template<class Scalar>
Teuchos::RCP< const LinearOpBase< Scalar > > multiply ( const Teuchos::RCP< const LinearOpBase< Scalar > > &  A,
const Teuchos::RCP< const LinearOpBase< Scalar > > &  B,
const Teuchos::RCP< const LinearOpBase< Scalar > > &  C,
const std::string &  M_label = "" 
) [related]

Form an implicit multiplication of three linear operators: M = A * B * C.

Definition at line 405 of file Thyra_DefaultMultipliedLinearOp.hpp.


The documentation for this class was generated from the following files:
Generated on Wed May 12 21:42:32 2010 for Thyra Operator/Vector Support by  doxygen 1.4.7