optimize_least_squares_mango.cpp
Go to the documentation of this file.
1
// Copyright 2019, University of Maryland and the MANGO development team.
2
//
3
// This file is part of MANGO.
4
//
5
// MANGO is free software: you can redistribute it and/or modify it
6
// under the terms of the GNU Lesser General Public License as
7
// published by the Free Software Foundation, either version 3 of the
8
// License, or (at your option) any later version.
9
//
10
// MANGO is distributed in the hope that it will be useful, but
11
// WITHOUT ANY WARRANTY; without even the implied warranty of
12
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
// Lesser General Public License for more details.
14
//
15
// You should have received a copy of the GNU Lesser General Public
16
// License along with MANGO. If not, see
17
// <https://www.gnu.org/licenses/>.
18
19
#include <iostream>
20
#include <cassert>
21
#include <stdexcept>
22
#include "
Least_squares_solver.hpp
"
23
#include "
Package_mango.hpp
"
24
// <includes>
25
// This section was automatically generated by ./update_algorithms
26
#include "
Levenberg_marquardt.hpp
"
27
// </includes>
28
29
void
mango::Package_mango::optimize_least_squares
(
Least_squares_solver
* solver) {
30
if
(solver->
verbose
>0) std::cout <<
"Hello from optimize_least_squares_mango"
<< std::endl;
31
32
LeastSquaresAlgorithm
* algorithm;
33
34
switch
(solver->
algorithm
) {
35
// <algorithms>
36
// This section was automatically generated by ./update_algorithms
37
case
MANGO_LEVENBERG_MARQUARDT
:
38
algorithm =
new
Levenberg_marquardt
(solver);
39
break
;
40
// </algorithms>
41
default
:
42
throw
std::runtime_error(
"Error in mango::Package_mango::optimize_least_squares. Unexpected algorithm."
);
43
}
44
45
algorithm->
solve
();
46
}
47
Least_squares_solver.hpp
mango::LeastSquaresAlgorithm::solve
virtual void solve()=0
mango::Solver::verbose
int verbose
Definition:
Solver.hpp:63
mango::Least_squares_solver
Definition:
Least_squares_solver.hpp:28
mango::Package_mango::optimize_least_squares
void optimize_least_squares(Least_squares_solver *)
Definition:
optimize_least_squares_mango.cpp:29
mango::Levenberg_marquardt
Definition:
Levenberg_marquardt.hpp:13
mango::LeastSquaresAlgorithm
Definition:
Package_mango.hpp:48
mango::MANGO_LEVENBERG_MARQUARDT
@ MANGO_LEVENBERG_MARQUARDT
Definition:
mango.hpp:78
Package_mango.hpp
mango::Solver::algorithm
algorithm_type algorithm
Definition:
Solver.hpp:42
Levenberg_marquardt.hpp