10 #ifndef ROL_OBJECTIVE_H
11 #define ROL_OBJECTIVE_H
43 template<
typename Real>
136 ROL_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
137 ">>> ERROR (ROL::Objective): invHessVec not implemented!");
160 ROL_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
161 ">>> ERROR (ROL::Objective): prox not implemented!");
186 const bool printToStream =
true,
187 std::ostream & outStream = std::cout,
189 const int order = 1 ) {
218 const bool printToStream =
true,
219 std::ostream & outStream = std::cout,
221 const int order = 1 );
246 const std::vector<Real> &steps,
247 const bool printToStream =
true,
248 std::ostream & outStream = std::cout,
249 const int order = 1 ) {
281 const std::vector<Real> &steps,
282 const bool printToStream =
true,
283 std::ostream & outStream = std::cout,
284 const int order = 1 );
308 const bool printToStream =
true,
309 std::ostream & outStream = std::cout,
311 const int order = 1 ) {
313 return checkHessVec(x, x.
dual(), v, printToStream, outStream, numSteps, order);
341 const bool printToStream =
true,
342 std::ostream & outStream = std::cout,
344 const int order = 1) ;
369 const std::vector<Real> &steps,
370 const bool printToStream =
true,
371 std::ostream & outStream = std::cout,
372 const int order = 1 ) {
374 return checkHessVec(x, x.
dual(), v, steps, printToStream, outStream, order);
402 const std::vector<Real> &steps,
403 const bool printToStream =
true,
404 std::ostream & outStream = std::cout,
405 const int order = 1) ;
425 const bool printToStream =
true,
426 std::ostream & outStream = std::cout ) {
451 const bool printToStream =
true,
452 std::ostream & outStream = std::cout );
465 param_.assign(param.begin(),param.end());
Ptr< Vector< Real > > dual_
Provides the interface to evaluate objective functions.
virtual const Vector & dual() const
Return dual representation of , for example, the result of applying a Riesz map, or change of basis...
virtual Real value(const Vector< Real > &x, Real &tol)=0
Compute value.
virtual Real dirDeriv(const Vector< Real > &x, const Vector< Real > &d, Real &tol)
Compute directional derivative.
virtual void hessVec(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
Apply Hessian approximation to vector.
Contains definitions of custom data types in ROL.
virtual void precond(Vector< Real > &Pv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
Apply preconditioner to vector.
virtual std::vector< std::vector< Real > > checkGradient(const Vector< Real > &x, const Vector< Real > &d, const std::vector< Real > &steps, const bool printToStream=true, std::ostream &outStream=std::cout, const int order=1)
Finite-difference gradient check with specified step sizes.
virtual void prox(Vector< Real > &Pv, const Vector< Real > &v, Real t, Real &tol)
Defines the linear algebra or vector space interface.
virtual void update(const Vector< Real > &x, UpdateType type, int iter=-1)
Update objective function.
std::vector< Real > param_
virtual std::vector< std::vector< Real > > checkGradient(const Vector< Real > &x, const Vector< Real > &d, const bool printToStream=true, std::ostream &outStream=std::cout, const int numSteps=ROL_NUM_CHECKDERIV_STEPS, const int order=1)
Finite-difference gradient check.
virtual void gradient(Vector< Real > &g, const Vector< Real > &x, Real &tol)
Compute gradient.
virtual void invHessVec(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
Apply inverse Hessian approximation to vector.
Ptr< Vector< Real > > prim_
Ptr< Vector< Real > > basis_
virtual std::vector< std::vector< Real > > checkHessVec(const Vector< Real > &x, const Vector< Real > &v, const std::vector< Real > &steps, const bool printToStream=true, std::ostream &outStream=std::cout, const int order=1)
Finite-difference Hessian-applied-to-vector check with specified step sizes.
#define ROL_NUM_CHECKDERIV_STEPS
Number of steps for derivative checks.
virtual void setParameter(const std::vector< Real > ¶m)
virtual std::vector< std::vector< Real > > checkHessVec(const Vector< Real > &x, const Vector< Real > &v, const bool printToStream=true, std::ostream &outStream=std::cout, const int numSteps=ROL_NUM_CHECKDERIV_STEPS, const int order=1)
Finite-difference Hessian-applied-to-vector check.
virtual void set(const Vector &x)
Set where .
virtual void update(const Vector< Real > &x, bool flag=true, int iter=-1)
Update objective function.
const std::vector< Real > getParameter(void) const
virtual std::vector< Real > checkHessSym(const Vector< Real > &x, const Vector< Real > &v, const Vector< Real > &w, const bool printToStream=true, std::ostream &outStream=std::cout)
Hessian symmetry check.