44 #ifndef ROL_ELASTICLINEARCONSTRAINT_DEF_H
45 #define ROL_ELASTICLINEARCONSTRAINT_DEF_H
49 template<
typename Real>
53 : con_(con), x_(x->clone()), c_(c->clone()), tmp_(x->clone()) {
57 template<
typename Real>
60 template<
typename Real>
63 template<
typename Real>
68 tmp_->set(*xs); tmp_->axpy(static_cast<Real>(-1),*x_);
69 con_->applyJacobian(c,*tmp_,*x_,tol);
72 c.
axpy(static_cast<Real>(-1),*xv);
75 template<
typename Real>
80 con_->applyJacobian(jv,*vs,*x_,tol);
82 jv.
axpy(static_cast<Real>(-1),*vv);
85 template<
typename Real>
90 con_->applyAdjointJacobian(*as,v,*x_,tol);
92 av->set(v.
dual()); av->scale(static_cast<Real>(-1));
95 template<
typename Real>
100 con_->applyAdjointJacobian(*as,v,*x_,tol);
102 av->set(dualv); av->scale(static_cast<Real>(-1));
105 template<
typename Real>
110 template<
typename Real>
113 Real tol = std::sqrt(ROL_EPSILON<Real>());
114 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 .