10 #include "Thyra_EpetraExtDiagScalingTransformer.hpp"
11 #include "Thyra_MultipliedLinearOpBase.hpp"
12 #include "Thyra_DiagonalLinearOpBase.hpp"
13 #include "Thyra_ScaledAdjointLinearOpBase.hpp"
14 #include "Thyra_EpetraLinearOp.hpp"
15 #include "Thyra_get_Epetra_Operator.hpp"
17 #include "Epetra_Map.h"
18 #include "Epetra_LocalMap.h"
19 #include "Epetra_SerialComm.h"
20 #include "Epetra_CrsMatrix.h"
21 #include "Teuchos_Assert.hpp"
22 #include "Teuchos_RCP.hpp"
36 using Teuchos::rcp_dynamic_cast;
52 if(transp!=
NOTRANS)
return false;
57 if(transp!=
NOTRANS)
return false;
65 if(dA==Teuchos::null && dB!=Teuchos::null)
68 if(dA!=Teuchos::null && dB==Teuchos::null)
78 return nonconstEpetraLinearOp();
88 using Teuchos::rcp_dynamic_cast;
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 );
128 if(dA==Teuchos::null) {
129 bool exactly_one_op_must_be_diagonal__dB_neq_null = dB!=Teuchos::null;
135 else if(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;
156 bool rightScale = dB!=Teuchos::null;
163 if(epetra_op==Teuchos::null)
166 *epetra_op = *epetra_A;
174 if(epetra_op==Teuchos::null)
177 *epetra_op = *epetra_B;
181 epetra_op->
Scale(A_scalar*B_scalar);
Concrete LinearOpBase adapter subclass for Epetra_Operator object.
EOpTransp
Enumeration for determining how a linear operator is applied. `*.
void unwrap(const LinearOpBase< Scalar > &Op, Scalar *scalar, EOpTransp *transp, const LinearOpBase< Scalar > **origOp)
Extract the overallScalar, overallTransp and const origOp from a const LinearOpBase object...
Use the non-transposed operator.
T_To & dyn_cast(T_From &from)
Use the transposed operator with complex-conjugate clements (same as TRANS for real scalar types)...
virtual int numOps() const =0
Returns the number of constituent operators.
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.
Interface class for implicitly multiplied linear operators.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
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.
int LeftScale(const Epetra_Vector &x)
const Epetra_Map & OperatorRangeMap() const
Teuchos::RCP< Epetra_Operator > get_Epetra_Operator(LinearOpBase< Scalar > &)
Get smart pointer to non-const Epetra_Operator object from reference to a non-const EpetraLinearOp ac...
#define TEUCHOS_ASSERT(assertion_test)
int Scale(double ScalarConstant)
virtual Teuchos::RCP< const LinearOpBase< Scalar > > getOp(const int k) const =0
Return the kth constant constituent operator.
int RightScale(const Epetra_Vector &x)
Interface class for for diagonal linear operators.
RCP< Epetra_Operator > epetra_op()