ROL
ROL_ReducedLinearConstraint_Def.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_REDUCED_LINEAR_CONSTRAINT_DEF_H
11 #define ROL_REDUCED_LINEAR_CONSTRAINT_DEF_H
12 
13 namespace ROL {
14 
15 template<typename Real>
17  const Ptr<BoundConstraint<Real>> &bnd,
18  const Ptr<const Vector<Real>> &x)
19  : con_(con), bnd_(bnd), x_(x), prim_(x->clone()) {}
20 
21 template<typename Real>
23  x_ = x;
24 }
25 
26 template<typename Real>
28  const Real zero(0);
29  prim_->set(x);
30  bnd_->pruneActive(*prim_,*x_,zero);
31  con_->value(c,*prim_,tol);
32 }
33 
34 template<typename Real>
36  const Vector<Real> &v,
37  const Vector<Real> &x, Real &tol) {
38  const Real zero(0);
39  prim_->set(v);
40  bnd_->pruneActive(*prim_,*x_,zero);
41  con_->applyJacobian(jv,*prim_,x,tol);
42 }
43 
44 template<typename Real>
46  const Vector<Real> &v,
47  const Vector<Real> &x, Real &tol) {
48  const Real zero(0);
49  con_->applyAdjointJacobian(jv,v,x,tol);
50  bnd_->pruneActive(jv,*x_,zero);
51 }
52 
53 template<typename Real>
55  const Vector<Real> &u,
56  const Vector<Real> &v,
57  const Vector<Real> &x, Real &tol) {
58  ahuv.zero();
59 }
60 
61 } // namespace ROL
62 
63 #endif // ROL_REDUCED_LINEAR_CONSTRAINT_H
void value(Vector< Real > &c, const Vector< Real > &x, Real &tol) override
Evaluate the constraint operator at .
virtual void zero()
Set to zero vector.
Definition: ROL_Vector.hpp:133
Defines the linear algebra or vector space interface.
Definition: ROL_Vector.hpp:46
Objective_SerialSimOpt(const Ptr< Obj > &obj, const V &ui) z0_ zero()
void setX(const Ptr< const Vector< Real >> &x)
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 .
Provides the interface to apply upper and lower bound constraints.
void applyAdjointJacobian(Vector< Real > &jv, const Vector< Real > &v, const Vector< Real > &x, Real &tol) override
Apply the adjoint of the the constraint Jacobian at , , to vector .
ReducedLinearConstraint(const Ptr< Constraint< Real >> &con, const Ptr< BoundConstraint< Real >> &bnd, const Ptr< const Vector< Real >> &x)
Defines the general constraint operator interface.