ROL
ROL_NonlinearLeastSquaresObjective.hpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Rapid Optimization Library (ROL) Package
4 //
5 // Copyright 2014 NTESS and the ROL contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 #ifndef ROL_NONLINEARLEASTSQUARESOBJECTIVE_H
11 #define ROL_NONLINEARLEASTSQUARESOBJECTIVE_H
12 
13 #include "ROL_Objective.hpp"
14 #include "ROL_Constraint.hpp"
15 #include "ROL_Types.hpp"
16 
36 namespace ROL {
37 
38 template<typename Real>
40 private:
41  const Ptr<Constraint<Real> > con_;
42  const bool GaussNewtonHessian_;
43 
44  Ptr<Vector<Real> > c1_, c2_, c1dual_, x_;
45 
46 public:
55  const Vector<Real> &optvec,
56  const Vector<Real> &convec,
57  const bool GNH = false);
58 
59  void update( const Vector<Real> &x, UpdateType type, int iter = -1 ) override;
60  void update( const Vector<Real> &x, bool flag = true, int iter = -1 ) override;
61  Real value( const Vector<Real> &x, Real &tol ) override;
62  void gradient( Vector<Real> &g, const Vector<Real> &x, Real &tol ) override;
63  void hessVec( Vector<Real> &hv, const Vector<Real> &v, const Vector<Real> &x, Real &tol ) override;
64  void precond( Vector<Real> &Pv, const Vector<Real> &v, const Vector<Real> &x, Real &tol ) override;
65 
66 // Definitions for parametrized (stochastic) equality constraints
67 public:
68  void setParameter(const std::vector<Real> &param) override;
69 };
70 
71 } // namespace ROL
72 
74 
75 #endif
Provides the interface to evaluate objective functions.
Real value(const Vector< Real > &x, Real &tol) override
Compute value.
void gradient(Vector< Real > &g, const Vector< Real > &x, Real &tol) override
Compute gradient.
Contains definitions of custom data types in ROL.
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.
Definition: ROL_Vector.hpp:46
void setParameter(const std::vector< Real > &param) override
void update(const Vector< Real > &x, UpdateType type, int iter=-1) override
Update objective function.
Provides the interface to evaluate nonlinear least squares objective functions.
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.