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
22namespace ROL {
23
24template<typename Real>
25class SlacklessConstraint : public Constraint<Real> {
26private:
27 const Ptr<Constraint<Real>> con_;
28
29public:
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
40public:
41 void setParameter(const std::vector<Real> &param) override;
42
43private:
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
Defines the general constraint operator interface.
This class strips out the slack variables from constraint evaluations to create the new constraint .
void applyJacobian(Vector< Real > &jv, const Vector< Real > &v, const Vector< Real > &x, Real &tol) override
Apply the constraint Jacobian at , , to vector .
void setParameter(const std::vector< Real > &param) override
const Ptr< Constraint< Real > > con_
void value(Vector< Real > &c, const Vector< Real > &x, Real &tol) override
Evaluate the constraint operator at .
void zeroSlack(Vector< Real > &x) const
Ptr< Vector< Real > > getOpt(Vector< Real > &xs) const
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 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 update(const Vector< Real > &x, UpdateType type, int iter=-1) override
Update constraint function.
Defines the linear algebra or vector space interface.