10 #ifndef ROL_NONLINEARLEASTSQUARESOBJECTIVE_DEF_H
11 #define ROL_NONLINEARLEASTSQUARESOBJECTIVE_DEF_H
15 template<
typename Real>
20 : con_(con), GaussNewtonHessian_(GNH) {
23 x_ = optvec.
dual().clone();
26 template<
typename Real>
28 Real tol = std::sqrt(ROL_EPSILON<Real>());
29 con_->update(x,type,iter);
30 con_->value(*c1_,x,tol);
31 c1dual_->set(c1_->dual());
34 template<
typename Real>
36 Real tol = std::sqrt(ROL_EPSILON<Real>());
37 con_->update(x,flag,iter);
38 con_->value(*c1_,x,tol);
39 c1dual_->set(c1_->dual());
42 template<
typename Real>
45 return half*(c1_->dot(*c1_));
48 template<
typename Real>
50 con_->applyAdjointJacobian(g,*c1dual_,x,tol);
53 template<
typename Real>
55 con_->applyJacobian(*c2_,v,x,tol);
56 con_->applyAdjointJacobian(hv,c2_->
dual(),x,tol);
57 if ( !GaussNewtonHessian_ ) {
58 con_->applyAdjointHessian(*x_,*c1dual_,v,x,tol);
63 template<
typename Real>
65 con_->applyPreconditioner(Pv,v,x,x.
dual(),tol);
68 template<
typename Real>
71 con_->setParameter(param);
virtual const Vector & dual() const
Return dual representation of , for example, the result of applying a Riesz map, or change of basis...
Ptr< Vector< Real > > c1_
Real value(const Vector< Real > &x, Real &tol) override
Compute value.
virtual ROL::Ptr< Vector > clone() const =0
Clone to make a new (uninitialized) vector.
virtual void plus(const Vector &x)=0
Compute , where .
void gradient(Vector< Real > &g, const Vector< Real > &x, Real &tol) override
Compute gradient.
void precond(Vector< Real > &Pv, const Vector< Real > &v, const Vector< Real > &x, Real &tol) override
Apply preconditioner to vector.
Defines the linear algebra or vector space interface.
Ptr< Vector< Real > > c2_
void setParameter(const std::vector< Real > ¶m) override
void update(const Vector< Real > &x, UpdateType type, int iter=-1) override
Update objective function.
virtual void setParameter(const std::vector< Real > ¶m)
Ptr< Vector< Real > > c1dual_
NonlinearLeastSquaresObjective(const Ptr< Constraint< Real > > &con, const Vector< Real > &optvec, const Vector< Real > &convec, const bool GNH=false)
Constructor.
void hessVec(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, Real &tol) override
Apply Hessian approximation to vector.
Defines the general constraint operator interface.