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,
11 #include <isl_pw_macro.h>
13 __isl_give PW
*FN(PW
,scale
)(__isl_take PW
*pw
, isl_int v
)
18 if (isl_int_is_one(v
))
20 if (pw
&& DEFAULT_IS_ZERO
&& isl_int_is_zero(v
)) {
22 isl_space
*space
= FN(PW
,get_space
)(pw
);
23 zero
= FN(PW
,ZERO
)(space
OPT_TYPE_ARG(pw
->));
27 if (isl_int_is_neg(v
))
28 pw
= FN(PW
,negate_type
)(pw
);
30 n
= FN(PW
,n_piece
)(pw
);
32 return FN(PW
,free
)(pw
);
33 for (i
= 0; i
< n
; ++i
) {
36 el
= FN(PW
,take_base_at
)(pw
, i
);
37 el
= FN(EL
,scale
)(el
, v
);
38 pw
= FN(PW
,restore_base_at
)(pw
, i
, el
);