From 609214d41e76838eee4cdb73c971cb6235a3708e Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Thu, 12 May 2011 12:52:57 +0200 Subject: [PATCH] add isl_mat_get_ctx Signed-off-by: Sven Verdoolaege --- doc/user.pod | 1 + include/isl/mat.h | 2 ++ isl_mat.c | 5 +++++ 3 files changed, 8 insertions(+) diff --git a/doc/user.pod b/doc/user.pod index 9ddcfca7..d71c3306 100644 --- a/doc/user.pod +++ b/doc/user.pod @@ -1905,6 +1905,7 @@ Matrices can be created, copied and freed using the following functions. Note that the elements of a newly created matrix may have arbitrary values. The elements can be changed and inspected using the following functions. + isl_ctx *isl_mat_get_ctx(__isl_keep isl_mat *mat); int isl_mat_rows(__isl_keep isl_mat *mat); int isl_mat_cols(__isl_keep isl_mat *mat); int isl_mat_get_element(__isl_keep isl_mat *mat, diff --git a/include/isl/mat.h b/include/isl/mat.h index a28d6775..dfa74c28 100644 --- a/include/isl/mat.h +++ b/include/isl/mat.h @@ -24,6 +24,8 @@ extern "C" { struct isl_mat; typedef struct isl_mat isl_mat; +isl_ctx *isl_mat_get_ctx(__isl_keep isl_mat *mat); + __isl_give isl_mat *isl_mat_alloc(struct isl_ctx *ctx, unsigned n_row, unsigned n_col); struct isl_mat *isl_mat_dup(struct isl_mat *mat); diff --git a/isl_mat.c b/isl_mat.c index 9ccf01ec..dc64b63f 100644 --- a/isl_mat.c +++ b/isl_mat.c @@ -14,6 +14,11 @@ #include "isl_map_private.h" #include +isl_ctx *isl_mat_get_ctx(__isl_keep isl_mat *mat) +{ + return mat ? mat->ctx : NULL; +} + struct isl_mat *isl_mat_alloc(struct isl_ctx *ctx, unsigned n_row, unsigned n_col) { -- 2.11.4.GIT