From 245b1efcd452bede3fe96b61e300b58d8182e3fd Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Mon, 28 Aug 2017 12:12:24 +0200 Subject: [PATCH] add isl_mat_row_basis Signed-off-by: Sven Verdoolaege --- doc/user.pod | 6 ++++++ include/isl/mat.h | 1 + isl_mat.c | 9 +++++++++ 3 files changed, 16 insertions(+) diff --git a/doc/user.pod b/doc/user.pod index 7b28af64..ca52ad74 100644 --- a/doc/user.pod +++ b/doc/user.pod @@ -7753,6 +7753,12 @@ the original and the kernel (in that order) is the zero matrix. __isl_give isl_mat *isl_mat_right_kernel(__isl_take isl_mat *mat); +The following function computes a basis for the space spanned +by the rows of a matrix. + + __isl_give isl_mat *isl_mat_row_basis( + __isl_take isl_mat *mat); + =head2 Bounds on Piecewise Quasipolynomials and Piecewise Quasipolynomial Reductions The following functions determine diff --git a/include/isl/mat.h b/include/isl/mat.h index 144230b2..9140db44 100644 --- a/include/isl/mat.h +++ b/include/isl/mat.h @@ -94,6 +94,7 @@ __isl_give isl_mat *isl_mat_add_zero_rows(__isl_take isl_mat *mat, unsigned n); void isl_mat_col_add(__isl_keep isl_mat *mat, int dst_col, int src_col); __isl_give isl_mat *isl_mat_unimodular_complete(__isl_take isl_mat *M, int row); +__isl_give isl_mat *isl_mat_row_basis(__isl_take isl_mat *mat); __isl_give isl_mat *isl_mat_from_row_vec(__isl_take isl_vec *vec); __isl_give isl_mat *isl_mat_concat(__isl_take isl_mat *top, diff --git a/isl_mat.c b/isl_mat.c index cdee428c..d8f8a25b 100644 --- a/isl_mat.c +++ b/isl_mat.c @@ -2018,3 +2018,12 @@ int isl_mat_initial_non_zero_cols(__isl_keep isl_mat *mat) return i; } + +/* Return a basis for the space spanned by the rows of "mat". + * Any basis will do, so simply perform Gaussian elimination and + * remove the empty rows. + */ +__isl_give isl_mat *isl_mat_row_basis(__isl_take isl_mat *mat) +{ + return isl_mat_reverse_gauss(mat); +} -- 2.11.4.GIT