44 #ifndef ROL_LINEAROPERATORSUM_H 45 #define ROL_LINEAROPERATORSUM_H 68 Teuchos::RCP<std::vector<Teuchos::RCP<OP> > >
ops_;
75 Teuchos::RCP<V> & scratch ) :
77 ops_ = Teuchos::rcp(
new std::vector<OP> > );
85 Teuchos::RCP<V> & scratch ) :
87 ops_ = Teuchos::rcp(
new std::vector<OP> > );
96 for( size_type i=0; i<ops_->size(); ++i ) {
97 (*ops_)[i]->update(x,flag,
true);
102 (*ops_)[0]->apply(Hv,v,tol);
103 for( size_type i=1; i<ops_->size(); ++i ) {
104 (*ops_)[i]->apply(*scratch_,v,tol);
110 TEUCHOS_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 .
Teuchos::RCP< V > scratch_
Defines the linear algebra or vector space interface.
virtual void update(const Vector< Real > &x, bool flag=true, int iter=-1)
Update linear operator.
std::vector< Teuchos::RCP< OP > >::size_type size_type
Teuchos::RCP< std::vector< Teuchos::RCP< OP > > > ops_
virtual void applyInverse(Vector< Real > &Hv, const Vector< Real > &v, Real &tol) const
Apply inverse of linear operator.
Provides the interface to apply a linear operator.
LinearOperatorSum(Teuchos::RCP< OP > &A, Teuchos::RCP< OP > &B, Teuchos::RCP< OP > &C, Teuchos::RCP< V > &scratch)
LinearOperator< Real > OP
LinearOperatorSum(Teuchos::RCP< OP > &A, Teuchos::RCP< OP > &B, Teuchos::RCP< V > &scratch)
virtual void apply(Vector< Real > &Hv, const Vector< Real > &v, Real &tol) const
Apply linear operator.
Provides the interface to sum of linear operators applied to a vector