6 typedef struct _gs_matrix_t gs_matrix_t;
9 * Allocate a new matrix and init internal data for a matrix of size
10 * row_init X col_init. Matrix cannot grow beyond these init values.
11 * All elements are initially (implicitly) set to 0.
13 gs_matrix_t *gs_new_matrix(int n_init_rows, int n_init_cols);
16 * Free space used by matrix m
18 void gs_delete_matrix(gs_matrix_t *m);
20 void gs_matrix_assure_row_capacity(gs_matrix_t *m, int row, int min_capacity);
22 void gs_matrix_trim_row_capacities(gs_matrix_t *m);
24 void gs_matrix_delete_zero_entries(gs_matrix_t *m);
27 * Sets m[row, col] to val
28 * @p increase If non-zero @p val is added to the existing
30 void gs_matrix_set(gs_matrix_t *m, int row, int col, double val);
33 * Returns the value stored in m[row, col].
35 double gs_matrix_get(const gs_matrix_t *m, int row, int col);
38 * Performs one step of the Gauss-Seidel algorithm
39 * @p m The iteration matrix
40 * @p x The iteration vector
41 * @p a The dimension of the matrix (axa matrix)
43 double gs_matrix_gauss_seidel(const gs_matrix_t *m, double *x, int n);
45 unsigned gs_matrix_get_n_entries(const gs_matrix_t *m);
48 * Dumps the matrix factor*m to the stream @p out.
50 void gs_matrix_dump(const gs_matrix_t *m, int a, int b, FILE *out);
52 int gs_matrix_get_sizeof_allocated_memory(const gs_matrix_t *m);
54 void gs_matrix_export(const gs_matrix_t *m, double *nw, int size);