10 #ifndef ROL_LINEAROPERATORSUM_H
11 #define ROL_LINEAROPERATORSUM_H
34 ROL::Ptr<std::vector<ROL::Ptr<OP> > >
ops_;
41 ROL::Ptr<V> & scratch ) :
43 ops_ = ROL::makePtr<std::vector<OP> >>();
51 ROL::Ptr<V> & scratch ) :
53 ops_ = ROL::makePtr<std::vector<OP> >>();
63 (*ops_)[i]->update(x,flag,
true);
68 (*ops_)[0]->apply(Hv,v,tol);
76 ROL_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
77 ">>> ERROR (ROL_LinearOperatorSum, applyInverse): "
78 "Inverse is not defined for general sum of operators.");
85 #endif // ROL_LINEAROPERATOR_PRODUCT_H
virtual void plus(const Vector &x)=0
Compute , where .
virtual void applyInverse(Vector< Real > &Hv, const Vector< Real > &v, Real &tol) const
Apply inverse of linear operator.
std::vector< ROL::Ptr< OP > >::size_type size_type
Defines the linear algebra or vector space interface.
virtual void update(const Vector< Real > &x, bool flag=true, int iter=-1)
Update linear operator.
LinearOperatorSum(ROL::Ptr< OP > &A, ROL::Ptr< OP > &B, ROL::Ptr< V > &scratch)
ROL::Ptr< std::vector< ROL::Ptr< OP > > > ops_
Provides the interface to apply a linear operator.
virtual void apply(Vector< Real > &Hv, const Vector< Real > &v, Real &tol) const
Apply linear operator.
LinearOperator< Real > OP
Provides the interface to sum of linear operators applied to a vector
LinearOperatorSum(ROL::Ptr< OP > &A, ROL::Ptr< OP > &B, ROL::Ptr< OP > &C, ROL::Ptr< V > &scratch)