ROL
ROL_ElasticObjective.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_ELASTICOBJECTIVE_H
11 #define ROL_ELASTICOBJECTIVE_H
12 
15 
46 namespace ROL {
47 
48 template<typename Real>
49 class ElasticObjective : public Objective<Real> {
50 private:
51  // Required for Augmented Lagrangian definition
52  Ptr<AugmentedLagrangianObjective<Real>> alobj_;
53  Ptr<Vector<Real>> e_, tmp_;
54  Real sigma_, cscale_;
55 
56 public:
57  ElasticObjective(const Ptr<Objective<Real>> &obj,
58  const Ptr<Constraint<Real>> &con,
59  const Real penaltyParameter,
60  const Real sigma,
61  const Vector<Real> &dualOptVec,
62  const Vector<Real> &primConVec,
63  const Vector<Real> &dualConVec,
64  ParameterList &parlist);
65 
66  ElasticObjective(const Ptr<Objective<Real>> &obj,
67  const Ptr<Constraint<Real>> &con,
68  const Real penaltyParameter,
69  const Real sigma,
70  const Vector<Real> &dualOptVec,
71  const Vector<Real> &primConVec,
72  const Vector<Real> &dualConVec,
73  const bool scaleLagrangian,
74  const int HessianApprox);
75 
76  void update( const Vector<Real> &x, UpdateType type, int iter = -1 ) override;
77  Real value( const Vector<Real> &x, Real &tol ) override;
78  void gradient( Vector<Real> &g, const Vector<Real> &x, Real &tol ) override;
79  void hessVec( Vector<Real> &hv, const Vector<Real> &v, const Vector<Real> &x, Real &tol ) override;
80 
81  // Set problem data scalings
82  void setScaling(const Real fscale = 1.0, const Real cscale = 1.0);
83  // Return objective function value
84  Real getObjectiveValue(const Vector<Real> &x, Real &tol);
85  // Compute objective function gradient
86  const Ptr<const Vector<Real>> getObjectiveGradient(const Vector<Real> &x, Real &tol);
87  // Return constraint value
88  const Ptr<const Vector<Real>> getConstraintVec(const Vector<Real> &x, Real &tol);
89  // Return total number of constraint evaluations
90  int getNumberConstraintEvaluations(void) const;
91  // Return total number of objective evaluations
92  int getNumberFunctionEvaluations(void) const;
93  // Return total number of gradient evaluations
94  int getNumberGradientEvaluations(void) const;
95  // Reset with upated penalty parameter
96  void reset(const Vector<Real> &multiplier, Real penaltyParameter, Real sigma);
97  // Return augmented Lagrangian
98  const Ptr<AugmentedLagrangianObjective<Real>> getAugmentedLagrangian(void) const;
99 }; // class ElasticObjective
100 
101 } // namespace ROL
102 
104 
105 #endif
Provides the interface to evaluate objective functions.
const Ptr< const Vector< Real > > getConstraintVec(const Vector< Real > &x, Real &tol)
Ptr< AugmentedLagrangianObjective< Real > > alobj_
int getNumberFunctionEvaluations(void) const
void gradient(Vector< Real > &g, const Vector< Real > &x, Real &tol) override
Compute gradient.
const Ptr< AugmentedLagrangianObjective< Real > > getAugmentedLagrangian(void) const
Ptr< Vector< Real > > e_
Defines the linear algebra or vector space interface.
Definition: ROL_Vector.hpp:46
Real getObjectiveValue(const Vector< Real > &x, Real &tol)
void setScaling(const Real fscale=1.0, const Real cscale=1.0)
Provides the interface to evaluate the elastic augmented Lagrangian.
const Ptr< const Vector< Real > > getObjectiveGradient(const Vector< Real > &x, Real &tol)
int getNumberConstraintEvaluations(void) const
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.
int getNumberGradientEvaluations(void) const
ElasticObjective(const Ptr< Objective< Real >> &obj, const Ptr< Constraint< Real >> &con, const Real penaltyParameter, const Real sigma, const Vector< Real > &dualOptVec, const Vector< Real > &primConVec, const Vector< Real > &dualConVec, ParameterList &parlist)
void reset(const Vector< Real > &multiplier, Real penaltyParameter, Real sigma)
Ptr< Vector< Real > > tmp_
Defines the general constraint operator interface.