44 #ifndef ROL_BINARY_CONSTRAINT_H
45 #define ROL_BINARY_CONSTRAINT_H
68 const ROL::Ptr<const V>
lo_;
69 const ROL::Ptr<const V>
up_;
79 class BoundsCheck :
public Elementwise::BinaryFunction<Real> {
89 Real
apply(
const Real &dl,
const Real &du )
const {
91 if( dl < ROL_INF<Real>() ) {
92 if( du < ROL_INF<Real>() ) {
94 case 0:
return dl*du;
break;
95 case 1:
return du-dl;
break;
96 case 2:
return -2.0;
break;
97 default:
return 0.0;
break;
102 case 0:
return dl;
break;
103 case 1:
return 1.0;
break;
104 case 2:
return 0.0;
break;
105 default:
return 0.0;
break;
110 if( du <ROL_INF<Real>() ) {
112 case 0:
return du;
break;
113 case 1:
return -1.0;
break;
114 case 2:
return 0.0;
break;
115 default:
return 0.0;
break;
175 Elementwise::Multiply<Real> mult;
202 Elementwise::Multiply<Real> mult;
227 #endif // ROL_BINARY_CONSTRAINT_H
virtual void scale(const Real alpha)=0
Compute where .
const ROL::Ptr< const V > lo_
Implements an equality constraint function that evaluates to zero on the surface of a bounded paralle...
void setPenalty(Real gamma)
const ROL::Ptr< const V > up_
virtual void axpy(const Real alpha, const Vector &x)
Compute where .
virtual void applyBinary(const Elementwise::BinaryFunction< Real > &f, const Vector &x)
BinaryConstraint(const ROL::Ptr< const BoundConstraint< Real >> &bnd, Real gamma)
void applyAdjointJacobian(V &ajv, const V &v, const V &x, Real &tol)
Apply the adjoint of the the constraint Jacobian at , , to vector .
Defines the linear algebra or vector space interface.
void value(V &c, const V &x, Real &tol)
Evaluate constraint .
Provides the interface to apply upper and lower bound constraints.
void applyAdjointHessian(V &ahuv, const V &u, const V &v, const V &x, Real &tol)
virtual void set(const Vector &x)
Set where .
void applyJacobian(V &jv, const V &v, const V &x, Real &tol)
BinaryConstraint(const ROL::Ptr< const V > &lo, const ROL::Ptr< const V > &up, Real gamma)
BinaryConstraint(const BoundConstraint< Real > &bnd, Real gamma)
Real apply(const Real &dl, const Real &du) const
Defines the general constraint operator interface.