ROL
Toggle main menu visibility
Loading...
Searching...
No Matches
src
function
objective
ROL_BallIndicatorObjective.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_BALLINDICATOROBJECTIVE_H
11
#define ROL_BALLINDICATOROBJECTIVE_H
12
13
#include "
ROL_Objective.hpp
"
14
21
22
23
namespace
ROL
{
24
25
template
<
typename
Real>
26
class
BallIndicatorObjective
:
public
Objective
<Real> {
27
private
:
28
const
Ptr<Vector<Real>>
x_
,
pwa_
;
29
const
Real
rad_
;
30
31
public
:
32
33
BallIndicatorObjective
(
const
Ptr<
Vector<Real>
> &x, Real rad)
34
:
x_
(x),
pwa_
(x->clone()),
rad_
(rad) {}
35
36
Real
value
(
const
Vector<Real>
&x, Real &tol ) {
37
const
Real
zero
(0), one(1);
38
pwa_
->set(x);
pwa_
->axpy(-one,*
x_
);
39
Real norm =
pwa_
->norm();
40
return
(norm <=
rad_
) ?
zero
:
ROL_INF<Real>
();
41
}
42
43
void
prox
(
Vector<Real>
&Pv,
const
Vector<Real>
&v, Real t, Real &tol){
44
pwa_
->set(v);
pwa_
->axpy(-one,*
x_
);
45
Real norm =
pwa_
->norm();
46
if
(norm <=
rad_
) {
47
Pv.
set
(v);
48
}
49
else
{
50
Pv.
set
(*
x_
);
51
Pv.
axpy
(
rad_
/norm,*
pwa_
);
52
}
53
}
54
};
// class BallIndicatorObjective
55
56
}
// namespace ROL
57
58
#endif
ROL_Objective.hpp
zero
Objective_SerialSimOpt(const Ptr< Obj > &obj, const V &ui) z0 zero)()
Definition
ROL_Objective_SerialSimOpt.hpp:77
ROL::BallIndicatorObjective::x_
const Ptr< Vector< Real > > x_
Definition
ROL_BallIndicatorObjective.hpp:28
ROL::BallIndicatorObjective::prox
void prox(Vector< Real > &Pv, const Vector< Real > &v, Real t, Real &tol)
Definition
ROL_BallIndicatorObjective.hpp:43
ROL::BallIndicatorObjective::rad_
const Real rad_
Definition
ROL_BallIndicatorObjective.hpp:29
ROL::BallIndicatorObjective::value
Real value(const Vector< Real > &x, Real &tol)
Definition
ROL_BallIndicatorObjective.hpp:36
ROL::BallIndicatorObjective::BallIndicatorObjective
BallIndicatorObjective(const Ptr< Vector< Real > > &x, Real rad)
Definition
ROL_BallIndicatorObjective.hpp:33
ROL::BallIndicatorObjective::pwa_
const Ptr< Vector< Real > > pwa_
Definition
ROL_BallIndicatorObjective.hpp:28
ROL::ROL::Objective::Objective
Objective()
Definition
ROL_Constraint_SerialSimOpt.hpp:53
ROL::Vector
Defines the linear algebra or vector space interface.
Definition
ROL_Vector.hpp:51
ROL::Vector::set
virtual void set(const Vector &x)
Set where .
Definition
ROL_Vector.hpp:176
ROL::Vector::axpy
virtual void axpy(const Real alpha, const Vector &x)
Compute where .
Definition
ROL_Vector.hpp:120
ROL
Definition
ROL_ElementwiseVector.hpp:27
ROL::ROL_INF
Real ROL_INF(void)
Definition
ROL_Types.hpp:71
Generated by
1.17.0