ROL
ROL_SlacklessConstraint.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_SLACKLESSCONSTRAINT_HPP
11 #define ROL_SLACKLESSCONSTRAINT_HPP
12 
13 #include "ROL_Constraint.hpp"
15 
22 namespace ROL {
23 
24 template<typename Real>
25 class SlacklessConstraint : public Constraint<Real> {
26 private:
27  const Ptr<Constraint<Real>> con_;
28 
29 public:
30  SlacklessConstraint( const Ptr<Constraint<Real>> &con );
31 
32  void update( const Vector<Real> &x, UpdateType type, int iter = -1 ) override;
33  void update( const Vector<Real> &x, bool flag = true, int iter = -1 ) override;
34  void value(Vector<Real> &c, const Vector<Real> &x, Real &tol ) override;
35  void applyJacobian( Vector<Real> &jv, const Vector<Real> &v, const Vector<Real> &x, Real &tol ) override;
36  void applyAdjointJacobian( Vector<Real> &ajv, const Vector<Real> &v, const Vector<Real> &x, const Vector<Real> &dualv, Real &tol ) override;
37  void applyAdjointHessian( Vector<Real> &ahuv, const Vector<Real> &u, const Vector<Real> &v, const Vector<Real> &x, Real &tol ) override;
38 
39 // Definitions for parametrized (stochastic) constraint functions
40 public:
41  void setParameter(const std::vector<Real> &param) override;
42 
43 private:
44  Ptr<Vector<Real>> getOpt( Vector<Real> &xs ) const;
45  Ptr<const Vector<Real>> getOpt( const Vector<Real> &xs ) const;
46  void zeroSlack( Vector<Real> &x ) const;
47 
48 }; // class SlacklessConstraint
49 
50 } // namespace ROL
51 
53 
54 #endif // ROL__SLACKLESSCONSTRAINT_HPP
55 
const Ptr< Constraint< Real > > con_
void update(const Vector< Real > &x, UpdateType type, int iter=-1) override
Update constraint function.
SlacklessConstraint(const Ptr< Constraint< Real >> &con)
Ptr< Vector< Real > > getOpt(Vector< Real > &xs) const
Defines the linear algebra or vector space interface.
Definition: ROL_Vector.hpp:46
void applyAdjointJacobian(Vector< Real > &ajv, const Vector< Real > &v, const Vector< Real > &x, const Vector< Real > &dualv, Real &tol) override
Apply the adjoint of the the constraint Jacobian at , , to vector .
void applyJacobian(Vector< Real > &jv, const Vector< Real > &v, const Vector< Real > &x, Real &tol) override
Apply the constraint Jacobian at , , to vector .
void applyAdjointHessian(Vector< Real > &ahuv, const Vector< Real > &u, const Vector< Real > &v, const Vector< Real > &x, Real &tol) override
Apply the derivative of the adjoint of the constraint Jacobian at to vector in direction ...
void value(Vector< Real > &c, const Vector< Real > &x, Real &tol) override
Evaluate the constraint operator at .
This class strips out the slack variables from constraint evaluations to create the new constraint ...
void setParameter(const std::vector< Real > &param) override
void zeroSlack(Vector< Real > &x) const
Defines the general constraint operator interface.