ROL
Toggle main menu visibility
Loading...
Searching...
No Matches
src
algorithm
TypeU
trustregion
ROL_CauchyPoint_U.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_CAUCHYPOINT_U_H
11
#define ROL_CAUCHYPOINT_U_H
12
16
17
#include "
ROL_TrustRegion_U.hpp
"
18
#include "
ROL_Types.hpp
"
19
20
namespace
ROL
{
21
22
template
<
class
Real>
23
class
CauchyPoint_U
:
public
TrustRegion_U
<Real> {
24
private
:
25
26
Ptr<Vector<Real>>
dual_
;
27
28
public
:
29
30
CauchyPoint_U
() {}
31
32
void
initialize
(
const
Vector<Real>
&x,
const
Vector<Real>
&g) {
33
dual_
= g.
clone
();
34
}
35
36
void
solve
(
Vector<Real>
&s, Real &snorm, Real &pRed,
37
int
&iflag,
int
&iter,
const
Real del,
38
TrustRegionModel_U<Real>
&model) {
39
const
Real
zero
(0), half(0.5);
40
Real tol = std::sqrt(
ROL_EPSILON<Real>
());
41
// Set step to (projected) gradient
42
s.
set
(model.
getGradient
()->dual());
43
// Apply (reduced) Hessian to (projected) gradient
44
model.
hessVec
(*
dual_
,s,s,tol);
45
Real gnorm = s.
norm
();
46
Real gnorm2 = gnorm*gnorm;
47
//Real gBg = dual_->dot(s.dual());
48
Real gBg =
dual_
->apply(s);
49
Real alpha = gnorm2/gBg;
50
if
( alpha*gnorm >= del || gBg <=
zero
) {
51
alpha = del/gnorm;
52
}
53
s.
scale
(-alpha);
54
snorm = alpha*gnorm;
55
iflag = 0;
56
iter = 0;
57
pRed = alpha*(gnorm2 - half*alpha*gBg);
58
}
59
};
60
61
}
// namespace ROL
62
63
#endif
zero
Objective_SerialSimOpt(const Ptr< Obj > &obj, const V &ui) z0 zero)()
Definition
ROL_Objective_SerialSimOpt.hpp:77
ROL_TrustRegion_U.hpp
ROL_Types.hpp
Contains definitions of custom data types in ROL.
ROL::CauchyPoint_U::initialize
void initialize(const Vector< Real > &x, const Vector< Real > &g)
Definition
ROL_CauchyPoint_U.hpp:32
ROL::CauchyPoint_U::solve
void solve(Vector< Real > &s, Real &snorm, Real &pRed, int &iflag, int &iter, const Real del, TrustRegionModel_U< Real > &model)
Definition
ROL_CauchyPoint_U.hpp:36
ROL::CauchyPoint_U::dual_
Ptr< Vector< Real > > dual_
Definition
ROL_CauchyPoint_U.hpp:26
ROL::CauchyPoint_U::CauchyPoint_U
CauchyPoint_U()
Definition
ROL_CauchyPoint_U.hpp:30
ROL::TrustRegionModel_U
Provides the interface to evaluate trust-region model functions.
Definition
ROL_TrustRegionModel_U.hpp:32
ROL::TrustRegionModel_U::hessVec
virtual void hessVec(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &s, Real &tol) override
Definition
ROL_TrustRegionModel_U.hpp:150
ROL::TrustRegionModel_U::getGradient
virtual const Ptr< const Vector< Real > > getGradient(void) const
Definition
ROL_TrustRegionModel_U.hpp:168
ROL::TrustRegion_U
Provides interface for and implements trust-region subproblem solvers.
Definition
ROL_TrustRegion_U.hpp:23
ROL::Vector
Defines the linear algebra or vector space interface.
Definition
ROL_Vector.hpp:51
ROL::Vector::norm
virtual Real norm() const =0
Returns where .
ROL::Vector::set
virtual void set(const Vector &x)
Set where .
Definition
ROL_Vector.hpp:176
ROL::Vector::scale
virtual void scale(const Real alpha)=0
Compute where .
ROL::Vector::clone
virtual ROL::Ptr< Vector > clone() const =0
Clone to make a new (uninitialized) vector.
ROL
Definition
ROL_ElementwiseVector.hpp:27
ROL::ROL_EPSILON
Real ROL_EPSILON(void)
Platform-dependent machine epsilon.
Definition
ROL_Types.hpp:57
Generated by
1.17.0