#include <ExampleTridiagSpmdLinearOp.hpp>
Inheritance diagram for ExampleTridiagSpmdLinearOp< Scalar >:
Public Member Functions | |
| ExampleTridiagSpmdLinearOp () | |
| Construct to uninitialized. | |
| ExampleTridiagSpmdLinearOp (const Teuchos::RCP< const Teuchos::Comm< Thyra::Index > > &comm, const Thyra::Index localDim, const Scalar lower[], const Scalar diag[], const Scalar upper[]) | |
Calls initialize(). | |
| void | initialize (const Teuchos::RCP< const Teuchos::Comm< Thyra::Index > > &comm, const Thyra::Index localDim, const Scalar lower[], const Scalar diag[], const Scalar upper[]) |
| std::string | description () const |
| Default description that gives the label, type, and dimenstion . | |
Protected Member Functions | |
| bool | opSupported (Thyra::ETransp M_trans) const |
Return if the M_trans operation of apply() is supported or not. | |
| void | euclideanApply (const Thyra::ETransp M_trans, const RTOpPack::ConstSubVectorView< Scalar > &local_x_in, const RTOpPack::SubVectorView< Scalar > *local_y_out, const Scalar alpha, const Scalar beta) const |
| Apply the operator to explicit vector data. | |
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.
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()).
, 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()).
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()).
Note, this is just an example class and for the sake of simplified presentation the private members are listed first and in-class declarations are used which are not a good idea in production code. However, in this case, they make the example code easier to read and maintaining encapsulation and a well defined interface are unnecessary here.
See the source code for this simple example by clicking on the link to the definition below.
Definition at line 133 of file ExampleTridiagSpmdLinearOp.hpp.
| ExampleTridiagSpmdLinearOp< Scalar >::ExampleTridiagSpmdLinearOp | ( | ) | [inline] |
| ExampleTridiagSpmdLinearOp< Scalar >::ExampleTridiagSpmdLinearOp | ( | const Teuchos::RCP< const Teuchos::Comm< Thyra::Index > > & | comm, | |
| const Thyra::Index | localDim, | |||
| const Scalar | lower[], | |||
| const Scalar | diag[], | |||
| const Scalar | upper[] | |||
| ) | [inline] |
| void ExampleTridiagSpmdLinearOp< Scalar >::initialize | ( | const Teuchos::RCP< const Teuchos::Comm< Thyra::Index > > & | comm, | |
| const Thyra::Index | localDim, | |||
| const Scalar | lower[], | |||
| const Scalar | diag[], | |||
| const Scalar | upper[] | |||
| ) | [inline] |
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 |
localDim >= 2 Postconditions:
setLocalDimensions() Definition at line 179 of file ExampleTridiagSpmdLinearOp.hpp.
| std::string ExampleTridiagSpmdLinearOp< Scalar >::description | ( | ) | const [inline, virtual] |
Default description that gives the label, type, and dimenstion .
Reimplemented from Thyra::LinearOpDefaultBase< RangeScalar, DomainScalar >.
Definition at line 203 of file ExampleTridiagSpmdLinearOp.hpp.
| bool ExampleTridiagSpmdLinearOp< Scalar >::opSupported | ( | Thyra::ETransp | M_trans | ) | const [inline, protected, virtual] |
Return if the M_trans operation of apply() is supported or not.
Preconditions:
Note that an operator must support at least one of the values of ETrans (i.e. the transposed or the non-transposed operations must be supported, both can not be unsupported)
Implements Thyra::SingleScalarEuclideanLinearOpBase< Scalar >.
Definition at line 213 of file ExampleTridiagSpmdLinearOp.hpp.
| void ExampleTridiagSpmdLinearOp< Scalar >::euclideanApply | ( | const Thyra::ETransp | M_trans, | |
| const RTOpPack::ConstSubVectorView< Scalar > & | local_x_in, | |||
| const RTOpPack::SubVectorView< Scalar > * | local_y_out, | |||
| const Scalar | alpha, | |||
| const Scalar | beta | |||
| ) | const [inline, protected, virtual] |
Apply the operator to explicit vector data.
See LinearOpBase::euclideanApply() for a discussion of the arguments to this function. What differentiates this function is that local_x and local_y are passed as objects with explicit pointers to local vector data.
Since this function is protected and does not get directly called by a client. Instead, this function is called by the vector version of euclideanApply().
Implements Thyra::SpmdLinearOpBase< Scalar >.
Definition at line 221 of file ExampleTridiagSpmdLinearOp.hpp.
1.4.7