ROL
Toggle main menu visibility
Loading...
Searching...
No Matches
src
function
constraint
ROL_ConstraintFromObjective.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_CONSTRAINTFROMOBJECTIVE_H
11
#define ROL_CONSTRAINTFROMOBJECTIVE_H
12
13
#include "
ROL_Objective.hpp
"
14
#include "
ROL_Constraint.hpp
"
15
#include "
ROL_SingletonVector.hpp
"
16
25
26
27
namespace
ROL
{
28
29
template
<
typename
Real>
30
class
ConstraintFromObjective
:
public
Constraint
<Real> {
31
private
:
32
const
Ptr<Objective<Real>>
obj_
;
33
Ptr<Vector<Real>>
dualVector_
;
34
const
Real
offset_
;
35
bool
isDualInitialized_
;
36
37
public
:
38
ConstraintFromObjective
(
const
Ptr<
Objective<Real>
> &obj,
const
Real offset = 0 );
39
40
const
Ptr<Objective<Real>>
getObjective
(
void
)
const
;
41
42
void
setParameter
(
const
std::vector<Real> ¶m )
override
;
43
44
void
update
(
const
Vector<Real>
& x,
UpdateType
type,
int
iter = -1 )
override
;
45
void
update
(
const
Vector<Real>
& x,
bool
flag =
true
,
int
iter = -1 )
override
;
46
void
value
(
Vector<Real>
& c,
const
Vector<Real>
& x, Real& tol )
override
;
47
void
applyJacobian
(
Vector<Real>
& jv,
const
Vector<Real>
& v,
const
Vector<Real>
& x, Real& tol )
override
;
48
void
applyAdjointJacobian
(
Vector<Real>
& ajv,
const
Vector<Real>
& v,
const
Vector<Real>
& x, Real& tol )
override
;
49
void
applyAdjointHessian
(
Vector<Real>
& ahuv,
const
Vector<Real>
& u,
const
Vector<Real>
& v,
const
Vector<Real>
& x, Real& tol )
override
;
50
51
private
:
52
Real
getValue
(
const
Vector<Real>
& x );
53
void
setValue
(
Vector<Real>
& x, Real val );
54
55
};
// ConstraintFromObjective
56
57
}
// namespace ROL
58
59
#include "
ROL_ConstraintFromObjective_Def.hpp
"
60
61
#endif
// ROL_CONSTRAINTFROMOBJECTIVE_H
ROL_ConstraintFromObjective_Def.hpp
ROL_Constraint.hpp
ROL_Objective.hpp
ROL_SingletonVector.hpp
ROL::ConstraintFromObjective::setValue
void setValue(Vector< Real > &x, Real val)
Definition
ROL_ConstraintFromObjective_Def.hpp:72
ROL::ConstraintFromObjective::update
void update(const Vector< Real > &x, UpdateType type, int iter=-1) override
Definition
ROL_ConstraintFromObjective_Def.hpp:29
ROL::ConstraintFromObjective::value
void value(Vector< Real > &c, const Vector< Real > &x, Real &tol) override
Definition
ROL_ConstraintFromObjective_Def.hpp:39
ROL::ConstraintFromObjective::offset_
const Real offset_
Definition
ROL_ConstraintFromObjective.hpp:34
ROL::ConstraintFromObjective::ConstraintFromObjective
ConstraintFromObjective(const Ptr< Objective< Real > > &obj, const Real offset=0)
Definition
ROL_ConstraintFromObjective_Def.hpp:16
ROL::ConstraintFromObjective::applyAdjointHessian
void applyAdjointHessian(Vector< Real > &ahuv, const Vector< Real > &u, const Vector< Real > &v, const Vector< Real > &x, Real &tol) override
Definition
ROL_ConstraintFromObjective_Def.hpp:61
ROL::ConstraintFromObjective::obj_
const Ptr< Objective< Real > > obj_
Definition
ROL_ConstraintFromObjective.hpp:32
ROL::ConstraintFromObjective::setParameter
void setParameter(const std::vector< Real > ¶m) override
Definition
ROL_ConstraintFromObjective_Def.hpp:23
ROL::ConstraintFromObjective::getObjective
const Ptr< Objective< Real > > getObjective(void) const
Definition
ROL_ConstraintFromObjective_Def.hpp:20
ROL::ConstraintFromObjective::applyAdjointJacobian
void applyAdjointJacobian(Vector< Real > &ajv, const Vector< Real > &v, const Vector< Real > &x, Real &tol) override
Definition
ROL_ConstraintFromObjective_Def.hpp:55
ROL::ConstraintFromObjective::applyJacobian
void applyJacobian(Vector< Real > &jv, const Vector< Real > &v, const Vector< Real > &x, Real &tol) override
Definition
ROL_ConstraintFromObjective_Def.hpp:44
ROL::ConstraintFromObjective::dualVector_
Ptr< Vector< Real > > dualVector_
Definition
ROL_ConstraintFromObjective.hpp:33
ROL::ConstraintFromObjective::isDualInitialized_
bool isDualInitialized_
Definition
ROL_ConstraintFromObjective.hpp:35
ROL::ConstraintFromObjective::getValue
Real getValue(const Vector< Real > &x)
Definition
ROL_ConstraintFromObjective_Def.hpp:67
ROL::Objective
Provides the interface to evaluate objective functions.
Definition
ROL_Objective.hpp:44
ROL::ROL::Constraint::Constraint
Constraint(void)
Definition
ROL_Constraint_SerialSimOpt.hpp:59
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