10 #ifndef THYRA_MULTI_VECTOR_LINEAR_OP_WITH_SOLVE_HPP
11 #define THYRA_MULTI_VECTOR_LINEAR_OP_WITH_SOLVE_HPP
13 #include "Thyra_DefaultMultiVectorLinearOpWithSolve_decl.hpp"
14 #include "Thyra_DefaultDiagonalLinearOp.hpp"
15 #include "Thyra_LinearOpWithSolveBase.hpp"
16 #include "Thyra_DefaultMultiVectorProductVectorSpace.hpp"
17 #include "Thyra_DefaultMultiVectorProductVector.hpp"
18 #include "Thyra_AssertOp.hpp"
19 #include "Teuchos_dyn_cast.hpp"
28 template<
class Scalar>
33 template<
class Scalar>
40 validateInitialize(lows,multiVecRange,multiVecDomain);
42 multiVecRange_ = multiVecRange;
43 multiVecDomain_ = multiVecDomain;
47 template<
class Scalar>
54 validateInitialize(lows,multiVecRange,multiVecDomain);
56 multiVecRange_ = multiVecRange;
57 multiVecDomain_ = multiVecDomain;
61 template<
class Scalar>
65 return lows_.getNonconstObj();
69 template<
class Scalar>
73 return lows_.getConstObj();
77 template<
class Scalar>
81 multiVecRange_ = Teuchos::null;
82 multiVecDomain_ = Teuchos::null;
89 template<
class Scalar>
93 return multiVecRange_;
97 template<
class Scalar>
101 return multiVecDomain_;
105 template<
class Scalar>
109 return Teuchos::null;
119 template<
class Scalar>
124 return Thyra::opSupported(*lows_.getConstObj(),M_trans);
128 template<
class Scalar>
143 for (
Ordinal col_j = 0; col_j < numCols; ++col_j) {
149 X =
dyn_cast<
const MVPV>(*x).getMultiVector().assert_not_null();
151 Y =
dyn_cast<MVPV>(*y).getNonconstMultiVector().assert_not_null();
153 Thyra::apply( *lows_.getConstObj(), M_trans, *X, Y.
ptr(), alpha, beta );
163 template<
class Scalar>
169 return Thyra::solveSupports(*lows_.getConstObj(),M_trans);
173 template<
class Scalar>
179 return Thyra::solveSupportsSolveMeasureType(
180 *lows_.getConstObj(),M_trans,solveMeasureType);
184 template<
class Scalar>
195 using Teuchos::outArg;
196 using Teuchos::inOutArg;
202 accumulateSolveStatusInit(outArg(overallSolveStatus));
204 for (
Ordinal col_j = 0; col_j < numCols; ++col_j) {
210 B =
dyn_cast<
const MVPV>(*b).getMultiVector().assert_not_null();
212 X =
dyn_cast<MVPV>(*x).getNonconstMultiVector().assert_not_null();
215 Thyra::solve(*lows_.getConstObj(), transp, *B, X.
ptr(), solveCriteria);
217 accumulateSolveStatus(
219 solveStatus, inOutArg(overallSolveStatus) );
223 return overallSolveStatus;
231 template<
class Scalar>
243 if (lows->range() != Teuchos::null)
245 "DefaultMultiVectorLinearOpWithSolve<Scalar>::initialize(lows,multiVecRange,multiVecDomain)",
246 *lows->range(), *multiVecRange->getBlock(0) );
247 if (lows->domain() != Teuchos::null)
249 "DefaultMultiVectorLinearOpWithSolve<Scalar>::initialize(lows,multiVecRange,multiVecDomain)",
250 *lows->domain(), *multiVecDomain->getBlock(0) );
254 (void)multiVecDomain;
262 #endif // THYRA_MULTI_VECTOR_LINEAR_OP_WITH_SOLVE_HPP
RCP< const VectorSpaceBase< Scalar > > range() const
#define THYRA_ASSERT_VEC_SPACES(FUNC_NAME, VS1, VS2)
This is a very useful macro that should be used to validate that two vector spaces are compatible...
Implicit concrete LinearOpWithSolveBase subclass that takes a flattended out multi-vector and perform...
Base class for all linear operators that can support a high-level solve operation.
RCP< const VectorSpaceBase< Scalar > > domain() const
bool is_null(const boost::shared_ptr< T > &p)
EOpTransp
Enumeration for determining how a linear operator is applied. `*.
DefaultMultiVectorLinearOpWithSolve()
Construct to uninitialized.
T_To & dyn_cast(T_From &from)
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
Concrete implementation of a product vector which is really composed out of the columns of a multi-ve...
Teuchos::Ordinal Ordinal
Type for the dimension of a vector space. `*.
RCP< const LinearOpWithSolveBase< Scalar > > getLinearOpWithSolve() const
Interface for a collection of column vectors called a multi-vector.
RCP< const VectorBase< Scalar > > col(Ordinal j) const
Calls colImpl().
void nonconstInitialize(const RCP< LinearOpWithSolveBase< Scalar > > &lows, const RCP< const DefaultMultiVectorProductVectorSpace< Scalar > > &multiVecRange, const RCP< const DefaultMultiVectorProductVectorSpace< Scalar > > &multiVecDomain)
RCP< const LinearOpBase< Scalar > > clone() const
Simple struct for the return status from a solve.
Standard concrete implementation of a product vector space that creates product vectors fromed implic...
virtual RCP< const VectorSpaceBase< Scalar > > domain() const =0
Return a smart pointer for the domain space for this operator.
SolveStatus< Scalar > solveImpl(const EOpTransp transp, const MultiVectorBase< Scalar > &B, const Ptr< MultiVectorBase< Scalar > > &X, const Ptr< const SolveCriteria< Scalar > > solveCriteria) const
bool solveSupportsImpl(EOpTransp M_trans) const
RCP< LinearOpWithSolveBase< Scalar > > getNonconstLinearOpWithSolve()
Simple struct that defines the requested solution criteria for a solve.
bool solveSupportsSolveMeasureTypeImpl(EOpTransp M_trans, const SolveMeasureType &solveMeasureType) const
#define TEUCHOS_TEST_FOR_EXCEPT(throw_exception_test)
void initialize(const RCP< const LinearOpWithSolveBase< Scalar > > &lows, const RCP< const DefaultMultiVectorProductVectorSpace< Scalar > > &multiVecRange, const RCP< const DefaultMultiVectorProductVectorSpace< Scalar > > &multiVecDomain)