Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
C<add_constant> and C<add_coefficient> add an integer value to
the possibly rational constant or coefficient.
+To check whether an affine expressions is obviously zero, use
+
+ #include <isl/aff.h>
+ int isl_aff_plain_is_zero(__isl_keep isl_aff *aff);
+
Operations include
#include <isl/aff.h>
__isl_give isl_aff *isl_aff_add_coefficient_si(__isl_take isl_aff *aff,
enum isl_dim_type type, int pos, int v);
+int isl_aff_plain_is_zero(__isl_keep isl_aff *aff);
+
__isl_give isl_div *isl_aff_get_div(__isl_keep isl_aff *aff, int pos);
__isl_give isl_aff *isl_aff_neg(__isl_take isl_aff *aff);
return aff ? isl_local_space_get_dim_name(aff->ls, type, pos) : 0;
}
+int isl_aff_plain_is_zero(__isl_keep isl_aff *aff)
+{
+ if (!aff)
+ return -1;
+
+ return isl_seq_first_non_zero(aff->v->el + 1, aff->v->size - 1) < 0;
+}
+
int isl_aff_get_denominator(__isl_keep isl_aff *aff, isl_int *v)
{
if (!aff)