ROL
ROL_SimConstraint.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_CONSTRAINT_STATE_H
11#define ROL_CONSTRAINT_STATE_H
12
14
15namespace ROL {
16
17template<typename Real>
18class SimConstraint : public Constraint<Real> {
19private:
20 const Ptr<Constraint_SimOpt<Real>> con_;
21 const Ptr<const Vector<Real>> z_;
22 const bool inSolve_;
23 Ptr<Vector<Real>> ijv_;
24 bool init_;
25
26public:
28 const Ptr<const Vector<Real>> &z,
29 bool inSolve = false);
30
31 void update( const Vector<Real> &u, bool flag = true, int iter = -1 ) override;
32 void update( const Vector<Real> &u, UpdateType type, int iter = -1 ) override;
33 void value(Vector<Real> &c,const Vector<Real> &u,Real &tol) override;
34 void applyJacobian(Vector<Real> &jv,const Vector<Real> &v,const Vector<Real> &u,Real &tol) override;
36 void applyAdjointJacobian(Vector<Real> &ajv,const Vector<Real> &v,const Vector<Real> &u,Real &tol) override;
37 void applyAdjointHessian(Vector<Real> &ahwv,const Vector<Real> &w,const Vector<Real> &v,const Vector<Real> &u,Real &tol) override;
38 void applyPreconditioner(Vector<Real> &pv,const Vector<Real> &v,const Vector<Real> &u,const Vector<Real> &g,Real &tol) override;
39
40 // Definitions for parametrized (stochastic) equality constraints
41 void setParameter(const std::vector<Real> &param) override;
42
43}; // class SimConstraint
44
45} // namespace ROL
46
48
49#endif
Defines the constraint operator interface for simulation-based optimization.
Defines the general constraint operator interface.
void setParameter(const std::vector< Real > &param) override
void applyAdjointJacobian(Vector< Real > &ajv, const Vector< Real > &v, const Vector< Real > &u, Real &tol) override
Apply the adjoint of the the constraint Jacobian at , , to vector .
void update(const Vector< Real > &u, bool flag=true, int iter=-1) override
Update constraint functions. x is the optimization variable, flag = true if optimization variable i...
Ptr< Vector< Real > > ijv_
void applyAdjointHessian(Vector< Real > &ahwv, const Vector< Real > &w, const Vector< Real > &v, const Vector< Real > &u, Real &tol) override
Apply the derivative of the adjoint of the constraint Jacobian at to vector in direction ,...
void applyJacobian(Vector< Real > &jv, const Vector< Real > &v, const Vector< Real > &u, Real &tol) override
Apply the constraint Jacobian at , , to vector .
const Ptr< const Vector< Real > > z_
void value(Vector< Real > &c, const Vector< Real > &u, Real &tol) override
Evaluate the constraint operator at .
void applyPreconditioner(Vector< Real > &pv, const Vector< Real > &v, const Vector< Real > &u, const Vector< Real > &g, Real &tol) override
Apply a constraint preconditioner at , , to vector . Ideally, this preconditioner satisfies the follo...
const Ptr< Constraint_SimOpt< Real > > con_
Defines the linear algebra or vector space interface.