SimGrid  3.14.159
Versatile Simulation of Distributed Systems
matrix.h File Reference
#include "xbt/misc.h"
#include "xbt/function_types.h"

Classes

struct  s_xbt_matrix_t
 

Macros

#define xbt_matrix_get_ptr(mat, l, c)
 Retrieve the address of a cell (not its content) More...
 
#define xbt_matrix_get_as(mat, l, c, type)
 Quick retrieval of scalar content. More...
 

Typedefs

typedef struct s_xbt_matrix_txbt_matrix_t
 

Functions

xbt_matrix_t xbt_matrix_new (int lines, int rows, const unsigned long elmsize, void_f_pvoid_t const free_f)
 constructor More...
 
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)
 Creates a matrix being a submatrix of another one. More...
 
void xbt_matrix_free (xbt_matrix_t matrix)
 destructor More...
 
void xbt_matrix_copy_values (xbt_matrix_t dest, xbt_matrix_t src, 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)
 Copy the values from the matrix src into the matrix dst. More...
 
void xbt_matrix_dump (xbt_matrix_t matrix, const char *name, int coords, void_f_pvoid_t display_fun)
 Display the content of a matrix (debugging purpose) More...
 
xbt_matrix_t xbt_matrix_double_new_zeros (int lines, int rows)
 Creates a new matrix of double filled with zeros. More...
 
xbt_matrix_t xbt_matrix_double_new_id (int lines, int rows)
 Creates a new matrix of double being the identity matrix. More...
 
xbt_matrix_t xbt_matrix_double_new_seq (int lines, int rows)
 Creates a new matrix of double containing the sequence of numbers in order. More...
 
void xbt_matrix_double_addmult (xbt_matrix_t A, xbt_matrix_t B, xbt_matrix_t C)
 add to C the result of A*B More...
 

Macro Definition Documentation

◆ xbt_matrix_get_ptr

#define xbt_matrix_get_ptr (   mat,
  l,
 
)

Retrieve the address of a cell (not its content)

◆ xbt_matrix_get_as

#define xbt_matrix_get_as (   mat,
  l,
  c,
  type 
)

Quick retrieval of scalar content.

Typedef Documentation

◆ xbt_matrix_t

Function Documentation

◆ xbt_matrix_new()

xbt_matrix_t xbt_matrix_new ( int  lines,
int  rows,
const unsigned long  elmsize,
void_f_pvoid_t const  free_f 
)

constructor

◆ xbt_matrix_new_sub()

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 
)

Creates a matrix being a submatrix of another one.

Examples:
examples/msg/app-pmm/app-pmm.c.

◆ xbt_matrix_free()

void xbt_matrix_free ( xbt_matrix_t  matrix)

destructor

Examples:
examples/msg/app-pmm/app-pmm.c.

◆ xbt_matrix_copy_values()

void xbt_matrix_copy_values ( xbt_matrix_t  dst,
xbt_matrix_t  src,
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 
)

Copy the values from the matrix src into the matrix dst.

Parameters
dstdestination
srcsource
lsizenumber of lines to copy
rsizenumber of rows to copy
lpos_dstline offset on destination matrix
rpos_dstrow offset on destination matrix
lpos_srcline offset on destination matrix
rpos_srcrow offset on destination matrix
cpy_fthe function to use to copy the elements over
Examples:
examples/msg/app-pmm/app-pmm.c.

◆ xbt_matrix_dump()

void xbt_matrix_dump ( xbt_matrix_t  matrix,
const char *  name,
int  coords,
void_f_pvoid_t  display_fun 
)

Display the content of a matrix (debugging purpose)

Parameters
coordsboolean indicating whether we should add the coords of each cell to the output

◆ xbt_matrix_double_new_zeros()

xbt_matrix_t xbt_matrix_double_new_zeros ( int  lines,
int  rows 
)

Creates a new matrix of double filled with zeros.

Examples:
examples/msg/app-pmm/app-pmm.c.

◆ xbt_matrix_double_new_id()

xbt_matrix_t xbt_matrix_double_new_id ( int  lines,
int  rows 
)

Creates a new matrix of double being the identity matrix.

Examples:
examples/msg/app-pmm/app-pmm.c.

◆ xbt_matrix_double_new_seq()

xbt_matrix_t xbt_matrix_double_new_seq ( int  lines,
int  rows 
)

Creates a new matrix of double containing the sequence of numbers in order.

Examples:
examples/msg/app-pmm/app-pmm.c.

◆ xbt_matrix_double_addmult()

void xbt_matrix_double_addmult ( xbt_matrix_t  A,
xbt_matrix_t  B,
xbt_matrix_t  C 
)

add to C the result of A*B

Examples:
examples/msg/app-pmm/app-pmm.c.