ROL
Toggle main menu visibility
Loading...
Searching...
No Matches
src
function
objective
ROL_CompositeObjective.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_COMPOSITE_OBJECTIVE_H
11
#define ROL_COMPOSITE_OBJECTIVE_H
12
13
#include "
ROL_StdObjective.hpp
"
14
19
20
21
namespace
ROL
{
22
23
template
<
typename
Real>
24
class
CompositeObjective
:
public
Objective
<Real> {
25
private
:
26
const
std::vector<Ptr<Objective<Real>>>
obj_vec_
;
27
const
Ptr<StdObjective<Real>>
std_obj_
;
28
29
Ptr<std::vector<Real>>
obj_value_
,
obj_grad_
,
obj_gv_
,
obj_hess_
;
30
Ptr<StdVector<Real>>
obj_value_vec_
,
obj_grad_vec_
,
obj_gv_vec_
,
obj_hess_vec_
;
31
std::vector<Ptr<Vector<Real>>>
vec_grad_
,
vec_hess_
;
32
33
bool
isInitialized_
,
isValueComputed_
,
isGradientComputed_
;
34
35
public
:
36
CompositeObjective
(
const
std::vector<Ptr<
Objective<Real>
>> &obj_vec,
37
const
Ptr<
StdObjective<Real>
> &std_obj);
38
39
void
update
(
const
Vector<Real>
&x,
UpdateType
type,
int
iter = -1 )
override
;
40
void
update
(
const
Vector<Real>
&x,
bool
flag =
true
,
int
iter = -1 )
override
;
41
Real
value
(
const
Vector<Real>
&x, Real &tol )
override
;
42
void
gradient
(
Vector<Real>
&g,
const
Vector<Real>
&x, Real &tol )
override
;
43
void
hessVec
(
Vector<Real>
&hv,
const
Vector<Real>
&v,
const
Vector<Real>
&x, Real &tol )
override
;
44
45
// Definitions for parametrized (stochastic) objective functions
46
public
:
47
void
setParameter
(
const
std::vector<Real> ¶m)
override
;
48
49
private
:
50
void
initialize
(
const
Vector<Real>
&x);
51
void
computeValue
(
const
Vector<Real>
&x, Real &tol);
52
void
computeGradient
(
const
Vector<Real>
&x, Real &tol);
53
void
computeHessVec
(
const
Vector<Real>
&v,
const
Vector<Real>
&x, Real &tol);
54
};
55
56
}
// namespace ROL
57
58
#include "
ROL_CompositeObjective_Def.hpp
"
59
60
#endif
ROL_CompositeObjective_Def.hpp
ROL_StdObjective.hpp
ROL::CompositeObjective::initialize
void initialize(const Vector< Real > &x)
Definition
ROL_CompositeObjective_Def.hpp:90
ROL::CompositeObjective::setParameter
void setParameter(const std::vector< Real > ¶m) override
Definition
ROL_CompositeObjective_Def.hpp:78
ROL::CompositeObjective::obj_gv_
Ptr< std::vector< Real > > obj_gv_
Definition
ROL_CompositeObjective.hpp:29
ROL::CompositeObjective::obj_value_
Ptr< std::vector< Real > > obj_value_
Definition
ROL_CompositeObjective.hpp:29
ROL::CompositeObjective::obj_grad_
Ptr< std::vector< Real > > obj_grad_
Definition
ROL_CompositeObjective.hpp:29
ROL::CompositeObjective::obj_gv_vec_
Ptr< StdVector< Real > > obj_gv_vec_
Definition
ROL_CompositeObjective.hpp:30
ROL::CompositeObjective::gradient
void gradient(Vector< Real > &g, const Vector< Real > &x, Real &tol) override
Definition
ROL_CompositeObjective_Def.hpp:57
ROL::CompositeObjective::obj_hess_
Ptr< std::vector< Real > > obj_hess_
Definition
ROL_CompositeObjective.hpp:29
ROL::CompositeObjective::obj_hess_vec_
Ptr< StdVector< Real > > obj_hess_vec_
Definition
ROL_CompositeObjective.hpp:30
ROL::CompositeObjective::vec_hess_
std::vector< Ptr< Vector< Real > > > vec_hess_
Definition
ROL_CompositeObjective.hpp:31
ROL::CompositeObjective::obj_grad_vec_
Ptr< StdVector< Real > > obj_grad_vec_
Definition
ROL_CompositeObjective.hpp:30
ROL::CompositeObjective::computeValue
void computeValue(const Vector< Real > &x, Real &tol)
Definition
ROL_CompositeObjective_Def.hpp:104
ROL::CompositeObjective::hessVec
void hessVec(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, Real &tol) override
Definition
ROL_CompositeObjective_Def.hpp:67
ROL::CompositeObjective::update
void update(const Vector< Real > &x, UpdateType type, int iter=-1) override
Definition
ROL_CompositeObjective_Def.hpp:31
ROL::CompositeObjective::obj_vec_
const std::vector< Ptr< Objective< Real > > > obj_vec_
Definition
ROL_CompositeObjective.hpp:26
ROL::CompositeObjective::isInitialized_
bool isInitialized_
Definition
ROL_CompositeObjective.hpp:33
ROL::CompositeObjective::computeHessVec
void computeHessVec(const Vector< Real > &v, const Vector< Real > &x, Real &tol)
Definition
ROL_CompositeObjective_Def.hpp:129
ROL::CompositeObjective::isGradientComputed_
bool isGradientComputed_
Definition
ROL_CompositeObjective.hpp:33
ROL::CompositeObjective::isValueComputed_
bool isValueComputed_
Definition
ROL_CompositeObjective.hpp:33
ROL::CompositeObjective::computeGradient
void computeGradient(const Vector< Real > &x, Real &tol)
Definition
ROL_CompositeObjective_Def.hpp:116
ROL::CompositeObjective::obj_value_vec_
Ptr< StdVector< Real > > obj_value_vec_
Definition
ROL_CompositeObjective.hpp:30
ROL::CompositeObjective::vec_grad_
std::vector< Ptr< Vector< Real > > > vec_grad_
Definition
ROL_CompositeObjective.hpp:31
ROL::CompositeObjective::std_obj_
const Ptr< StdObjective< Real > > std_obj_
Definition
ROL_CompositeObjective.hpp:27
ROL::CompositeObjective::value
Real value(const Vector< Real > &x, Real &tol) override
Definition
ROL_CompositeObjective_Def.hpp:51
ROL::CompositeObjective::CompositeObjective
CompositeObjective(const std::vector< Ptr< Objective< Real > > > &obj_vec, const Ptr< StdObjective< Real > > &std_obj)
Definition
ROL_CompositeObjective_Def.hpp:16
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::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