1 #ifndef CADO_LINALG_GAUSS_H_
2 #define CADO_LINALG_GAUSS_H_
3 
4 #include <gmp.h>
5 
6 #ifdef __cplusplus
7 extern "C" {
8 #endif
9 
10 /* TODO: I'd like to deprecate this code and rely on block-level
11  * operations only.
12  *
13  * for the moment, it's not marked an iwyu-private thing of bblas, since
14  * it should be regarded as an external piece of code, really.
15  */
16 
17 /* Compute the right nullspace of the nrows times ncols matrix given by
18  * mat. The matrix is given as a flat array of mp_limb_t, with the
19  * specified number of limbs per row. The kernel is written to the array
20  * of arrays given by the ker argument, where each member is expected to
21  * hold space for at least limbs_per_col mp_limb_t values. Caution leads
22  * to allocate as many as ncols pointers in the ker array.
23  *
24  * The dimension of the kernel is given by the return value. If ker ==
25  * NULL, this is the only thing computed (and limbs_per_col is unused).
26  *
27  * limbs_per_row (and accordingly limbs_per_col) must of course be
28  * larger than or equal to ceiling(ncols/GMP_LIMB_BITS). We allow this
29  * value to be exceeded so as to allow some padding.
30  *
31  * In case you wonder, this function is not reentrant at all. Sorry.
32  */
33 extern int kernel(mp_limb_t* mat, mp_limb_t** ker, int nrows, int ncols,
34 		  int limbs_per_row, int limbs_per_col);
35 
36 /* This is the dual function. It returns into lmat an extraction matrix
37  * such that the first rows of lmat*mat are linearly independent, while
38  * the rest is zero. lmat is full rank. Of course the number of
39  * independent rows matches the rank of mat, and is actually returned by
40  * the function.
41  */
42 extern int spanned_basis(mp_limb_t * lmat, mp_limb_t * mat, int nrows, int ncols,
43         int limbs_per_row, int limbs_per_col, mp_limb_t * elim_table);
44 #ifdef __cplusplus
45 }
46 #endif
47 
48 #endif	/* CADO_LINALG_GAUSS_H_ */
49