X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=isl_equalities.c;h=60c5e9491cd23c0da6e6a7e29a138083d78dd841;hb=2f8d92593afe1c6c61b3b5b920e0accbbe7888ca;hp=e09e1c6da8d3869d068ea6d4e6a1529e3c47d0e3;hpb=309036cf4fb6d77a3287a8de8a9098c0a1211778;p=platform%2Fupstream%2Fisl.git diff --git a/isl_equalities.c b/isl_equalities.c index e09e1c6..60c5e94 100644 --- a/isl_equalities.c +++ b/isl_equalities.c @@ -186,8 +186,12 @@ static struct isl_mat *parameter_compression_multi( A = isl_mat_left_hermite(A, 0, NULL, NULL); T = isl_mat_sub_alloc(A->ctx, A->row, 0, A->n_row, 0, A->n_row); T = isl_mat_lin_to_aff(T); + if (!T) + goto error; isl_int_set(T->row[0][0], D); T = isl_mat_right_inverse(T); + if (!T) + goto error; isl_assert(T->ctx, isl_int_is_one(T->row[0][0]), goto error); T = isl_mat_transpose(T); isl_mat_free(A); @@ -249,7 +253,7 @@ error: * then we divide this row of A by the common factor, unless gcd(A_i) = 0. * In the later case, we simply drop the row (in both A and d). * - * If there are no rows left in A, the G is the identity matrix. Otherwise, + * If there are no rows left in A, then G is the identity matrix. Otherwise, * for each row i, we now determine the lattice of integer vectors * that satisfies this row. Let U_i be the unimodular extension of the * row A_i. This unimodular extension exists because gcd(A_i) = 1. @@ -372,12 +376,12 @@ error: * * M x - c = 0 * - * this function computes unimodular transformation from a lower-dimensional + * this function computes a unimodular transformation from a lower-dimensional * space to the original space that bijectively maps the integer points x' * in the lower-dimensional space to the integer points x in the original * space that satisfy the equalities. * - * The input is given as a matrix B = [ -c M ] and the out is a + * The input is given as a matrix B = [ -c M ] and the output is a * matrix that maps [1 x'] to [1 x]. * If T2 is not NULL, then *T2 is set to a matrix mapping [1 x] to [1 x']. * @@ -400,7 +404,7 @@ error: * * If any of the c' is non-integer, then the original set has no * integer solutions (since the x' are a unimodular transformation - * of the x). + * of the x) and a zero-column matrix is returned. * Otherwise, the transformation is given by * * x = U1 H1^{-1} c + U2 x2'