44 #ifndef ROL_OBJECTIVE_H 45 #define ROL_OBJECTIVE_H 142 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
143 ">>> ERROR (ROL::Objective): invHessVec not implemented!");
181 const bool printToStream =
true,
182 std::ostream & outStream = std::cout,
184 const int order = 1 ) {
215 const bool printToStream =
true,
216 std::ostream & outStream = std::cout,
218 const int order = 1 );
243 const std::vector<Real> &steps,
244 const bool printToStream =
true,
245 std::ostream & outStream = std::cout,
246 const int order = 1 ) {
278 const std::vector<Real> &steps,
279 const bool printToStream =
true,
280 std::ostream & outStream = std::cout,
281 const int order = 1 );
305 const bool printToStream =
true,
306 std::ostream & outStream = std::cout,
308 const int order = 1 ) {
310 return checkHessVec(x, x.
dual(), v, printToStream, outStream, numSteps, order);
338 const bool printToStream =
true,
339 std::ostream & outStream = std::cout,
341 const int order = 1) ;
366 const std::vector<Real> &steps,
367 const bool printToStream =
true,
368 std::ostream & outStream = std::cout,
369 const int order = 1 ) {
371 return checkHessVec(x, x, v, steps, printToStream, outStream, order);
399 const std::vector<Real> &steps,
400 const bool printToStream =
true,
401 std::ostream & outStream = std::cout,
402 const int order = 1) ;
422 const bool printToStream =
true,
423 std::ostream & outStream = std::cout ) {
425 return checkHessSym(x, x, v, w, printToStream, outStream);
448 const bool printToStream =
true,
449 std::ostream & outStream = std::cout );
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.
Defines the linear algebra or vector space interface.
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.
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 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.
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.