ROL
ROL_StdConstraint.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_STDEQUALITY_CONSTRAINT_H
11 #define ROL_STDEQUALITY_CONSTRAINT_H
12 
13 #include "ROL_Constraint.hpp"
14 #include "ROL_StdVector.hpp"
15 
22 namespace ROL {
23 
24 template<typename Real>
25 class StdConstraint : public virtual Constraint<Real> {
26 public:
27  virtual ~StdConstraint() {}
28 
30  void update( const Vector<Real> &x, bool flag = true, int iter = -1 ) override;
31  virtual void update( const std::vector<Real> &x, bool flag = true, int iter = -1 ) {}
32  void update( const Vector<Real> &x, UpdateType type, int iter = -1 ) override;
33  virtual void update( const std::vector<Real> &x, UpdateType type, int iter = -1 ) {}
34 
36  void value(Vector<Real> &c, const Vector<Real> &x, Real &tol) override;
37  virtual void value( std::vector<Real> &c, const std::vector<Real> &x, Real &tol ) = 0;
38 
40  void applyJacobian(Vector<Real> &jv, const Vector<Real> &v,
41  const Vector<Real> &x, Real &tol) override;
42  virtual void applyJacobian( std::vector<Real> &jv, const std::vector<Real> &v,
43  const std::vector<Real> &x, Real &tol );
44 
47  const Vector<Real> &x, Real &tol) override;
48  virtual void applyAdjointJacobian( std::vector<Real> &ajv, const std::vector<Real> &v,
49  const std::vector<Real> &x, Real &tol );
50 
52  void applyAdjointHessian(Vector<Real> &ahuv, const Vector<Real> &u, const Vector<Real> &v,
53  const Vector<Real> &x, Real &tol) override;
54  virtual void applyAdjointHessian( std::vector<Real> &ahuv, const std::vector<Real> &u,
55  const std::vector<Real> &v, const std::vector<Real> &x,
56  Real &tol );
57 
59  std::vector<Real> solveAugmentedSystem(Vector<Real> &v1, Vector<Real> &v2,
60  const Vector<Real> &b1, const Vector<Real> &b2,
61  const Vector<Real> &x, Real &tol) override;
62  virtual std::vector<Real> solveAugmentedSystem( std::vector<Real> &v1, std::vector<Real> &v2,
63  const std::vector<Real> &b1, const std::vector<Real> &b2,
64  const std::vector<Real> &x, Real tol );
65 
67  void applyPreconditioner(Vector<Real> &pv, const Vector<Real> &v, const Vector<Real> &x,
68  const Vector<Real> &g, Real &tol) override;
69  virtual void applyPreconditioner( std::vector<Real> &pv, const std::vector<Real> &v,
70  const std::vector<Real> &x, const std::vector<Real> &g, Real &tol );
71 
72 }; // class StdConstraint
73 
74 } // namespace ROL
75 
77 
78 #endif
Defines the equality constraint operator interface for StdVectors.
Defines the linear algebra or vector space interface.
Definition: ROL_Vector.hpp:46
void value(Vector< Real > &c, const Vector< Real > &x, Real &tol) override
Evaluate the constraint operator at .
virtual void update(const std::vector< Real > &x, UpdateType type, int iter=-1)
std::vector< Real > solveAugmentedSystem(Vector< Real > &v1, Vector< Real > &v2, const Vector< Real > &b1, const Vector< Real > &b2, const Vector< Real > &x, Real &tol) override
Approximately solves the augmented system where , , , , is an identity or Riesz operator...
void update(const Vector< Real > &x, bool flag=true, int iter=-1) override
Update constraint functions. x is the optimization variable, flag = true if optimization variable is ...
virtual void update(const std::vector< Real > &x, bool flag=true, int iter=-1)
void applyPreconditioner(Vector< Real > &pv, const Vector< Real > &v, const Vector< Real > &x, const Vector< Real > &g, Real &tol) override
Apply a constraint preconditioner at , , to vector . Ideally, this preconditioner satisfies the follo...
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 applyJacobian(Vector< Real > &jv, const Vector< Real > &v, const Vector< Real > &x, Real &tol) override
Apply the constraint Jacobian at , , to vector .
Defines the general constraint operator interface.
void applyAdjointJacobian(Vector< Real > &ajv, const Vector< Real > &v, const Vector< Real > &x, Real &tol) override
Apply the adjoint of the the constraint Jacobian at , , to vector .