Lines Matching full:box

21 /* Representation of a box of fixed size containing the elements
26 * the failure of finding a fixed-size box.
33 /* Free "box" and return NULL.
35 __isl_null isl_fixed_box *isl_fixed_box_free(__isl_take isl_fixed_box *box) in isl_fixed_box_free() argument
37 if (!box) in isl_fixed_box_free()
39 isl_multi_aff_free(box->offset); in isl_fixed_box_free()
40 isl_multi_val_free(box->size); in isl_fixed_box_free()
41 free(box); in isl_fixed_box_free()
51 isl_fixed_box *box; in isl_fixed_box_alloc() local
56 box = isl_alloc_type(ctx, struct isl_fixed_box); in isl_fixed_box_alloc()
57 if (!box) in isl_fixed_box_alloc()
59 box->offset = offset; in isl_fixed_box_alloc()
60 box->size = size; in isl_fixed_box_alloc()
62 return box; in isl_fixed_box_alloc()
84 /* Return a copy of "box".
86 __isl_give isl_fixed_box *isl_fixed_box_copy(__isl_keep isl_fixed_box *box) in isl_fixed_box_copy() argument
91 offset = isl_fixed_box_get_offset(box); in isl_fixed_box_copy()
92 size = isl_fixed_box_get_size(box); in isl_fixed_box_copy()
97 * (without checking whether "box" is a valid box).
100 __isl_take isl_fixed_box *box, int pos, __isl_keep isl_aff *offset, in isl_fixed_box_set_extent() argument
103 if (!box) in isl_fixed_box_set_extent()
105 box->offset = isl_multi_aff_set_aff(box->offset, pos, in isl_fixed_box_set_extent()
107 box->size = isl_multi_val_set_val(box->size, pos, isl_val_copy(size)); in isl_fixed_box_set_extent()
108 if (!box->offset || !box->size) in isl_fixed_box_set_extent()
109 return isl_fixed_box_free(box); in isl_fixed_box_set_extent()
110 return box; in isl_fixed_box_set_extent()
114 * if "box" is a valid box.
117 __isl_take isl_fixed_box *box, int pos, __isl_keep isl_aff *offset, in isl_fixed_box_set_valid_extent() argument
122 valid = isl_fixed_box_is_valid(box); in isl_fixed_box_set_valid_extent()
124 return box; in isl_fixed_box_set_valid_extent()
125 return isl_fixed_box_set_extent(box, pos, offset, size); in isl_fixed_box_set_valid_extent()
128 /* Replace "box" by an invalid box, by setting all offsets to NaN
132 __isl_take isl_fixed_box *box) in isl_fixed_box_invalidate() argument
140 if (!box) in isl_fixed_box_invalidate()
142 n = isl_multi_val_dim(box->size, isl_dim_set); in isl_fixed_box_invalidate()
144 return isl_fixed_box_free(box); in isl_fixed_box_invalidate()
146 infty = isl_val_infty(isl_fixed_box_get_ctx(box)); in isl_fixed_box_invalidate()
147 space = isl_space_domain(isl_fixed_box_get_space(box)); in isl_fixed_box_invalidate()
150 box = isl_fixed_box_set_extent(box, i, nan, infty); in isl_fixed_box_invalidate()
154 if (!box->offset || !box->size) in isl_fixed_box_invalidate()
155 return isl_fixed_box_free(box); in isl_fixed_box_invalidate()
156 return box; in isl_fixed_box_invalidate()
159 /* Project the domain of the fixed box onto its parameter space.
163 __isl_take isl_fixed_box *box) in isl_fixed_box_project_domain_on_params() argument
167 valid = isl_fixed_box_is_valid(box); in isl_fixed_box_project_domain_on_params()
169 return isl_fixed_box_free(box); in isl_fixed_box_project_domain_on_params()
171 return box; in isl_fixed_box_project_domain_on_params()
173 box->offset = isl_multi_aff_project_domain_on_params(box->offset); in isl_fixed_box_project_domain_on_params()
174 if (!box->offset) in isl_fixed_box_project_domain_on_params()
175 return isl_fixed_box_free(box); in isl_fixed_box_project_domain_on_params()
177 return box; in isl_fixed_box_project_domain_on_params()
180 /* Return the isl_ctx to which "box" belongs.
182 isl_ctx *isl_fixed_box_get_ctx(__isl_keep isl_fixed_box *box) in isl_fixed_box_get_ctx() argument
184 if (!box) in isl_fixed_box_get_ctx()
186 return isl_multi_aff_get_ctx(box->offset); in isl_fixed_box_get_ctx()
189 /* Return the space in which "box" lives.
191 __isl_give isl_space *isl_fixed_box_get_space(__isl_keep isl_fixed_box *box) in isl_fixed_box_get_space() argument
193 if (!box) in isl_fixed_box_get_space()
195 return isl_multi_aff_get_space(box->offset); in isl_fixed_box_get_space()
198 /* Does "box" contain valid information?
200 isl_bool isl_fixed_box_is_valid(__isl_keep isl_fixed_box *box) in isl_fixed_box_is_valid() argument
202 if (!box) in isl_fixed_box_is_valid()
204 return isl_bool_not(isl_multi_aff_involves_nan(box->offset)); in isl_fixed_box_is_valid()
207 /* Return the offsets of the box "box".
210 __isl_keep isl_fixed_box *box) in isl_fixed_box_get_offset() argument
212 if (!box) in isl_fixed_box_get_offset()
214 return isl_multi_aff_copy(box->offset); in isl_fixed_box_get_offset()
217 /* Return the sizes of the box "box".
219 __isl_give isl_multi_val *isl_fixed_box_get_size(__isl_keep isl_fixed_box *box) in isl_fixed_box_get_size() argument
221 if (!box) in isl_fixed_box_get_size()
223 return isl_multi_val_copy(box->size); in isl_fixed_box_get_size()
325 * then invalidate the box. Otherwise, set the offset and size
335 static __isl_give isl_fixed_box *set_dim_extent(__isl_take isl_fixed_box *box, in set_dim_extent() argument
343 if (!box || !map) in set_dim_extent()
344 return isl_fixed_box_free(box); in set_dim_extent()
359 box = isl_fixed_box_free(box); in set_dim_extent()
363 box = isl_fixed_box_free(box); in set_dim_extent()
365 box = isl_fixed_box_set_valid_extent(box, pos, in set_dim_extent()
368 box = isl_fixed_box_invalidate(box); in set_dim_extent()
373 return box; in set_dim_extent()
376 /* Try and construct a fixed-size rectangular box with an offset
378 * If no such box can be constructed, then return an invalidated box,
390 isl_fixed_box *box; in isl_map_get_range_simple_fixed_box_hull() local
396 box = isl_fixed_box_init(space); in isl_map_get_range_simple_fixed_box_hull()
402 box = set_dim_extent(box, map, i); in isl_map_get_range_simple_fixed_box_hull()
403 valid = isl_fixed_box_is_valid(box); in isl_map_get_range_simple_fixed_box_hull()
409 return box; in isl_map_get_range_simple_fixed_box_hull()
412 /* Try and construct a fixed-size rectangular box with an offset
414 * If no such box can be constructed, then return an invalidated box,
417 * Compute the box using isl_map_get_range_simple_fixed_box_hull
425 isl_fixed_box *box; in isl_set_get_simple_fixed_box_hull() local
428 box = isl_map_get_range_simple_fixed_box_hull(map); in isl_set_get_simple_fixed_box_hull()
430 box = isl_fixed_box_project_domain_on_params(box); in isl_set_get_simple_fixed_box_hull()
432 return box; in isl_set_get_simple_fixed_box_hull()
443 /* Print the information contained in "box" to "p".
447 __isl_take isl_printer *p, __isl_keep isl_fixed_box *box) in isl_printer_print_fixed_box() argument
449 if (!box) in isl_printer_print_fixed_box()
453 p = print_yaml_field_multi_aff(p, "offset", box->offset); in isl_printer_print_fixed_box()
454 p = print_yaml_field_multi_val(p, "size", box->size); in isl_printer_print_fixed_box()