45#ifndef ROL_DYNAMICOBJECTIVECHECK_HPP
46#define ROL_DYNAMICOBJECTIVECHECK_HPP
49#include "ROL_ValidateFunction.hpp"
57template<
typename Real>
61 ValidateFunction<Real>& validator,
65 const std::vector<std::string>& methods ) {
68 check( obj_check, validator, uo, un, z, methods );
72 ValidateFunction<Real>& validator,
77 const std::vector<std::string>& methods ) {
80 check( obj_check, validator, uo, un, z, methods );
84 ValidateFunction<Real>& validator,
88 const std::vector<std::string>& methods ) {
101 if( std::find(methods.begin(),methods.end(),
"gradient_uo") != methods.end() ) {
105 validator.derivative_check(
value, grad,
update, *gu, *vu, uo,
"grad_uo'*dir" );
107 if( std::find(methods.begin(),methods.end(),
"gradient_un") != methods.end() ) {
111 validator.derivative_check(
value, grad,
update, *gu, *vu, un,
"grad_un'*dir" );
113 if( std::find(methods.begin(),methods.end(),
"gradient_z") != methods.end() ) {
117 validator.derivative_check(
value, grad,
update, *gz, *vz, z,
"grad_z'*dir" );
122 if( std::find(methods.begin(),methods.end(),
"hessVec_uo_uo") != methods.end() ) {
126 validator.derivative_check( grad, hessVec,
update, *gu, *vu, uo,
"norm(H_uo_uo*vec)" );
129 if( std::find(methods.begin(),methods.end(),
"hessVec_uo_un") != methods.end() ) {
133 validator.derivative_check( grad, hessVec,
update, *gu, *vu, un,
"norm(H_uo_un*vec)" );
136 if( std::find(methods.begin(),methods.end(),
"hessVec_uo_z") != methods.end() ) {
140 validator.derivative_check( grad, hessVec,
update, *gu, *vz, z,
"norm(H_uo_z*vec)" );
145 if( std::find(methods.begin(),methods.end(),
"hessVec_un_uo") != methods.end() ) {
149 validator.derivative_check( grad, hessVec,
update, *gu, *vu, uo,
"norm(H_un_uo*vec)" );
152 if( std::find(methods.begin(),methods.end(),
"hessVec_un_un") != methods.end() ) {
156 validator.derivative_check( grad, hessVec,
update, *gu, *vu, un,
"norm(H_un_un*vec)" );
159 if( std::find(methods.begin(),methods.end(),
"hessVec_un_z") != methods.end() ) {
163 validator.derivative_check( grad, hessVec,
update, *gu, *vz, z,
"norm(H_un_z*vec)" );
168 if( std::find(methods.begin(),methods.end(),
"hessVec_z_uo") != methods.end() ) {
172 validator.derivative_check( grad, hessVec,
update, *gz, *vu, uo,
"norm(H_z_uo*vec)" );
175 if( std::find(methods.begin(),methods.end(),
"hessVec_z_un") != methods.end() ) {
179 validator.derivative_check( grad, hessVec,
update, *gz, *vu, un,
"norm(H_z_un*vec)" );
182 if( std::find(methods.begin(),methods.end(),
"hessVec_z_z") != methods.end() ) {
187 validator.derivative_check( grad, hessVec,
update, *gz, *vz, z,
"norm(H_z_z*vec)" );
192 ValidateFunction<Real>& validator,
196 std::vector<std::string> methods = {
"gradient_uo",
208 check(obj, validator, uo, un, z, methods);
Defines the time-dependent objective function interface for simulation-based optimization....
Defines the linear algebra or vector space interface.
virtual const Vector & dual() const
Return dual representation of , for example, the result of applying a Riesz map, or change of basis,...
virtual ROL::Ptr< Vector > clone() const =0
Clone to make a new (uninitialized) vector.
f_vector_t< Real > gradient_uo_uo(const V &un, const V &z)
f_vector_t< Real > gradient_z_un(const V &uo, const V &z)
f_dderiv_t< Real > hessVec_un_z(const V &uo, const V &un)
f_vector_t< Real > gradient_un(const V &uo, const V &z)
f_dderiv_t< Real > hessVec_un_uo(const V &un, const V &z)
f_update_t< Real > update_z(const V &uo, const V &un)
f_update_t< Real > update_un(const V &uo, const V &z)
f_scalar_t< Real > value_uo(const V &un, const V &z)
f_vector_t< Real > gradient_un_un(const V &uo, const V &z)
f_vector_t< Real > gradient_un_uo(const V &un, const V &z)
f_vector_t< Real > gradient_uo(const V &un, const V &z)
f_dderiv_t< Real > hessVec_z_uo(const V &un, const V &z)
f_vector_t< Real > gradient_un_z(const V &uo, const V &un)
f_vector_t< Real > gradient_uo_z(const V &uo, const V &un)
f_scalar_t< Real > value_z(const V &uo, const V &un)
f_vector_t< Real > gradient_z_uo(const V &un, const V &z)
f_vector_t< Real > gradient_uo_un(const V &uo, const V &z)
f_update_t< Real > update_uo(const V &un, const V &z)
f_dderiv_t< Real > hessVec_z_un(const V &uo, const V &z)
f_dderiv_t< Real > hessVec_z_z(const V &uo, const V &un)
f_vector_t< Real > gradient_z_z(const V &uo, const V &un)
f_dderiv_t< Real > hessVec_uo_uo(const V &un, const V &z)
f_scalar_t< Real > value_un(const V &uo, const V &z)
f_vector_t< Real > gradient_z(const V &uo, const V &un)
f_dderiv_t< Real > hessVec_un_un(const V &uo, const V &z)
f_dderiv_t< Real > hessVec_uo_un(const V &uo, const V &z)
f_dderiv_t< Real > hessVec_uo_z(const V &uo, const V &un)
ROL::Objective_SerialSimOpt Objective_SimOpt value(const V &u, const V &z, Real &tol) override
virtual void update(const Vector< Real > &u, const Vector< Real > &z, bool flag=true, int iter=-1) override
DynamicConstraint_CheckInterface< Real > make_check(DynamicConstraint< Real > &con)
static void check(DynamicObjective< Real > &obj, ValidateFunction< Real > &validator, const Vector< Real > &uo, const Vector< Real > &un, const Vector< Real > &z, TimeStamp< Real > &timeStamp, const std::vector< std::string > &methods)
static void check(DynamicObjective< Real > &obj, ValidateFunction< Real > &validator, const Vector< Real > &uo, const Vector< Real > &un, const Vector< Real > &z)
static void check(DynamicObjective_CheckInterface< Real > &obj_check, ValidateFunction< Real > &validator, const Vector< Real > &uo, const Vector< Real > &un, const Vector< Real > &z, const std::vector< std::string > &methods)
static void check(DynamicObjective< Real > &obj, ValidateFunction< Real > &validator, const Vector< Real > &uo, const Vector< Real > &un, const Vector< Real > &z, const std::vector< std::string > &methods)
Contains local time step information.