44 #ifndef ROL_NONLINEARLEASTSQUARESOBJECTIVE_DEF_H
45 #define ROL_NONLINEARLEASTSQUARESOBJECTIVE_DEF_H
49 template<
typename Real>
54 : con_(con), GaussNewtonHessian_(GNH) {
57 x_ = optvec.
dual().clone();
60 template<
typename Real>
62 Real tol = std::sqrt(ROL_EPSILON<Real>());
63 con_->update(x,type,iter);
64 con_->value(*c1_,x,tol);
65 c1dual_->set(c1_->dual());
68 template<
typename Real>
70 Real tol = std::sqrt(ROL_EPSILON<Real>());
71 con_->update(x,flag,iter);
72 con_->value(*c1_,x,tol);
73 c1dual_->set(c1_->dual());
76 template<
typename Real>
79 return half*(c1_->dot(*c1_));
82 template<
typename Real>
84 con_->applyAdjointJacobian(g,*c1dual_,x,tol);
87 template<
typename Real>
89 con_->applyJacobian(*c2_,v,x,tol);
90 con_->applyAdjointJacobian(hv,c2_->
dual(),x,tol);
91 if ( !GaussNewtonHessian_ ) {
92 con_->applyAdjointHessian(*x_,*c1dual_,v,x,tol);
97 template<
typename Real>
99 con_->applyPreconditioner(Pv,v,x,x.
dual(),tol);
102 template<
typename Real>
105 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.