/* * Copyright 2010 INRIA Saclay * Copyright 2012 Ecole Normale Superieure * * Use of this software is governed by the MIT license * * Written by Sven Verdoolaege, * INRIA Saclay - Ile-de-France, Parc Club Orsay Universite, * ZAC des vignes, 4 rue Jacques Monod, 91893 Orsay, France * and Ecole Normale Superieure, 45 rue d’Ulm, 75230 Paris, France */ /* Function for computing the lexicographic optimum of a map * in the form of either an isl_map or an isl_pw_multi_aff. */ #define xSF(TYPE,SUFFIX) … #define SF(TYPE,SUFFIX) … /* Compute the lexicographic minimum (or maximum if "flags" includes * ISL_OPT_MAX) of "bmap" over the domain "dom" and return the result. * If "empty" is not NULL, then *empty is assigned a set that * contains those parts of the domain where there is no solution. * If "flags" includes ISL_OPT_FULL, then "dom" is NULL and the optimum * should be computed over the domain of "bmap". "empty" is also NULL * in this case. * If "bmap" is marked as rational (ISL_BASIC_MAP_RATIONAL), * then the rational optimum is computed. Otherwise, the integral optimum * is computed. */ static __isl_give TYPE *SF(isl_basic_map_partial_lexopt,SUFFIX)( __isl_take isl_basic_map *bmap, __isl_take isl_basic_set *dom, __isl_give isl_set **empty, unsigned flags) { … } __isl_give TYPE *SF(isl_basic_map_partial_lexmax,SUFFIX)( __isl_take isl_basic_map *bmap, __isl_take isl_basic_set *dom, __isl_give isl_set **empty) { … } __isl_give TYPE *SF(isl_basic_map_partial_lexmin,SUFFIX)( __isl_take isl_basic_map *bmap, __isl_take isl_basic_set *dom, __isl_give isl_set **empty) { … } __isl_give TYPE *SF(isl_basic_set_partial_lexmin,SUFFIX)( __isl_take isl_basic_set *bset, __isl_take isl_basic_set *dom, __isl_give isl_set **empty) { … } __isl_give TYPE *SF(isl_basic_set_partial_lexmax,SUFFIX)( __isl_take isl_basic_set *bset, __isl_take isl_basic_set *dom, __isl_give isl_set **empty) { … } /* Given a basic map "bmap", compute the lexicographically minimal * (or maximal) image element for each domain element in dom. * If empty is not NULL, then set *empty to those elements in dom * that do not have an image element. * If "flags" includes ISL_OPT_FULL, then "dom" is NULL and the optimum * should be computed over the domain of "bmap". "empty" is also NULL * in this case. * * We first make sure the basic sets in dom are disjoint and then * simply collect the results over each of the basic sets separately. * We could probably improve the efficiency a bit by moving the union * domain down into the parametric integer programming. * * If a full optimum is being computed (i.e., "flags" includes ISL_OPT_FULL), * then no domain is given and there is then also no need to consider * the disjuncts of the domain. */ static __isl_give TYPE *SF(basic_map_partial_lexopt,SUFFIX)( __isl_take isl_basic_map *bmap, __isl_take isl_set *dom, __isl_give isl_set **empty, unsigned flags) { … } /* Compute the lexicographic minimum (or maximum if "flags" includes * ISL_OPT_MAX) of "bmap" over its domain. */ __isl_give TYPE *SF(isl_basic_map_lexopt,SUFFIX)( __isl_take isl_basic_map *bmap, unsigned flags) { … } __isl_give TYPE *SF(isl_basic_map_lexmin,SUFFIX)(__isl_take isl_basic_map *bmap) { … } static __isl_give TYPE *SF(isl_map_partial_lexopt_aligned,SUFFIX)( __isl_take isl_map *map, __isl_take isl_set *dom, __isl_give isl_set **empty, unsigned flags); /* This function is currently only used when TYPE is defined as isl_map. */ static __isl_give TYPE *SF(isl_map_partial_lexopt,SUFFIX)( __isl_take isl_map *map, __isl_take isl_set *dom, __isl_give isl_set **empty, unsigned flags) __attribute__ ((unused)); /* Given a map "map", compute the lexicographically minimal * (or maximal) image element for each domain element in dom. * Set *empty to those elements in dom that do not have an image element. * * Align parameters if needed and then call isl_map_partial_lexopt_aligned. */ static __isl_give TYPE *SF(isl_map_partial_lexopt,SUFFIX)( __isl_take isl_map *map, __isl_take isl_set *dom, __isl_give isl_set **empty, unsigned flags) { … } /* Compute the lexicographic minimum (or maximum if "flags" includes * ISL_OPT_MAX) of "map" over its domain. */ __isl_give TYPE *SF(isl_map_lexopt,SUFFIX)(__isl_take isl_map *map, unsigned flags) { … } __isl_give TYPE *SF(isl_map_lexmin,SUFFIX)(__isl_take isl_map *map) { … } __isl_give TYPE *SF(isl_map_lexmax,SUFFIX)(__isl_take isl_map *map) { … } __isl_give TYPE *SF(isl_set_lexmin,SUFFIX)(__isl_take isl_set *set) { … } __isl_give TYPE *SF(isl_set_lexmax,SUFFIX)(__isl_take isl_set *set) { … }