43 #include "Thyra_EpetraExtDiagScaledMatProdTransformer.hpp"
44 #include "Thyra_MultipliedLinearOpBase.hpp"
45 #include "Thyra_DiagonalLinearOpBase.hpp"
46 #include "Thyra_ScaledAdjointLinearOpBase.hpp"
47 #include "Thyra_EpetraLinearOp.hpp"
48 #include "Thyra_get_Epetra_Operator.hpp"
50 #include "Epetra_Map.h"
51 #include "Epetra_LocalMap.h"
52 #include "Epetra_SerialComm.h"
53 #include "Epetra_CrsMatrix.h"
54 #include "EpetraExt_MatrixMatrix.h"
55 #include "Teuchos_Assert.hpp"
75 return nonconstEpetraLinearOp();
84 using EpetraExt::MatrixMatrix;
86 using Teuchos::rcp_dynamic_cast;
96 bool haveDiagScaling = (multi_op.
numOps()==3);
100 double B_scalar = 0.0;
103 unwrap( op_B, &B_scalar, &B_transp, &B );
108 double D_scalar = 1.0;
109 if(haveDiagScaling) {
113 unwrap( op_D, &D_scalar, &D_transp, &D );
119 double G_scalar = 0.0;
122 unwrap( op_G, &G_scalar, &G_transp, &G );
136 if(haveDiagScaling) {
169 if(haveDiagScaling) {
179 epetra_BD = epetra_BD_temp;
182 epetra_BD = epetra_B;
185 int mm_error = MatrixMatrix::Multiply( *epetra_BD, B_transp==
CONJTRANS,
186 *epetra_G, G_transp==
CONJTRANS, *epetra_op);
188 "EpetraExt::MatrixMatrix::Multiply failed returning error code " << mm_error <<
".");
191 if(B_scalar*G_scalar*D_scalar!=1.0)
192 epetra_op->
Scale(B_scalar*G_scalar*D_scalar);
Concrete LinearOpBase adapter subclass for Epetra_Operator object.
bool is_null(const boost::shared_ptr< T > &p)
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...
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
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)...
const Epetra_Map & ColMap() const
const Epetra_Map & OperatorDomainMap() const
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.
const Epetra_Map & RowMap() const
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
#define TEUCHOS_UNREACHABLE_RETURN(dummyReturnVal)
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)
#define TEUCHOS_TEST_FOR_EXCEPT(throw_exception_test)
Interface class for for diagonal linear operators.
RCP< Epetra_Operator > epetra_op()