* Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium
*/
-#include "isl_dim.h"
-#include "isl_seq.h"
+#include <isl_ctx_private.h>
+#include <isl/dim.h>
+#include <isl/seq.h>
#include <isl_mat_private.h>
#include "isl_map_private.h"
#include <isl_dim_private.h>
{
int i;
isl_int *old;
+ isl_int **row;
if (!mat)
return NULL;
mat->block = isl_blk_extend(mat->ctx, mat->block, n_row * mat->max_col);
if (isl_blk_is_error(mat->block))
goto error;
- mat->row = isl_realloc_array(mat->ctx, mat->row, isl_int *, n_row);
- if (!mat->row)
+ row = isl_realloc_array(mat->ctx, mat->row, isl_int *, n_row);
+ if (!row)
goto error;
+ mat->row = row;
for (i = 0; i < mat->n_row; ++i)
mat->row[i] = mat->block.data + (mat->row[i] - old);
return inv;
error:
isl_mat_free(mat);
+ isl_mat_free(inv);
return NULL;
}
isl_int_submul(mat->row[i][dst_col], f, mat->row[i][src_col]);
}
+void isl_mat_col_add(__isl_keep isl_mat *mat, int dst_col, int src_col)
+{
+ int i;
+
+ if (!mat)
+ return;
+
+ for (i = 0; i < mat->n_row; ++i)
+ isl_int_add(mat->row[i][dst_col],
+ mat->row[i][dst_col], mat->row[i][src_col]);
+}
+
void isl_mat_col_mul(struct isl_mat *mat, int dst_col, isl_int f, int src_col)
{
int i;