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
24namespace ROL {
25
26template<typename Real>
27class ObjectiveFromConstraint : public Objective<Real> {
28private:
29 Ptr<Constraint<Real>> con_;
30 Ptr<Vector<Real>> l_; // Lagrange multiplier
31 Ptr<Vector<Real>> c_; // Constraint vector
32
33public:
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
Defines the general constraint operator interface.
void hessVec(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, Real &tol) override
Apply Hessian approximation to vector.
Real value(const Vector< Real > &x, Real &tol) override
Compute value.
void update(const Vector< Real > &x, UpdateType type, int iter=-1) override
Update objective function.
void gradient(Vector< Real > &g, const Vector< Real > &x, Real &tol) override
Compute gradient.
void updateMultiplier(const Vector< Real > &l)
Provides the interface to evaluate objective functions.
Defines the linear algebra or vector space interface.