44 #ifndef ROL_AFFINE_HYPERPLANE_EQUALITY_CONSTRAINT_H
45 #define ROL_AFFINE_HYPERPLANE_EQUALITY_CONSTRAINT_H
82 const Teuchos::RCP<Vector<Real> >
a_;
92 std::vector<Real> &cp = *(cc.
getVector());
99 std::vector<Real> &jp = *(jc.
getVector());
100 jp[0] =
a_->dot(v.
dual());
106 const std::vector<Real> &vp = *(vc.
getVector());
121 std::vector<Real> &v2p = *(v2c.
getVector());
123 const std::vector<Real> &b2p = *(b2c.
getVector());
125 v2p[0] = (
a_->dot(b1.
dual()) - b2p[0])/
a_->dot(*
a_);
127 v1.
axpy(-v2p[0],
a_->dual());
129 std::vector<Real> out;
void applyJacobian(Vector< Real > &jv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
Apply the constraint Jacobian at , , to vector .
virtual const Vector & dual() const
Return dual representation of , for example, the result of applying a Riesz map, or change of basis...
std::vector< Real > solveAugmentedSystem(Vector< Real > &v1, Vector< Real > &v2, const Vector< Real > &b1, const Vector< Real > &b2, const Vector< Real > &x, Real &tol)
Approximately solves the augmented system where , , , , is an identity or Riesz operator...
virtual void scale(const Real alpha)=0
Compute where .
Teuchos::RCP< const std::vector< Element > > getVector() const
virtual void axpy(const Real alpha, const Vector &x)
Compute where .
This equality constraint defines an affine hyperplane.
void applyAdjointHessian(Vector< Real > &ahuv, const Vector< Real > &u, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
Apply the derivative of the adjoint of the constraint Jacobian at to vector in direction ...
virtual void zero()
Set to zero vector.
Defines the linear algebra or vector space interface.
Defines the equality constraint operator interface.
void applyAdjointJacobian(Vector< Real > &ajv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
Apply the adjoint of the the constraint Jacobian at , , to vector .
const Real b_
Affine shift.
virtual void set(const Vector &x)
Set where .
ScalarLinearEqualityConstraint(const Teuchos::RCP< Vector< Real > > &a, const Real b)
void value(Vector< Real > &c, const Vector< Real > &x, Real &tol)
Evaluate the constraint operator at .
const Teuchos::RCP< Vector< Real > > a_
Dual vector defining hyperplane.