ROL
ROL_IdentityOperator.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_IDENTITYOPERATOR_H
11 #define ROL_IDENTITYOPERATOR_H
12 
13 #include "ROL_LinearOperator.hpp"
14 
15 
21 namespace ROL {
22 
23 template<class Real>
24 class IdentityOperator : public LinearOperator<Real> {
25 
26  void apply( Vector<Real> &Hv, const Vector<Real> &v, Real &tol ) const {
27  Hv.set(v);
28  }
29 
30  void applyInverse( Vector<Real> &Hv, const Vector<Real> &v, Real &tol ) const {
31  Hv.set(v);
32  }
33 
34 };
35 
36 } // namespace ROL
37 
38 
39 
40 
41 #endif // ROL_NULLOPERATOR_H
42 
Defines the linear algebra or vector space interface.
Definition: ROL_Vector.hpp:46
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.
virtual void set(const Vector &x)
Set where .
Definition: ROL_Vector.hpp:175
void apply(Vector< Real > &Hv, const Vector< Real > &v, Real &tol) const
Apply linear operator.
Multiplication by unity.