|
RcdMathLib_doc
Open Source Library for Linear and Non-linear Algebra
|
Implement the Levenberg–Marquardt (LVM) algorithm. More...
#include <stdio.h>#include <math.h>#include <float.h>#include <inttypes.h>#include "levenberg_marquardt.h"#include "matrix.h"#include "vector.h"#include "solve.h"#include "utils.h"Go to the source code of this file.
Functions | |
| matrix_t | opt_levenberg_marquardt_correction (uint8_t f_length, uint8_t n, matrix_t x_vec[n], matrix_t data_vec[f_length], matrix_t mu, matrix_t s[n], void(*get_f_error)(vector_t x_vec[], vector_t data_vec[], vector_t f_vec[]), void(*get_jacobian)(vector_t x_vec[], matrix_t J[][n])) |
| Implements the correction-function of the Levenberg–Marquardt (LVM) algorithm. More... | |
| uint8_t | opt_levenberg_marquardt (uint8_t f_length, uint8_t n, vector_t x0_vec[n], vector_t data_vec[f_length], matrix_t eps, matrix_t tau, matrix_t beta0, matrix_t beta1, uint8_t max_iter_num, vector_t est_x_vec[n], void(*get_f_error)(vector_t x0_vec[], vector_t data_vec[], vector_t f_vec[]), void(*get_jacobian)(vector_t x0_vec[], matrix_t J[][n])) |
| Implements the Levenberg–Marquardt (LVM) algorithm. More... | |
| matrix_t | opt_levenberg_marquardt_get_mu0 (uint8_t n, matrix_t tau, matrix_t JTJ[][n]) |
Compute the initial value of the Levenberg–Marquardt (LVM) algorithm. More... | |
Implement the Levenberg–Marquardt (LVM) algorithm.
Definition in file levenberg_marquardt.c.
| uint8_t opt_levenberg_marquardt | ( | uint8_t | f_length, |
| uint8_t | n, | ||
| vector_t | x0_vec[n], | ||
| vector_t | data_vec[f_length], | ||
| matrix_t | eps, | ||
| matrix_t | tau, | ||
| matrix_t | beta0, | ||
| matrix_t | beta1, | ||
| uint8_t | max_iter_num, | ||
| vector_t | est_x_vec[n], | ||
| void(*)(vector_t x0_vec[], vector_t data_vec[], vector_t f_vec[]) | get_f_error, | ||
| void(*)(vector_t x0_vec[], matrix_t J[][n]) | get_jacobian | ||
| ) |
Implements the Levenberg–Marquardt (LVM) algorithm.
The user should provide pointers to the error and Jacobian functions.
| [in] | f_length | length of the error functions vector. |
| [in] | n | length of the start vector. |
| [in] | x0_vec[] | start vector. |
| [in] | data_vec[] | data vector. |
| [in] | eps | accuracy bound. |
| [in] | tau | factor. |
| [in] | beta0 | factor. |
| [in] | beta1 | factor. |
| [in] | max_iter_num | maximal iteration number of the LVM algorithm. |
| [out] | est_x_vec[] | estimated (optimized) vector. |
| [in] | (*get_f_error) | pointer to the error function. |
| [in] | (*get_jacobian) | pointer to the Jacobian matrix. |
Definition at line 143 of file levenberg_marquardt.c.
References matrix_add_to_diag(), matrix_mul_scalar(), matrix_t, matrix_trans_mul_itself(), matrix_trans_mul_vec(), opt_levenberg_marquardt_correction(), opt_levenberg_marquardt_get_mu0(), solve_householder(), vector_add(), vector_copy(), vector_get_norm2(), and vector_t.
Referenced by optimization_exponential_data_test(), optimization_sinusoidal_data_test(), and optimization_test().
| matrix_t opt_levenberg_marquardt_correction | ( | uint8_t | f_length, |
| uint8_t | n, | ||
| matrix_t | x_vec[n], | ||
| matrix_t | data_vec[f_length], | ||
| matrix_t | mu, | ||
| matrix_t | s[n], | ||
| void(*)(vector_t x_vec[], vector_t data_vec[], vector_t f_vec[]) | get_f_error, | ||
| void(*)(vector_t x_vec[], matrix_t J[][n]) | get_jacobian | ||
| ) |
Implements the correction-function of the Levenberg–Marquardt (LVM) algorithm.
The user should provide pointers to the error and Jacobian functions.
| [in] | f_length | length of the error functions vector. |
| [in] | n | length of the start vector. |
| [in] | x_vec[] | start vector. |
| [in] | data_vec[] | data vector. |
| [in] | mu | regularization parameter . |
| [out] | s[] | correction vector. |
| [in] | (*get_f_error) | pointer to the error function that calculates the matrix . |
| [in] | (*get_jacobian) | pointer to the Jacobian matrix. |
Definition at line 53 of file levenberg_marquardt.c.
References matrix_add_to_diag(), matrix_mul_scalar(), matrix_mul_vec(), matrix_t, matrix_trans_mul_itself(), matrix_trans_mul_vec(), solve_householder(), vector_add(), vector_get_scalar_product(), and vector_t.
Referenced by opt_levenberg_marquardt().
Compute the initial value
of the Levenberg–Marquardt (LVM) algorithm.
The user should provide a pointer to the matrix
.
| [in] | n | column number of the matrix . |
| [in] | tau | factor. |
| [in] | JTJ[][] | pointer to the matrix . |
Definition at line 227 of file levenberg_marquardt.c.
References matrix_t.
Referenced by opt_levenberg_marquardt().