* Copyright 2008-2009 Katholieke Universiteit Leuven
* Copyright 2010 INRIA Saclay
* Copyright 2014 Ecole Normale Superieure
- * Copyright 2017 Sven Verdoolaege
+ * Copyright 2016-2017 Sven Verdoolaege
*
* Use of this software is governed by the MIT license
*
@@ -1867,6 +1867,25 @@ __isl_give isl_vec *isl_mat_get_row(__isl_keep isl_mat *mat, unsigned row)
return v;
}
+/* Return a copy of column "col" of "mat" as an isl_vec.
+ */
+__isl_give isl_vec *isl_mat_get_col(__isl_keep isl_mat *mat, unsigned col)
+{
+ int i;
+ isl_vec *v;
+
+ if (check_col_range(mat, col, 1) < 0)
+ return NULL;
+
+ v = isl_vec_alloc(isl_mat_get_ctx(mat), mat->n_row);
+ if (!v)
+ return NULL;
+ for (i = 0; i < mat->n_row; ++i)
+ isl_int_set(v->el[i], mat->row[i][col]);
+
+ return v;
+}
+
__isl_give isl_mat *isl_mat_vec_concat(__isl_take isl_mat *top,
__isl_take isl_vec *bot)
{
@@ -47,6 +47,7 @@ __isl_give isl_mat *isl_mat_scale_down_row(__isl_take isl_mat *mat, int row,
isl_int m);
__isl_give isl_vec *isl_mat_get_row(__isl_keep isl_mat *mat, unsigned row);
+__isl_give isl_vec *isl_mat_get_col(__isl_keep isl_mat *mat, unsigned col);
__isl_give isl_mat *isl_mat_lexnonneg_rows(__isl_take isl_mat *mat);