matrix_tools.h File Reference
#include <gsl/gsl_matrix.h>
#include <gsl/gsl_vector.h>
#include <gsl/gsl_blas.h>
#include <gsl/gsl_linalg.h>
#include <vector>
Include dependency graph for matrix_tools.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

gsl_matrix * colcat (const gsl_matrix *a, const gsl_matrix *b)
 Concatanate : columnwise.
gsl_matrix * rowcat (const gsl_matrix *a, const gsl_matrix *b)
 Concatenate : row-wise.
double gsl_det (gsl_matrix *m)
int gsl_inverse (gsl_matrix *m, gsl_matrix *im)
double gsl_inverse_det (gsl_matrix *m, gsl_matrix *im)
int gsl_linsolve_lu (gsl_matrix *A, gsl_vector *b, gsl_vector *x)
 Linear Algebra LU decomposition.
int gsl_linsolve_svd (gsl_matrix *A, gsl_vector *b, gsl_vector *x)
 Linear Algebra: SVD.
int encaps_gsl_linsolveSVD (vector< vector< double > > &A, vector< double > &b, vector< double > &x)
 SVD solutions.
int encaps_gsl_linsolveLU (double A[], double b[], double x[], int size)
 Encapsule gsl_linsolve_lu.
void gsl_vector2double (gsl_vector *gsl_v, double *v, size_t size)
 copie d'un gsl_vector dans un double[]
void gsl_vector2double_offset (gsl_vector *gsl_v, double *v, size_t size, size_t offset)
 Concert a gsl_vector to a double[].
void sub_double (double *v, double *vi, size_t size, size_t offset)
void gsl_matrix2double (gsl_matrix *gsl_m, double *m, size_t sizei, size_t sizej)
 copie d'un gsl_matrix dans un double[]
int gsl_rank_svd (gsl_matrix *A)
 Calculate rank of matrix using SVD.
int gsl_inverse_svd (gsl_matrix *A, gsl_matrix *invA)
 Calculate the inverse of a matrix (size n*m) using SVD.
int encaps_gsl_inverse_svd (double *A, double *invA, int noc, int nor)
double gsl_vector_norme (gsl_vector *v)
 norme d'un vecteur
int gsl_vector_cross_product3D (gsl_vector *A, gsl_vector *B, gsl_vector *AB)
 cross product
int gsl_vector_create_row (gsl_vector *row, gsl_vector *A, gsl_vector *B)
double norme_diff_vecteur (double *v1, double *v2, size_t size)
 Calculate the Eucleadian distance between 2 vectors.
void vect2double (vector< double > &vecA, double *A)
 Convert 1d vector to array of doubles.
void vectormat2double (vector< vector< double > > &matA, double *A)
 Convert 2d vector to array of doubles.
void gsl_dbl2matrix (double *A, gsl_matrix *Matr)
 Convert array of doubles to gsl_matrix.
int gsl_matrixprod (gsl_matrix *A, gsl_matrix *B, gsl_matrix *C)
 Calculate Matrix Product.
int gsl_matrixvecprod (gsl_matrix *A, gsl_vector *B, gsl_vector *C)
 Calculate Matrix - Vector Product.

Function Documentation

gsl_matrix* colcat ( const gsl_matrix *  a,
const gsl_matrix *  b 
)

Concatanate : columnwise.

Referenced by get_matrix_adjoin().

Here is the caller graph for this function:

int encaps_gsl_inverse_svd ( double *  A,
double *  invA,
int  noc,
int  nor 
)
int encaps_gsl_linsolveLU ( double  A[],
double  b[],
double  x[],
int  size 
)

Encapsule gsl_linsolve_lu.

References gsl_linsolve_lu().

Here is the call graph for this function:

int encaps_gsl_linsolveSVD ( vector< vector< double > > &  A,
vector< double > &  b,
vector< double > &  x 
)

SVD solutions.

This function takes in data expressed as vectors and solves linear equation Ax-b= 0 using the SVD method

References gsl_linsolve_svd(), vect2double(), and vectormat2double().

Here is the call graph for this function:

void gsl_dbl2matrix ( double *  A,
gsl_matrix *  Matr 
)

Convert array of doubles to gsl_matrix.

Convert an array of double A (of known size) to a gsl_matrix Matr(of known size, equal). The format followed is that Matr->data = A.

Referenced by calc_joint_angle_err().

Here is the caller graph for this function:

double gsl_det ( gsl_matrix *  m)

DETERMINANT DE MATRICES GSL

Referenced by get_trans_matrix().

Here is the caller graph for this function:

int gsl_inverse ( gsl_matrix *  m,
gsl_matrix *  im 
)

INVERSE DE MATRICE

Referenced by ekf_kalman_gain(), and getRot().

Here is the caller graph for this function:

double gsl_inverse_det ( gsl_matrix *  m,
gsl_matrix *  im 
)
int gsl_inverse_svd ( gsl_matrix *  A,
gsl_matrix *  invA 
)

Calculate the inverse of a matrix (size n*m) using SVD.

Referenced by encaps_gsl_inverse_svd().

Here is the caller graph for this function:

int gsl_linsolve_lu ( gsl_matrix *  A,
gsl_vector *  b,
gsl_vector *  x 
)

Linear Algebra LU decomposition.

Solve linear equation A*X-b = 0 uising LU decomposition

Referenced by encaps_gsl_linsolveLU().

Here is the caller graph for this function:

int gsl_linsolve_svd ( gsl_matrix *  A,
gsl_vector *  b,
gsl_vector *  x 
)

Linear Algebra: SVD.

Solve equation A*x -b = 0 using SVD

Referenced by encaps_gsl_linsolveSVD().

Here is the caller graph for this function:

void gsl_matrix2double ( gsl_matrix *  gsl_m,
double *  m,
size_t  sizei,
size_t  sizej 
)

copie d'un gsl_matrix dans un double[]

Referenced by calc_collar_angles(), and encaps_vector2rot().

Here is the caller graph for this function:

int gsl_matrixprod ( gsl_matrix *  A,
gsl_matrix *  B,
gsl_matrix *  C 
)

Calculate Matrix Product.

Function that calculates product of two matrices A*B and stores the result in matrix C.

Returns:
0 if no error. Any other value indicates error.

Referenced by calc_collar_angles(), calc_joint_angle_err(), and calc_pts_in_collar_base_frame().

Here is the caller graph for this function:

int gsl_matrixvecprod ( gsl_matrix *  A,
gsl_vector *  B,
gsl_vector *  C 
)

Calculate Matrix - Vector Product.

Function that calculates product of matrice A with vector B and stores the result in vector C.

Returns:
0 if no error. Any other value indicates error.

Referenced by calc_joint_angle_err(), and calc_pts_in_collar_base_frame().

Here is the caller graph for this function:

int gsl_rank_svd ( gsl_matrix *  A)

Calculate rank of matrix using SVD.

void gsl_vector2double ( gsl_vector *  gsl_v,
double *  v,
size_t  size 
)

copie d'un gsl_vector dans un double[]

Referenced by calc_pts_in_collar_base_frame(), generate_jacobian_femur(), get_fourier_dominant_estimate(), gsl_low_pass_fourier(), and h_femur_encaps().

Here is the caller graph for this function:

void gsl_vector2double_offset ( gsl_vector *  gsl_v,
double *  v,
size_t  size,
size_t  offset 
)

Concert a gsl_vector to a double[].

int gsl_vector_create_row ( gsl_vector *  row,
gsl_vector *  A,
gsl_vector *  B 
)
int gsl_vector_cross_product3D ( gsl_vector *  A,
gsl_vector *  B,
gsl_vector *  AB 
)

cross product

Referenced by get_matrix_adjoin(), and gramSchmidt().

Here is the caller graph for this function:

double gsl_vector_norme ( gsl_vector *  v)

norme d'un vecteur

Referenced by gramSchmidt(), gsl_Rot_matrix2vector(), and gsl_vector2Rot_matrix().

Here is the caller graph for this function:

double norme_diff_vecteur ( double *  v1,
double *  v2,
size_t  size 
)

Calculate the Eucleadian distance between 2 vectors.

Returns:
The 2 norm of $ (v_1 - _v2) $
gsl_matrix* rowcat ( const gsl_matrix *  a,
const gsl_matrix *  b 
)

Concatenate : row-wise.

void sub_double ( double *  v,
double *  vi,
size_t  size,
size_t  offset 
)
void vect2double ( vector< double > &  vecA,
double *  A 
)

Convert 1d vector to array of doubles.

This function is necessary as gsl functions need vectors and matrices to be expressed in terms of arrays of doubles. The function copies the contents of the vector to an array of doubles.

Referenced by encaps_gsl_linsolveSVD(), get_distri_matrices(), get_trans_matrix(), and main().

Here is the caller graph for this function:

void vectormat2double ( vector< vector< double > > &  matA,
double *  A 
)

Convert 2d vector to array of doubles.

This function is necessary as gsl functions need vectors and matrices to be expressed in terms of arrays of doubles. The function copies the contents of matrix to a 1d array of doubles. The data is stored according to the method used by GSL ie. matrix[i][j] is stored in location double[i*numcol+j] where numcol is the number of columns in the matrix.

Referenced by calc_mario_frame_opti(), encaps_gsl_linsolveSVD(), generate_jacobian_femur(), and h_femur_encaps().

Here is the caller graph for this function:

 All Data Structures Files Functions Variables Typedefs Defines