Thyra
Version of the Day
|
Simple example subclass for Spmd tridiagonal matrices. More...
#include <ExampleTridiagSpmdLinearOp.hpp>
Public Member Functions | |
ExampleTridiagSpmdLinearOp () | |
ExampleTridiagSpmdLinearOp (const Teuchos::RCP< const Teuchos::Comm< Thyra::Ordinal > > &comm, const Thyra::Ordinal localDim, const Teuchos::ArrayView< const Scalar > &lower, const Teuchos::ArrayView< const Scalar > &diag, const Teuchos::ArrayView< const Scalar > &upper) | |
void | initialize (const Teuchos::RCP< const Teuchos::Comm< Thyra::Ordinal > > &comm, const Thyra::Ordinal localDim, const Teuchos::ArrayView< const Scalar > &lower, const Teuchos::ArrayView< const Scalar > &diag, const Teuchos::ArrayView< const Scalar > &upper) |
Public Member Functions inherited from Thyra::LinearOpDefaultBase< Scalar > | |
std::string | description () const |
Default description that gives the label, type, and dimenstion . More... | |
void | describe (Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel) const |
Generates a default outputting for all linear operators. More... | |
Public Member Functions inherited from Thyra::LinearOpBase< Scalar > | |
bool | opSupported (EOpTransp M_trans) const |
Return if the M_trans operation of apply() is supported or not. More... | |
void | apply (const EOpTransp M_trans, const MultiVectorBase< Scalar > &X, const Ptr< MultiVectorBase< Scalar > > &Y, const Scalar alpha, const Scalar beta) const |
Apply the linear operator to a multi-vector : Y = alpha*op(M)*X + beta*Y . More... | |
virtual RCP< const LinearOpBase< Scalar > > | clone () const |
Clone the linear operator object (if supported). More... | |
Protected Member Functions | |
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > | range () const |
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > | domain () const |
bool | opSupportedImpl (Thyra::EOpTransp M_trans) const |
void | applyImpl (const Thyra::EOpTransp M_trans, const Thyra::MultiVectorBase< Scalar > &X_in, const Teuchos::Ptr< Thyra::MultiVectorBase< Scalar > > &Y_inout, const Scalar alpha, const Scalar beta) const |
Protected Member Functions inherited from Thyra::LinearOpBase< Scalar > |
Additional Inherited Members | |
Related Functions inherited from Thyra::LinearOpBase< Scalar > | |
template<class Scalar > | |
bool | isFullyUninitialized (const LinearOpBase< Scalar > &M) |
Determines if a linear operator is in the "Fully Uninitialized" state or not. More... | |
template<class Scalar > | |
bool | isPartiallyInitialized (const LinearOpBase< Scalar > &M) |
Determines if a linear operator is in the "Partially Initialized" state or not. More... | |
template<class Scalar > | |
bool | isFullyInitialized (const LinearOpBase< Scalar > &M) |
Determines if a linear operator is in the "Fully Initialized" state or not. More... | |
template<class Scalar > | |
bool | opSupported (const LinearOpBase< Scalar > &M, EOpTransp M_trans) |
Determines if an operation is supported for a single scalar type. More... | |
template<class Scalar > | |
void | apply (const LinearOpBase< Scalar > &M, const EOpTransp M_trans, const MultiVectorBase< Scalar > &X, const Ptr< MultiVectorBase< Scalar > > &Y, const Scalar alpha=static_cast< Scalar >(1.0), const Scalar beta=static_cast< Scalar >(0.0)) |
Non-member function call for M.apply(...) . More... | |
void | apply (const LinearOpBase< double > &M, const EOpTransp M_trans, const MultiVectorBase< double > &X, const Ptr< MultiVectorBase< double > > &Y, const double alpha=1.0, const double beta=0.0) |
Calls apply<double>(...) . More... | |
Simple example subclass for Spmd tridiagonal matrices.
This subclass represents a linear operator for tridiagonal matrices of the global form:
If there is only processes then the arrays lower[]
, diag[]
, and upper[]
of dimension localDim-1
, localDim
and localDim-1
respectively are stored (see initialize()
).
If there processes then locally this class stores slightly different arrays of data depending on which process this is and process-to-process communication is required.
On process 0 with local vector elements the following sub-matrix is stored:
In this case, arrays lower[]
, diag[]
, and upper[]
of dimension localDim-1
, localDim
and localDim
respectively are stored (see initialize()
).
On process , where , with local offset and local vector elements the following sub-matrix is stored:
In this case, arrays lower[]
, diag[]
, and upper[]
of dimension localDim
, localDim
and localDim
respectively are stored (see initialize()
).
On process with local offset and local vector elements the following sub-matrix is stored:
In this case, arrays lower[]
, diag[]
, and upper[]
of dimension localDim
, localDim
and localDim-1
respectively are stored (see initialize()
).
See the source code for this simple example by clicking on the link to the definition below.
Definition at line 143 of file ExampleTridiagSpmdLinearOp.hpp.
|
inline |
Construct to uninitialized.
Definition at line 147 of file ExampleTridiagSpmdLinearOp.hpp.
|
inline |
Calls initialize()
.
Definition at line 150 of file ExampleTridiagSpmdLinearOp.hpp.
void ExampleTridiagSpmdLinearOp< Scalar >::initialize | ( | const Teuchos::RCP< const Teuchos::Comm< Thyra::Ordinal > > & | comm, |
const Thyra::Ordinal | localDim, | ||
const Teuchos::ArrayView< const Scalar > & | lower, | ||
const Teuchos::ArrayView< const Scalar > & | diag, | ||
const Teuchos::ArrayView< const Scalar > & | upper | ||
) |
Initialize given lower, diagonal and upper arrays of data.
comm | [in] Communicator (allowed to be Teuchos::null) |
localDim | [in] Dimension of this matrix (must be >= 2). |
lower | [in] Array (length ( procRank == 0 ? localDim - 1 : localDim ) ) of the lower diagonal elements |
diag | [in] Array (length localDim ) of the central diagonal elements |
upper | [in] Array (length ( procRank == numProc-1 ? localDim - 1 : localDim ) ) of the upper diagonal elements |
Preconditions:
localDim >= 2
Postconditions:
Definition at line 232 of file ExampleTridiagSpmdLinearOp.hpp.
|
inlineprotectedvirtual |
Implements Thyra::LinearOpBase< Scalar >.
Definition at line 193 of file ExampleTridiagSpmdLinearOp.hpp.
|
inlineprotectedvirtual |
Implements Thyra::LinearOpBase< Scalar >.
Definition at line 197 of file ExampleTridiagSpmdLinearOp.hpp.
|
inlineprotectedvirtual |
Implements Thyra::LinearOpBase< Scalar >.
Definition at line 201 of file ExampleTridiagSpmdLinearOp.hpp.
|
protectedvirtual |
Implements Thyra::LinearOpBase< Scalar >.
Definition at line 250 of file ExampleTridiagSpmdLinearOp.hpp.