/*
* Copyright 2008-2009 Katholieke Universiteit Leuven
*
- * Use of this software is governed by the GNU LGPLv2.1 license
+ * Use of this software is governed by the MIT license
*
* Written by Sven Verdoolaege, K.U.Leuven, Departement
* Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium
struct isl_mat *transpose = NULL;
int i, j;
+ if (!mat)
+ return NULL;
+
if (mat->n_col == mat->n_row) {
mat = isl_mat_cow(mat);
if (!mat)
return mat;
}
-struct isl_mat *isl_mat_product(struct isl_mat *left, struct isl_mat *right)
+__isl_give isl_mat *isl_mat_product(__isl_take isl_mat *left,
+ __isl_take isl_mat *right)
{
int i, j, k;
struct isl_mat *prod;
{
int r;
+ if (n == 0)
+ return mat;
+
mat = isl_mat_cow(mat);
if (!mat)
return NULL;