ROL
|
Evaluates ROL::DynamicObjective over a sequential set of time intervals. More...
#include <ROL_SerialObjective.hpp>
Public Types | |
using | size_type = typename std::vector< Real >::size_type |
Public Types inherited from ROL::SerialFunction< Real > | |
using | size_type = typename std::vector< Real >::size_type |
Public Member Functions | |
SerialObjective (const Ptr< DynamicObjective< Real >> &obj, const Vector< Real > &u_initial, const TimeStampsPtr< Real > timeStampsPtr) | |
virtual Real | value (const Vector< Real > &u, const Vector< Real > &z, Real &tol) override |
Compute value. More... | |
virtual void | gradient_1 (Vector< Real > &g, const Vector< Real > &u, const Vector< Real > &z, Real &tol) override |
Compute gradient with respect to first component. More... | |
virtual void | gradient_2 (Vector< Real > &g, const Vector< Real > &u, const Vector< Real > &z, Real &tol) override |
Compute gradient with respect to second component. More... | |
virtual void | hessVec_11 (Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &u, const Vector< Real > &z, Real &tol) override |
Apply Hessian approximation to vector. More... | |
virtual void | hessVec_12 (Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &u, const Vector< Real > &z, Real &tol) override |
virtual void | hessVec_21 (Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &u, const Vector< Real > &z, Real &tol) override |
virtual void | hessVec_22 (Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &u, const Vector< Real > &z, Real &tol) override |
Public Member Functions inherited from ROL::Objective_SimOpt< Real > | |
virtual void | update (const Vector< Real > &u, const Vector< Real > &z, bool flag=true, int iter=-1) |
Update objective function. u is an iterate, z is an iterate, flag = true if the iterate has changed, iter is the outer algorithm iterations count. More... | |
void | update (const Vector< Real > &x, bool flag=true, int iter=-1) |
Update objective function. More... | |
virtual void | update (const Vector< Real > &u, const Vector< Real > &z, UpdateType type, int iter=-1) |
void | update (const Vector< Real > &x, UpdateType type, int iter=-1) |
Update objective function. More... | |
Real | value (const Vector< Real > &x, Real &tol) |
Compute value. More... | |
void | gradient (Vector< Real > &g, const Vector< Real > &x, Real &tol) |
Compute gradient. More... | |
void | hessVec (Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, Real &tol) |
Apply Hessian approximation to vector. More... | |
std::vector< std::vector< Real > > | checkGradient_1 (const Vector< Real > &u, const Vector< Real > &z, const Vector< Real > &d, const bool printToStream=true, std::ostream &outStream=std::cout, const int numSteps=ROL_NUM_CHECKDERIV_STEPS, const int order=1) |
std::vector< std::vector< Real > > | checkGradient_1 (const Vector< Real > &u, const Vector< Real > &z, const Vector< Real > &g, const Vector< Real > &d, const bool printToStream, std::ostream &outStream, const int numSteps, const int order) |
std::vector< std::vector< Real > > | checkGradient_1 (const Vector< Real > &u, const Vector< Real > &z, const Vector< Real > &g, const Vector< Real > &d, const std::vector< Real > &steps, const bool printToStream, std::ostream &outStream, const int order) |
std::vector< std::vector< Real > > | checkGradient_2 (const Vector< Real > &u, const Vector< Real > &z, const Vector< Real > &d, const bool printToStream=true, std::ostream &outStream=std::cout, const int numSteps=ROL_NUM_CHECKDERIV_STEPS, const int order=1) |
std::vector< std::vector< Real > > | checkGradient_2 (const Vector< Real > &u, const Vector< Real > &z, const Vector< Real > &g, const Vector< Real > &d, const bool printToStream, std::ostream &outStream, const int numSteps, const int order) |
std::vector< std::vector< Real > > | checkGradient_2 (const Vector< Real > &u, const Vector< Real > &z, const Vector< Real > &g, const Vector< Real > &d, const std::vector< Real > &steps, const bool printToStream, std::ostream &outStream, const int order) |
std::vector< std::vector< Real > > | checkHessVec_11 (const Vector< Real > &u, const Vector< Real > &z, const Vector< Real > &v, const bool printToStream=true, std::ostream &outStream=std::cout, const int numSteps=ROL_NUM_CHECKDERIV_STEPS, const int order=1) |
std::vector< std::vector< Real > > | checkHessVec_11 (const Vector< Real > &u, const Vector< Real > &z, const Vector< Real > &v, const std::vector< Real > &steps, const bool printToStream=true, std::ostream &outStream=std::cout, const int order=1) |
std::vector< std::vector< Real > > | checkHessVec_11 (const Vector< Real > &u, const Vector< Real > &z, const Vector< Real > &hv, const Vector< Real > &v, const bool printToStream, std::ostream &outStream, const int numSteps, const int order) |
std::vector< std::vector< Real > > | checkHessVec_11 (const Vector< Real > &u, const Vector< Real > &z, const Vector< Real > &hv, const Vector< Real > &v, const std::vector< Real > &steps, const bool printToStream, std::ostream &outStream, const int order) |
std::vector< std::vector< Real > > | checkHessVec_12 (const Vector< Real > &u, const Vector< Real > &z, const Vector< Real > &v, const bool printToStream=true, std::ostream &outStream=std::cout, const int numSteps=ROL_NUM_CHECKDERIV_STEPS, const int order=1) |
std::vector< std::vector< Real > > | checkHessVec_12 (const Vector< Real > &u, const Vector< Real > &z, const Vector< Real > &v, const std::vector< Real > &steps, const bool printToStream=true, std::ostream &outStream=std::cout, const int order=1) |
std::vector< std::vector< Real > > | checkHessVec_12 (const Vector< Real > &u, const Vector< Real > &z, const Vector< Real > &hv, const Vector< Real > &v, const bool printToStream, std::ostream &outStream, const int numSteps, const int order) |
std::vector< std::vector< Real > > | checkHessVec_12 (const Vector< Real > &u, const Vector< Real > &z, const Vector< Real > &hv, const Vector< Real > &v, const std::vector< Real > &steps, const bool printToStream, std::ostream &outStream, const int order) |
std::vector< std::vector< Real > > | checkHessVec_21 (const Vector< Real > &u, const Vector< Real > &z, const Vector< Real > &v, const bool printToStream=true, std::ostream &outStream=std::cout, const int numSteps=ROL_NUM_CHECKDERIV_STEPS, const int order=1) |
std::vector< std::vector< Real > > | checkHessVec_21 (const Vector< Real > &u, const Vector< Real > &z, const Vector< Real > &v, const std::vector< Real > &steps, const bool printToStream=true, std::ostream &outStream=std::cout, const int order=1) |
std::vector< std::vector< Real > > | checkHessVec_21 (const Vector< Real > &u, const Vector< Real > &z, const Vector< Real > &hv, const Vector< Real > &v, const bool printToStream, std::ostream &outStream, const int numSteps, const int order) |
std::vector< std::vector< Real > > | checkHessVec_21 (const Vector< Real > &u, const Vector< Real > &z, const Vector< Real > &hv, const Vector< Real > &v, const std::vector< Real > &steps, const bool printToStream, std::ostream &outStream, const int order) |
std::vector< std::vector< Real > > | checkHessVec_22 (const Vector< Real > &u, const Vector< Real > &z, const Vector< Real > &v, const bool printToStream=true, std::ostream &outStream=std::cout, const int numSteps=ROL_NUM_CHECKDERIV_STEPS, const int order=1) |
std::vector< std::vector< Real > > | checkHessVec_22 (const Vector< Real > &u, const Vector< Real > &z, const Vector< Real > &v, const std::vector< Real > &steps, const bool printToStream=true, std::ostream &outStream=std::cout, const int order=1) |
std::vector< std::vector< Real > > | checkHessVec_22 (const Vector< Real > &u, const Vector< Real > &z, const Vector< Real > &hv, const Vector< Real > &v, const bool printToStream, std::ostream &outStream, const int numSteps, const int order) |
std::vector< std::vector< Real > > | checkHessVec_22 (const Vector< Real > &u, const Vector< Real > &z, const Vector< Real > &hv, const Vector< Real > &v, const std::vector< Real > &steps, const bool printToStream, std::ostream &outStream, const int order) |
Public Member Functions inherited from ROL::Objective< Real > | |
virtual | ~Objective () |
Objective () | |
virtual Real | dirDeriv (const Vector< Real > &x, const Vector< Real > &d, Real &tol) |
Compute directional derivative. More... | |
virtual void | invHessVec (Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, Real &tol) |
Apply inverse Hessian approximation to vector. More... | |
virtual void | precond (Vector< Real > &Pv, const Vector< Real > &v, const Vector< Real > &x, Real &tol) |
Apply preconditioner to vector. More... | |
virtual void | prox (Vector< Real > &Pv, const Vector< Real > &v, Real t, Real &tol) |
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. More... | |
virtual std::vector < std::vector< Real > > | checkGradient (const Vector< Real > &x, const Vector< Real > &g, 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. More... | |
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. More... | |
virtual std::vector < std::vector< Real > > | checkGradient (const Vector< Real > &x, const Vector< Real > &g, 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. More... | |
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. More... | |
virtual std::vector < std::vector< Real > > | checkHessVec (const Vector< Real > &x, const Vector< Real > &hv, 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. More... | |
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. More... | |
virtual std::vector < std::vector< Real > > | checkHessVec (const Vector< Real > &x, const Vector< Real > &hv, 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. More... | |
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. More... | |
virtual std::vector< Real > | checkHessSym (const Vector< Real > &x, const Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &w, const bool printToStream=true, std::ostream &outStream=std::cout) |
Hessian symmetry check. More... | |
virtual void | setParameter (const std::vector< Real > ¶m) |
Public Member Functions inherited from ROL::SerialFunction< Real > | |
SerialFunction (const Vector< Real > &u_initial, const TimeStampsPtr< Real > &timeStampsPtr) | |
size_type | numTimeSteps () const |
const Vector< Real > & | getInitialCondition () const |
void | setInitialCondition (const Vector< Real > &u_initial) |
const Vector< Real > & | getZeroState () const |
bool | getSkipInitialCondition () const |
void | setSkipInitialCondition (bool skip) |
TimeStampsPtr< Real > | getTimeStampsPtr () const |
void | setTimeStampsPtr (const TimeStampsPtr< Real > &timeStampsPtr) |
TimeStamp< Real > & | getTimeStamp (size_type i) |
const TimeStamp< Real > & | getTimeStamp (size_type i) const |
void | setTimeStamp (size_type i, const TimeStamp< Real > &timeStamp) |
Private Types | |
using | PV = PartitionedVector< Real > |
Private Attributes | |
Ptr< DynamicObjective< Real > > | obj_ |
Additional Inherited Members | |
Protected Member Functions inherited from ROL::Objective< Real > | |
const std::vector< Real > | getParameter (void) const |
Protected Member Functions inherited from ROL::SerialFunction< Real > | |
const TimeStamp< Real > & | ts (size_type i) const |
Ptr< Vector< Real > > | clone (const Vector< Real > &x) |
Evaluates ROL::DynamicObjective over a sequential set of time intervals.
\[ f(u,z) = \sum\limits_{k=1}^n f_k(u_{k-1},u_k,z_k) \]
\[ \frac{\partial f}{\partial u_j} = \frac{\partial f_j(u_{j-1},u_j,z_j}{\partial u_j} + \frac{\partial f_{j+1}(u_j,u_{j+1},z_{j+1}}{\partial u_j} \]
Definition at line 37 of file ROL_SerialObjective.hpp.
|
private |
Definition at line 40 of file ROL_SerialObjective.hpp.
using ROL::SerialObjective< Real >::size_type = typename std::vector<Real>::size_type |
Definition at line 48 of file ROL_SerialObjective.hpp.
|
inline |
Definition at line 54 of file ROL_SerialObjective.hpp.
|
inlineoverridevirtual |
Compute value.
Implements ROL::Objective_SimOpt< Real >.
Definition at line 61 of file ROL_SerialObjective.hpp.
References ROL::SerialFunction< Real >::getInitialCondition(), ROL::SerialFunction< Real >::getSkipInitialCondition(), ROL::SerialFunction< Real >::numTimeSteps(), ROL::SerialObjective< Real >::obj_, ROL::partition(), and ROL::SerialFunction< Real >::ts().
|
inlineoverridevirtual |
Compute gradient with respect to first component.
Reimplemented from ROL::Objective_SimOpt< Real >.
Definition at line 78 of file ROL_SerialObjective.hpp.
References ROL::SerialFunction< Real >::clone(), ROL::SerialFunction< Real >::getInitialCondition(), ROL::SerialFunction< Real >::numTimeSteps(), ROL::SerialObjective< Real >::obj_, ROL::partition(), and ROL::SerialFunction< Real >::ts().
|
inlineoverridevirtual |
Compute gradient with respect to second component.
Reimplemented from ROL::Objective_SimOpt< Real >.
Definition at line 108 of file ROL_SerialObjective.hpp.
References ROL::SerialFunction< Real >::getInitialCondition(), ROL::SerialFunction< Real >::getSkipInitialCondition(), ROL::SerialFunction< Real >::numTimeSteps(), ROL::SerialObjective< Real >::obj_, ROL::partition(), and ROL::SerialFunction< Real >::ts().
|
inlineoverridevirtual |
Apply Hessian approximation to vector.
Reimplemented from ROL::Objective_SimOpt< Real >.
Definition at line 125 of file ROL_SerialObjective.hpp.
References ROL::SerialFunction< Real >::clone(), ROL::SerialFunction< Real >::getInitialCondition(), ROL::SerialFunction< Real >::numTimeSteps(), ROL::SerialObjective< Real >::obj_, ROL::partition(), and ROL::SerialFunction< Real >::ts().
|
inlineoverridevirtual |
Reimplemented from ROL::Objective_SimOpt< Real >.
Definition at line 155 of file ROL_SerialObjective.hpp.
References ROL::SerialFunction< Real >::clone(), ROL::SerialFunction< Real >::getInitialCondition(), ROL::SerialFunction< Real >::numTimeSteps(), ROL::SerialObjective< Real >::obj_, ROL::partition(), and ROL::SerialFunction< Real >::ts().
|
inlineoverridevirtual |
Reimplemented from ROL::Objective_SimOpt< Real >.
Definition at line 186 of file ROL_SerialObjective.hpp.
References ROL::SerialFunction< Real >::clone(), ROL::SerialFunction< Real >::getInitialCondition(), ROL::SerialFunction< Real >::numTimeSteps(), ROL::SerialObjective< Real >::obj_, ROL::partition(), and ROL::SerialFunction< Real >::ts().
|
inlineoverridevirtual |
Reimplemented from ROL::Objective_SimOpt< Real >.
Definition at line 210 of file ROL_SerialObjective.hpp.
References ROL::SerialFunction< Real >::getInitialCondition(), ROL::SerialFunction< Real >::getSkipInitialCondition(), ROL::SerialFunction< Real >::numTimeSteps(), ROL::SerialObjective< Real >::obj_, ROL::partition(), and ROL::SerialFunction< Real >::ts().
|
private |
Definition at line 44 of file ROL_SerialObjective.hpp.
Referenced by ROL::SerialObjective< Real >::gradient_1(), ROL::SerialObjective< Real >::gradient_2(), ROL::SerialObjective< Real >::hessVec_11(), ROL::SerialObjective< Real >::hessVec_12(), ROL::SerialObjective< Real >::hessVec_21(), ROL::SerialObjective< Real >::hessVec_22(), and ROL::SerialObjective< Real >::value().