44#ifndef ROL_ELASTICLINEARCONSTRAINT_DEF_H
45#define ROL_ELASTICLINEARCONSTRAINT_DEF_H
49template<
typename Real>
53 : con_(con), x_(x->clone()), c_(c->clone()), tmp_(x->clone()) {
57template<
typename Real>
60template<
typename Real>
63template<
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);
75template<
typename Real>
80 con_->applyJacobian(jv,*vs,*x_,tol);
82 jv.
axpy(
static_cast<Real
>(-1),*vv);
85template<
typename Real>
90 con_->applyAdjointJacobian(*as,v,*x_,tol);
92 av->set(v.
dual()); av->scale(
static_cast<Real
>(-1));
95template<
typename Real>
100 con_->applyAdjointJacobian(*as,v,*x_,tol);
102 av->set(dualv); av->scale(
static_cast<Real
>(-1));
105template<
typename Real>
110template<
typename Real>
113 Real tol = std::sqrt(ROL_EPSILON<Real>());
114 con_->value(*c_,*x_,tol);
Defines the general constraint operator interface.
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 .
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 value(Vector< Real > &c, const Vector< Real > &x, Real &tol) override
Evaluate the constraint operator at .
void update(const Vector< Real > &x, UpdateType type, int iter=-1) override
Update constraint function.
void applyJacobian(Vector< Real > &jv, const Vector< Real > &v, const Vector< Real > &x, Real &tol) override
Apply the constraint Jacobian at , , to vector .
Defines the linear algebra of vector space on a generic partitioned vector.
Defines the linear algebra or vector space interface.
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 zero()
Set to zero vector.
virtual void axpy(const Real alpha, const Vector &x)
Compute where .