44 #ifndef ROL_OBJECTIVE_H
45 #define ROL_OBJECTIVE_H
150 ROL_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
151 ">>> ERROR (ROL::Objective): invHessVec not implemented!");
191 const bool printToStream =
true,
192 std::ostream & outStream = std::cout,
194 const int order = 1 ) {
223 const bool printToStream =
true,
224 std::ostream & outStream = std::cout,
226 const int order = 1 );
251 const std::vector<Real> &steps,
252 const bool printToStream =
true,
253 std::ostream & outStream = std::cout,
254 const int order = 1 ) {
286 const std::vector<Real> &steps,
287 const bool printToStream =
true,
288 std::ostream & outStream = std::cout,
289 const int order = 1 );
313 const bool printToStream =
true,
314 std::ostream & outStream = std::cout,
316 const int order = 1 ) {
318 return checkHessVec(x, x.
dual(), v, printToStream, outStream, numSteps, order);
346 const bool printToStream =
true,
347 std::ostream & outStream = std::cout,
349 const int order = 1) ;
374 const std::vector<Real> &steps,
375 const bool printToStream =
true,
376 std::ostream & outStream = std::cout,
377 const int order = 1 ) {
379 return checkHessVec(x, x.
dual(), v, steps, printToStream, outStream, order);
407 const std::vector<Real> &steps,
408 const bool printToStream =
true,
409 std::ostream & outStream = std::cout,
410 const int order = 1) ;
430 const bool printToStream =
true,
431 std::ostream & outStream = std::cout ) {
456 const bool printToStream =
true,
457 std::ostream & outStream = std::cout );
470 param_.assign(param.begin(),param.end());
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.
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.
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.