version 0.4.4
trustregion.hh
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2021-2025 The Ikarus Developers ikarus@ibb.uni-stuttgart.de
2// SPDX-License-Identifier: LGPL-3.0-or-later
3
9#pragma once
10
11#include <iosfwd>
12#include <type_traits>
13
14#include <dune/common/float_cmp.hh>
15#include <dune/functions/common/signature.hh>
16
17#include <spdlog/spdlog.h>
18
19#include <Eigen/Sparse>
20
29
30namespace Ikarus {
31
37{
41};
42
44{
45 int verbosity = 5;
46 double maxtime = std::numeric_limits<double>::infinity();
47 int minIter = 3;
48 int maxIter = 1000;
49 int debug = 0;
50 double grad_tol = 1e-6;
51 double corr_tol = 1e-6;
52 double rho_prime = 0.01;
53 bool useRand = false;
54 double rho_reg = 1e6;
55 double Delta_bar = std::numeric_limits<double>::infinity();
56 double Delta0 = 10;
57};
58
64template <PreConditioner preConditioner = PreConditioner::IncompleteCholesky, typename UF = utils::UpdateDefault>
66{
67 static_assert(std::copy_constructible<UF>,
68 " The update function should be copy constructable. If it is a lambda wrap it in a std::function");
69
70 using UpdateFunction = UF;
71
73 static constexpr PreConditioner preConditionerType = preConditioner;
75 template <typename UF2>
78 .updateFunction = std::forward<UF2>(updateFunction)};
79 return settings;
80 }
81};
82
83template <typename F, PreConditioner preConditioner = PreConditioner::IncompleteCholesky,
84 typename UF = utils::UpdateDefault>
85class TrustRegion;
86
95template <typename F, typename TRConfig>
96requires traits::isSpecializationNonTypeAndTypes<TrustRegionConfig, std::remove_cvref_t<TRConfig>>::value
97auto createNonlinearSolver(TRConfig&& config, F&& f) {
98 static constexpr PreConditioner preConditioner = std::remove_cvref_t<TRConfig>::preConditionerType;
99 using UF = std::remove_cvref_t<TRConfig>::UpdateFunction;
100 static_assert(std::remove_cvref_t<F>::nDerivatives == 2,
101 "The number of derivatives in the DifferentiableFunction have to be exactly 2.");
102 auto solver = std::make_shared<TrustRegion<F, preConditioner, UF>>(f, std::forward<TRConfig>(config).updateFunction);
103
104 solver->setup(config.parameters);
105 return solver;
106}
107
112enum class StopReason
113{
119};
120
126{
130 std::string stopReasonString;
131 std::string trstr;
132 std::string accstr;
134 std::string cauchystr = " ";
136 bool used_cauchy = false;
138 std::string reasonString;
139};
140
145struct Stats
146{
147 double gradNorm{1};
148 double etaNorm{1};
149 double time{0};
150 double energy{0};
151 double energyProposal{0};
152 double rho{0};
153 int outerIter{0};
155};
156
169template <typename F, PreConditioner preConditioner, typename UF>
171// template <typename NLO, PreConditioner preConditioner, typename UF>
172// class TrustRegion : public NonlinearSolverBase<NLO>
173{
174public:
176
177 using FTraits = typename F::Traits;
178 using Domain = typename FTraits::Domain;
179 using CorrectionType = typename FTraits::template Range<1>;
180 using UpdateFunction = UF;
182
183 using EnergyType = typename FTraits::template Range<0>;
184 using GradientType = typename FTraits::template Range<1>;
185 using HessianType = typename FTraits::template Range<2>;
186
192 template <typename UF2 = UF>
193 explicit TrustRegion(const F& f, UF2&& updateFunction = {})
194 : energyFunction_{f},
195 updateFunction_{std::forward<UF2>(updateFunction)} {}
196
201 void setup(const Settings& settings) {
202 settings_ = settings;
203 assert(settings_.rho_prime < 0.25 && "options.rho_prime must be strictly smaller than 1/4.");
204 assert(settings_.Delta_bar > 0 && "options.Delta_bar must be positive.");
205 assert(settings_.Delta0 > 0 && settings_.Delta0 < settings_.Delta_bar &&
206 "options.Delta0 must be positive and smaller than Delta_bar.");
207 }
208
215 using enum NonLinearSolverMessages;
216
217 NonLinearSolverInformation solverInformation;
218 auto state = typename TrustRegion::State{.domain = x, .correction = eta_, .information = solverInformation};
219
220 this->notify(INIT, state);
221 stats_ = Stats{};
222 info_ = AlgoInfo{};
223
224 auto& energyF = energyFunction_;
225 auto gradientF = derivative(energyF);
226 auto hessianF = derivative(gradientF);
227 decltype(auto) e = energyF(x);
228 decltype(auto) g = gradientF(x);
229 decltype(auto) h = hessianF(x);
230
231 eta_.resizeLike(g);
232 Heta_.resizeLike(g);
233 truncatedConjugateGradient_.analyzePattern(h);
234 stats_.energy = e;
235 stats_.gradNorm = norm(g);
236 truncatedConjugateGradient_.analyzePattern(h);
237
238 innerInfo_.Delta = settings_.Delta0;
239 spdlog::info(
240 " | iter | inner_i | rho | energy | energy_p | energy_inc | norm(g) | Delta | norm(corr) | "
241 "InnerBreakReason");
242 spdlog::info("{:-^143}", "-");
243 while (not stoppingCriterion(e)) {
244 this->notify(ITERATION_STARTED, state);
245 if (settings_.useRand) {
246 if (stats_.outerIter == 0) {
247 eta_.setRandom();
248 while (eta_.dot(h * eta_) > innerInfo_.Delta * innerInfo_.Delta)
249 eta_ *= eps_; // eps is sqrt(sqrt(maschine-precision))
250 } else
251 eta_.setZero();
252 } else
253 eta_.setZero();
254
255 solveInnerProblem(g, h);
256 stats_.innerIterSum += innerInfo_.numInnerIter;
257
258 info_.stopReasonString = tcg_stop_reason_[static_cast<int>(innerInfo_.stop_tCG)];
259 Heta_ = h * eta_;
260 if (settings_.useRand and stats_.outerIter == 0) {
261 info_.used_cauchy = false;
262 info_.randomPredictionString = " Used Random correction predictor";
263 info_.cauchystr = " ";
264 double tauC;
265 // Check the curvature
266 const Eigen::VectorXd Hg = h * g;
267 const auto g_Hg = g.dot(Hg);
268 if (g_Hg <= 0)
269 tauC = 1;
270 else
271 tauC = std::min(Dune::power(stats_.gradNorm, 3) / (innerInfo_.Delta * g_Hg), 1.0);
272
273 // generate the Cauchy point.
274 const Eigen::VectorXd etaC = -tauC * innerInfo_.Delta / stats_.gradNorm * g;
275 const Eigen::VectorXd HetaC = -tauC * innerInfo_.Delta / stats_.gradNorm * Hg;
276
277 const double mdle = stats_.energy + g.dot(eta_) + .5 * Heta_.dot(eta_);
278 const double mdlec = stats_.energy + g.dot(etaC) + .5 * HetaC.dot(etaC);
279 if (mdlec < mdle && stats_.outerIter == 0) {
280 eta_ = etaC;
281 Heta_ = HetaC;
282 info_.used_cauchy = true;
283
284 info_.cauchystr = " USED CAUCHY POINT!";
285 }
286 } else
287 info_.cauchystr = " ";
288
289 stats_.etaNorm = eta_.norm();
290
291 updateFunction_(x, eta_);
292
293 // Calculate energy of our proposed update step
294 e = energyF(x);
295 stats_.energyProposal = e;
296
297 // Will we accept the proposal or not?
298 // Check the performance of the quadratic model against the actual energy.
299 auto rhonum = stats_.energy - stats_.energyProposal;
300 auto rhoden = -eta_.dot(g + 0.5 * Heta_);
301
302 /* Close to convergence the proposed energy and the real energy almost coincide.
303 * Therefore, the performance check of our model becomes ill-conditioned
304 * The regularisation fixes this */
305 const auto rhoReg = std::max(1.0, abs(stats_.energy)) * eps_ * settings_.rho_reg;
306 rhonum = rhonum + rhoReg;
307 rhoden = rhoden + rhoReg;
308
309 const bool modelDecreased = rhoden > 0.0;
310
311 if (!modelDecreased)
312 info_.stopReasonString.append(", model did not decrease");
313
314 stats_.rho = rhonum / rhoden;
315 stats_.rho = stats_.rho < 0.0 ? -1.0 : stats_.rho; // move rho to the domain [-1.0,inf]
316
317 info_.trstr = " ";
318
319 // measure if energy decreased
320 const bool energyDecreased = Dune::FloatCmp::ge(stats_.energy - stats_.energyProposal, -1e-12);
321
322 // If the model behaves badly or if the energy increased we reduce the trust region size
323 if (stats_.rho < 1e-4 || not modelDecreased || std::isnan(stats_.rho) || not energyDecreased) {
324 info_.trstr = "TR-";
325 innerInfo_.Delta /= 4.0;
326 info_.consecutive_TRplus = 0;
327 info_.consecutive_TRminus++;
328 if (info_.consecutive_TRminus >= 5 && settings_.verbosity >= 1) {
329 info_.consecutive_TRminus = -std::numeric_limits<int>::infinity();
330 spdlog::info(" +++ Detected many consecutive TR- (radius decreases).");
331 spdlog::info(" +++ Consider decreasing options.Delta_bar by an order of magnitude.");
332 }
333
334 } else if (stats_.rho > 0.99 && (innerInfo_.stop_tCG == Eigen::TCGStopReason::negativeCurvature ||
336 info_.trstr = "TR+";
337 innerInfo_.Delta = std::min(3.5 * innerInfo_.Delta, settings_.Delta_bar);
338 info_.consecutive_TRminus = 0;
339 info_.consecutive_TRplus++;
340 if (info_.consecutive_TRplus >= 5 && settings_.verbosity >= 1) {
341 info_.consecutive_TRplus = -std::numeric_limits<int>::infinity();
342 spdlog::info(" +++ Detected many consecutive TR+ (radius increases)");
343 spdlog::info(" +++ Consider increasing options.Delta_bar by an order of magnitude");
344
345 } else {
346 info_.consecutive_TRplus = 0;
347 info_.consecutive_TRminus = 0;
348 }
349 }
350
351 if (modelDecreased && stats_.rho > settings_.rho_prime && energyDecreased) {
352 if (stats_.energyProposal > stats_.energy)
353 spdlog::info(
354 "Energy function increased by {} (step size: {}). Since this is small we accept the step and hope for "
355 "convergence of the gradient norm.",
356 stats_.energyProposal - stats_.energy, stats_.etaNorm);
357
358 info_.acceptProposal = true;
359 info_.accstr = "acc";
360 info_.consecutive_Rejected = 0;
361 } else {
362 info_.acceptProposal = false;
363 info_.accstr = "REJ";
364
365 if (info_.consecutive_Rejected >= 5)
366 innerInfo_.Delta /= 2;
367 else
368 innerInfo_.Delta = std::min(innerInfo_.Delta, stats_.etaNorm / 2.0);
369 ++info_.consecutive_Rejected;
370 }
371
372 stats_.outerIter++;
373
374 if (settings_.verbosity == 1)
375 logState();
376
377 info_.randomPredictionString = "";
378
379 solverInformation.correctionNorm = stats_.etaNorm;
380 solverInformation.residualNorm = stats_.gradNorm;
381 this->notify(CORRECTION_UPDATED, state);
382
383 if (info_.acceptProposal) {
384 stats_.energy = stats_.energyProposal;
385 this->notify(CORRECTIONNORM_UPDATED, state);
386 this->notify(RESIDUALNORM_UPDATED, state);
387 this->notify(SOLUTION_CHANGED, state);
388 } else {
389 updateFunction_(x, -eta_);
390 eta_.setZero();
391 }
392 e = energyF(x);
393 g = gradientF(x);
394 h = hessianF(x);
395 stats_.gradNorm = g.norm();
397 }
398 spdlog::info("{}", info_.reasonString);
399 spdlog::info("Total iterations: {} Total CG Iterations: {}", stats_.outerIter, stats_.innerIterSum);
400
401 solverInformation.success =
403
404 solverInformation.iterations = stats_.outerIter;
405 solverInformation.residualNorm = stats_.gradNorm;
406 if (solverInformation.success)
408 return solverInformation;
409 }
414 auto& energy() { return energyFunction_; }
415
420 auto residual() { return derivative(energyFunction_); }
421
422private:
423 template <class T>
424 constexpr auto make_optional_reference(T& value) {
425 return std::make_optional<std::reference_wrapper<const T>>(std::cref(value));
426 }
427
428 template <class T>
429 requires(not std::is_lvalue_reference_v<T>)
430 constexpr T make_optional_reference(T&& value) {
431 return value;
432 }
433
434 void logState() const {
435 spdlog::info(
436 "{:>3s} {:>3s} {:>6d} {:>9d} {:>6.2f} {:>9.2e} {:>9.2e} {:>11.2e} {:>9.2e} {:>9.2e} {:>11.2e} "
437 "{:<73}",
438 info_.accstr, info_.trstr, stats_.outerIter, innerInfo_.numInnerIter, stats_.rho, stats_.energy,
439 stats_.energyProposal, stats_.energyProposal - stats_.energy, stats_.gradNorm, innerInfo_.Delta, stats_.etaNorm,
441 }
442
443 void logFinalState() {
444 spdlog::info("{:>3s} {:>3s} {:>6d} {:>9d} {: ^6} {: ^9} {: ^9} {: ^11} {:>9.2e} {: ^9} {: ^11} {:<73}",
445 info_.accstr, info_.trstr, stats_.outerIter, innerInfo_.numInnerIter, " ", " ", " ", " ",
446 stats_.gradNorm, " ", " ", info_.stopReasonString + info_.cauchystr + info_.randomPredictionString);
447 }
448
449 bool stoppingCriterion(const auto& energy) {
450 std::ostringstream stream;
452 if (stats_.gradNorm < settings_.grad_tol && stats_.outerIter != 0) {
453 logFinalState();
454 spdlog::info("CONVERGENCE: Energy: {:1.16e} norm(gradient): {:1.16e}", energy, stats_.gradNorm);
455 stream << "Gradient norm tolerance reached; options.tolerance = " << settings_.grad_tol;
456
457 info_.reasonString = stream.str();
458
460 return true;
461 } else if (stats_.etaNorm < settings_.corr_tol && stats_.outerIter != 0) {
462 logFinalState();
463 spdlog::info("CONVERGENCE: Energy: {:1.16e} norm(correction): {:1.16e}", energy, stats_.etaNorm);
464 stream << "Displacement norm tolerance reached; = " << settings_.corr_tol << "." << std::endl;
465
466 info_.reasonString = stream.str();
468 return true;
469 }
470
472 if (stats_.time >= settings_.maxtime) {
473 logFinalState();
474 stream << "Max time exceeded; options.maxtime = " << settings_.maxtime << ".";
475 info_.reasonString = stream.str();
477 return true;
478 }
479
481 if (stats_.outerIter >= settings_.maxIter) {
482 logFinalState();
483 stream << "Max iteration count reached; options.maxiter = " << settings_.maxIter << ".";
484 info_.reasonString = stream.str();
486 return true;
487 }
488 return false;
489 }
490
491 void solveInnerProblem(const auto& g, const auto& h) {
492 truncatedConjugateGradient_.setInfo(innerInfo_);
493 int attempts = 0;
494 truncatedConjugateGradient_.factorize(h);
495 // If the preconditioner is IncompleteCholesky the factorization may fail if we have negative diagonal entries and
496 // the initial shift is too small. Therefore, if the factorization fails we increase the initial shift by a factor
497 // of 5.
498 if constexpr (preConditioner == PreConditioner::IncompleteCholesky) {
499 while (truncatedConjugateGradient_.info() != Eigen::Success) {
500 choleskyInitialShift_ *= 5;
501 truncatedConjugateGradient_.preconditioner().setInitialShift(choleskyInitialShift_);
502 truncatedConjugateGradient_.factorize(h);
503 if (attempts > 5)
504 DUNE_THROW(Dune::MathError, "Factorization of preconditioner failed!");
505 ++attempts;
506 }
507 if (truncatedConjugateGradient_.info() == Eigen::Success)
508 choleskyInitialShift_ = 1e-3;
509 }
510 eta_ = truncatedConjugateGradient_.solveWithGuess(-g, eta_);
511 innerInfo_ = truncatedConjugateGradient_.getInfo();
512 }
513
514 F energyFunction_;
515
516 UpdateFunction updateFunction_;
517 std::remove_cvref_t<CorrectionType> eta_;
518 std::remove_cvref_t<CorrectionType> Heta_;
519 Settings settings_;
520 AlgoInfo info_;
521 double choleskyInitialShift_ = 1e-3;
522 Eigen::TCGInfo<double> innerInfo_;
523 Stats stats_;
524 static constexpr double eps_ = 0.0001220703125; // 0.0001220703125 is sqrt(sqrt(maschine-precision))
525 std::array<std::string, 6> tcg_stop_reason_{
526 {"negative curvature", "exceeded trust region", "reached target residual-kappa (linear)",
527 "reached target residual-theta (superlinear)", "maximum inner iterations", "model increased"}
528 };
529
530 using PreConditionerType =
531 std::conditional_t<preConditioner == PreConditioner::IdentityPreconditioner, Eigen::IdentityPreconditioner,
532 std::conditional_t<preConditioner == PreConditioner::DiagonalPreconditioner,
533 typename Eigen::DiagonalPreconditioner<std::decay_t<EnergyType>>,
534 typename Eigen::IncompleteCholesky<std::decay_t<EnergyType>>>>;
535 Eigen::TruncatedConjugateGradient<std::decay_t<HessianType>, Eigen::Lower | Eigen::Upper, PreConditionerType>
536 truncatedConjugateGradient_;
537};
538
549template <typename F, PreConditioner preConditioner = PreConditioner::IncompleteCholesky,
550 typename UF = utils::UpdateDefault>
551auto makeTrustRegion(const F& f, UF&& updateFunction = {}) {
552 return std::make_shared<TrustRegion<F, preConditioner, UF>>(f, updateFunction);
553}
554
555template <typename F, PreConditioner preConditioner = PreConditioner::IncompleteCholesky,
556 typename UF2 = utils::UpdateDefault>
557TrustRegion(const F& f, UF2&& updateFunction = {}) -> TrustRegion<F, preConditioner, std::remove_cvref_t<UF2>>;
558
559} // namespace Ikarus
Contains stl-like type traits.
Collection of fallback default functions.
Helper for the autodiff library.
Implementation of the solver information returned by the nonlinear solvers.
Base for all nonlinear solvers.
Definition of TruncatedConjugateGradient class for solving linear systems using truncated conjugate g...
Implementation of the observer design pattern with broadcasters.
Enums for observer messages.
auto norm(const Eigen::MatrixBase< Derived > &v)
Adding free norm function to Eigen types.
Definition: linearalgebrahelper.hh:259
Definition: assemblermanipulatorbuildingblocks.hh:22
TrustRegion(const F &f, UF2 &&updateFunction={}) -> TrustRegion< F, preConditioner, std::remove_cvref_t< UF2 > >
::value auto createNonlinearSolver(NRConfig &&config, F &&f)
Function to create a NewtonRaphson solver instance.
Definition: newtonraphson.hh:82
auto makeTrustRegion(const F &f, UF &&updateFunction={})
Creates an instance of the TrustRegion solver.
Definition: trustregion.hh:551
NonLinearSolverMessages
Enum class defining non-linear solver-related messages.
Definition: broadcastermessages.hh:22
StopReason
Enumeration of reasons for stopping the TrustRegion solver.
Definition: trustregion.hh:113
PreConditioner
Enumeration of available preconditioners for the trust region solver.
Definition: trustregion.hh:37
Scalar Delta
Definition: truncatedconjugategradient.hh:38
TCGStopReason stop_tCG
Definition: truncatedconjugategradient.hh:37
Eigen::Index numInnerIter
Definition: truncatedconjugategradient.hh:43
Iterative solver for solving linear systems using the truncated conjugate gradient method.
Definition: truncatedconjugategradient.hh:196
TCGInfo< typename MatrixType::RealScalar > getInfo()
Get information about the truncated conjugate gradient algorithm.
Definition: truncatedconjugategradient.hh:227
void setInfo(TCGInfo< typename MatrixType::RealScalar > alginfo)
Set information about the truncated conjugate gradient algorithm.
Definition: truncatedconjugategradient.hh:233
Base for all nonlinear solvers. Defines the message interface that can be broadcasted to listeners.
Definition: nonlinearsolverbase.hh:24
State for nonlinear solvers.
Definition: nonlinearsolverstate.hh:24
const Domain & domain
Definition: nonlinearsolverstate.hh:28
Information about the result of a non-linear solver.
Definition: solverinfos.hh:21
double correctionNorm
Definition: solverinfos.hh:30
int iterations
Definition: solverinfos.hh:31
double residualNorm
Definition: solverinfos.hh:29
bool success
Definition: solverinfos.hh:28
Definition: trustregion.hh:44
double grad_tol
Gradient tolerance.
Definition: trustregion.hh:50
double Delta_bar
Maximum trust region radius.
Definition: trustregion.hh:55
double rho_reg
Regularization value for rho.
Definition: trustregion.hh:54
double Delta0
Initial trust region radius.
Definition: trustregion.hh:56
bool useRand
Flag for using random correction predictor.
Definition: trustregion.hh:53
int verbosity
Verbosity level.
Definition: trustregion.hh:45
int debug
Debugging flag.
Definition: trustregion.hh:49
int minIter
Minimum number of iterations.
Definition: trustregion.hh:47
double maxtime
Maximum allowable time for solving.
Definition: trustregion.hh:46
double corr_tol
Correction tolerance.
Definition: trustregion.hh:51
int maxIter
Maximum number of iterations.
Definition: trustregion.hh:48
double rho_prime
Rho prime value.
Definition: trustregion.hh:52
Definition: trustregion.hh:66
static constexpr PreConditioner preConditionerType
Definition: trustregion.hh:73
TRSettings parameters
Definition: trustregion.hh:72
UF UpdateFunction
Definition: trustregion.hh:70
UF updateFunction
Definition: trustregion.hh:74
auto rebindUpdateFunction(UF2 &&updateFunction) const
Definition: trustregion.hh:76
Trust Region solver for non-linear optimization problems.
Definition: trustregion.hh:173
UF UpdateFunction
Type of the update function.
Definition: trustregion.hh:180
typename FTraits::template Range< 0 > EnergyType
Type of the scalar cost.
Definition: trustregion.hh:183
auto residual()
Access the residual.
Definition: trustregion.hh:420
TrustRegion(const F &f, UF2 &&updateFunction={})
Constructs a TrustRegion solver instance.
Definition: trustregion.hh:193
typename FTraits::template Range< 2 > HessianType
Type of the Hessian matrix.
Definition: trustregion.hh:185
typename FTraits::template Range< 1 > GradientType
Type of the gradient vector.
Definition: trustregion.hh:184
F DifferentiableFunction
Type of function to minimize.
Definition: trustregion.hh:181
typename FTraits::Domain Domain
Type of the parameter vector of.
Definition: trustregion.hh:178
typename FTraits::template Range< 1 > CorrectionType
Type of the correction of x += deltaX.
Definition: trustregion.hh:179
TRSettings Settings
Type of the settings for the TrustRegion solver.
Definition: trustregion.hh:175
void setup(const Settings &settings)
Sets up the TrustRegion solver with the provided settings and checks feasibility.
Definition: trustregion.hh:201
NonLinearSolverInformation solve(Domain &x)
Solves the nonlinear optimization problem using the TrustRegion algorithm.
Definition: trustregion.hh:214
typename F::Traits FTraits
Definition: trustregion.hh:177
auto & energy()
Access the energy function.
Definition: trustregion.hh:414
Additional information about the TrustRegion algorithm.
Definition: trustregion.hh:126
std::string cauchystr
Used Cauchy step string.
Definition: trustregion.hh:134
StopReason stop
Stopping reason.
Definition: trustregion.hh:137
std::string randomPredictionString
Random prediction string.
Definition: trustregion.hh:133
bool acceptProposal
Flag indicating whether the proposal is accepted.
Definition: trustregion.hh:135
std::string reasonString
String describing the stopping reason.
Definition: trustregion.hh:138
int consecutive_TRminus
Consecutive trust region decreases.
Definition: trustregion.hh:128
bool used_cauchy
Flag indicating whether Cauchy point was used.
Definition: trustregion.hh:136
int consecutive_Rejected
Consecutive rejected proposals.
Definition: trustregion.hh:129
std::string trstr
Trust region change string (TR+, TR-).
Definition: trustregion.hh:131
std::string stopReasonString
String describing the stopping reason.
Definition: trustregion.hh:130
std::string accstr
Acceptance string (REJ, acc).
Definition: trustregion.hh:132
int consecutive_TRplus
Consecutive trust region increases.
Definition: trustregion.hh:127
Information about the TrustRegion solver.
Definition: trustregion.hh:146
double rho
Definition: trustregion.hh:152
double etaNorm
Definition: trustregion.hh:148
double energyProposal
Definition: trustregion.hh:151
double energy
Definition: trustregion.hh:150
double gradNorm
Definition: trustregion.hh:147
int outerIter
Definition: trustregion.hh:153
double time
Definition: trustregion.hh:149
int innerIterSum
Definition: trustregion.hh:154
void notify(NonLinearSolverMessages message, const State &data)
This calls all the registered functions.
Definition: broadcaster.hh:61