10 #ifndef THYRA_DEFAULT_SERIAL_DENSE_LINEAR_OP_WITH_SOLVE_HPP
11 #define THYRA_DEFAULT_SERIAL_DENSE_LINEAR_OP_WITH_SOLVE_HPP
14 #include "Thyra_DefaultSerialDenseLinearOpWithSolve_decl.hpp"
15 #include "Thyra_LinearOpWithSolveBase.hpp"
16 #include "Thyra_DetachedMultiVectorView.hpp"
17 #include "Thyra_MultiVectorStdOps.hpp"
18 #include "Thyra_AssertOp.hpp"
19 #include "Teuchos_Assert.hpp"
28 template<
class Scalar>
33 template<
class Scalar>
37 using Teuchos::outArg;
45 factorize(*M, outArg(LU_), outArg(ipiv_));
49 template<
class Scalar>
58 template<
class Scalar>
68 template<
class Scalar>
84 template<
class Scalar>
88 return Thyra::opSupported(*M_, M_trans);
92 template<
class Scalar>
101 Thyra::apply( *M_, M_trans, X, Y, alpha, beta );
108 template<
class Scalar>
113 return ( ST::isComplex ? ( M_trans!=
CONJ ) :
true );
117 template<
class Scalar>
122 return this->solveSupportsImpl(M_trans);
126 template<
class Scalar>
137 "DefaultSerialDenseLinearOpWithSolve<Scalar>::solve(...)",
138 *
this, M_trans, *X, &B );
140 backsolve( LU_, ipiv_, M_trans, B, X );
150 template<
class Scalar>
157 using Teuchos::outArg;
159 const int dim = dM.subDim();
162 RTOpPack::assign_entries<Scalar>( outArg(LU_tmp), dM.smv() );
164 RTOpPack::getrf<Scalar>( LU_tmp, (*ipiv)(), outArg(rank) );
170 template<
class Scalar>
171 void DefaultSerialDenseLinearOpWithSolve<Scalar>::backsolve(
173 const ArrayView<const int> ipiv,
175 const MultiVectorBase<Scalar> &B,
176 const Ptr<MultiVectorBase<Scalar> > &X
179 using Teuchos::outArg;
181 DetachedMultiVectorView<Scalar> dX(*X);
182 RTOpPack::getrs<Scalar>( LU, ipiv, convertToRTOpPackETransp(transp),
190 #endif // THYRA_DEFAULT_SERIAL_DENSE_LINEAR_OP_WITH_SOLVE_HPP
#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...
Create an explicit non-mutable (const) view of a MultiVectorBase object.
SolveStatus< Scalar > solveImpl(const EOpTransp transp, const MultiVectorBase< Scalar > &B, const Ptr< MultiVectorBase< Scalar > > &X, const Ptr< const SolveCriteria< Scalar > > solveCriteria) const
bool is_null(const boost::shared_ptr< T > &p)
EOpTransp
Enumeration for determining how a linear operator is applied. `*.
#define THYRA_ASSERT_LINEAR_OP_MULTIVEC_APPLY_SPACES(FUNC_NAME, M, M_T, X, Y)
This is a very useful macro that should be used to validate that the spaces for the multi-vector vers...
Simple concreate subclass of LinearOpWithSolveBase for serial dense matrices implemented using LAPACK...
DefaultSerialDenseLinearOpWithSolve()
RCP< const VectorSpaceBase< Scalar > > range() const
RCP< const LinearOpBase< Scalar > > getFwdOp() const
Use the non-transposed operator with complex-conjugate elements (same as NOTRANS for real scalar type...
bool solveSupportsSolveMeasureTypeImpl(EOpTransp M_trans, const SolveMeasureType &solveMeasureType) const
void initialize(const RCP< const MultiVectorBase< Scalar > > &M)
Interface for a collection of column vectors called a multi-vector.
bool opSupportedImpl(EOpTransp M_trans) const
Simple struct for the return status from a solve.
bool solveSupportsImpl(EOpTransp M_trans) const
ESolveStatus solveStatus
The return status of the solve.
void applyImpl(const EOpTransp M_trans, const MultiVectorBase< Scalar > &X, const Ptr< MultiVectorBase< Scalar > > &Y, const Scalar alpha, const Scalar beta) const
The requested solution criteria has likely been achieved.
#define TEUCHOS_ASSERT(assertion_test)
#define TEUCHOS_ASSERT_EQUALITY(val1, val2)
RCP< const VectorSpaceBase< Scalar > > domain() const
Simple struct that defines the requested solution criteria for a solve.