ROL
Toggle main menu visibility
Loading...
Searching...
No Matches
src
function
objective
ROL_ObjectiveFromConstraint_Def.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_OBJECTIVE_FROM_CONSTRAINT_DEF_H
11
#define ROL_OBJECTIVE_FROM_CONSTRAINT_DEF_H
12
13
namespace
ROL
{
14
15
template
<
typename
Real>
16
ObjectiveFromConstraint<Real>::ObjectiveFromConstraint
(
const
Ptr<
Constraint<Real>
> &con,
17
const
Vector<Real>
&l ) :
18
con_
(con),
l_
(l.clone()),
c_
(l.dual().clone()) {
19
l_
->set(l);
20
}
21
22
template
<
typename
Real>
23
void
ObjectiveFromConstraint<Real>::update
(
const
Vector<Real>
&x,
UpdateType
type,
int
iter ) {
24
con_
->update(x,type,iter);
25
}
26
27
template
<
typename
Real>
28
void
ObjectiveFromConstraint<Real>::update
(
const
Vector<Real>
&x,
bool
flag,
int
iter ) {
29
con_
->update(x,flag,iter);
30
}
31
32
template
<
typename
Real>
33
Real
ObjectiveFromConstraint<Real>::value
(
const
Vector<Real>
&x, Real &tol ) {
34
con_
->value(*
c_
,x,tol);
35
//return l_->dot(c_->dual());
36
return
l_
->apply(*
c_
);
37
}
38
39
template
<
typename
Real>
40
void
ObjectiveFromConstraint<Real>::gradient
(
Vector<Real>
&g,
const
Vector<Real>
&x, Real &tol ) {
41
con_
->applyAdjointJacobian(g,*
l_
,x,tol);
42
}
43
44
template
<
typename
Real>
45
void
ObjectiveFromConstraint<Real>::hessVec
(
Vector<Real>
&hv,
const
Vector<Real>
&v,
const
Vector<Real>
&x, Real &tol ) {
46
con_
->applyAdjointHessian(hv,*
l_
,v,x,tol);
47
}
48
49
template
<
typename
Real>
50
void
ObjectiveFromConstraint<Real>::updateMultiplier
(
const
Vector<Real>
&l ) {
51
l_
->set(l);
52
}
53
54
}
// namespace ROL
55
56
#endif
// ROL_OBJECTIVE_FROM_CONSTRAINT_DEF_H
ROL::Constraint
Defines the general constraint operator interface.
Definition
ROL_Constraint.hpp:52
ROL::ObjectiveFromConstraint::hessVec
void hessVec(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, Real &tol) override
Definition
ROL_ObjectiveFromConstraint_Def.hpp:45
ROL::ObjectiveFromConstraint::value
Real value(const Vector< Real > &x, Real &tol) override
Definition
ROL_ObjectiveFromConstraint_Def.hpp:33
ROL::ObjectiveFromConstraint::update
void update(const Vector< Real > &x, UpdateType type, int iter=-1) override
Definition
ROL_ObjectiveFromConstraint_Def.hpp:23
ROL::ObjectiveFromConstraint::c_
Ptr< Vector< Real > > c_
Definition
ROL_ObjectiveFromConstraint.hpp:31
ROL::ObjectiveFromConstraint::gradient
void gradient(Vector< Real > &g, const Vector< Real > &x, Real &tol) override
Definition
ROL_ObjectiveFromConstraint_Def.hpp:40
ROL::ObjectiveFromConstraint::updateMultiplier
void updateMultiplier(const Vector< Real > &l)
Definition
ROL_ObjectiveFromConstraint_Def.hpp:50
ROL::ObjectiveFromConstraint::ObjectiveFromConstraint
ObjectiveFromConstraint(const Ptr< Constraint< Real > > &con, const Vector< Real > &l)
Definition
ROL_ObjectiveFromConstraint_Def.hpp:16
ROL::ObjectiveFromConstraint::l_
Ptr< Vector< Real > > l_
Definition
ROL_ObjectiveFromConstraint.hpp:30
ROL::ObjectiveFromConstraint::con_
Ptr< Constraint< Real > > con_
Definition
ROL_ObjectiveFromConstraint.hpp:29
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