11#ifndef ROL_DYNAMICOBJECTIVECHECK_HPP
12#define ROL_DYNAMICOBJECTIVECHECK_HPP
15#include "ROL_ValidateFunction.hpp"
23template<
typename Real>
27 ValidateFunction<Real>& validator,
31 const std::vector<std::string>& methods ) {
34 check( obj_check, validator, uo, un, z, methods );
38 ValidateFunction<Real>& validator,
43 const std::vector<std::string>& methods ) {
46 check( obj_check, validator, uo, un, z, methods );
50 ValidateFunction<Real>& validator,
54 const std::vector<std::string>& methods ) {
67 if( std::find(methods.begin(),methods.end(),
"gradient_uo") != methods.end() ) {
71 validator.derivative_check(
value, grad,
update, *gu, *vu, uo,
"grad_uo'*dir" );
73 if( std::find(methods.begin(),methods.end(),
"gradient_un") != methods.end() ) {
77 validator.derivative_check(
value, grad,
update, *gu, *vu, un,
"grad_un'*dir" );
79 if( std::find(methods.begin(),methods.end(),
"gradient_z") != methods.end() ) {
83 validator.derivative_check(
value, grad,
update, *gz, *vz, z,
"grad_z'*dir" );
88 if( std::find(methods.begin(),methods.end(),
"hessVec_uo_uo") != methods.end() ) {
92 validator.derivative_check( grad, hessVec,
update, *gu, *vu, uo,
"norm(H_uo_uo*vec)" );
95 if( std::find(methods.begin(),methods.end(),
"hessVec_uo_un") != methods.end() ) {
99 validator.derivative_check( grad, hessVec,
update, *gu, *vu, un,
"norm(H_uo_un*vec)" );
102 if( std::find(methods.begin(),methods.end(),
"hessVec_uo_z") != methods.end() ) {
106 validator.derivative_check( grad, hessVec,
update, *gu, *vz, z,
"norm(H_uo_z*vec)" );
111 if( std::find(methods.begin(),methods.end(),
"hessVec_un_uo") != methods.end() ) {
115 validator.derivative_check( grad, hessVec,
update, *gu, *vu, uo,
"norm(H_un_uo*vec)" );
118 if( std::find(methods.begin(),methods.end(),
"hessVec_un_un") != methods.end() ) {
122 validator.derivative_check( grad, hessVec,
update, *gu, *vu, un,
"norm(H_un_un*vec)" );
125 if( std::find(methods.begin(),methods.end(),
"hessVec_un_z") != methods.end() ) {
129 validator.derivative_check( grad, hessVec,
update, *gu, *vz, z,
"norm(H_un_z*vec)" );
134 if( std::find(methods.begin(),methods.end(),
"hessVec_z_uo") != methods.end() ) {
138 validator.derivative_check( grad, hessVec,
update, *gz, *vu, uo,
"norm(H_z_uo*vec)" );
141 if( std::find(methods.begin(),methods.end(),
"hessVec_z_un") != methods.end() ) {
145 validator.derivative_check( grad, hessVec,
update, *gz, *vu, un,
"norm(H_z_un*vec)" );
148 if( std::find(methods.begin(),methods.end(),
"hessVec_z_z") != methods.end() ) {
153 validator.derivative_check( grad, hessVec,
update, *gz, *vz, z,
"norm(H_z_z*vec)" );
158 ValidateFunction<Real>& validator,
162 std::vector<std::string> methods = {
"gradient_uo",
174 check(obj, validator, uo, un, z, methods);
178 ValidateFunction<Real>& validator,
183 std::vector<std::string> methods = {
"gradient_uo",
195 check(obj, validator, uo, un, z, ts, 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< Real > &obj, ValidateFunction< Real > &validator, const Vector< Real > &uo, const Vector< Real > &un, const Vector< Real > &z, TimeStamp< Real > &ts)
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.