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_union_macro.h>
13 /* Evaluate "u" in the void point "pnt".
14 * In particular, return the value NaN.
16 static __isl_give isl_val
*FN(UNION
,eval_void
)(__isl_take UNION
*u
,
17 __isl_take isl_point
*pnt
)
21 ctx
= isl_point_get_ctx(pnt
);
24 return isl_val_nan(ctx
);
27 /* Is the domain space of "entry" equal to "space"?
29 static int FN(UNION
,has_domain_space
)(const void *entry
, const void *val
)
31 PART
*part
= (PART
*)entry
;
32 isl_space
*space
= (isl_space
*) val
;
34 if (isl_space_is_params(space
))
35 return isl_space_is_set(part
->dim
);
37 return isl_space_tuple_is_equal(part
->dim
, isl_dim_in
,
41 __isl_give isl_val
*FN(UNION
,eval
)(__isl_take UNION
*u
,
42 __isl_take isl_point
*pnt
)
45 struct isl_hash_table_entry
*entry
;
52 is_void
= isl_point_is_void(pnt
);
56 return FN(UNION
,eval_void
)(u
, pnt
);
58 space
= isl_space_copy(pnt
->dim
);
61 hash
= isl_space_get_hash(space
);
62 entry
= isl_hash_table_find(u
->space
->ctx
, &u
->table
,
63 hash
, &FN(UNION
,has_domain_space
),
65 isl_space_free(space
);
67 v
= isl_val_zero(isl_point_get_ctx(pnt
));
70 v
= FN(PART
,eval
)(FN(PART
,copy
)(entry
->data
), pnt
);