Paparazzi UAS  v5.12_stable-4-g9b43e9b
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
pprz_matrix_decomp_float.c File Reference

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>
+ Include dependency graph for pprz_matrix_decomp_float.c:

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...
 

Detailed Description

Matrix decompositions in floating point.

Definition in file pprz_matrix_decomp_float.c.

Function Documentation

void pprz_cholesky_float ( float **  out,
float **  in,
int  n 
)

Cholesky decomposition.

http://rosettacode.org/wiki/Cholesky_decomposition#C

Parameters
outpointer to the output array [n x n]
inpointer to the input array [n x n]
ndimension 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.

+ Here is the call graph for this function:

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

Parameters
Qsquare orthogonal matrix Q [m x m]
Rupper triangular matrix R [m x n]
inpointer to the input array [m x n]
mnumber of rows of the input matrix
nnumber 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.

+ Here is the call graph for this function:

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).

Parameters
ainput matrix [m x n] and output matrix U [m x n]
woutput diagonal vector of matrix W [n]
voutput square matrix V [n x n]
mnumber of rows of input the matrix
nnumber of columns of the input matrix
Returns
0 (false) if convergence failed, 1 (true) if decomposition succed

Definition at line 147 of file pprz_matrix_decomp_float.c.

References H, Int32RMat::m, pythag(), mesonh.mesonh_atmosphere::X, mesonh.mesonh_atmosphere::Y, and mesonh.mesonh_atmosphere::Z.

Referenced by fit_linear_flow_field(), and pprz_polyfit_float().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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.

Parameters
xsolution of the system ([n x l] matrix)
uU matrix from SVD decomposition
wdiagonal of the W matrix from the SVD decomposition
vV matrrix from SVD decomposition
bright-hand side input matrix from system to solve (column vector [m x l])
mnumber of rows of the matrix A
nnumber of columns of the matrix A
lnumber 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().

+ Here is the caller graph for this function:

static float pythag ( float  a,
float  b 
)
inlinestatic

Some SVD decomposition utility macros and functions.

Definition at line 112 of file pprz_matrix_decomp_float.c.

Referenced by pprz_svd_float().

+ Here is the caller graph for this function: