43 #ifndef THYRA_DEFAULT_SERIAL_DENSE_LINEAR_OP_WITH_SOLVE_HPP
44 #define THYRA_DEFAULT_SERIAL_DENSE_LINEAR_OP_WITH_SOLVE_HPP
47 #include "Thyra_DefaultSerialDenseLinearOpWithSolve_decl.hpp"
48 #include "Thyra_LinearOpWithSolveBase.hpp"
49 #include "Thyra_DetachedMultiVectorView.hpp"
50 #include "Thyra_MultiVectorStdOps.hpp"
51 #include "Thyra_AssertOp.hpp"
52 #include "Teuchos_Assert.hpp"
61 template<
class Scalar>
66 template<
class Scalar>
70 using Teuchos::outArg;
78 factorize(*M, outArg(LU_), outArg(ipiv_));
82 template<
class Scalar>
91 template<
class Scalar>
101 template<
class Scalar>
107 return Teuchos::null;
117 template<
class Scalar>
121 return Thyra::opSupported(*M_, M_trans);
125 template<
class Scalar>
134 Thyra::apply( *M_, M_trans, X, Y, alpha, beta );
141 template<
class Scalar>
146 return ( ST::isComplex ? ( M_trans!=
CONJ ) :
true );
150 template<
class Scalar>
155 return this->solveSupportsImpl(M_trans);
159 template<
class Scalar>
170 "DefaultSerialDenseLinearOpWithSolve<Scalar>::solve(...)",
171 *
this, M_trans, *X, &B );
173 backsolve( LU_, ipiv_, M_trans, B, X );
183 template<
class Scalar>
190 using Teuchos::outArg;
192 const int dim = dM.subDim();
195 RTOpPack::assign_entries<Scalar>( outArg(LU_tmp), dM.smv() );
197 RTOpPack::getrf<Scalar>( LU_tmp, (*ipiv)(), outArg(rank) );
203 template<
class Scalar>
204 void DefaultSerialDenseLinearOpWithSolve<Scalar>::backsolve(
206 const ArrayView<const int> ipiv,
208 const MultiVectorBase<Scalar> &B,
209 const Ptr<MultiVectorBase<Scalar> > &X
212 using Teuchos::outArg;
214 DetachedMultiVectorView<Scalar> dX(*X);
215 RTOpPack::getrs<Scalar>( LU, ipiv, convertToRTOpPackETransp(transp),
223 #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.