replace PolyLib format gist test case by isl format one
[isl.git] / isl_pw_neg_templ.c
blob65970cf641665db391e3c44754af7251cf7e9562
1 /*
2 * Copyright 2010 INRIA Saclay
4 * Use of this software is governed by the MIT license
6 * Written by Sven Verdoolaege, INRIA Saclay - Ile-de-France,
7 * Parc Club Orsay Universite, ZAC des vignes, 4 rue Jacques Monod,
8 * 91893 Orsay, France
9 */
11 #include <isl_pw_macro.h>
13 __isl_give PW *FN(PW,neg)(__isl_take PW *pw)
15 int i;
17 if (!pw)
18 return NULL;
20 if (FN(PW,IS_ZERO)(pw))
21 return pw;
23 pw = FN(PW,cow)(pw);
24 if (!pw)
25 return NULL;
27 for (i = 0; i < pw->n; ++i) {
28 pw->p[i].FIELD = FN(EL,neg)(pw->p[i].FIELD);
29 if (!pw->p[i].FIELD)
30 return FN(PW,free)(pw);
33 return pw;