|
RcdMathLib_doc
Open Source Library for Linear and Non-linear Algebra
|
Go to the documentation of this file.
37 void (*get_f_error)(
vector_t x0_vec[],
40 void (*get_jacobian)(
vector_t x0_vec[],
58 get_f_error(x0_vec, data_vec, f_vec);
61 min_error = max_error;
68 while ((step >= eps) && (iter_num < max_iter_num) && (f_error > fmin)) {
73 get_jacobian(x_vec, J);
77 get_f_error(x_vec, data_vec, f_vec);
86 vector_sub(n, x_vec, correction_vec, next_x_vec);
95 get_f_error(x_vec, data_vec, f_vec);
99 if (min_error > f_error) {
104 max_error =
utils_max(f_error, max_error);
106 if ((max_error - min_error) > 10) {
int8_t moore_penrose_get_pinv(uint8_t m, uint8_t n, matrix_t A[m][n], matrix_t pinv_A[n][m])
Calculate the Moore–Penrose inverse of a rectangular matrix.
vector_t vector_get_norm2(uint8_t length, vector_t arr[])
Compute the 2-norm norm of a vector.
void matrix_mul_vec(uint8_t m, uint8_t n, matrix_t matrix[m][n], matrix_t vec[n], matrix_t dst_arr[m])
Compute the multiplication of a matrix with a column vector.
vector_t vector_get_euclidean_distance(uint8_t length, vector_t vec1[], vector_t vec2[])
Compute the Euclidean distance between two vectors.
#define vector_t
Define the data type of the vector elements.
void matrix_trans_mul_itself(uint8_t m, uint8_t n, matrix_t A[m][n], matrix_t AT_mul_A[n][n])
Compute the multiplication of the transpose of a matrix with itself.
void matrix_trans_mul_vec(uint8_t m, uint8_t n, matrix_t A[m][n], uint8_t b_size, matrix_t b_vec[m], matrix_t c_vec[n])
Compute the multiplication of transposed matrix with column vector.
Moore–Penrose algorithm to compute the pseudo-inverse of a matrix.
Utilities for linear algebra.
double utils_max(double a, double b)
Returns the greater of two real numbers.
void vector_copy(uint8_t size, vector_t src_arr[], vector_t dest_arr[])
Copy the elements of the source vector to the destination vector.
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.
#define matrix_t
Define the data type of the matrix elements.
void vector_sub(uint8_t size, vector_t a_vec[], vector_t b_vec[], vector_t a_minus_b[])
Compute the subtraction of two vectors.