Robotran C Documentation
mbs_1D_array.h
Go to the documentation of this file.
1 
33 #ifndef MBS_1D_ARRAY_h
34 #define MBS_1D_ARRAY_h
35 
36 #include <stdio.h>
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40 
41 /* Functions related to arrays of doubles */
53 double *mbs_linspace_0(double start, double stop, int num);
54 
66 double *mbs_linspace_1(double start, double stop, int num);
83 double *mbs_arange_0(double start, double stop, double step, int with_end, int *size);
84 
100 int *mbs_range_0(int start, int stop, int *size);
101 
118 int *mbs_range_1(int start, int stop, int *size);
119 
137 double *mbs_drand_0(int num, double min, double max);
138 
150 double *mbs_drand_1(int num, double min, double max);
151 
175 int get_dinterval_binary_0(double *array, int size, double value, int *index, int lim_check);
176 
200 int get_dinterval_binary_1(double *array, int size, double value, int *index, int lim_check);
201 
228 int get_dinterval_binary_from_index_0(double *array, int size, double value, int *index, int lim_check, int verbose);
229 
254 int get_dinterval_binary_from_index_1(double *array, int size, double value, int *index, int lim_check, int verbose);
255 
268 int mbs_argmin_dvec_0(double *vec, int size);
269 
283 int mbs_argmin_dvec_1(double *vec, int size);
284 
285 /* Functions related to arrays of integers */
300 int save_ivec_0(int *vec, int size,char *name, int row);
301 
316 int save_ivec_1(int *vec, int size,char *name, int row);
317 
327 double dot_dvec_3(double v1[3], double v2[3]);
328 
338 double dot_dvec_4(double v1[4], double v2[4]);
339 
350 double dot_dvec_0(double *v1, double *v2, int size);
351 
362 double dot_dvec_1(double *v1, double *v2, int size);
363 
365 double scalar_product(double v1[4], double v2[4]);
366 
368 double scalar_product_0(double* v1, double* v2, int n);
369 
371 double scalar_product_1(double* v1, double* v2, int n);
372 
386 double *add_dvec_4(double res[4], double v1[4], double v2[4]);
387 
401 double *add_dvec_3(double res[3], double v1[3], double v2[3]);
402 
417 double *add_dvec_0(double *res, double *v1, double *v2, int size);
418 
433 double *add_dvec_1(double *res, double *v1, double *v2, int size);
434 
436 void vector_sum(double v1[4], double v2[4], double v_dest[4]);
437 
439 void sum_dvec_0(double *v1, double *v2, int size, double *v_dest);
440 
455 double *subtract_dvec_4(double res[4], double v1[4], double v2[4]);
456 
471 double *subtract_dvec_3(double res[3], double v1[3], double v2[3]);
472 
488 double *subtract_dvec_0(double *res, double *v1, double *v2, int size);
489 
505 double *subtract_dvec_1(double *res, double *v1, double *v2, int size);
506 
508 void vector_diff(double v1[4], double v2[4], double v_dest[4]);
510 void diff_dvec_0(double *v1, double *v2, int size, double *v_dest);
511 
520 void cross_product(double v1[4], double v2[4], double v_dest[4]);
521 
522 
523 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
524  * MULTIPLICATION/DIVISION BY SCALAR *
525  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
543 double *multiply_dvec_3(double res[3], double val, double vec[3]);
544 
562 double *multiply_dvec_4(double res[4], double val, double vec[4]);
563 
582 double *multiply_dvec_0(double *res, double val, double *vec, int size);
583 
602 double *multiply_dvec_1(double *res, double val, double *vec, int size);
603 
604 
605 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
606  * ELEMENT-WISE MULTIPLICATION *
607  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
625 double *multiply_dvec_dvec_3(double res[3], double vec_1[3], double vec_2[3]);
626 
644 double *multiply_dvec_dvec_4(double res[4], double vec_1[4], double vec_2[4]);
645 
664 double *multiply_dvec_dvec_0(double *res, double *vec_1, double *vec_2, int size);
665 
684 double *multiply_dvec_dvec_1(double *res, double *vec_1, double *vec_2, int size);
685 
687 void number_product(double s, double v1[4], double v_dest[4]);
688 
689 // integer related functions
696 int* get_ivec_0(int l_v);
702 int* get_ivec_1(int l_v);
707 void free_ivec_0(int* vec);
712 void free_ivec_1(int* vec);
713 
720 void copy_ivec_0(int* vec_src, int* vec_dest, int l_v);
727 void copy_ivec_1(int* vec_src, int* vec_dest, int l_v);
728 
739 int *re_copy_ivec_0(int *src, int s_nx, int *dest, int d_nx);
740 
751 int *re_copy_ivec_0(int *src, int s_nx, int *dest, int d_nx);
752 
758 void print_ivec_0(int* vec, int l_v);
763 void print_ivec_1(int* vec);
764 
777 int code_ivec_0(FILE *file_out, int *values, const char *name, int size);
778 
791 int code_ivec_1(FILE *file_out, int *values, const char *name, int size);
792 
793 
800 void sort_ivec_0(int* vec_src, int* vec_dest, int l_v);
801 
808 void sort_dvec_0(double* vec_src, double* vec_dest, int l_v);
809 
816 void sort_ivec_1(int* vec_src, int* vec_dest, int l_v);
823 void sort_inplace_ivec_1(int* vec, int l_v);
829 void f0123_ivec_0(int* vec, int l_v);
838 void conc_ivec_0(int* vec1_src, int l_v1, int* vec2_src, int l_v2, int* vec_dest);
847 void conc_ivec_1(int* vec1_src, int l_v1, int* vec2_src, int l_v2, int* vec3);
848 
859 int slct_ivec_0(int* vec1_src, int l_v1, int* vec_ind_src, int l_v2, int* vec1_dest);
860 
869 int find_ivec_0(int* vec, int l_v, int f);
870 
879 int find_dvec_0(double* vec, int l_v, double f);
880 
889 int find_ivec_1(int* vec, int l_v, int f);
890 
899 int same_ivec_0(int* v1, int* v2, int size);
900 
908 int same_ivec_1(int* v1, int* v2);
909 
910 // double related functions
917 double* get_dvec_0(int l_v);
923 double* get_dvec_1(int l_v);
924 
929 void free_dvec_0(double* vec);
934 void free_dvec_1(double* vec);
935 
942 double *copy_dvec_0(double* vec_src, double* vec_dest, int l_v);
948 double *copy_dvec_1(double* vec_src, double* vec_dest);
949 
959 double *convert_dvec_0_to_1(double *src, int size, int free_src);
960 
970 double *convert_dvec_1_to_0(double *src, int size, int free_src);
971 
983 double *re_copy_dvec_0(double *src, int s_nx, double *dest, int d_nx);
995 double *re_copy_dvec_1(double *src, int s_nx, double *dest, int d_nx);
996 
1004 void print_dvec_0(double* vec, int nb_r);
1005 
1012 void print_format_dvec_0(double* vec, int nb_r, char* format);
1013 
1018 void print_dvec_1(double* vec);
1019 
1032 int code_dvec_0(FILE *file_out, double *values, const char *name, int size);
1033 
1046 int code_dvec_1(FILE *file_out, double *values, const char *name, int size);
1047 
1055 void save_dvec_0(double* vec, int nb_r, char* name);
1056 
1067 void pick_and_place_dvec_1(double* src, int* index, int n, double* dest);
1068 
1079 void pick_and_place_dvec_0(double* src, int* index, int n, double* dest);
1080 
1088 void slct_dvec_1(double* vec1_src, int* vec_ind_src, int l_v, double* vec3);
1089 
1100 int slct_dvec_0(double* vec1_src, int l_v1, int* vec_ind_src, int l_v2, double* vec_dest);
1101 
1109 int any_dvec_0(double* vec, int l_v);
1110 
1117 void value_dvec_0(double value, double* vec, int l_v);
1123 void value_dvec_1(double value, double* vec);
1124 
1130 void zeros_dvec_3(double vec[3]);
1131 
1139 void zeros_dvec_4(double vec[4]);
1140 
1146 void zeros_dvec_0(double* vec, int l_v);
1151 void zeros_dvec_1(double* vec);
1152 
1158 void opposite_dvec_0(double* vec, int n);
1159 
1164 void opposite_dvec_1(double* vec);
1165 
1181 int cmp_dvec_0(double* v1, double* v2, int size);
1182 
1193 int same_dvec_0(double* v1, double* v2, int size);
1194 
1202 int same_dvec_1(double* v1, double* v2);
1203 
1213 int max_dvec_0(double* vec, int size);
1214 
1223 int max_dvec_1(double* vec);
1224 
1225 /********************************************
1226  * NORM-related functions *
1227  ********************************************/
1228 
1230 double norm(double v[4]);
1231 
1241 void normalize(double v[4], double vn[4]);
1242 
1252 double norm_dvec_3(double v[3]);
1253 
1263 double norm_dvec_4(double v[4]);
1264 
1272 double norm_dvec_0(double* vec, int l_v);
1280 double norm_dvec_1(double* vec, int l_v);
1289 void normalize_dvec_0(double* vec, double* vn, int l_v);
1299 void normalize_dvec_1(double* vec, double* vn, int l_v);
1300 
1308 double norminf_vector_1(double *v, int n);
1309 
1310 
1311 
1312 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
1313  * COMPUTATION IN SPACE *
1314  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1334 double *projection_dvec_3(double res[3], double vec[3], double axis[3]);
1335 
1355 double *projection_dvec_4(double res[4], double vec[4], double axis[4]);
1356 
1367 double distance_dvec_3(double pt_1[3], double pt_2[3]);
1368 
1380 double distance_dvec_4(double pt_1[4], double pt_2[4]);
1381 
1399 double *mean_dvec_3(double res[3], double pt_1[3], double pt_2[3]);
1400 
1418 double *mean_dvec_4(double res[4], double pt_1[4], double pt_2[4]);
1419 
1437 double *mean_n_dvec_3(double res[3], double *vecs[], int n_vecs);
1438 
1458 double *mean_n_dvec_4(double res[4], double *vecs[], int n_vecs);
1459 
1460 #ifdef __cplusplus
1461 }
1462 #endif
1463 
1464 #endif
pick_and_place_dvec_0
void pick_and_place_dvec_0(double *src, int *index, int n, double *dest)
Pick the values from an array and set them in the destination array at the specified index.
Definition: mbs_1D_array.c:1710
code_dvec_0
int code_dvec_0(FILE *file_out, double *values, const char *name, int size)
Write C-code to allocate and fill an array of double.
Definition: mbs_1D_array.c:1514
multiply_dvec_3
double * multiply_dvec_3(double res[3], double val, double vec[3])
Compute the product of a vector (of size 3) by a real.
Definition: mbs_1D_array.c:692
print_format_dvec_0
void print_format_dvec_0(double *vec, int nb_r, char *format)
print a (x sized) vector of doubles in console, starting with index 0
Definition: mbs_1D_array.c:1492
re_copy_dvec_0
double * re_copy_dvec_0(double *src, int s_nx, double *dest, int d_nx)
Copy an array of double into another, reallocate the destination if required.
Definition: mbs_1D_array.c:1438
code_ivec_0
int code_ivec_0(FILE *file_out, int *values, const char *name, int size)
Write C-code to allocate and fill an array of integers.
Definition: mbs_1D_array.c:974
free_ivec_1
void free_ivec_1(int *vec)
release memory for a vector of integers, starting with index 1
Definition: mbs_1D_array.c:858
multiply_dvec_dvec_1
double * multiply_dvec_dvec_1(double *res, double *vec_1, double *vec_2, int size)
Compute the element-wise multiplication of two vectors.
Definition: mbs_1D_array.c:790
multiply_dvec_dvec_3
double * multiply_dvec_dvec_3(double res[3], double vec_1[3], double vec_2[3])
Compute the element-wise multiplication of two vectors (of size 3).
Definition: mbs_1D_array.c:750
add_dvec_1
double * add_dvec_1(double *res, double *v1, double *v2, int size)
Sums the two vectors.
Definition: mbs_1D_array.c:594
slct_dvec_0
int slct_dvec_0(double *vec_src, int l_v1, int *vec_ind_src, int l_v2, double *vec_dest)
fill the third (l_v2 sized) vector by slicing the first (l_v1 sized) vector of doubles at the indexes...
Definition: mbs_1D_array.c:1729
subtract_dvec_1
double * subtract_dvec_1(double *res, double *v1, double *v2, int size)
Substraction the two vectors.
Definition: mbs_1D_array.c:665
save_ivec_1
int save_ivec_1(int *vec, int size, char *name, int row)
save a (x sized) vector of integers in the specified file, starting with index 0 The file is open wit...
Definition: mbs_1D_array.c:492
conc_ivec_0
void conc_ivec_0(int *vec1_src, int l_v1, int *vec2_src, int l_v2, int *vec_dest)
concatenate the first (l_v1 sized) vector and the second (l_v2 sized) vectors of integers into the th...
Definition: mbs_1D_array.c:1190
projection_dvec_4
double * projection_dvec_4(double res[4], double vec[4], double axis[4])
Project a vector on an axis (of size 4).
Definition: mbs_1D_array.c:1925
multiply_dvec_1
double * multiply_dvec_1(double *res, double val, double *vec, int size)
Compute the product of a vector by a real.
Definition: mbs_1D_array.c:732
mbs_drand_1
double * mbs_drand_1(int num, double min, double max)
Allocate an array with the specified random number in the specified range.
Definition: mbs_1D_array.c:284
cmp_dvec_0
int cmp_dvec_0(double *v1, double *v2, int size)
Compare two vectors of floats, as strcmp does it.
Definition: mbs_1D_array.c:1823
sort_inplace_ivec_1
void sort_inplace_ivec_1(int *vec, int l_v)
sort and modify the (x sized) vector of integers, starting with index 1 The "Bubble sort" is used,...
Definition: mbs_1D_array.c:1162
distance_dvec_3
double distance_dvec_3(double pt_1[3], double pt_2[3])
Compute the euclidian distance between two points in 3D.
Definition: mbs_1D_array.c:1933
diff_dvec_0
void diff_dvec_0(double *v1, double *v2, int size, double *v_dest)
Definition: mbs_1D_array.c:683
mbs_msg
void mbs_msg(const char *msg,...)
Send a message.
Definition: mbs_message.c:87
multiply_dvec_dvec_4
double * multiply_dvec_dvec_4(double res[4], double vec_1[4], double vec_2[4])
Compute the element-wise multiplication of two vectors (of size 3).
Definition: mbs_1D_array.c:763
MSG_ERR
#define MSG_ERR
Definition: mbs_1D_array.c:24
multiply_dvec_4
double * multiply_dvec_4(double res[4], double val, double vec[4])
Compute the product of a vector (of size 3) by a real.
Definition: mbs_1D_array.c:705
norm_dvec_1
double norm_dvec_1(double *vec, int l_v)
compute the norm of a [l_v sized] vector of doubles, starting with index 1
Definition: norm.c:76
dot_dvec_0
double dot_dvec_0(double *v1, double *v2, int size)
Dot product (or scalar product) of 2 vectors.
Definition: mbs_1D_array.c:521
print_dvec_0
void print_dvec_0(double *vec, int l_v)
print a (x sized) vector of doubles in console, starting with index 0
Definition: mbs_1D_array.c:1487
conc_ivec_0
void conc_ivec_0(int *vec1_src, int l_vec1, int *vec2_src, int l_vec2, int *vec_dest)
concatenate the first (l_v1 sized) vector and the second (l_v2 sized) vectors of integers into the th...
Definition: mbs_1D_array.c:1190
distance_dvec_4
double distance_dvec_4(double pt_1[4], double pt_2[4])
Compute the euclidian distance between two points in 3D.
Definition: mbs_1D_array.c:1941
dot_dvec_4
double dot_dvec_4(double v1[4], double v2[4])
Dot product (or scalar product) of 2 vectors (of size 3).
Definition: mbs_1D_array.c:516
add_dvec_0
double * add_dvec_0(double *res, double *v1, double *v2, int size)
Sums the two vectors.
Definition: mbs_1D_array.c:580
mean_dvec_3
double * mean_dvec_3(double res[3], double pt_1[3], double pt_2[3])
Compute the coordinates of the middle point between two points.
Definition: mbs_1D_array.c:1949
find_ivec_1
int find_ivec_1(int *vec, int l_v, int f)
return the index of the value f in the (x sized) vector vec of integers, starting with index 1....
Definition: mbs_1D_array.c:1270
MSG_PRE
#define MSG_PRE
Definition: mbs_1D_array.c:25
find_ivec_0
int find_ivec_0(int *vec, int l_v, int f)
return the index of the value f in the (x sized) vector vec of integers, starting with index 0....
Definition: mbs_1D_array.c:1240
code_ivec_1
int code_ivec_1(FILE *file_out, int *values, const char *name, int size)
Write C-code to allocate and fill an array of integers.
Definition: mbs_1D_array.c:1019
add_dvec_4
double * add_dvec_4(double res[4], double v1[4], double v2[4])
Sums the two vectors (of size 3).
Definition: mbs_1D_array.c:554
norm
double norm(double v[4])
DEPRECATED: See norm_dvec_4().
Definition: norm.c:27
mbs_drand_0
double * mbs_drand_0(int num, double min, double max)
Allocate an array with the specified random number in the specified range.
Definition: mbs_1D_array.c:249
copy_dvec_0
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
max_dvec_1
int max_dvec_1(double *vec)
Find the index of the maximum value in the vector.
Definition: mbs_1D_array.c:1890
multiply_dvec_0
double * multiply_dvec_0(double *res, double val, double *vec, int size)
Compute the product of a vector by a real.
Definition: mbs_1D_array.c:718
print_dvec_0
void print_dvec_0(double *vec, int nb_r)
print a (x sized) vector of doubles in console, starting with index 0
Definition: mbs_1D_array.c:1487
scalar_product_1
double scalar_product_1(double *v1, double *v2, int n)
Definition: mbs_1D_array.c:545
scalar_product
double scalar_product(double v1[4], double v2[4])
Definition: mbs_1D_array.c:536
zeros_dvec_1
void zeros_dvec_1(double *vec)
set all the element of a vector of doubles to zero, starting with index 1
Definition: mbs_1D_array.c:1803
normalize_dvec_0
void normalize_dvec_0(double *vec, double *vn, int l_v)
Compute the normalize vector with starting with index 0.
Definition: norm.c:88
scalar_product_0
double scalar_product_0(double *v1, double *v2, int n)
Definition: mbs_1D_array.c:540
re_copy_ivec_1
int * re_copy_ivec_1(int *src, int s_nx, int *dest, int d_nx)
Definition: mbs_1D_array.c:912
value_dvec_1
void value_dvec_1(double value, double *vec)
set all the element of a vector of doubles to a value, starting with index 1
Definition: mbs_1D_array.c:1774
get_dvec_0
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
max_dvec_0
int max_dvec_0(double *vec, int size)
Find the index of the maximum value in the array.
Definition: mbs_1D_array.c:1868
same_ivec_1
int same_ivec_1(int *v1, int *v2)
Compare if two vector are the same.
Definition: mbs_1D_array.c:1302
free_ivec_0
void free_ivec_0(int *vec)
release memory for a vector of integers, starting with index 0
Definition: mbs_1D_array.c:853
get_dinterval_binary_from_index_1
int get_dinterval_binary_from_index_1(double *array, int size, double value, int *index, int lim_check, int verbose)
Find the index of the highest value in the array lower or equal than the value.
Definition: mbs_1D_array.c:417
sort_dvec_0
void sort_dvec_0(double *vec_src, double *vec_dest, int l_v)
sort the first (l_v sized) vector of double into the second vector, starting with index 0
Definition: mbs_1D_array.c:1090
mbs_linspace_1
double * mbs_linspace_1(double start, double stop, int num)
Allocate an evenly spaced numbers over the specified range.
Definition: mbs_1D_array.c:83
add_dvec_3
double * add_dvec_3(double res[3], double v1[3], double v2[3])
Sums the two vectors (of size 3).
Definition: mbs_1D_array.c:567
find_dvec_0
int find_dvec_0(double *vec, int l_v, double f)
return the index of the value f in the (x sized) vector vec of doubles, starting with index 0....
Definition: mbs_1D_array.c:1255
mean_dvec_4
double * mean_dvec_4(double res[4], double pt_1[4], double pt_2[4])
Compute the coordinates of the middle point between two points.
Definition: mbs_1D_array.c:1963
print_ivec_1
void print_ivec_1(int *vec)
print a vector (of size specified in vec[0]) of integers in console, starting with index 1
Definition: mbs_1D_array.c:953
get_dvec_1
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
code_dvec_0
int code_dvec_0(FILE *file_out, double *values, const char *name, int size)
Write C-code to allocate and fill an array of double.
Definition: mbs_1D_array.c:1514
f0123_ivec_0
void f0123_ivec_0(int *vec, int l_v)
Fill the (l_v sized) vector of integers as [0 1 2 3 ... l_v-1], starting with index 0.
Definition: mbs_1D_array.c:1180
mbs_argmin_dvec_0
int mbs_argmin_dvec_0(double *vec, int size)
Returns the index of the minimum value in the vector of double (dvec 0).
Definition: mbs_1D_array.c:428
print_dvec_1
void print_dvec_1(double *vec)
print a vector (of size specified in vec[0]) of doubles in console, starting with index 1
Definition: mbs_1D_array.c:1644
code_ivec_0
int code_ivec_0(FILE *file_out, int *values, const char *name, int size)
Write C-code to allocate and fill an array of integers.
Definition: mbs_1D_array.c:974
normalize
void normalize(double v[4], double vn[4])
DEPRECATED: See normalize_dvec_1()
Definition: norm.c:33
mean_n_dvec_3
double * mean_n_dvec_3(double res[3], double *vecs[], int n_vecs)
Compute the coordinates of the middle point between multiples points.
Definition: mbs_1D_array.c:1976
any_dvec_0
int any_dvec_0(double *vec, int l_v)
check if all values of a [l_v sized] vector of doubles are equal to 0, return 0 in that case,...
Definition: mbs_1D_array.c:1748
sort_ivec_0
void sort_ivec_0(int *vec_src, int *vec_dest, int l_v)
sort the first (l_v sized) vector of integers into the second vector, starting with index 0
Definition: mbs_1D_array.c:1054
subtract_dvec_1
double * subtract_dvec_1(double *res, double *v1, double *v2, int size)
Substraction the two vectors.
Definition: mbs_1D_array.c:665
same_dvec_1
int same_dvec_1(double *v1, double *v2)
Compare if two vector of floats are the same.
Definition: mbs_1D_array.c:1853
pick_and_place_dvec_1
void pick_and_place_dvec_1(double *src, int *index, int n, double *dest)
Pick the values from an array and set them in the destination array at the specified index.
Definition: mbs_1D_array.c:1701
sort_ivec_1
void sort_ivec_1(int *vec_src, int *vec_dest, int l_v)
sort the first (x sized) vector of integers into the second vector, starting with index 1
Definition: mbs_1D_array.c:1126
cmp_dvec_0
int cmp_dvec_0(double *v1, double *v2, int size)
Compare two vectors of floats, as strcmp does it.
Definition: mbs_1D_array.c:1823
save_dvec_0
void save_dvec_0(double *vec, int nb_r, char *name)
save a (x sized) vector of doubles in the specified file, starting with index 0 The file is open with...
Definition: mbs_1D_array.c:1674
opposite_dvec_1
void opposite_dvec_1(double *vec)
function to take the opposite of a given vector (minus in front of each entry)
Definition: mbs_1D_array.c:1818
mbs_warning_msg
void mbs_warning_msg(const char *msg,...)
Send a warning message.
Definition: mbs_message.c:100
get_ivec_0
int * get_ivec_0(int l_v)
create (with memory allocation) a vector (length l_v) of integers, starting at index 0....
Definition: mbs_1D_array.c:818
multiply_dvec_dvec_4
double * multiply_dvec_dvec_4(double res[4], double vec_1[4], double vec_2[4])
Compute the element-wise multiplication of two vectors (of size 3).
Definition: mbs_1D_array.c:763
get_dinterval_binary_0
int get_dinterval_binary_0(double *array, int size, double value, int *index, int lim_check)
Find the index of the highest value in the array lower or equal than the value.
Definition: mbs_1D_array.c:320
save_ivec_0
int save_ivec_0(int *vec, int size, char *name, int row)
save a (x sized) vector of integers in the specified file, starting with index 0 The file is open wit...
Definition: mbs_1D_array.c:447
dot_dvec_3
double dot_dvec_3(double v1[3], double v2[3])
Dot product (or scalar product) of 2 vectors (of size 3).
Definition: mbs_1D_array.c:511
number_product
void number_product(double s, double v1[4], double v_dest[4])
Definition: mbs_1D_array.c:804
distance_dvec_4
double distance_dvec_4(double pt_1[4], double pt_2[4])
Compute the euclidian distance between two points in 3D.
Definition: mbs_1D_array.c:1941
free_dvec_1
void free_dvec_1(double *vec)
release memory for a vector of doubles, starting at index 1
Definition: mbs_1D_array.c:1358
add_dvec_0
double * add_dvec_0(double *res, double *v1, double *v2, int size)
Sums the two vectors.
Definition: mbs_1D_array.c:580
mbs_1D_array.h
Declares all operation betweens vectors, vector and scalar.
mean_dvec_3
double * mean_dvec_3(double res[3], double pt_1[3], double pt_2[3])
Compute the coordinates of the middle point between two points.
Definition: mbs_1D_array.c:1949
get_dinterval_binary_from_index_0
int get_dinterval_binary_from_index_0(double *array, int size, double value, int *index, int lim_check, int verbose)
Find the index of the highest value in the array lower or equal than the value.
Definition: mbs_1D_array.c:365
vector_diff
void vector_diff(double v1[4], double v2[4], double v_dest[4])
Definition: mbs_1D_array.c:678
mean_n_dvec_4
double * mean_n_dvec_4(double res[4], double *vecs[], int n_vecs)
Compute the coordinates of the middle point between multiples points.
Definition: mbs_1D_array.c:1993
zeros_dvec_3
void zeros_dvec_3(double vec[3])
Put all element of a vector of size 3 to 0.
Definition: mbs_1D_array.c:1779
binary_search_0
int binary_search_0(double *array, double value, int id_min, int id_max)
Definition: mbs_1D_array.c:303
norm_dvec_0
double norm_dvec_0(double *vec, int l_v)
compute the norm of a [l_v sized] vector of doubles, starting with index 0
Definition: norm.c:64
zeros_dvec_4
void zeros_dvec_4(double vec[4])
Put all element of a vector of size 3 to 0.
Definition: mbs_1D_array.c:1786
subtract_dvec_0
double * subtract_dvec_0(double *res, double *v1, double *v2, int size)
Substraction the two vectors.
Definition: mbs_1D_array.c:651
save_dvec_0
void save_dvec_0(double *vec, int l_v, char *name)
save a (x sized) vector of doubles in the specified file, starting with index 0 The file is open with...
Definition: mbs_1D_array.c:1674
mbs_range_0
int * mbs_range_0(int start, int stop, int *size)
Return an array of value in the interval spaced by 1.
Definition: mbs_1D_array.c:176
slct_ivec_0
int slct_ivec_0(int *vec_src, int l_vec1, int *vec_ind_src, int l_vec2, int *vec_dest)
fill the third (l_v2 sized) vector by slicing the first (l_v1 sized) vector of integers at the indexe...
Definition: mbs_1D_array.c:1221
get_ivec_1
int * get_ivec_1(int l_v)
create (with memory allocation) a vector (length l_v) of integers, starting at index 1
Definition: mbs_1D_array.c:834
cross_product
void cross_product(double v1[4], double v2[4], double v_dest[4])
Compute the cross product of 2 vectors in a third vector. The first index is 1.
Definition: mbs_1D_array.c:810
same_ivec_0
int same_ivec_0(int *v1, int *v2, int size)
Compare if two vector are the same.
Definition: mbs_1D_array.c:1285
scalar_product
double scalar_product(double v1[4], double v2[4])
Definition: mbs_1D_array.c:536
norminf_vector_1
double norminf_vector_1(double *v, int n)
Compute the maximum of a vector.
Definition: norm.c:38
slct_dvec_0
int slct_dvec_0(double *vec1_src, int l_v1, int *vec_ind_src, int l_v2, double *vec_dest)
fill the third (l_v2 sized) vector by slicing the first (l_v1 sized) vector of doubles at the indexes...
Definition: mbs_1D_array.c:1729
copy_ivec_1
void copy_ivec_1(int *vec_src, int *vec_dest, int l_v)
Copy the content of a vector (of size l_v) of integers to a second vector, starting with index 1.
Definition: mbs_1D_array.c:873
get_dvec_0
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
convert_dvec_0_to_1
double * convert_dvec_0_to_1(double *src, int size, int free_src)
Copy a dvec0 into a new allocated dvec1.
Definition: mbs_1D_array.c:1403
mbs_linspace_0
double * mbs_linspace_0(double start, double stop, int num)
Allocate an evenly spaced numbers over the specified range.
Definition: mbs_1D_array.c:63
multiply_dvec_3
double * multiply_dvec_3(double res[3], double val, double vec[3])
Compute the product of a vector (of size 3) by a real.
Definition: mbs_1D_array.c:692
free_dvec_0
void free_dvec_0(double *vec)
release memory for a vector of doubles, starting at index 0
Definition: mbs_1D_array.c:1353
multiply_dvec_dvec_1
double * multiply_dvec_dvec_1(double *res, double *vec_1, double *vec_2, int size)
Compute the element-wise multiplication of two vectors.
Definition: mbs_1D_array.c:790
multiply_dvec_dvec_3
double * multiply_dvec_dvec_3(double res[3], double vec_1[3], double vec_2[3])
Compute the element-wise multiplication of two vectors (of size 3).
Definition: mbs_1D_array.c:750
code_dvec_1
int code_dvec_1(FILE *file_out, double *values, const char *name, int size)
Write C-code to allocate and fill an array of double.
Definition: mbs_1D_array.c:1584
save_ivec_1
int save_ivec_1(int *vec, int size, char *name, int row)
save a (x sized) vector of integers in the specified file, starting with index 0 The file is open wit...
Definition: mbs_1D_array.c:492
projection_dvec_4
double * projection_dvec_4(double res[4], double vec[4], double axis[4])
Project a vector on an axis (of size 4).
Definition: mbs_1D_array.c:1925
mbs_drand_1
double * mbs_drand_1(int num, double min, double max)
Allocate an array with the specified random number in the specified range.
Definition: mbs_1D_array.c:284
multiply_dvec_4
double * multiply_dvec_4(double res[4], double val, double vec[4])
Compute the product of a vector (of size 3) by a real.
Definition: mbs_1D_array.c:705
mbs_arange_0
double * mbs_arange_0(double start, double stop, double step, int with_end, int *size)
Allocate an a array with specified step between two values.
Definition: mbs_1D_array.c:103
mbs_argmin_dvec_0
int mbs_argmin_dvec_0(double *vec, int size)
Returns the index of the minimum value in the vector of double (dvec 0).
Definition: mbs_1D_array.c:428
print_dvec_1
void print_dvec_1(double *vec)
print a vector (of size specified in vec[0]) of doubles in console, starting with index 1
Definition: mbs_1D_array.c:1644
zeros_dvec_0
void zeros_dvec_0(double *vec, int l_v)
set all the element of a [l_v sized] vector of doubles to zero, starting with index 0
Definition: mbs_1D_array.c:1793
value_dvec_0
void value_dvec_0(double value, double *vec, int l_v)
set all the element of a [l_v sized] vector of doubles to a value, starting with index 0
Definition: mbs_1D_array.c:1764
mean_n_dvec_3
double * mean_n_dvec_3(double res[3], double *vecs[], int n_vecs)
Compute the coordinates of the middle point between multiples points.
Definition: mbs_1D_array.c:1976
dot_dvec_4
double dot_dvec_4(double v1[4], double v2[4])
Dot product (or scalar product) of 2 vectors (of size 3).
Definition: mbs_1D_array.c:516
dot_dvec_1
double dot_dvec_1(double *v1, double *v2, int size)
Dot product (or scalar product) of 2 vectors.
Definition: mbs_1D_array.c:531
opposite_dvec_1
void opposite_dvec_1(double *vec)
function to take the opposite of a given vector (minus in front of each entry)
Definition: mbs_1D_array.c:1818
vector_sum
void vector_sum(double v1[4], double v2[4], double v_dest[4])
Definition: mbs_1D_array.c:607
mbs_range_1
int * mbs_range_1(int start, int stop, int *size)
Return an array of value in the interval spaced by 1.
Definition: mbs_1D_array.c:212
get_dinterval_binary_0
int get_dinterval_binary_0(double *array, int size, double value, int *index, int lim_check)
Find the index of the highest value in the array lower or equal than the value.
Definition: mbs_1D_array.c:320
code_ivec_1
int code_ivec_1(FILE *file_out, int *values, const char *name, int size)
Write C-code to allocate and fill an array of integers.
Definition: mbs_1D_array.c:1019
sum_dvec_0
void sum_dvec_0(double *v1, double *v2, int size, double *v_dest)
Definition: mbs_1D_array.c:614
print_ivec_0
void print_ivec_0(int *vec, int l_v)
print a (l_v sized) vector of integers in console, starting with index 0
Definition: mbs_1D_array.c:932
convert_dvec_1_to_0
double * convert_dvec_1_to_0(double *src, int size, int free_src)
Copy a dvec1 into a new allocated dvec0.
Definition: mbs_1D_array.c:1419
free_dvec_1
void free_dvec_1(double *vec)
release memory for a vector of doubles, starting at index 1
Definition: mbs_1D_array.c:1358
get_dinterval_binary_1
int get_dinterval_binary_1(double *array, int size, double value, int *index, int lim_check)
Find the index of the highest value in the array lower or equal than the value.
Definition: mbs_1D_array.c:354
add_dvec_4
double * add_dvec_4(double res[4], double v1[4], double v2[4])
Sums the two vectors (of size 3).
Definition: mbs_1D_array.c:554
vector_diff
void vector_diff(double v1[4], double v2[4], double v_dest[4])
Definition: mbs_1D_array.c:678
copy_dvec_0
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
max_dvec_1
int max_dvec_1(double *vec)
Find the index of the maximum value in the vector.
Definition: mbs_1D_array.c:1890
externalmbs::increment
subroutine, public increment(tbegin)
Increment time step and save the current configuration of all mbs.
Definition: mod_external_robotran.f90:237
multiply_dvec_dvec_0
double * multiply_dvec_dvec_0(double *res, double *vec_1, double *vec_2, int size)
Compute the element-wise multiplication of two vectors.
Definition: mbs_1D_array.c:776
zeros_dvec_4
void zeros_dvec_4(double vec[4])
Put all element of a vector of size 3 to 0.
Definition: mbs_1D_array.c:1786
copy_ivec_0
void copy_ivec_0(int *vec_src, int *vec_dest, int l_v)
Copy the content of a vector(of size l_v) of integers to a second vector, starting with index 0.
Definition: mbs_1D_array.c:863
norm_dvec_4
double norm_dvec_4(double v[4])
compute the norm of a vector of 3 doubles, starting with index 1.
Definition: norm.c:59
re_copy_dvec_1
double * re_copy_dvec_1(double *src, int s_nx, double *dest, int d_nx)
Copy an array of double into another, reallocate the destination if required.
Definition: mbs_1D_array.c:1467
pick_and_place_dvec_0
void pick_and_place_dvec_0(double *src, int *index, int n, double *dest)
Pick the values from an array and set them in the destination array at the specified index.
Definition: mbs_1D_array.c:1710
cross_product
void cross_product(double v1[4], double v2[4], double v_dest[4])
Compute the cross product of 2 vectors in a third vector. The first index is 1.
Definition: mbs_1D_array.c:810
free_ivec_0
void free_ivec_0(int *vec)
release memory for a vector of integers, starting with index 0
Definition: mbs_1D_array.c:853
get_dinterval_binary_from_index_1
int get_dinterval_binary_from_index_1(double *array, int size, double value, int *index, int lim_check, int verbose)
Find the index of the highest value in the array lower or equal than the value.
Definition: mbs_1D_array.c:417
re_copy_dvec_0
double * re_copy_dvec_0(double *src, int s_nx, double *dest, int d_nx)
Copy an array of double into another, reallocate the destination if required.
Definition: mbs_1D_array.c:1438
sort_dvec_0
void sort_dvec_0(double *vec_src, double *vec_dest, int l_v)
sort the first (l_v sized) vector of double into the second vector, starting with index 0
Definition: mbs_1D_array.c:1090
add_dvec_3
double * add_dvec_3(double res[3], double v1[3], double v2[3])
Sums the two vectors (of size 3).
Definition: mbs_1D_array.c:567
print_format_dvec_0
void print_format_dvec_0(double *vec, int l_v, char *format)
print a (x sized) vector of doubles in console, starting with index 0
Definition: mbs_1D_array.c:1492
subtract_dvec_4
double * subtract_dvec_4(double res[4], double v1[4], double v2[4])
Substraction the two vectors (of size 3).
Definition: mbs_1D_array.c:625
find_dvec_0
int find_dvec_0(double *vec, int l_v, double f)
return the index of the value f in the (x sized) vector vec of doubles, starting with index 0....
Definition: mbs_1D_array.c:1255
multiply_dvec_1
double * multiply_dvec_1(double *res, double val, double *vec, int size)
Compute the product of a vector by a real.
Definition: mbs_1D_array.c:732
print_ivec_1
void print_ivec_1(int *vec)
print a vector (of size specified in vec[0]) of integers in console, starting with index 1
Definition: mbs_1D_array.c:953
sort_inplace_ivec_1
void sort_inplace_ivec_1(int *vec, int l_v)
sort and modify the (x sized) vector of integers, starting with index 1 The "Bubble sort" is used,...
Definition: mbs_1D_array.c:1162
distance_dvec_3
double distance_dvec_3(double pt_1[3], double pt_2[3])
Compute the euclidian distance between two points in 3D.
Definition: mbs_1D_array.c:1933
convert_dvec_0_to_1
double * convert_dvec_0_to_1(double *src, int size, int free_src)
Copy a dvec0 into a new allocated dvec1.
Definition: mbs_1D_array.c:1403
diff_dvec_0
void diff_dvec_0(double *v1, double *v2, int size, double *v_dest)
Definition: mbs_1D_array.c:683
copy_dvec_1
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
f0123_ivec_0
void f0123_ivec_0(int *vec, int l_v)
Fill the (l_v sized) vector of integers as [0 1 2 3 ... l_v-1], starting with index 0.
Definition: mbs_1D_array.c:1180
dot_dvec_0
double dot_dvec_0(double *v1, double *v2, int size)
Dot product (or scalar product) of 2 vectors.
Definition: mbs_1D_array.c:521
mbs_message.h
re_copy_ivec_0
int * re_copy_ivec_0(int *src, int s_nx, int *dest, int d_nx)
Copy an array of int into another, reallocate the destination if required.
Definition: mbs_1D_array.c:883
same_dvec_0
int same_dvec_0(double *v1, double *v2, int size)
Compare if two vectors of floats are the same.
Definition: mbs_1D_array.c:1848
any_dvec_0
int any_dvec_0(double *vec, int l_v)
check if all values of a [l_v sized] vector of doubles are equal to 0, return 0 in that case,...
Definition: mbs_1D_array.c:1748
same_dvec_1
int same_dvec_1(double *v1, double *v2)
Compare if two vector of floats are the same.
Definition: mbs_1D_array.c:1853
sort_ivec_1
void sort_ivec_1(int *vec_src, int *vec_dest, int l_v)
sort the first (x sized) vector of integers into the second vector, starting with index 1
Definition: mbs_1D_array.c:1126
re_copy_ivec_0
int * re_copy_ivec_0(int *src, int s_nx, int *dest, int d_nx)
Copy an array of int into another, reallocate the destination if required.
Definition: mbs_1D_array.c:883
get_ivec_0
int * get_ivec_0(int l_v)
create (with memory allocation) a vector (length l_v) of integers, starting at index 0....
Definition: mbs_1D_array.c:818
mbs_argmin_dvec_1
int mbs_argmin_dvec_1(double *vec, int size)
Returns the index of the minimum value in the vector of double (dvec 1).
Definition: mbs_1D_array.c:441
zeros_dvec_0
void zeros_dvec_0(double *vec, int l_v)
set all the element of a [l_v sized] vector of doubles to zero, starting with index 0
Definition: mbs_1D_array.c:1793
projection_dvec_3
double * projection_dvec_3(double res[3], double vec[3], double axis[3])
Project a vector on an axis (of size 3).
Definition: mbs_1D_array.c:1917
dot_dvec_1
double dot_dvec_1(double *v1, double *v2, int size)
Dot product (or scalar product) of 2 vectors.
Definition: mbs_1D_array.c:531
slct_dvec_1
void slct_dvec_1(double *vec1_src, int *vec_ind_src, int l_v, double *vec3)
fill the third vector by slicing the first vector of doubles at the indexes specified in the second (...
Definition: mbs_1D_array.c:1719
get_dinterval_binary_from_index_0
int get_dinterval_binary_from_index_0(double *array, int size, double value, int *index, int lim_check, int verbose)
Find the index of the highest value in the array lower or equal than the value.
Definition: mbs_1D_array.c:365
opposite_dvec_0
void opposite_dvec_0(double *vec, int n)
function to take the opposite of a given vector (minus in front of each entry)
Definition: mbs_1D_array.c:1808
zeros_dvec_3
void zeros_dvec_3(double vec[3])
Put all element of a vector of size 3 to 0.
Definition: mbs_1D_array.c:1779
conc_ivec_1
void conc_ivec_1(int *vec1_src, int l_v1, int *vec2_src, int l_v2, int *vec3)
concatenate the first (l_v1 sized) vector and the second (l_v2 sized) vectors of integers into the th...
Definition: mbs_1D_array.c:1205
vector_sum
void vector_sum(double v1[4], double v2[4], double v_dest[4])
Definition: mbs_1D_array.c:607
normalize_dvec_1
void normalize_dvec_1(double *vec, double *vn, int l_v)
Compute the normalize vector with first index is 1.
Definition: norm.c:101
mbs_range_1
int * mbs_range_1(int start, int stop, int *size)
Return an array of value in the interval spaced by 1.
Definition: mbs_1D_array.c:212
subtract_dvec_0
double * subtract_dvec_0(double *res, double *v1, double *v2, int size)
Substraction the two vectors.
Definition: mbs_1D_array.c:651
zeros_dvec_1
void zeros_dvec_1(double *vec)
set all the element of a vector of doubles to zero, starting with index 1
Definition: mbs_1D_array.c:1803
slct_ivec_0
int slct_ivec_0(int *vec1_src, int l_v1, int *vec_ind_src, int l_v2, int *vec1_dest)
fill the third (l_v2 sized) vector by slicing the first (l_v1 sized) vector of integers at the indexe...
Definition: mbs_1D_array.c:1221
convert_dvec_1_to_0
double * convert_dvec_1_to_0(double *src, int size, int free_src)
Copy a dvec1 into a new allocated dvec0.
Definition: mbs_1D_array.c:1419
subtract_dvec_3
double * subtract_dvec_3(double res[3], double v1[3], double v2[3])
Substraction the two vectors (of size 3).
Definition: mbs_1D_array.c:638
max_dvec_0
int max_dvec_0(double *vec, int size)
Find the index of the maximum value in the array.
Definition: mbs_1D_array.c:1868
multiply_dvec_dvec_0
double * multiply_dvec_dvec_0(double *res, double *vec_1, double *vec_2, int size)
Compute the element-wise multiplication of two vectors.
Definition: mbs_1D_array.c:776
same_ivec_0
int same_ivec_0(int *v1, int *v2, int size)
Compare if two vector are the same.
Definition: mbs_1D_array.c:1285
free_ivec_1
void free_ivec_1(int *vec)
release memory for a vector of integers, starting with index 1
Definition: mbs_1D_array.c:858
mbs_linspace_1
double * mbs_linspace_1(double start, double stop, int num)
Allocate an evenly spaced numbers over the specified range.
Definition: mbs_1D_array.c:83
copy_ivec_0
void copy_ivec_0(int *vec_src, int *vec_dest, int l_v)
Copy the content of a vector(of size l_v) of integers to a second vector, starting with index 0.
Definition: mbs_1D_array.c:863
add_dvec_1
double * add_dvec_1(double *res, double *v1, double *v2, int size)
Sums the two vectors.
Definition: mbs_1D_array.c:594
re_copy_dvec_1
double * re_copy_dvec_1(double *src, int s_nx, double *dest, int d_nx)
Copy an array of double into another, reallocate the destination if required.
Definition: mbs_1D_array.c:1467
copy_ivec_1
void copy_ivec_1(int *vec_src, int *vec_dest, int l_v)
Copy the content of a vector (of size l_v) of integers to a second vector, starting with index 1.
Definition: mbs_1D_array.c:873
mbs_linspace_0
double * mbs_linspace_0(double start, double stop, int num)
Allocate an evenly spaced numbers over the specified range.
Definition: mbs_1D_array.c:63
get_dvec_1
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
mbs_linspace
int mbs_linspace(double start, double stop, int num, double *linspace)
Definition: mbs_1D_array.c:28
free_dvec_0
void free_dvec_0(double *vec)
release memory for a vector of doubles, starting at index 0
Definition: mbs_1D_array.c:1353
code_dvec_1
int code_dvec_1(FILE *file_out, double *values, const char *name, int size)
Write C-code to allocate and fill an array of double.
Definition: mbs_1D_array.c:1584
sort_ivec_0
void sort_ivec_0(int *vec_src, int *vec_dest, int l_v)
sort the first (l_v sized) vector of integers into the second vector, starting with index 0
Definition: mbs_1D_array.c:1054
subtract_dvec_4
double * subtract_dvec_4(double res[4], double v1[4], double v2[4])
Substraction the two vectors (of size 3).
Definition: mbs_1D_array.c:625
slct_dvec_1
void slct_dvec_1(double *vec_src, int *vec_ind_src, int l_v, double *vec_dest)
fill the third vector by slicing the first vector of doubles at the indexes specified in the second (...
Definition: mbs_1D_array.c:1719
pick_and_place_dvec_1
void pick_and_place_dvec_1(double *src, int *index, int n, double *dest)
Pick the values from an array and set them in the destination array at the specified index.
Definition: mbs_1D_array.c:1701
conc_ivec_1
void conc_ivec_1(int *vec1_src, int l_vec1, int *vec2_src, int l_vec2, int *vec_dest)
concatenate the first (l_v1 sized) vector and the second (l_v2 sized) vectors of integers into the th...
Definition: mbs_1D_array.c:1205
find_ivec_1
int find_ivec_1(int *vec, int l_v, int f)
return the index of the value f in the (x sized) vector vec of integers, starting with index 1....
Definition: mbs_1D_array.c:1270
copy_dvec_1
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
save_ivec_0
int save_ivec_0(int *vec, int size, char *name, int row)
save a (x sized) vector of integers in the specified file, starting with index 0 The file is open wit...
Definition: mbs_1D_array.c:447
find_ivec_0
int find_ivec_0(int *vec, int l_v, int f)
return the index of the value f in the (x sized) vector vec of integers, starting with index 0....
Definition: mbs_1D_array.c:1240
dot_dvec_3
double dot_dvec_3(double v1[3], double v2[3])
Dot product (or scalar product) of 2 vectors (of size 3).
Definition: mbs_1D_array.c:511
number_product
void number_product(double s, double v1[4], double v_dest[4])
Definition: mbs_1D_array.c:804
mbs_arange_0
double * mbs_arange_0(double start, double stop, double step, int with_end, int *size)
Allocate an a array with specified step between two values.
Definition: mbs_1D_array.c:103
same_dvec_0
int same_dvec_0(double *v1, double *v2, int size)
Compare if two vectors of floats are the same.
Definition: mbs_1D_array.c:1848
value_dvec_0
void value_dvec_0(double value, double *vec, int l_v)
set all the element of a [l_v sized] vector of doubles to a value, starting with index 0
Definition: mbs_1D_array.c:1764
mbs_drand_0
double * mbs_drand_0(int num, double min, double max)
Allocate an array with the specified random number in the specified range.
Definition: mbs_1D_array.c:249
mean_n_dvec_4
double * mean_n_dvec_4(double res[4], double *vecs[], int n_vecs)
Compute the coordinates of the middle point between multiples points.
Definition: mbs_1D_array.c:1993
multiply_dvec_0
double * multiply_dvec_0(double *res, double val, double *vec, int size)
Compute the product of a vector by a real.
Definition: mbs_1D_array.c:718
sum_dvec_0
void sum_dvec_0(double *v1, double *v2, int size, double *v_dest)
Definition: mbs_1D_array.c:614
scalar_product_1
double scalar_product_1(double *v1, double *v2, int n)
Definition: mbs_1D_array.c:545
print_ivec_0
void print_ivec_0(int *vec, int l_v)
print a (l_v sized) vector of integers in console, starting with index 0
Definition: mbs_1D_array.c:932
norm_dvec_3
double norm_dvec_3(double v[3])
compute the norm of a vector of 3 doubles, starting with index 0.
Definition: norm.c:54
mbs_argmin_dvec_1
int mbs_argmin_dvec_1(double *vec, int size)
Returns the index of the minimum value in the vector of double (dvec 1).
Definition: mbs_1D_array.c:441
projection_dvec_3
double * projection_dvec_3(double res[3], double vec[3], double axis[3])
Project a vector on an axis (of size 3).
Definition: mbs_1D_array.c:1917
scalar_product_0
double scalar_product_0(double *v1, double *v2, int n)
Definition: mbs_1D_array.c:540
value_dvec_1
void value_dvec_1(double value, double *vec)
set all the element of a vector of doubles to a value, starting with index 1
Definition: mbs_1D_array.c:1774
get_dinterval_binary_1
int get_dinterval_binary_1(double *array, int size, double value, int *index, int lim_check)
Find the index of the highest value in the array lower or equal than the value.
Definition: mbs_1D_array.c:354
mbs_range_0
int * mbs_range_0(int start, int stop, int *size)
Return an array of value in the interval spaced by 1.
Definition: mbs_1D_array.c:176
opposite_dvec_0
void opposite_dvec_0(double *vec, int n)
function to take the opposite of a given vector (minus in front of each entry)
Definition: mbs_1D_array.c:1808
get_ivec_1
int * get_ivec_1(int l_v)
create (with memory allocation) a vector (length l_v) of integers, starting at index 1
Definition: mbs_1D_array.c:834
same_ivec_1
int same_ivec_1(int *v1, int *v2)
Compare if two vector are the same.
Definition: mbs_1D_array.c:1302
mean_dvec_4
double * mean_dvec_4(double res[4], double pt_1[4], double pt_2[4])
Compute the coordinates of the middle point between two points.
Definition: mbs_1D_array.c:1963
subtract_dvec_3
double * subtract_dvec_3(double res[3], double v1[3], double v2[3])
Substraction the two vectors (of size 3).
Definition: mbs_1D_array.c:638