RcdMathLib_doc
Open Source Library for Linear and Non-linear Algebra
modified_gauss_newton.c File Reference

Implement the Gauss–Newton algorithm. More...

#include <stdio.h>
#include <math.h>
#include "utils.h"
#include "matrix.h"
#include "vector.h"
#include "moore_penrose_pseudo_inverse.h"

Go to the source code of this file.

Functions

uint8_t modified_gauss_newton (uint8_t f_length, uint8_t n, vector_t x0_vec[n], vector_t data_vec[f_length], matrix_t eps, matrix_t fmin, 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 modified Gauss–Newton algorithm. More...
 

Detailed Description

Implement the Gauss–Newton algorithm.

Note
This function is generally implemented.
Author
Zakaria Kasmi zkasm.nosp@m.i@in.nosp@m.f.fu-.nosp@m.berl.nosp@m.in.de
Abdelmoumen Norrdine a.nor.nosp@m.rdin.nosp@m.e@goo.nosp@m.glem.nosp@m.ail.c.nosp@m.om

Definition in file modified_gauss_newton.c.

Function Documentation

◆ modified_gauss_newton()

uint8_t modified_gauss_newton ( uint8_t  f_length,
uint8_t  n,
vector_t  x0_vec[n],
vector_t  data_vec[f_length],
matrix_t  eps,
matrix_t  fmin,
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 modified Gauss–Newton algorithm.

The user should provide pointers to the error and Jacobian functions.

Note
This function is generally implemented.
Parameters
[in]f_lengthlength of the error functions vector.
[in]nlength of the start vector.
[in]x0_vec[]start vector.
[in]data_vec[]data vector.
[in]epsaccuracy bound.
[in]fmintermination tolerance on the error function.
[in]max_iter_nummaximal iteration number of the Gauss–Newton 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.
Returns
required iteration number.

Definition at line 32 of file modified_gauss_newton.c.

References matrix_mul_vec(), matrix_t, matrix_trans_mul_itself(), matrix_trans_mul_vec(), moore_penrose_get_pinv(), utils_max(), vector_copy(), vector_get_euclidean_distance(), vector_get_norm2(), vector_sub(), and vector_t.

Referenced by optimization_exponential_data_test(), optimization_sinusoidal_data_test(), and optimization_test().