10 #ifndef ROL_BINARY_CONSTRAINT_H
11 #define ROL_BINARY_CONSTRAINT_H
26 template<
typename Real>
29 const Ptr<const Vector<Real>>
lo_;
30 const Ptr<const Vector<Real>>
up_;
34 class BoundsCheck :
public Elementwise::BinaryFunction<Real> {
41 Real
apply(
const Real &dl,
const Real &du )
const {
42 const Real
zero(0), one(1), two(2);
43 if( dl < ROL_INF<Real>() ) {
44 if( du < ROL_INF<Real>() ) {
46 case 0:
return dl*du;
break;
47 case 1:
return du-dl;
break;
48 case 2:
return -two;
break;
49 default:
return zero;
break;
54 case 0:
return dl;
break;
55 case 1:
return one;
break;
56 case 2:
return zero;
break;
57 default:
return zero;
break;
62 if( du <ROL_INF<Real>() ) {
64 case 0:
return du;
break;
65 case 1:
return -one;
break;
66 case 2:
return zero;
break;
67 default:
return zero;
break;
96 #endif // ROL_BINARY_CONSTRAINT_H
Implements an equality constraint function that evaluates to zero on the surface of a bounded paralle...
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 setPenalty(Real gamma)
const Ptr< const Vector< Real > > up_
const Ptr< const Vector< Real > > lo_
Defines the linear algebra or vector space interface.
void applyJacobian(Vector< Real > &jv, const Vector< Real > &v, const Vector< Real > &x, Real &tol) override
Apply the constraint Jacobian at , , to vector .
Objective_SerialSimOpt(const Ptr< Obj > &obj, const V &ui) z0_ zero()
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 .
Provides the interface to apply upper and lower bound constraints.
Real apply(const Real &dl, const Real &du) const
void value(Vector< Real > &c, const Vector< Real > &x, Real &tol) override
Evaluate the constraint operator at .
Defines the general constraint operator interface.