44 #ifndef ROL_LINEAROPERATORSUM_H
45 #define ROL_LINEAROPERATORSUM_H
68 ROL::Ptr<std::vector<ROL::Ptr<OP> > >
ops_;
75 ROL::Ptr<V> & scratch ) :
77 ops_ = ROL::makePtr<std::vector<OP> >>();
85 ROL::Ptr<V> & scratch ) :
87 ops_ = ROL::makePtr<std::vector<OP> >>();
97 (*ops_)[i]->update(x,flag,
true);
102 (*ops_)[0]->apply(Hv,v,tol);
110 ROL_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
111 ">>> ERROR (ROL_LinearOperatorSum, applyInverse): "
112 "Inverse is not defined for general sum of operators.");
119 #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)