11 #include "Thyra_MultipliedLinearOpBase.hpp"
12 #include "Thyra_DiagonalLinearOpBase.hpp"
13 #include "Thyra_ScaledAdjointLinearOpBase.hpp"
17 #include "Epetra_Map.h"
18 #include "Epetra_LocalMap.h"
19 #include "Epetra_SerialComm.h"
20 #include "Epetra_CrsMatrix.h"
32 const LinearOpBase<double> &op_in)
const
36 using Teuchos::rcp_dynamic_cast;
39 const MultipliedLinearOpBase<double> &multi_op =
40 dyn_cast<
const MultipliedLinearOpBase<double> >(op_in);
43 if(multi_op.numOps()!=2)
51 unwrap( multi_op.getOp(0), &scalar, &transp, &A );
52 if(transp!=
NOTRANS)
return false;
56 unwrap( multi_op.getOp(1), &scalar, &transp, &B );
57 if(transp!=
NOTRANS)
return false;
61 = rcp_dynamic_cast<
const DiagonalLinearOpBase<double> >(A);
63 = rcp_dynamic_cast<
const DiagonalLinearOpBase<double> >(B);
78 return nonconstEpetraLinearOp();
83 const LinearOpBase<double> &op_in,
84 const Ptr<LinearOpBase<double> > &op_inout)
const
88 using Teuchos::rcp_dynamic_cast;
95 const MultipliedLinearOpBase<double> &multi_op =
96 dyn_cast<
const MultipliedLinearOpBase<double> >(op_in);
102 double A_scalar = 0.0;
105 unwrap( op_A, &A_scalar, &A_transp, &A );
110 double B_scalar = 0.0;
113 unwrap( op_B, &B_scalar, &B_transp, &B );
122 = rcp_dynamic_cast<
const DiagonalLinearOpBase<double> >(A);
124 = rcp_dynamic_cast<
const DiagonalLinearOpBase<double> >(B);
129 bool exactly_one_op_must_be_diagonal__dB_neq_null = dB!=
Teuchos::null;
136 bool exactly_one_op_must_be_diagonal__dA_neq_null = dA!=
Teuchos::null;
143 bool exactly_one_op_must_be_diagonal=
false;
154 rcp_dynamic_cast<Epetra_CrsMatrix>(thyra_epetra_op_inout.
epetra_op());
164 epetra_op =
Teuchos::rcp(
new Epetra_CrsMatrix(*epetra_A));
166 *epetra_op = *epetra_A;
167 epetra_op->RightScale(*v);
175 epetra_op =
Teuchos::rcp(
new Epetra_CrsMatrix(*epetra_B));
177 *epetra_op = *epetra_B;
178 epetra_op->LeftScale(*v);
181 epetra_op->Scale(A_scalar*B_scalar);
Concrete LinearOpBase adapter subclass for Epetra_Operator object.
void initialize(const RCP< Epetra_Operator > &op, EOpTransp opTrans=NOTRANS, EApplyEpetraOpAs applyAs=EPETRA_OP_APPLY_APPLY, EAdjointEpetraOp adjointSupport=EPETRA_OP_ADJOINT_SUPPORTED, const RCP< const VectorSpaceBase< double > > &range=Teuchos::null, const RCP< const VectorSpaceBase< double > > &domain=Teuchos::null)
Fully initialize.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
T_To & dyn_cast(T_From &from)
RCP< Epetra_Vector > get_Epetra_Vector(const Epetra_Map &map, const RCP< VectorBase< double > > &v)
Get a non-const Epetra_Vector view from a non-const VectorBase object if possible.
Teuchos::RCP< Epetra_Operator > get_Epetra_Operator(LinearOpBase< double > &op)
Full specialization for Scalar=double.
#define TEUCHOS_ASSERT(assertion_test)
RCP< Epetra_Operator > epetra_op()