ROL
ROL_LinearOperator.hpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Rapid Optimization Library (ROL) Package
4 //
5 // Copyright 2014 NTESS and the ROL contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 #ifndef ROL_LINEAROPERATOR_H
11 #define ROL_LINEAROPERATOR_H
12 
13 #include "ROL_Vector.hpp"
14 
34 namespace ROL {
35 
36 template <class Real>
38 public:
39 
40  virtual ~LinearOperator() {}
41 
49  virtual void update( const Vector<Real> &x, bool flag = true, int iter = -1 ) {}
50 
58  virtual void apply( Vector<Real> &Hv, const Vector<Real> &v, Real &tol ) const = 0;
59 
67  virtual void applyInverse( Vector<Real> &Hv, const Vector<Real> &v, Real &tol ) const {
68  Hv.set(v);
69  }
70 
80  virtual void applyAdjoint( Vector<Real> &Hv, const Vector<Real> &v, Real &tol ) const {
81  apply(Hv,v,tol);
82  }
83 
93  virtual void applyAdjointInverse( Vector<Real> &Hv, const Vector<Real> &v, Real &tol ) const {
94  applyInverse(Hv,v,tol);
95  }
96 
97 }; // class LinearOperator
98 
99 } // namespace ROL
100 
101 #endif
virtual void applyAdjoint(Vector< Real > &Hv, const Vector< Real > &v, Real &tol) const
Apply adjoint of linear operator.
virtual void apply(Vector< Real > &Hv, const Vector< Real > &v, Real &tol) const =0
Apply linear operator.
virtual void update(const Vector< Real > &x, bool flag=true, int iter=-1)
Update linear operator.
Defines the linear algebra or vector space interface.
Definition: ROL_Vector.hpp:46
virtual void applyInverse(Vector< Real > &Hv, const Vector< Real > &v, Real &tol) const
Apply inverse of linear operator.
virtual void applyAdjointInverse(Vector< Real > &Hv, const Vector< Real > &v, Real &tol) const
Apply adjoint of the inverse linear operator.
Provides the interface to apply a linear operator.
virtual void set(const Vector &x)
Set where .
Definition: ROL_Vector.hpp:175