|
Robotran C Documentation
|
Go to the documentation of this file.
62 #define make_transpose_arr_4x4(mat) {{3, 0, 0, 0}, \
63 {3, mat[1][1], mat[1][2], mat[1][3]}, \
64 {3, mat[2][1], mat[2][2], mat[2][3]}, \
65 {3, mat[3][1], mat[3][2], mat[3][3]}}
75 #define make_transpose_arr_3x3(mat) {{mat[0][0], mat[0][1], mat[0][2]}, \
76 {mat[1][0], mat[1][1], mat[1][2]}, \
77 {mat[2][0], mat[2][1], mat[2][2]}}
92 #define make_transpose_arr_4x4_to_3x3(mat)\
93 {{mat[1][1], mat[1][2], mat[1][3]}, \
94 {mat[2][1], mat[2][2], mat[2][3]}, \
95 {mat[3][1], mat[3][2], mat[3][3]}}
104 void transpose(
double M[4][4],
double Mt[4][4]);
121 void dot_3x3_arr(
double res[3],
double mat[3][3],
double vec[3]);
143 double *
dot_3x3_ptr(
double *res,
double **mat,
double *vec);
160 void dot_4x4_arr(
double res[4],
double mat[4][4],
double vec[4]);
182 double *
dot_4x4_ptr(
double *res,
double **mat,
double *vec);
209 double *
dot_nxm_ptr_0(
double *res,
double **mat,
double *vec,
int nr,
int nc);
236 double *
dot_nxm_ptr_1(
double *res,
double **mat,
double *vec,
int nr,
int nc);
245 void matrix_product_1(
double **M,
double *v,
double *v_out,
int nr,
int nc);
263 void matmul_3x3_arr(
double res[3][3],
double mat_1[3][3],
double mat_2[3][3]);
288 double **
matmul_3x3_ptr(
double **res,
double **mat_1,
double **mat_2);
306 void matmul_4x4_arr(
double res[4][4],
double mat_1[4][4],
double mat_2[4][4]);
331 double **
matmul_4x4_ptr(
double **res,
double **mat_1,
double **mat_2);
348 void doublematrix_product_0(
double **M1,
int nb_row_M1,
int nb_col_M1,
double **M2,
int nb_col_M2,
double **M);
362 void doublematrix_product_1(
double **M1,
int nb_row_M1,
int nb_col_M1,
double **M2,
int nb_col_M2,
double **M);
525 void copy_imat_0(
int** tab_src,
int** tab_dest,
int nb_r,
int nb_c);
647 void copy_dmat_0(
double** tab_src,
double** tab_dest,
int nb_r,
int nb_c);
656 void copy_dmat_1(
double** src,
double** dest,
int x,
int y);
672 double **
re_copy_dmat_0(
double **src,
int s_nx,
int s_ny,
double **dest,
int d_nx,
int d_ny);
689 double **
re_copy_dmat_1(
double **src,
int s_nx,
int s_ny,
double **dest,
int d_nx,
int d_ny);
698 void transpose_dmat_0(
double** tab_src,
double** tab_dest,
int nb_r,
int nb_c);
737 int read_dmat_0(
double** mat,
int nb_r,
int nb_c,
const char* name);
745 double**
load_dmat_0(
int nb_r,
int nb_c,
char* name);
761 int save_dmat_0(
double** mat,
int nb_r,
int nb_c,
char* name);
799 int code_dmat_0(FILE *file_out,
double **values,
const char *name,
int n_row,
int n_col);
812 int code_dmat_1(FILE *file_out,
double **values,
const char *name,
int n_row,
int n_col);
825 int slct_dmat_0(
double** tab_src,
int nb_r,
int nb_c,
double** tab_out,
int l_vec,
int* vec);
838 int slctr_dmat_0(
double** tab_src,
int nb_r,
int nb_c,
double** tab_dest,
int l_vec,
int* vec);
955 void mult_dmat_0(
double** A,
double** B,
double** C,
int n1,
int n2,
int n3);
965 void sum_dmat_0(
double** A,
double** B,
double** C,
int n1,
int n2);
975 void diff_dmat_0(
double** A,
double** B,
double** C,
int n1,
int n2);
1030 void scale_matrix(
double** matrix,
int* n,
int* initzeros);
1053 int same_dmat_0(
double **a,
double **b,
int x,
int y);
void update_initzeros(int *initzeros, double **matrix, int *n)
function to update the initzeros array (obsolete?)
Definition: mbs_matrix.c:1543
int ** get_imat_0(int nb_r, int nb_c)
create (with memory allocation) a [nb_r times nb_c] matrix of integers, starting at index 0....
Definition: mbs_matrix.c:549
int identity_dmat_3x3_arr(double mat[3][3])
Set the matrix to identity (diagonal to 1, outside to 0).
Definition: mbs_matrix.c:1345
void arrange_matrix(double **matrix, int *n, int *initzeros)
function to arrange matrix (obsolete?)
Definition: mbs_matrix.c:1560
#define MBS_INFO_FAILURE
Definition: mbs_define.h:32
void mbs_msg(const char *msg,...)
Send a message.
Definition: mbs_message.c:87
double ** copy_3x3_ptr(double **res, double **src)
Copy the matrix into another one.
Definition: mbs_matrix.c:759
double ** matmul_3x3_ptr(double **res, double **mat_1, double **mat_2)
Compute the product of two matrices.
Definition: mbs_matrix.c:224
int save_dmat_0(double **mat, int nb_r, int nb_c, char *name)
save a [nb_r times nb_c] matrix of doubles to a second matrix, starting with index 0
Definition: mbs_matrix.c:1003
double ** identity_dmat_3x3_ptr(double **mat)
Set the matrix to identity (diagonal to 1, outside to 0).
Definition: mbs_matrix.c:1301
void dot_4x4_arr(double res[4], double mat[4][4], double vec[4])
Compute the dot product of a matrix by a vector.
Definition: mbs_matrix.c:71
double ** identity_dmat_4x4_ptr(double **mat)
Set the matrix to identity (diagonal to 1, outside to 0).
Definition: mbs_matrix.c:1323
void matrix_product_0(double **M, double *v, double *Mv, int nr, int nc)
Definition: mbs_matrix.c:169
void scale_matrix(double **matrix, int *n, int *initzeros)
function to scale matrix (obsolete?)
Definition: mbs_matrix.c:1605
void doublematrix_product_0(double **M1, int nb_row_M1, int nb_col_M1, double **M2, int nb_col_M2, double **M)
Compute the product of two matrices of given shape. The first index is 0.
Definition: mbs_matrix.c:338
double * dot_4x4_ptr(double *res, double **mat, double *vec)
Compute the dot product of a matrix by a vector.
Definition: mbs_matrix.c:84
#define MSG_PRE
Definition: mbs_matrix.c:26
void mbs_error_msg(int err, const char *msg,...)
Send an error message.
Definition: mbs_message.c:131
double * get_dvec_0(int l_v)
create (with memory allocation) a vector (length l_v) of doubles, starting at index 0....
Definition: mbs_1D_array.c:1318
#define _MBS_ERR_LOW_FILES
Low Level error number Error during opening/writing files = -9.
Definition: mbs_errors_names.h:157
void copy_4x4_arr(double res[4][4], double src[4][4])
Copy the array into another one.
Definition: mbs_matrix.c:772
int ** get_imat_1(int nb_r, int nb_c)
create (with memory allocation) a [nb_r times nb_c] matrix of integers, starting at index 1
Definition: mbs_matrix.c:571
void copy_dmat_0(double **tab_src, double **tab_dest, int nb_r, int nb_c)
Copy the content of a [nb_r times nb_c] matrix of doubles to a second matrix, starting with index 0.
Definition: mbs_matrix.c:794
void dot_3x3_arr(double res[3], double mat[3][3], double vec[3])
Compute the dot product of a matrix by a vector.
Definition: mbs_matrix.c:41
void arrange_matrix(double **matrix, int *n, int *initzeros)
function to arrange matrix (obsolete?)
Definition: mbs_matrix.c:1560
void print_dmat_0(double **mat, int nb_r, int nb_c)
print a [nb_r times nb_c] matrix of doubles in console, starting with index 0
Definition: mbs_matrix.c:901
void free_dmat_0(double **mat)
release memory for a matrix of doubles, starting at index 0
Definition: mbs_matrix.c:683
void sum_dmat_0(double **A, double **B, double **C, int n1, int n2)
function to sum two matrices: A + B = C
Definition: mbs_matrix.c:1418
int slct_dmat_0(double **tab_src, int nb_r, int nb_c, double **tab_out, int l_vec, int *vec)
fill the second [nb_r times l_vec] matrix by selecting the columns of the first [nb_r times nb_c] mat...
Definition: mbs_matrix.c:1220
double ** identity_dmat_4x4_ptr(double **mat)
Set the matrix to identity (diagonal to 1, outside to 0).
Definition: mbs_matrix.c:1323
void matrix_product_0(double **M, double *v, double *Mv, int nr, int nc)
Definition: mbs_matrix.c:169
void transpose(double M[4][4], double Mt[4][4])
Compute the transpose of a matrix with first index is 1.
Definition: mbs_matrix.c:28
double * dot_nxm_ptr_1(double *res, double **mat, double *vec, int nr, int nc)
Compute the dot product of a matrix by a vector.
Definition: mbs_matrix.c:132
int slctr_dmat_0(double **tab_src, int nb_r, int nb_c, double **tab_dest, int l_vec, int *vec)
fill the second [l_vec times nb_c] matrix by selecting the rows of the first [nb_r times nb_c] matrix...
Definition: mbs_matrix.c:1242
int get_dmatfiles_size(const char *fileName, int *n_row, int *n_col)
Function to load a file and calculate the number of rows and columns.
Definition: mbs_matrix.c:1492
Declares all operation betweens matrices, matrice and vector, matrice and scalars.
void mbs_warning_msg(const char *msg,...)
Send a warning message.
Definition: mbs_message.c:100
double ** re_copy_dmat_0(double **src, int s_nx, int s_ny, double **dest, int d_nx, int d_ny)
Copy a 2D array of double into another, reallocate the destination if required.
Definition: mbs_matrix.c:820
void zeros_dmat_0(double **mat, int nb_r, int nb_c)
set all the element of a [nb_r times nb_c] matrix of doubles to zero, starting with index 0
Definition: mbs_matrix.c:1264
double ** copy_3x3_ptr(double **res, double **src)
Copy the matrix into another one.
Definition: mbs_matrix.c:759
int code_dmat_1(FILE *file_out, double **values, const char *name, int n_row, int n_col)
Write C-code to allocate and fill an array of arrays of doubles.
Definition: mbs_matrix.c:1164
int code_dmat_1(FILE *file_out, double **values, const char *name, int n_row, int n_col)
Write C-code to allocate and fill an array of arrays of doubles.
Definition: mbs_matrix.c:1164
void readmatrix(double **mat, int *n)
function to read a matrix (obsolete?)
Definition: mbs_matrix.c:1460
void scale_matrix(double **matrix, int *n, int *initzeros)
function to scale matrix (obsolete?)
Definition: mbs_matrix.c:1605
char * mbs_dirname(const char *path, int verbose)
mbs_dirname returns the leading part of the path (UNIX and MAC).
Definition: mbs_path.c:407
void matmul_4x4_arr(double res[4][4], double mat_1[4][4], double mat_2[4][4])
Compute the product of two matrices.
Definition: mbs_matrix.c:259
double ** get_dmat_0(int nb_r, int nb_c)
create (with memory allocation) a [nb_r times nb_c] matrix of doubles, starting at index 0 The functi...
Definition: mbs_matrix.c:603
void matmul_3x3_arr(double res[3][3], double mat_1[3][3], double mat_2[3][3])
Compute the product of two matrices.
Definition: mbs_matrix.c:194
int rotation_matrix_4x4_arr(int type, double angle, double R[4][4])
Definition: mbs_matrix.c:377
void print_dmat_0(double **mat, int nb_r, int nb_c)
print a [nb_r times nb_c] matrix of doubles in console, starting with index 0
Definition: mbs_matrix.c:901
void matrix_product(double M[4][4], double v[4], double Mv[4])
Definition: mbs_matrix.c:163
double ** load_dmat_0(int nb_r, int nb_c, char *name)
load a [nb_r times nb_c] matrix of doubles from a file starting with index 0. The matrix is created (...
Definition: mbs_matrix.c:996
void copy_dmat_1(double **src, double **dest, int x, int y)
Copy the content of a [x times y] matrix of doubles to a second matrix, starting with index 1.
Definition: mbs_matrix.c:807
void doublematrix_product_1(double **M1, int nb_row_M1, int nb_col_M1, double **M2, int nb_col_M2, double **M)
Compute the product of two matrices of given shape. The first index is 1.
Definition: mbs_matrix.c:355
double ** copy_4x4_ptr(double **res, double **src)
Copy the matrix into another one.
Definition: mbs_matrix.c:780
void update_initzeros(int *initzeros, double **matrix, int *n)
function to update the initzeros array (obsolete?)
Definition: mbs_matrix.c:1543
double ** copy_4x4_ptr(double **res, double **src)
Copy the matrix into another one.
Definition: mbs_matrix.c:780
int code_dmat_0(FILE *file_out, double **values, const char *name, int n_row, int n_col)
Write C-code to allocate and fill an array of arrays of doubles.
Definition: mbs_matrix.c:1098
int slct_dmat_0(double **tab_src, int nb_r1, int nb_c1, double **tab_out, int l2, int *vec)
fill the second [nb_r times l_vec] matrix by selecting the columns of the first [nb_r times nb_c] mat...
Definition: mbs_matrix.c:1220
void print_format_dmat_0(double **mat, int nb_r, int nb_c, char *format)
print a [nb_r times nb_c] matrix of doubles in console, starting with index 0
Definition: mbs_matrix.c:906
void free_imat_1(int **mat)
release memory for a matrix of integers, starting with index 1
Definition: mbs_matrix.c:707
double ** re_copy_dmat_1(double **src, int s_nx, int s_ny, double **dest, int d_nx, int d_ny)
Copy a 2D array of double into another, reallocate the destination if required.
Definition: mbs_matrix.c:855
void transpose_dmat_0(double **tab_src, double **tab_dest, int nb_r, int nb_c)
Transpose a [nb_r times nb_c] matrix of doubles and store the results in a [y times nb_r] matrix,...
Definition: mbs_matrix.c:874
void free_imat_0(int **mat)
release memory for a matrix of integers, starting with index 0
Definition: mbs_matrix.c:699
void dot_3x3_arr(double res[3], double mat[3][3], double vec[3])
Compute the dot product of a matrix by a vector.
Definition: mbs_matrix.c:41
void sum_dmat_0(double **A, double **B, double **C, int n1, int n2)
function to sum two matrices: A + B = C
Definition: mbs_matrix.c:1418
int rotation_matrix_4x4_ptr(int type, double angle, double **R)
Compute the rotation matrix for a specified angle around a specific axis.
Definition: mbs_matrix.c:420
void diff_dmat_0(double **A, double **B, double **C, int n1, int n2)
function to sum two matrices: A - B = C
Definition: mbs_matrix.c:1431
int rotation_matrix(int type, double angle, double R[4][4])
DEPRECATED, see rotation_matrix_4x4_arr().
Definition: mbs_matrix.c:372
void copy_3x3_arr(double res[3][3], double src[3][3])
Copy the array into another one.
Definition: mbs_matrix.c:752
#define _MBS_ERR_LOW_NULL_PTR
Low Level error number A called symbolic or user function is set to NULL;.
Definition: mbs_errors_names.h:142
int get_dmatfiles_size(const char *fileName, int *n_row, int *n_col)
Function to load a file and calculate the number of rows and columns.
Definition: mbs_matrix.c:1492
void matrix_product_1(double **M, double *v, double *v_out, int nr, int nc)
Definition: mbs_matrix.c:181
void matrix_product_1(double **M, double *v, double *v_out, int nr, int nc)
Definition: mbs_matrix.c:181
int read_dmat_0(double **mat, int nb_r, int nb_c, const char *name)
read a [nb_r times nb_c] matrix of doubles from a file starting with index 0 and store the values in ...
Definition: mbs_matrix.c:929
int set_diag_dmat_0(double **mat, int size, double value)
Set a diagonal matrix with the given value.
Definition: mbs_matrix.c:1277
void free_dvec_1(double *vec)
release memory for a vector of doubles, starting at index 1
Definition: mbs_1D_array.c:1358
double * dot_3x3_ptr(double *res, double **mat, double *vec)
Compute the dot product of a matrix by a vector.
Definition: mbs_matrix.c:54
int set_identity_dmat_0(double **mat, int size)
Set a matrix to identity matrix. Out-of-diagonal elements are set to zero.
Definition: mbs_matrix.c:1391
void copy_dmat_1(double **src, double **dest, int x, int y)
Copy the content of a [x times y] matrix of doubles to a second matrix, starting with index 1.
Definition: mbs_matrix.c:807
void matmul_3x3_arr(double res[3][3], double mat_1[3][3], double mat_2[3][3])
Compute the product of two matrices.
Definition: mbs_matrix.c:194
double * copy_dvec_0(double *vec_src, double *vec_dest, int l_v)
Copy the content of a vector (of sizel_v) of doubles to a second vector, starting with index 0.
Definition: mbs_1D_array.c:1363
double ** identity_dmat_3x3_ptr(double **mat)
Set the matrix to identity (diagonal to 1, outside to 0).
Definition: mbs_matrix.c:1301
void free_imat_1(int **mat)
release memory for a matrix of integers, starting with index 1
Definition: mbs_matrix.c:707
void matmul_4x4_arr(double res[4][4], double mat_1[4][4], double mat_2[4][4])
Compute the product of two matrices.
Definition: mbs_matrix.c:259
double ** get_dmat_1(int nb_r, int nb_c)
create (with memory allocation) a [nb_r times nb_c] matrix of doubles, starting at index 1
Definition: mbs_matrix.c:625
int same_dmat_0(double **a, double **b, int x, int y)
Compare if two 2D arrays of floats are the same.
Definition: mbs_matrix.c:1630
int ** get_imat_0(int nb_r, int nb_c)
create (with memory allocation) a [nb_r times nb_c] matrix of integers, starting at index 0....
Definition: mbs_matrix.c:549
double ** re_copy_dmat_1(double **src, int s_nx, int s_ny, double **dest, int d_nx, int d_ny)
Copy a 2D array of double into another, reallocate the destination if required.
Definition: mbs_matrix.c:855
void print_format_dmat_0(double **mat, int nb_r, int nb_c, char *format)
print a [nb_r times nb_c] matrix of doubles in console, starting with index 0
Definition: mbs_matrix.c:906
void zeros_dmat_0(double **mat, int nb_r, int nb_c)
set all the element of a [nb_r times nb_c] matrix of doubles to zero, starting with index 0
Definition: mbs_matrix.c:1264
void readmatrix(double **matrix, int *n)
function to read a matrix (obsolete?)
Definition: mbs_matrix.c:1460
void copy_imat_0(int **tab_src, int **tab_dest, int nb_r, int nb_c)
Copy the content of a [nb_r times nb_c] matrix of integers to a second matrix, starting with index 0.
Definition: mbs_matrix.c:715
int rotation_matrix_3x3_ptr(int type, double angle, double **R)
Compute the rotation matrix for a specified angle around a specific axis.
Definition: mbs_matrix.c:506
double ** get_dmat_0(int nb_r, int nb_c)
create (with memory allocation) a [nb_r times nb_c] matrix of doubles, starting at index 0 The functi...
Definition: mbs_matrix.c:603
void mult_dmat_0(double **A, double **B, double **C, int n1, int n2, int n3)
function to multiply two matrices: A * B = C [n1 n2] [n2 n3] = [n1 n3]
Definition: mbs_matrix.c:1401
int set_diag_dmat_0(double **mat, int size, double value)
Set a diagonal matrix with the given value.
Definition: mbs_matrix.c:1277
double * dot_nxm_ptr_1(double *res, double **mat, double *vec, int nr, int nc)
Compute the dot product of a matrix by a vector.
Definition: mbs_matrix.c:132
void free_dmat_0(double **mat)
release memory for a matrix of doubles, starting at index 0
Definition: mbs_matrix.c:683
void opposite_dmat_0(double **A, int n1, int n2)
function to take the opposite of a given matrix (minus in front of each entry)
Definition: mbs_matrix.c:1444
int code_dmat_0(FILE *file_out, double **values, const char *name, int n_row, int n_col)
Write C-code to allocate and fill an array of arrays of doubles.
Definition: mbs_matrix.c:1098
void transpose_dmat_0(double **tab_src, double **tab_dest, int nb_r, int nb_c)
Transpose a [nb_r times nb_c] matrix of doubles and store the results in a [y times nb_r] matrix,...
Definition: mbs_matrix.c:874
void print_imat_0(int **mat, int x, int y)
print a [nb_r times nb_c] matrix of integers in console, starting with index 0
Definition: mbs_matrix.c:728
void diff_dmat_0(double **A, double **B, double **C, int n1, int n2)
function to sum two matrices: A - B = C
Definition: mbs_matrix.c:1431
int identity_dmat_4x4_arr(double mat[4][4])
Set the matrix to identity (diagonal to 1, outside to 0).
Definition: mbs_matrix.c:1368
void free_imat_0(int **mat)
release memory for a matrix of integers, starting with index 0
Definition: mbs_matrix.c:699
double * copy_dvec_1(double *vec_src, double *vec_dest)
Copy the content of a vector (of size specified in vec_src[0]) of doubles to a second vector,...
Definition: mbs_1D_array.c:1378
int ** get_imat_1(int nb_r, int nb_c)
create (with memory allocation) a [nb_r times nb_c] matrix of integers, starting at index 1
Definition: mbs_matrix.c:571
int rotation_matrix(int type, double angle, double R[4][4])
DEPRECATED, see rotation_matrix_4x4_arr().
Definition: mbs_matrix.c:372
void doublematrix_product(double M1[4][4], double M2[4][4], double M[4][4])
DEPRECATED, see matmul_4x4_arr().
Definition: mbs_matrix.c:324
double * dot_nxm_ptr_0(double *res, double **mat, double *vec, int nr, int nc)
Compute the dot product of a matrix by a vector.
Definition: mbs_matrix.c:101
int rotation_matrix_4x4_ptr(int type, double angle, double **R)
Compute the rotation matrix for a specified angle around a specific axis.
Definition: mbs_matrix.c:420
int save_format_dmat_0(double **mat, int nb_r, int nb_c, char *name, char *format)
save a [nb_r times nb_c] matrix of doubles to a second matrix, starting with index 0.
Definition: mbs_matrix.c:1015
void dot_4x4_arr(double res[4], double mat[4][4], double vec[4])
Compute the dot product of a matrix by a vector.
Definition: mbs_matrix.c:71
int slctr_dmat_0(double **tab_src, int nb_r1, int nb_c1, double **tab_out, int l2, int *vec)
fill the second [l_vec times nb_c] matrix by selecting the rows of the first [nb_r times nb_c] matrix...
Definition: mbs_matrix.c:1242
void print_imat_0(int **mat, int nb_r, int nb_c)
print a [nb_r times nb_c] matrix of integers in console, starting with index 0
Definition: mbs_matrix.c:728
int identity_dmat_4x4_arr(double mat[4][4])
Set the matrix to identity (diagonal to 1, outside to 0).
Definition: mbs_matrix.c:1368
int save_dmat_0(double **mat, int nb_r, int nb_c, char *name)
save a [nb_r times nb_c] matrix of doubles to a second matrix, starting with index 0
Definition: mbs_matrix.c:1003
double ** matmul_4x4_ptr(double **res, double **mat_1, double **mat_2)
Compute the product of two matrices.
Definition: mbs_matrix.c:289
void copy_array_dmat_1(double src[4][4], double **dest)
Copy the content of an array of doubles to a pointer of matrix, starting with index 1.
Definition: mbs_matrix.c:1620
void transpose_dmat_1(double **tab_src, double **tab_dest, int x, int y)
Transpose a [x times y] matrix of doubles and store the results in a [y times x] matrix,...
Definition: mbs_matrix.c:888
double * dot_4x4_ptr(double *res, double **mat, double *vec)
Compute the dot product of a matrix by a vector.
Definition: mbs_matrix.c:84
double ** re_copy_dmat_0(double **src, int s_nx, int s_ny, double **dest, int d_nx, int d_ny)
Copy a 2D array of double into another, reallocate the destination if required.
Definition: mbs_matrix.c:820
int mbs_is_dir_or_file(const char *path)
Check if the path is valid and lead to a file or directory.
Definition: mbs_path.c:547
void doublematrix_product_1(double **M1, int nb_row_M1, int nb_col_M1, double **M2, int nb_col_M2, double **M)
Compute the product of two matrices of given shape. The first index is 1.
Definition: mbs_matrix.c:355
void matrix_product(double M[4][4], double v[4], double Mv[4])
Definition: mbs_matrix.c:163
void free_dmat_1(double **mat)
release memory for a matrix of doubles, starting at index 1
Definition: mbs_matrix.c:691
void mult_dmat_0(double **A, double **B, double **C, int n1, int n2, int n3)
function to multiply two matrices: A * B = C [n1 n2] [n2 n3] = [n1 n3]
Definition: mbs_matrix.c:1401
void doublematrix_product_0(double **M1, int nb_row_M1, int nb_col_M1, double **M2, int nb_col_M2, double **M)
Compute the product of two matrices of given shape. The first index is 0.
Definition: mbs_matrix.c:338
void copy_4x4_arr(double res[4][4], double src[4][4])
Copy the array into another one.
Definition: mbs_matrix.c:772
double * get_dvec_1(int l_v)
create (with memory allocation) a vector (length l_v) of doubles, starting at index 1
Definition: mbs_1D_array.c:1334
void doublematrix_product(double M1[4][4], double M2[4][4], double M[4][4])
DEPRECATED, see matmul_4x4_arr().
Definition: mbs_matrix.c:324
void opposite_dmat_0(double **A, int n1, int n2)
function to take the opposite of a given matrix (minus in front of each entry)
Definition: mbs_matrix.c:1444
int set_identity_dmat_0(double **mat, int size)
Set a matrix to identity matrix. Out-of-diagonal elements are set to zero.
Definition: mbs_matrix.c:1391
void free_dmat_1(double **mat)
release memory for a matrix of doubles, starting at index 1
Definition: mbs_matrix.c:691
int rotation_matrix_3x3_ptr(int type, double angle, double **R)
Compute the rotation matrix for a specified angle around a specific axis.
Definition: mbs_matrix.c:506
void free_dvec_0(double *vec)
release memory for a vector of doubles, starting at index 0
Definition: mbs_1D_array.c:1353
#define MBS_INFO_SUCCESS
Definition: mbs_define.h:30
int save_format_dmat_0(double **mat, int nb_r, int nb_c, char *name, char *format)
save a [nb_r times nb_c] matrix of doubles to a second matrix, starting with index 0.
Definition: mbs_matrix.c:1015
int identity_dmat_3x3_arr(double mat[3][3])
Set the matrix to identity (diagonal to 1, outside to 0).
Definition: mbs_matrix.c:1345
double ** get_dmat_1(int nb_r, int nb_c)
create (with memory allocation) a [nb_r times nb_c] matrix of doubles, starting at index 1
Definition: mbs_matrix.c:625
int same_dmat_0(double **a, double **b, int x, int y)
Compare if two 2D arrays of floats are the same.
Definition: mbs_matrix.c:1630
void transpose(double M[4][4], double Mt[4][4])
Compute the transpose of a matrix with first index is 1.
Definition: mbs_matrix.c:28
void copy_3x3_arr(double res[3][3], double src[3][3])
Copy the array into another one.
Definition: mbs_matrix.c:752
double ** get_contdmat_1(int nb_r, int nb_c)
create (with memory allocation) a [nb_r times nb_c] matrix of doubles, starting at index 1....
Definition: mbs_matrix.c:655
int rotation_matrix_3x3_arr(int type, double angle, double R[3][3])
Definition: mbs_matrix.c:463
void copy_dmat_0(double **tab_src, double **tab_dest, int nb_r, int nb_c)
Copy the content of a [nb_r times nb_c] matrix of doubles to a second matrix, starting with index 0.
Definition: mbs_matrix.c:794
double * dot_3x3_ptr(double *res, double **mat, double *vec)
Compute the dot product of a matrix by a vector.
Definition: mbs_matrix.c:54
int mbs_makedirs(char *path)
Create (recursively) the specified directory.
Definition: mbs_path.c:586
double ** matmul_3x3_ptr(double **res, double **mat_1, double **mat_2)
Compute the product of two matrices.
Definition: mbs_matrix.c:224
double ** load_dmat_0(int nb_r, int nb_c, char *name)
load a [nb_r times nb_c] matrix of doubles from a file starting with index 0. The matrix is created (...
Definition: mbs_matrix.c:996
int read_dmat_0(double **mat, int nb_r, int nb_c, const char *name)
read a [nb_r times nb_c] matrix of doubles from a file starting with index 0 and store the values in ...
Definition: mbs_matrix.c:929
#define MSG_ERR
Definition: mbs_matrix.c:25
double ** get_contdmat_1(int nb_r, int nb_c)
create (with memory allocation) a [nb_r times nb_c] matrix of doubles, starting at index 1....
Definition: mbs_matrix.c:655
void transpose_dmat_1(double **tab_src, double **tab_dest, int x, int y)
Transpose a [x times y] matrix of doubles and store the results in a [y times x] matrix,...
Definition: mbs_matrix.c:888
double ** matmul_4x4_ptr(double **res, double **mat_1, double **mat_2)
Compute the product of two matrices.
Definition: mbs_matrix.c:289
double * dot_nxm_ptr_0(double *res, double **mat, double *vec, int nr, int nc)
Compute the dot product of a matrix by a vector.
Definition: mbs_matrix.c:101
void copy_array_dmat_1(double src[4][4], double **dest)
Copy the content of an array of doubles to a pointer of matrix, starting with index 1.
Definition: mbs_matrix.c:1620
void copy_imat_0(int **tab1, int **tab2, int x, int y)
Copy the content of a [nb_r times nb_c] matrix of integers to a second matrix, starting with index 0.
Definition: mbs_matrix.c:715