44#ifndef ROL_BINARY_CONSTRAINT_H
45#define ROL_BINARY_CONSTRAINT_H
60template<
typename Real>
63 const Ptr<const Vector<Real>>
lo_;
64 const Ptr<const Vector<Real>>
up_;
68 class BoundsCheck :
public Elementwise::BinaryFunction<Real> {
75 Real
apply(
const Real &dl,
const Real &du )
const {
76 const Real
zero(0), one(1), two(2);
77 if( dl < ROL_INF<Real>() ) {
78 if( du < ROL_INF<Real>() ) {
80 case 0:
return dl*du;
break;
81 case 1:
return du-dl;
break;
82 case 2:
return -two;
break;
83 default:
return zero;
break;
88 case 0:
return dl;
break;
89 case 1:
return one;
break;
90 case 2:
return zero;
break;
91 default:
return zero;
break;
96 if( du <ROL_INF<Real>() ) {
98 case 0:
return du;
break;
99 case 1:
return -one;
break;
100 case 2:
return zero;
break;
101 default:
return zero;
break;
Objective_SerialSimOpt(const Ptr< Obj > &obj, const V &ui) z0 zero)()
Real apply(const Real &dl, const Real &du) const
Implements an equality constraint function that evaluates to zero on the surface of a bounded paralle...
const Ptr< const Vector< Real > > lo_
void value(Vector< Real > &c, const Vector< Real > &x, Real &tol) override
Evaluate the constraint operator at .
BinaryConstraint(const ROL::Ptr< const Vector< Real > > &lo, const ROL::Ptr< const Vector< Real > > &up, Real gamma)
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 .
void setPenalty(Real gamma)
void applyJacobian(Vector< Real > &jv, const Vector< Real > &v, const Vector< Real > &x, Real &tol) override
Apply the constraint Jacobian at , , to vector .
const Ptr< const Vector< Real > > up_
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 ,...
Provides the interface to apply upper and lower bound constraints.
Defines the general constraint operator interface.
Defines the linear algebra or vector space interface.