X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/0446fc9e3f379b9aff5e0bb44cf06d06b9e663cc..ea8d5b178fac42d5324d27748373f693842a8156:/include/xbt/matrix.h diff --git a/include/xbt/matrix.h b/include/xbt/matrix.h index 9a4742ab50..1b95b5fccc 100644 --- a/include/xbt/matrix.h +++ b/include/xbt/matrix.h @@ -15,13 +15,13 @@ SG_BEGIN_DECL() -typedef struct { - unsigned int lines, rows; - unsigned long elmsize; + typedef struct { + unsigned int lines, rows; + unsigned long elmsize; - char *data; - void_f_pvoid_t free_f; -} s_xbt_matrix_t, *xbt_matrix_t; + char *data; + void_f_pvoid_t free_f; + } s_xbt_matrix_t, *xbt_matrix_t; /** @brief Retrieve the address of a cell (not its content) @@ -31,38 +31,40 @@ typedef struct { /** @brief Quick retrieval of scalar content * @hideinitializer */ -#define xbt_matrix_get_as(mat,l,c,type) *(type*)xbt_matrix_get_ptr(mat,l,c) +#define xbt_matrix_get_as(mat,l,c,type) *(type*)xbt_matrix_get_ptr(mat,l,c) -XBT_PUBLIC(xbt_matrix_t) xbt_matrix_new(int lines, int rows, - const unsigned long elmsize, - void_f_pvoid_t const free_f); +XBT_PUBLIC(xbt_matrix_t) xbt_matrix_new(int lines, int rows, + const unsigned long elmsize, + void_f_pvoid_t const free_f); XBT_PUBLIC(xbt_matrix_t) xbt_matrix_new_sub(xbt_matrix_t from, - int lsize, int rsize, - int lpos, int rpos, - pvoid_f_pvoid_t const cpy_f); + int lsize, int rsize, + int lpos, int rpos, + pvoid_f_pvoid_t const cpy_f); XBT_PUBLIC(void) xbt_matrix_free(xbt_matrix_t matrix); XBT_PUBLIC(void) xbt_matrix_free_voidp(void *d); XBT_PUBLIC(void) xbt_matrix_copy_values(xbt_matrix_t dest, xbt_matrix_t src, - int lsize, int rsize, - int lpos_dst,int rpos_dst, - int lpos_src,int rpos_src, - pvoid_f_pvoid_t const cpy_f); + unsigned int lsize, + unsigned int rsize, + unsigned int lpos_dst, + unsigned int rpos_dst, + unsigned int lpos_src, + unsigned int rpos_src, + pvoid_f_pvoid_t const cpy_f); -XBT_PUBLIC(void) xbt_matrix_dump(xbt_matrix_t matrix, const char *name, int coords, - void_f_pvoid_t display_fun); -XBT_PUBLIC(void) xbt_matrix_dump_display_double(void*d); +XBT_PUBLIC(void) xbt_matrix_dump(xbt_matrix_t matrix, const char *name, + int coords, void_f_pvoid_t display_fun); +XBT_PUBLIC(void) xbt_matrix_dump_display_double(void *d); XBT_PUBLIC(xbt_matrix_t) xbt_matrix_double_new_zeros(int lines, int rows); XBT_PUBLIC(xbt_matrix_t) xbt_matrix_double_new_id(int lines, int rows); XBT_PUBLIC(xbt_matrix_t) xbt_matrix_double_new_rand(int lines, int rows); XBT_PUBLIC(xbt_matrix_t) xbt_matrix_double_new_seq(int lines, int rows); -XBT_PUBLIC(xbt_matrix_t) xbt_matrix_double_new_mult(xbt_matrix_t A,xbt_matrix_t B); -XBT_PUBLIC(void) xbt_matrix_double_addmult(xbt_matrix_t A,xbt_matrix_t B, - /*OUT*/ xbt_matrix_t C); +XBT_PUBLIC(xbt_matrix_t) xbt_matrix_double_new_mult(xbt_matrix_t A, + xbt_matrix_t B); +XBT_PUBLIC(void) xbt_matrix_double_addmult(xbt_matrix_t A, xbt_matrix_t B, + /*OUT*/ xbt_matrix_t C); SG_END_DECL() - - #endif /* XBT_MATRIX_H */