Skip to content

Commit be07540

Browse files
author
Francesco Rizzi
committed
fix default diagnostics for nnls
1 parent 579f8ca commit be07540

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

include/pressio/solvers_nonlinear/impl/nonlinear_least_squares.hpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -135,13 +135,13 @@ class NonLinLeastSquares : public RegistryType
135135
// currently we don't have the diagonostics stuff all flushed out
136136
// so we limit it to work for a specific case
137137
const auto & publicDiags = diagnostics_.publicNames();
138-
assert(publicDiags.size() == 6);
139-
assert(publicDiags[0] == Diagnostic::objectiveAbsolute);
140-
assert(publicDiags[1] == Diagnostic::objectiveRelative);
141-
assert(publicDiags[2] == Diagnostic::correctionAbsolutel2Norm);
142-
assert(publicDiags[3] == Diagnostic::correctionRelativel2Norm);
143-
assert(publicDiags[4] == Diagnostic::gradientAbsolutel2Norm);
144-
assert(publicDiags[5] == Diagnostic::gradientRelativel2Norm);
138+
// assert(publicDiags.size() == 6);
139+
// assert(publicDiags[0] == Diagnostic::objectiveAbsolute);
140+
// assert(publicDiags[1] == Diagnostic::objectiveRelative);
141+
// assert(publicDiags[2] == Diagnostic::correctionAbsolutel2Norm);
142+
// assert(publicDiags[3] == Diagnostic::correctionRelativel2Norm);
143+
// assert(publicDiags[4] == Diagnostic::gradientAbsolutel2Norm);
144+
// assert(publicDiags[5] == Diagnostic::gradientRelativel2Norm);
145145

146146
// check that the stopping criterion uses a metric already
147147
// supported in the diagonstics, otherwise add it

include/pressio/solvers_nonlinear/solvers_create_gauss_newton.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ auto create_gauss_newton_solver(const SystemType & system, /*(1)*/
9898
const std::vector<Diagnostic> defaultDiagnostics =
9999
{Diagnostic::objectiveAbsolute,
100100
Diagnostic::objectiveRelative,
101+
Diagnostic::residualAbsolutel2Norm,
102+
Diagnostic::residualRelativel2Norm,
101103
Diagnostic::correctionAbsolutel2Norm,
102104
Diagnostic::correctionRelativel2Norm,
103105
Diagnostic::gradientAbsolutel2Norm,
@@ -159,6 +161,8 @@ auto create_gauss_newton_solver(const SystemType & system, /*(2)*/
159161
const std::vector<Diagnostic> defaultDiagnostics =
160162
{Diagnostic::objectiveAbsolute,
161163
Diagnostic::objectiveRelative,
164+
Diagnostic::residualAbsolutel2Norm,
165+
Diagnostic::residualRelativel2Norm,
162166
Diagnostic::correctionAbsolutel2Norm,
163167
Diagnostic::correctionRelativel2Norm,
164168
Diagnostic::gradientAbsolutel2Norm,
@@ -217,6 +221,8 @@ auto create_gauss_newton_qr_solver(const SystemType & system,
217221
const std::vector<Diagnostic> defaultDiagnostics =
218222
{Diagnostic::objectiveAbsolute,
219223
Diagnostic::objectiveRelative,
224+
Diagnostic::residualAbsolutel2Norm,
225+
Diagnostic::residualRelativel2Norm,
220226
Diagnostic::correctionAbsolutel2Norm,
221227
Diagnostic::correctionRelativel2Norm,
222228
Diagnostic::gradientAbsolutel2Norm,

include/pressio/solvers_nonlinear/solvers_create_levenberg_marquardt.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,13 @@ auto create_levenberg_marquardt_solver(const SystemType & system,
100100
const std::vector<Diagnostic> defaultDiagnostics =
101101
{Diagnostic::objectiveAbsolute,
102102
Diagnostic::objectiveRelative,
103+
Diagnostic::residualAbsolutel2Norm,
104+
Diagnostic::residualRelativel2Norm,
103105
Diagnostic::correctionAbsolutel2Norm,
104106
Diagnostic::correctionRelativel2Norm,
105107
Diagnostic::gradientAbsolutel2Norm,
106108
Diagnostic::gradientRelativel2Norm};
107109

108-
109110
using tag = nonlinearsolvers::impl::LevenbergMarquardtNormalEqTag;
110111
using state_t = typename SystemType::state_type;
111112
using reg_t = nonlinearsolvers::impl::RegistryLevMarNormalEqs<SystemType, LinearSolverType>;

0 commit comments

Comments
 (0)