10 #ifndef ROL_ELASTICLINEARCONSTRAINT_DEF_H
11 #define ROL_ELASTICLINEARCONSTRAINT_DEF_H
15 template<
typename Real>
19 : con_(con), x_(x->clone()), c_(c->clone()), tmp_(x->clone()) {
23 template<
typename Real>
26 template<
typename Real>
29 template<
typename Real>
34 tmp_->set(*xs); tmp_->axpy(static_cast<Real>(-1),*x_);
35 con_->applyJacobian(c,*tmp_,*x_,tol);
38 c.
axpy(static_cast<Real>(-1),*xv);
41 template<
typename Real>
46 con_->applyJacobian(jv,*vs,*x_,tol);
48 jv.
axpy(static_cast<Real>(-1),*vv);
51 template<
typename Real>
56 con_->applyAdjointJacobian(*as,v,*x_,tol);
58 av->set(v.
dual()); av->scale(static_cast<Real>(-1));
61 template<
typename Real>
66 con_->applyAdjointJacobian(*as,v,*x_,tol);
68 av->set(dualv); av->scale(static_cast<Real>(-1));
71 template<
typename Real>
76 template<
typename Real>
79 Real tol = std::sqrt(ROL_EPSILON<Real>());
80 con_->value(*c_,*x_,tol);
virtual const Vector & dual() const
Return dual representation of , for example, the result of applying a Riesz map, or change of basis...
virtual void plus(const Vector &x)=0
Compute , where .
virtual void axpy(const Real alpha, const Vector &x)
Compute where .
Defines the linear algebra of vector space on a generic partitioned vector.
void update(const Vector< Real > &x, UpdateType type, int iter=-1) override
Update constraint function.
virtual void zero()
Set to zero vector.
Defines the linear algebra or vector space interface.
void value(Vector< Real > &c, const Vector< Real > &x, Real &tol) override
Evaluate the constraint operator at .
ElasticLinearConstraint(const Ptr< const Vector< Real >> &x, const Ptr< Constraint< Real >> &con, const Ptr< const Vector< Real >> &c)
void setAnchor(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 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 .
Defines the general constraint operator interface.
void applyJacobian(Vector< Real > &jv, const Vector< Real > &v, const Vector< Real > &x, Real &tol) override
Apply the constraint Jacobian at , , to vector .