ROL
Toggle main menu visibility
Loading...
Searching...
No Matches
src
function
std
ROL_StdObjective.hpp
Go to the documentation of this file.
1
// @HEADER
2
// *****************************************************************************
3
// Rapid Optimization Library (ROL) Package
4
//
5
// Copyright 2014 NTESS and the ROL contributors.
6
// SPDX-License-Identifier: BSD-3-Clause
7
// *****************************************************************************
8
// @HEADER
9
10
#ifndef ROL_STDOBJECTIVE_H
11
#define ROL_STDOBJECTIVE_H
12
13
#include "
ROL_Objective.hpp
"
14
#include "
ROL_StdVector.hpp
"
15
21
22
23
namespace
ROL
{
24
25
template
<
typename
Real>
26
class
StdObjective
:
public
virtual
Objective
<Real> {
27
public
:
28
virtual
void
update
(
const
std::vector<Real> &x,
bool
flag =
true
,
int
iter = -1 ) {}
29
30
using
Objective
<Real>
::update
;
31
void
update
(
const
Vector<Real>
&x,
bool
flag =
true
,
int
iter = -1 )
override
;
32
33
virtual
void
update
(
const
std::vector<Real> &x,
UpdateType
type,
int
iter = -1 ) {}
34
35
void
update
(
const
Vector<Real>
&x,
UpdateType
type,
int
iter = -1 )
override
;
36
37
virtual
Real
value
(
const
std::vector<Real> &x, Real &tol ) = 0;
38
39
using
Objective
<Real>
::value
;
40
Real
value
(
const
Vector<Real>
&x, Real &tol )
override
;
41
42
virtual
void
gradient
( std::vector<Real> &g,
const
std::vector<Real> &x, Real &tol );
43
44
using
Objective
<Real>
::gradient
;
45
void
gradient
(
Vector<Real>
&g,
const
Vector<Real>
&x, Real &tol )
override
;
46
47
virtual
Real
dirDeriv
(
const
std::vector<Real> &x,
const
std::vector<Real> &d, Real &tol );
48
49
using
Objective
<Real>
::dirDeriv
;
50
Real
dirDeriv
(
const
Vector<Real>
&x,
const
Vector<Real>
&d, Real &tol )
override
;
51
52
virtual
void
hessVec
( std::vector<Real> &hv,
const
std::vector<Real> &v,
const
std::vector<Real> &x, Real &tol );
53
54
using
Objective
<Real>
::hessVec
;
55
void
hessVec
(
Vector<Real>
&hv,
const
Vector<Real>
&v,
const
Vector<Real>
&x, Real &tol )
override
;
56
57
virtual
void
invHessVec
( std::vector<Real> &hv,
const
std::vector<Real> &v,
const
std::vector<Real> &x, Real &tol );
58
59
using
Objective
<Real>
::invHessVec
;
60
void
invHessVec
(
Vector<Real>
&hv,
const
Vector<Real>
&v,
const
Vector<Real>
&x, Real &tol )
override
;
61
62
virtual
void
precond
( std::vector<Real> &Pv,
const
std::vector<Real> &v,
const
std::vector<Real> &x, Real &tol );
63
64
using
Objective
<Real>
::precond
;
65
void
precond
(
Vector<Real>
&Pv,
const
Vector<Real>
&v,
const
Vector<Real>
&x, Real &tol )
override
;
66
67
private
:
68
Real
sgn
(Real x)
const
;
69
70
};
71
72
}
// namespace ROL
73
74
#include "
ROL_StdObjective_Def.hpp
"
75
76
#endif
ROL_Objective.hpp
update
virtual void update(const Vector< Real > &u_old, const Vector< Real > &u_new, const Vector< Real > &z, bool flag=true, int iter=-1)
Definition
ROL_Objective_TimeSimOpt.hpp:79
ROL_StdObjective_Def.hpp
ROL_StdVector.hpp
ROL::Objective
Provides the interface to evaluate objective functions.
Definition
ROL_Objective.hpp:44
ROL::ROL::Objective::Objective
Objective()
Definition
ROL_Constraint_SerialSimOpt.hpp:53
ROL::StdObjective
Specializes the ROL::Objective interface for objective functions that operate on ROL::StdVector's.
Definition
ROL_StdObjective.hpp:26
ROL::StdObjective::sgn
Real sgn(Real x) const
Definition
ROL_StdObjective_Def.hpp:124
ROL::StdObjective::dirDeriv
virtual Real dirDeriv(const std::vector< Real > &x, const std::vector< Real > &d, Real &tol)
Definition
ROL_StdObjective_Def.hpp:60
ROL::StdObjective::update
virtual void update(const std::vector< Real > &x, UpdateType type, int iter=-1)
Definition
ROL_StdObjective.hpp:33
ROL::StdObjective::invHessVec
virtual void invHessVec(std::vector< Real > &hv, const std::vector< Real > &v, const std::vector< Real > &x, Real &tol)
Definition
ROL_StdObjective_Def.hpp:97
ROL::StdObjective::precond
virtual void precond(std::vector< Real > &Pv, const std::vector< Real > &v, const std::vector< Real > &x, Real &tol)
Definition
ROL_StdObjective_Def.hpp:111
ROL::StdObjective::update
virtual void update(const std::vector< Real > &x, bool flag=true, int iter=-1)
Definition
ROL_StdObjective.hpp:28
ROL::StdObjective::hessVec
virtual void hessVec(std::vector< Real > &hv, const std::vector< Real > &v, const std::vector< Real > &x, Real &tol)
Definition
ROL_StdObjective_Def.hpp:78
ROL::StdObjective::value
virtual Real value(const std::vector< Real > &x, Real &tol)=0
ROL::StdObjective::gradient
virtual void gradient(std::vector< Real > &g, const std::vector< Real > &x, Real &tol)
Definition
ROL_StdObjective_Def.hpp:34
ROL::Vector
Defines the linear algebra or vector space interface.
Definition
ROL_Vector.hpp:51
ROL
Definition
ROL_ElementwiseVector.hpp:27
ROL::UpdateType
UpdateType
Definition
ROL_UpdateType.hpp:18
Generated by
1.17.0