projects
/
platform
/
upstream
/
isl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'maint'
[platform/upstream/isl.git]
/
isl_mat.c
diff --git
a/isl_mat.c
b/isl_mat.c
index
ace8a43
..
e64beae
100644
(file)
--- a/
isl_mat.c
+++ b/
isl_mat.c
@@
-14,6
+14,11
@@
#include "isl_map_private.h"
#include <isl_dim_private.h>
#include "isl_map_private.h"
#include <isl_dim_private.h>
+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)
{
struct isl_mat *isl_mat_alloc(struct isl_ctx *ctx,
unsigned n_row, unsigned n_col)
{
@@
-1192,7
+1197,7
@@
error:
return NULL;
}
return NULL;
}
-void isl_mat_
dump(struct
isl_mat *mat, FILE *out, int indent)
+void isl_mat_
print_internal(__isl_keep
isl_mat *mat, FILE *out, int indent)
{
int i, j;
{
int i, j;
@@
-1221,6
+1226,11
@@
void isl_mat_dump(struct isl_mat *mat, FILE *out, int indent)
}
}
}
}
+void isl_mat_dump(__isl_keep isl_mat *mat)
+{
+ isl_mat_print_internal(mat, stderr, 0);
+}
+
struct isl_mat *isl_mat_drop_cols(struct isl_mat *mat, unsigned col, unsigned n)
{
int r;
struct isl_mat *isl_mat_drop_cols(struct isl_mat *mat, unsigned col, unsigned n)
{
int r;
@@
-1559,6
+1569,10
@@
__isl_give isl_mat *isl_mat_scale_down(__isl_take isl_mat *mat, isl_int m)
{
int i;
{
int i;
+ if (isl_int_is_one(m))
+ return mat;
+
+ mat = isl_mat_cow(mat);
if (!mat)
return NULL;
if (!mat)
return NULL;
@@
-1583,6
+1597,17
@@
__isl_give isl_mat *isl_mat_normalize(__isl_take isl_mat *mat)
return mat;
}
return mat;
}
+__isl_give isl_mat *isl_mat_normalize_row(__isl_take isl_mat *mat, int row)
+{
+ mat = isl_mat_cow(mat);
+ if (!mat)
+ return NULL;
+
+ isl_seq_normalize(mat->ctx, mat->row[row], mat->n_col);
+
+ return mat;
+}
+
/* Number of initial non-zero columns.
*/
int isl_mat_initial_non_zero_cols(__isl_keep isl_mat *mat)
/* Number of initial non-zero columns.
*/
int isl_mat_initial_non_zero_cols(__isl_keep isl_mat *mat)