diff options
author | Sven Verdoolaege <skimo@kotnet.org> | 2013-04-06 10:32:51 +0200 |
---|---|---|
committer | Sven Verdoolaege <skimo@kotnet.org> | 2013-05-28 18:20:15 +0200 |
commit | 2d0fce082b6de7051cefa8f012b101c774c6a029 (patch) | |
tree | 164e308cdad949420b3cec3dc0fcdafb60bf8c9e /isl_mat.c | |
parent | fbdf8af4f16b910d7493c419885f939364096a0e (diff) | |
download | isl-2d0fce082b6de7051cefa8f012b101c774c6a029.tar.gz isl-2d0fce082b6de7051cefa8f012b101c774c6a029.tar.bz2 isl-2d0fce082b6de7051cefa8f012b101c774c6a029.zip |
add isl_mat_get_element_val
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
Diffstat (limited to 'isl_mat.c')
-rw-r--r-- | isl_mat.c | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -246,6 +246,25 @@ int isl_mat_get_element(__isl_keep isl_mat *mat, int row, int col, isl_int *v) return 0; } +/* Extract the element at row "row", oolumn "col" of "mat". + */ +__isl_give isl_val *isl_mat_get_element_val(__isl_keep isl_mat *mat, + int row, int col) +{ + isl_ctx *ctx; + + if (!mat) + return NULL; + ctx = isl_mat_get_ctx(mat); + if (row < 0 || row >= mat->n_row) + isl_die(ctx, isl_error_invalid, "row out of range", + return NULL); + if (col < 0 || col >= mat->n_col) + isl_die(ctx, isl_error_invalid, "column out of range", + return NULL); + return isl_val_int_from_isl_int(ctx, mat->row[row][col]); +} + __isl_give isl_mat *isl_mat_set_element(__isl_take isl_mat *mat, int row, int col, isl_int v) { |