|
Robotran C Documentation
|
Go to the documentation of this file.
33 #ifndef MBS_1D_ARRAY_h
34 #define MBS_1D_ARRAY_h
83 double *
mbs_arange_0(
double start,
double stop,
double step,
int with_end,
int *size);
137 double *
mbs_drand_0(
int num,
double min,
double max);
150 double *
mbs_drand_1(
int num,
double min,
double max);
300 int save_ivec_0(
int *vec,
int size,
char *name,
int row);
316 int save_ivec_1(
int *vec,
int size,
char *name,
int row);
327 double dot_dvec_3(
double v1[3],
double v2[3]);
338 double dot_dvec_4(
double v1[4],
double v2[4]);
350 double dot_dvec_0(
double *v1,
double *v2,
int size);
362 double dot_dvec_1(
double *v1,
double *v2,
int size);
386 double *
add_dvec_4(
double res[4],
double v1[4],
double v2[4]);
401 double *
add_dvec_3(
double res[3],
double v1[3],
double v2[3]);
417 double *
add_dvec_0(
double *res,
double *v1,
double *v2,
int size);
433 double *
add_dvec_1(
double *res,
double *v1,
double *v2,
int size);
436 void vector_sum(
double v1[4],
double v2[4],
double v_dest[4]);
439 void sum_dvec_0(
double *v1,
double *v2,
int size,
double *v_dest);
488 double *
subtract_dvec_0(
double *res,
double *v1,
double *v2,
int size);
505 double *
subtract_dvec_1(
double *res,
double *v1,
double *v2,
int size);
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);
520 void cross_product(
double v1[4],
double v2[4],
double v_dest[4]);
582 double *
multiply_dvec_0(
double *res,
double val,
double *vec,
int size);
602 double *
multiply_dvec_1(
double *res,
double val,
double *vec,
int size);
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);
777 int code_ivec_0(FILE *file_out,
int *values,
const char *name,
int size);
791 int code_ivec_1(FILE *file_out,
int *values,
const char *name,
int size);
800 void sort_ivec_0(
int* vec_src,
int* vec_dest,
int l_v);
808 void sort_dvec_0(
double* vec_src,
double* vec_dest,
int l_v);
816 void sort_ivec_1(
int* vec_src,
int* vec_dest,
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);
859 int slct_ivec_0(
int* vec1_src,
int l_v1,
int* vec_ind_src,
int l_v2,
int* vec1_dest);
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);
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);
1032 int code_dvec_0(FILE *file_out,
double *values,
const char *name,
int size);
1046 int code_dvec_1(FILE *file_out,
double *values,
const char *name,
int size);
1055 void save_dvec_0(
double* vec,
int nb_r,
char* name);
1088 void slct_dvec_1(
double* vec1_src,
int* vec_ind_src,
int l_v,
double* vec3);
1100 int slct_dvec_0(
double* vec1_src,
int l_v1,
int* vec_ind_src,
int l_v2,
double* vec_dest);
1181 int cmp_dvec_0(
double* v1,
double* v2,
int size);
1193 int same_dvec_0(
double* v1,
double* v2,
int size);
1230 double norm(
double v[4]);
1241 void normalize(
double v[4],
double vn[4]);
1399 double *
mean_dvec_3(
double res[3],
double pt_1[3],
double pt_2[3]);
1418 double *
mean_dvec_4(
double res[4],
double pt_1[4],
double pt_2[4]);
1437 double *
mean_n_dvec_3(
double res[3],
double *vecs[],
int n_vecs);
1458 double *
mean_n_dvec_4(
double res[4],
double *vecs[],
int n_vecs);
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
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
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
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
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
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
void free_ivec_1(int *vec)
release memory for a vector of integers, starting with index 1
Definition: mbs_1D_array.c:858
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
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
double * add_dvec_1(double *res, double *v1, double *v2, int size)
Sums the two vectors.
Definition: mbs_1D_array.c:594
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
double * subtract_dvec_1(double *res, double *v1, double *v2, int size)
Substraction the two vectors.
Definition: mbs_1D_array.c:665
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
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
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
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
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
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
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
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
void diff_dvec_0(double *v1, double *v2, int size, double *v_dest)
Definition: mbs_1D_array.c:683
void mbs_msg(const char *msg,...)
Send a message.
Definition: mbs_message.c:87
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
#define MSG_ERR
Definition: mbs_1D_array.c:24
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
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
double dot_dvec_0(double *v1, double *v2, int size)
Dot product (or scalar product) of 2 vectors.
Definition: mbs_1D_array.c:521
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
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
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
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
double * add_dvec_0(double *res, double *v1, double *v2, int size)
Sums the two vectors.
Definition: mbs_1D_array.c:580
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
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
#define MSG_PRE
Definition: mbs_1D_array.c:25
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
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
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
double norm(double v[4])
DEPRECATED: See norm_dvec_4().
Definition: norm.c:27
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
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
int max_dvec_1(double *vec)
Find the index of the maximum value in the vector.
Definition: mbs_1D_array.c:1890
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
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
double scalar_product_1(double *v1, double *v2, int n)
Definition: mbs_1D_array.c:545
double scalar_product(double v1[4], double v2[4])
Definition: mbs_1D_array.c:536
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
void normalize_dvec_0(double *vec, double *vn, int l_v)
Compute the normalize vector with starting with index 0.
Definition: norm.c:88
double scalar_product_0(double *v1, double *v2, int n)
Definition: mbs_1D_array.c:540
int * re_copy_ivec_1(int *src, int s_nx, int *dest, int d_nx)
Definition: mbs_1D_array.c:912
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
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
int max_dvec_0(double *vec, int size)
Find the index of the maximum value in the array.
Definition: mbs_1D_array.c:1868
int same_ivec_1(int *v1, int *v2)
Compare if two vector are the same.
Definition: mbs_1D_array.c:1302
void free_ivec_0(int *vec)
release memory for a vector of integers, starting with index 0
Definition: mbs_1D_array.c:853
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
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
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
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
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
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
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
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
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
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
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
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
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
void normalize(double v[4], double vn[4])
DEPRECATED: See normalize_dvec_1()
Definition: norm.c:33
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
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
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
double * subtract_dvec_1(double *res, double *v1, double *v2, int size)
Substraction the two vectors.
Definition: mbs_1D_array.c:665
int same_dvec_1(double *v1, double *v2)
Compare if two vector of floats are the same.
Definition: mbs_1D_array.c:1853
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
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
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
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
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
void mbs_warning_msg(const char *msg,...)
Send a warning message.
Definition: mbs_message.c:100
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
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
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
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
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
void number_product(double s, double v1[4], double v_dest[4])
Definition: mbs_1D_array.c:804
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
void free_dvec_1(double *vec)
release memory for a vector of doubles, starting at index 1
Definition: mbs_1D_array.c:1358
double * add_dvec_0(double *res, double *v1, double *v2, int size)
Sums the two vectors.
Definition: mbs_1D_array.c:580
Declares all operation betweens vectors, vector and scalar.
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
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
void vector_diff(double v1[4], double v2[4], double v_dest[4])
Definition: mbs_1D_array.c:678
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
void zeros_dvec_3(double vec[3])
Put all element of a vector of size 3 to 0.
Definition: mbs_1D_array.c:1779
int binary_search_0(double *array, double value, int id_min, int id_max)
Definition: mbs_1D_array.c:303
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
void zeros_dvec_4(double vec[4])
Put all element of a vector of size 3 to 0.
Definition: mbs_1D_array.c:1786
double * subtract_dvec_0(double *res, double *v1, double *v2, int size)
Substraction the two vectors.
Definition: mbs_1D_array.c:651
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
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
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
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
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
int same_ivec_0(int *v1, int *v2, int size)
Compare if two vector are the same.
Definition: mbs_1D_array.c:1285
double scalar_product(double v1[4], double v2[4])
Definition: mbs_1D_array.c:536
double norminf_vector_1(double *v, int n)
Compute the maximum of a vector.
Definition: norm.c:38
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
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
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
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
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
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
void free_dvec_0(double *vec)
release memory for a vector of doubles, starting at index 0
Definition: mbs_1D_array.c:1353
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
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
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
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
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
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
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
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
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
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
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
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
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
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
double dot_dvec_1(double *v1, double *v2, int size)
Dot product (or scalar product) of 2 vectors.
Definition: mbs_1D_array.c:531
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
void vector_sum(double v1[4], double v2[4], double v_dest[4])
Definition: mbs_1D_array.c:607
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
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
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
void sum_dvec_0(double *v1, double *v2, int size, double *v_dest)
Definition: mbs_1D_array.c:614
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
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
void free_dvec_1(double *vec)
release memory for a vector of doubles, starting at index 1
Definition: mbs_1D_array.c:1358
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
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
void vector_diff(double v1[4], double v2[4], double v_dest[4])
Definition: mbs_1D_array.c:678
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
int max_dvec_1(double *vec)
Find the index of the maximum value in the vector.
Definition: mbs_1D_array.c:1890
subroutine, public increment(tbegin)
Increment time step and save the current configuration of all mbs.
Definition: mod_external_robotran.f90:237
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
void zeros_dvec_4(double vec[4])
Put all element of a vector of size 3 to 0.
Definition: mbs_1D_array.c:1786
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
double norm_dvec_4(double v[4])
compute the norm of a vector of 3 doubles, starting with index 1.
Definition: norm.c:59
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
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
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
void free_ivec_0(int *vec)
release memory for a vector of integers, starting with index 0
Definition: mbs_1D_array.c:853
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
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
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
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
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
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
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
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
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
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
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
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
void diff_dvec_0(double *v1, double *v2, int size, double *v_dest)
Definition: mbs_1D_array.c:683
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
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
double dot_dvec_0(double *v1, double *v2, int size)
Dot product (or scalar product) of 2 vectors.
Definition: mbs_1D_array.c:521
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
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
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
int same_dvec_1(double *v1, double *v2)
Compare if two vector of floats are the same.
Definition: mbs_1D_array.c:1853
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
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
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
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
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
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
double dot_dvec_1(double *v1, double *v2, int size)
Dot product (or scalar product) of 2 vectors.
Definition: mbs_1D_array.c:531
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
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
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
void zeros_dvec_3(double vec[3])
Put all element of a vector of size 3 to 0.
Definition: mbs_1D_array.c:1779
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
void vector_sum(double v1[4], double v2[4], double v_dest[4])
Definition: mbs_1D_array.c:607
void normalize_dvec_1(double *vec, double *vn, int l_v)
Compute the normalize vector with first index is 1.
Definition: norm.c:101
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
double * subtract_dvec_0(double *res, double *v1, double *v2, int size)
Substraction the two vectors.
Definition: mbs_1D_array.c:651
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
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
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
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
int max_dvec_0(double *vec, int size)
Find the index of the maximum value in the array.
Definition: mbs_1D_array.c:1868
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
int same_ivec_0(int *v1, int *v2, int size)
Compare if two vector are the same.
Definition: mbs_1D_array.c:1285
void free_ivec_1(int *vec)
release memory for a vector of integers, starting with index 1
Definition: mbs_1D_array.c:858
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
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
double * add_dvec_1(double *res, double *v1, double *v2, int size)
Sums the two vectors.
Definition: mbs_1D_array.c:594
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
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
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
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
int mbs_linspace(double start, double stop, int num, double *linspace)
Definition: mbs_1D_array.c:28
void free_dvec_0(double *vec)
release memory for a vector of doubles, starting at index 0
Definition: mbs_1D_array.c:1353
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
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
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
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
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
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
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
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 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
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
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
void number_product(double s, double v1[4], double v_dest[4])
Definition: mbs_1D_array.c:804
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
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
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
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
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
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
void sum_dvec_0(double *v1, double *v2, int size, double *v_dest)
Definition: mbs_1D_array.c:614
double scalar_product_1(double *v1, double *v2, int n)
Definition: mbs_1D_array.c:545
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
double norm_dvec_3(double v[3])
compute the norm of a vector of 3 doubles, starting with index 0.
Definition: norm.c:54
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
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
double scalar_product_0(double *v1, double *v2, int n)
Definition: mbs_1D_array.c:540
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
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
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
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
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
int same_ivec_1(int *v1, int *v2)
Compare if two vector are the same.
Definition: mbs_1D_array.c:1302
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
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