projects
/
platform
/
upstream
/
isl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
26e0d48
)
add isl_mat_swap_cols
author
Sven Verdoolaege
<skimo@kotnet.org>
Thu, 26 Feb 2009 10:59:03 +0000
(11:59 +0100)
committer
Sven Verdoolaege
<skimo@kotnet.org>
Sun, 8 Mar 2009 18:01:48 +0000
(19:01 +0100)
isl_mat.c
patch
|
blob
|
history
isl_mat.h
patch
|
blob
|
history
diff --git
a/isl_mat.c
b/isl_mat.c
index
306f236
..
e2566d5
100644
(file)
--- a/
isl_mat.c
+++ b/
isl_mat.c
@@
-670,6
+670,25
@@
error:
return NULL;
}
return NULL;
}
+struct isl_mat *isl_mat_swap_cols(struct isl_ctx *ctx,
+ struct isl_mat *mat, unsigned i, unsigned j)
+{
+ int r;
+
+ mat = isl_mat_cow(ctx, mat);
+ if (!mat)
+ return NULL;
+ isl_assert(ctx, i < mat->n_col, goto error);
+ isl_assert(ctx, j < mat->n_col, goto error);
+
+ for (r = 0; r < mat->n_row; ++r)
+ isl_int_swap(mat->row[r][i], mat->row[r][j]);
+ return mat;
+error:
+ isl_mat_free(ctx, mat);
+ return NULL;
+}
+
struct isl_mat *isl_mat_swap_rows(struct isl_ctx *ctx,
struct isl_mat *mat, unsigned i, unsigned j)
{
struct isl_mat *isl_mat_swap_rows(struct isl_ctx *ctx,
struct isl_mat *mat, unsigned i, unsigned j)
{
diff --git
a/isl_mat.h
b/isl_mat.h
index
503b6f4
..
ea38739
100644
(file)
--- a/
isl_mat.h
+++ b/
isl_mat.h
@@
-41,6
+41,8
@@
void isl_mat_sub_copy(struct isl_ctx *ctx, isl_int **dst, isl_int **src,
void isl_mat_sub_neg(struct isl_ctx *ctx, isl_int **dst, isl_int **src,
unsigned n_row, unsigned dst_col, unsigned src_col, unsigned n_col);
void isl_mat_sub_neg(struct isl_ctx *ctx, isl_int **dst, isl_int **src,
unsigned n_row, unsigned dst_col, unsigned src_col, unsigned n_col);
+struct isl_mat *isl_mat_swap_cols(struct isl_ctx *ctx,
+ struct isl_mat *mat, unsigned i, unsigned j);
struct isl_mat *isl_mat_swap_rows(struct isl_ctx *ctx,
struct isl_mat *mat, unsigned i, unsigned j);
struct isl_mat *isl_mat_swap_rows(struct isl_ctx *ctx,
struct isl_mat *mat, unsigned i, unsigned j);