43 #include "Thyra_DefaultDiagonalLinearOpWithSolve.hpp"
48 #include "Epetra_RowMatrix.h"
49 #include "Epetra_Vector.h"
50 #include "Epetra_Map.h"
57 const LinearOpSourceBase<double> &fwdOpSrc
60 using Teuchos::outArg;
62 fwdOp = fwdOpSrc.getOp();
64 if( ! (eFwdOp = dynamic_cast<const EpetraLinearOpBase*>(&*fwdOp)) )
67 EOpTransp epetraFwdOpTransp;
71 outArg(epetraFwdOpApplyAs), outArg(epetraFwdOpAdjointSupport) );
72 if( !dynamic_cast<const Epetra_RowMatrix*>(&*epetraFwdOp) )
81 return Teuchos::rcp(
new DefaultDiagonalLinearOpWithSolve<double>());
86 const RCP<
const LinearOpSourceBase<double> > &fwdOpSrc
87 ,LinearOpWithSolveBase<double> *Op
88 ,
const ESupportSolveUse supportSolveUse
91 using Teuchos::outArg;
96 const EpetraLinearOpBase &eFwdOp = Teuchos::dyn_cast<const EpetraLinearOpBase>(*fwdOp);
98 EOpTransp epetraFwdOpTransp;
102 outArg(epetraFwdOpApplyAs), outArg(epetraFwdOpAdjointSupport) );
103 const Epetra_RowMatrix &eRMOp =
104 Teuchos::dyn_cast<const Epetra_RowMatrix>(*epetraFwdOp);
105 const Epetra_Map &map = eRMOp.OperatorDomainMap();
108 eRMOp.ExtractDiagonalCopy(*e_diag);
113 Teuchos::set_extra_data<RCP<const LinearOpSourceBase<double> > >(
114 fwdOpSrc,
"Thyra::DiagonalEpetraLinearOpWithSolveFactory::fwdOpSrc",
115 Teuchos::inOutArg(diag)
118 Teuchos::rcp_implicit_cast<
const VectorBase<double> >(diag)
125 LinearOpWithSolveBase<double> *Op
126 ,
RCP<
const LinearOpSourceBase<double> > *fwdOpSrc
127 ,
RCP<
const PreconditionerBase<double> > *prec
128 ,
RCP<
const LinearOpSourceBase<double> > *approxFwdOpSrc
129 ,ESupportSolveUse *supportSolveUse
132 using Teuchos::get_extra_data;
134 DefaultDiagonalLinearOpWithSolve<double>
137 diag = diagOp.getDiag();
141 get_extra_data<RCP<const LinearOpSourceBase<double> > >(
142 diag,
"Thyra::DiagonalEpetraLinearOpWithSolveFactory::fwdOpSrc"
147 *fwdOpSrc = Teuchos::null;
149 if(prec) *prec = Teuchos::null;
150 if(approxFwdOpSrc) *approxFwdOpSrc = Teuchos::null;
166 return Teuchos::null;
173 return Teuchos::null;
180 return Teuchos::null;
187 return Teuchos::null;