ROL
ROL_ObjectiveFromConstraint.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_OBJECTIVE_FROM_CONSTRAINT_H
11 #define ROL_OBJECTIVE_FROM_CONSTRAINT_H
12 
13 #include "ROL_Objective.hpp"
14 #include "ROL_Constraint.hpp"
15 
24 namespace ROL {
25 
26 template<typename Real>
27 class ObjectiveFromConstraint : public Objective<Real> {
28 private:
29  Ptr<Constraint<Real>> con_;
30  Ptr<Vector<Real>> l_; // Lagrange multiplier
31  Ptr<Vector<Real>> c_; // Constraint vector
32 
33 public:
35  ObjectiveFromConstraint( const Ptr<Constraint<Real>> &con,
36  const Vector<Real> &l );
37 
38  void update( const Vector<Real> &x, UpdateType type, int iter = -1 ) override;
39  void update( const Vector<Real> &x, bool flag = true, int iter = -1 ) override;
40  Real value( const Vector<Real> &x, Real &tol ) override;
41  void gradient( Vector<Real> &g, const Vector<Real> &x, Real &tol ) override;
42  void hessVec( Vector<Real> &hv, const Vector<Real> &v, const Vector<Real> &x, Real &tol ) override;
43  void updateMultiplier( const Vector<Real> &l );
44 
45 }; // class ObjectiveFromConstraint
46 
47 } // namespace ROL
48 
50 
51 #endif // ROL_OBJECTIVE_FROM_CONSTRAINT_H
Provides the interface to evaluate objective functions.
Defines the linear algebra or vector space interface.
Definition: ROL_Vector.hpp:46
void update(const Vector< Real > &x, UpdateType type, int iter=-1) override
Update objective function.
Real value(const Vector< Real > &x, Real &tol) override
Compute value.
void updateMultiplier(const Vector< Real > &l)
ObjectiveFromConstraint(const Ptr< Constraint< Real >> &con, const Vector< Real > &l)
void hessVec(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, Real &tol) override
Apply Hessian approximation to vector.
void gradient(Vector< Real > &g, const Vector< Real > &x, Real &tol) override
Compute gradient.
Defines the general constraint operator interface.