From 7c685fdbe881ac8bee583ca732ad3832f2f05d98 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Wed, 6 Sep 2017 23:06:10 +0200 Subject: [PATCH] expose isl_mat_rank Signed-off-by: Sven Verdoolaege --- doc/user.pod | 6 ++++++ include/isl/mat.h | 1 + isl_vertices.c | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/doc/user.pod b/doc/user.pod index 4291278d..7b28af64 100644 --- a/doc/user.pod +++ b/doc/user.pod @@ -7734,6 +7734,12 @@ The elements can be changed and inspected using the following functions. __isl_take isl_mat *mat, int row, int col, __isl_take isl_val *v); +The following function computes the rank of a matrix. +The return value may be -1 if some error occurred. + + #include + int isl_mat_rank(__isl_keep isl_mat *mat); + The following function can be used to compute the (right) inverse of a matrix, i.e., a matrix such that the product of the original and the inverse (in that order) is a multiple of the identity matrix. diff --git a/include/isl/mat.h b/include/isl/mat.h index 8764c96f..144230b2 100644 --- a/include/isl/mat.h +++ b/include/isl/mat.h @@ -103,6 +103,7 @@ __isl_give isl_mat *isl_mat_vec_concat(__isl_take isl_mat *top, isl_bool isl_mat_is_equal(__isl_keep isl_mat *mat1, __isl_keep isl_mat *mat2); +int isl_mat_rank(__isl_keep isl_mat *mat); int isl_mat_initial_non_zero_cols(__isl_keep isl_mat *mat); void isl_mat_print_internal(__isl_keep isl_mat *mat, FILE *out, int indent); diff --git a/isl_vertices.c b/isl_vertices.c index f70e410d..4a952268 100644 --- a/isl_vertices.c +++ b/isl_vertices.c @@ -229,7 +229,7 @@ error: return NULL; } -static int isl_mat_rank(__isl_keep isl_mat *mat) +int isl_mat_rank(__isl_keep isl_mat *mat) { int row, col; isl_mat *H; -- 2.11.4.GIT