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!");
168 ROL_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
169 ">>> ERROR (ROL::Objective): prox not implemented!");
206 const bool printToStream =
true,
207 std::ostream & outStream = std::cout,
209 const int order = 1 ) {
238 const bool printToStream =
true,
239 std::ostream & outStream = std::cout,
241 const int order = 1 );
266 const std::vector<Real> &steps,
267 const bool printToStream =
true,
268 std::ostream & outStream = std::cout,
269 const int order = 1 ) {
301 const std::vector<Real> &steps,
302 const bool printToStream =
true,
303 std::ostream & outStream = std::cout,
304 const int order = 1 );
328 const bool printToStream =
true,
329 std::ostream & outStream = std::cout,
331 const int order = 1 ) {
333 return checkHessVec(x, x.
dual(), v, printToStream, outStream, numSteps, order);
361 const bool printToStream =
true,
362 std::ostream & outStream = std::cout,
364 const int order = 1) ;
389 const std::vector<Real> &steps,
390 const bool printToStream =
true,
391 std::ostream & outStream = std::cout,
392 const int order = 1 ) {
394 return checkHessVec(x, x.
dual(), v, steps, printToStream, outStream, order);
422 const std::vector<Real> &steps,
423 const bool printToStream =
true,
424 std::ostream & outStream = std::cout,
425 const int order = 1) ;
445 const bool printToStream =
true,
446 std::ostream & outStream = std::cout ) {
471 const bool printToStream =
true,
472 std::ostream & outStream = std::cout );
495 bool printToStream =
true,
496 std::ostream &outStream = std::cout,
510 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 std::vector< std::vector< Real > > checkProxJacVec(const Vector< Real > &x, const Vector< Real > &v, Real t=Real(1), bool printToStream=true, std::ostream &outStream=std::cout, int numSteps=ROL_NUM_CHECKDERIV_STEPS)
Finite-difference proximity operator Jacobian-applied-to-vector check.
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)
Compute the proximity operator.
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 proxJacVec(Vector< Real > &Jv, const Vector< Real > &v, const Vector< Real > &x, Real t, Real &tol)
Apply the Jacobian of the proximity operator.
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.