Paparazzi UAS
v5.8.2_stable-0-g6260b7c
Paparazzi is a free software Unmanned Aircraft System.
|
Matrix decompositions in floating point. More...
#include "math/pprz_matrix_decomp_float.h"
#include "math/pprz_algebra_float.h"
#include <math.h>
#include <string.h>
Go to the source code of this file.
Functions | |
void | pprz_cholesky_float (float **out, float **in, int n) |
Cholesky decomposition. More... | |
void | pprz_qr_float (float **Q, float **R, float **in, int m, int n) |
QR decomposition. More... | |
static float | pythag (float a, float b) |
Some SVD decomposition utility macros and functions. More... | |
int | pprz_svd_float (float **a, float *w, float **v, int m, int n) |
SVD decomposition. More... | |
void | pprz_svd_solve_float (float **x, float **u, float *w, float **v, float **b, int m, int n, int l) |
SVD based linear solver. More... | |
Matrix decompositions in floating point.
Definition in file pprz_matrix_decomp_float.c.
void pprz_cholesky_float | ( | float ** | out, |
float ** | in, | ||
int | n | ||
) |
Cholesky decomposition.
http://rosettacode.org/wiki/Cholesky_decomposition#C
out | pointer to the output array [n x n] |
in | pointer to the input array [n x n] |
n | dimension of the matrix |
Definition at line 40 of file pprz_matrix_decomp_float.c.
References float_mat_copy(), float_mat_zero(), and MAKE_MATRIX_PTR.
void pprz_qr_float | ( | float ** | Q, |
float ** | R, | ||
float ** | in, | ||
int | m, | ||
int | n | ||
) |
QR decomposition.
using Householder method
http://rosettacode.org/wiki/QR_decomposition#C
Q | square orthogonal matrix Q [m x m] |
R | upper triangular matrix R [m x n] |
in | pointer to the input array [m x n] |
m | number of rows of the input matrix |
n | number of column of the input matrix |
Definition at line 73 of file pprz_matrix_decomp_float.c.
References float_mat_col(), float_mat_copy(), float_mat_minor(), float_mat_mul(), float_mat_transpose(), float_mat_vmul(), float_vect_norm(), float_vect_sdiv(), Int32RMat::m, and MAKE_MATRIX_PTR.
int pprz_svd_float | ( | float ** | a, |
float * | w, | ||
float ** | v, | ||
int | m, | ||
int | n | ||
) |
SVD decomposition.
------------------------------------------------------------------— * Reference: "Numerical Recipes By W.H. Press, B. P. Flannery, * S.A. Teukolsky and W.T. Vetterling, Cambridge * University Press, 1986" [BIBLI 08]. * ------------------------------------------------------------------— *
Given a matrix a(m,n), this routine computes its singular value decomposition, A = U · W · Vt. The matrix U replaces a on output. The diagonal matrix of singular values W is output as a vector w(n). The matrix V (not the transpose Vt) is output as v(n,n).
a | input matrix [m x n] and output matrix U [m x n] |
w | output diagonal vector of matrix W [n] |
v | output square matrix V [n x n] |
m | number of rows of input the matrix |
n | number of columns of the input matrix |
Definition at line 147 of file pprz_matrix_decomp_float.c.
References Int32RMat::m, and pythag().
Referenced by fit_linear_flow_field(), and pprz_polyfit_float().
void pprz_svd_solve_float | ( | float ** | x, |
float ** | u, | ||
float * | w, | ||
float ** | v, | ||
float ** | b, | ||
int | m, | ||
int | n, | ||
int | l | ||
) |
SVD based linear solver.
Solves A · X = B for a vector X, where A is specified by the arrays u, w, v as returned by pprz_svd_float. m and n are the dimensions of a. b(m) is the input right-hand side. x(n) is the output solution vector. No input quantities are destroyed, so the routine may be called sequentially with different b's.
x | solution of the system ([n x l] matrix) |
u | U matrix from SVD decomposition |
w | diagonal of the W matrix from the SVD decomposition |
v | V matrrix from SVD decomposition |
b | right-hand side input matrix from system to solve (column vector [m x l]) |
m | number of rows of the matrix A |
n | number of columns of the matrix A |
l | number of columns of the matrix B |
Definition at line 446 of file pprz_matrix_decomp_float.c.
References Int32RMat::m.
Referenced by fit_linear_flow_field(), and pprz_polyfit_float().
|
inlinestatic |
Some SVD decomposition utility macros and functions.
Definition at line 112 of file pprz_matrix_decomp_float.c.
Referenced by pprz_svd_float().