ROL
ROL_ScalarLinearConstraint.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_AFFINE_HYPERPLANE_EQUALITY_CONSTRAINT_H
11 #define ROL_AFFINE_HYPERPLANE_EQUALITY_CONSTRAINT_H
12 
13 #include "ROL_Vector.hpp"
14 #include "ROL_SingletonVector.hpp"
15 #include "ROL_Constraint.hpp"
16 
17 #include <vector>
43 namespace ROL {
44 
45 template<typename Real>
46 class ScalarLinearConstraint : public Constraint<Real> {
47 private:
48  const Ptr<const Vector<Real>> a_;
49  const Real b_;
50 
51 public:
52  ScalarLinearConstraint(const Ptr<const Vector<Real>> &a,
53  const Real b);
54 
55  void value(Vector<Real> &c, const Vector<Real> &x, Real &tol) override;
56  void applyJacobian(Vector<Real> &jv, const Vector<Real> &v,
57  const Vector<Real> &x, Real &tol) override;
59  const Vector<Real> &x, Real &tol) override;
60  void applyAdjointHessian(Vector<Real> &ahuv, const Vector<Real> &u,
61  const Vector<Real> &v, const Vector<Real> &x,
62  Real &tol) override;
63  std::vector<Real> solveAugmentedSystem(Vector<Real> &v1, Vector<Real> &v2,
64  const Vector<Real> &b1, const Vector<Real> &b2,
65  const Vector<Real> &x, Real &tol) override;
66 
67 }; // class ScalarLinearConstraint
68 
69 } // namespace ROL
70 
72 
73 #endif
void value(Vector< Real > &c, const Vector< Real > &x, Real &tol) override
Evaluate the constraint operator at .
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 ...
Defines the linear algebra or vector space interface.
Definition: ROL_Vector.hpp:46
This equality constraint defines an affine hyperplane.
const Ptr< const Vector< Real > > a_
Dual vector defining hyperplane.
ScalarLinearConstraint(const Ptr< const Vector< Real >> &a, const Real b)
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 .
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 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.