/* * Copyright 2011 INRIA Saclay * Copyright 2012-2013 Ecole Normale Superieure * Copyright 2016 Sven Verdoolaege * * 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 */ #include <isl/ctx.h> #include <isl/space.h> #include <isl/local_space.h> #include <isl/union_map.h> #include <isl_map_private.h> #include <isl_aff_private.h> #include <isl_vec_private.h> #include <isl_seq.h> #include <bset_from_bmap.c> #include <set_from_map.c> /* Check that the input living in "space" lives in a map space. * That is, check that "space" is a map space. */ static isl_stat check_input_is_map(__isl_keep isl_space *space) { … } /* Check that the input living in "space" lives in a set space. * That is, check that "space" is a set space. */ static isl_stat check_input_is_set(__isl_keep isl_space *space) { … } /* Construct a basic map mapping the domain of the affine expression * to a one-dimensional range prescribed by the affine expression. * If "rational" is set, then construct a rational basic map. * * A NaN affine expression cannot be converted to a basic map. */ static __isl_give isl_basic_map *isl_basic_map_from_aff2( __isl_take isl_aff *aff, int rational) { … } /* Construct a basic map mapping the domain of the affine expression * to a one-dimensional range prescribed by the affine expression. */ __isl_give isl_basic_map *isl_basic_map_from_aff(__isl_take isl_aff *aff) { … } /* Construct a map mapping the domain of the affine expression * to a one-dimensional range prescribed by the affine expression. */ __isl_give isl_map *isl_map_from_aff(__isl_take isl_aff *aff) { … } /* Construct a basic map mapping the domain of the multi-affine expression * to its range, with each dimension in the range equated to the * corresponding affine expression. * If "rational" is set, then construct a rational basic map. */ __isl_give isl_basic_map *isl_basic_map_from_multi_aff2( __isl_take isl_multi_aff *maff, int rational) { … } /* Construct a basic map mapping the domain of the multi-affine expression * to its range, with each dimension in the range equated to the * corresponding affine expression. * If "ma" lives in a set space, then the result is actually a set. */ static __isl_give isl_basic_map *basic_map_from_multi_aff( __isl_take isl_multi_aff *ma) { … } /* Construct a basic map mapping the domain of the multi-affine expression * to its range, with each dimension in the range equated to the * corresponding affine expression. */ __isl_give isl_basic_map *isl_basic_map_from_multi_aff( __isl_take isl_multi_aff *ma) { … } /* Construct a basic set mapping the parameter domain * of the multi-affine expression to its space, with each dimension * in the space equated to the corresponding affine expression. */ __isl_give isl_basic_set *isl_basic_set_from_multi_aff( __isl_take isl_multi_aff *ma) { … } /* Construct a map mapping the domain of the multi-affine expression * to its range, with each dimension in the range equated to the * corresponding affine expression. * If "maff" lives in a set space, then the result is actually a set. */ __isl_give isl_map *isl_map_from_multi_aff_internal( __isl_take isl_multi_aff *maff) { … } /* Construct a map mapping the domain the multi-affine expression * to its range, with each dimension in the range equated to the * corresponding affine expression. */ __isl_give isl_map *isl_map_from_multi_aff(__isl_take isl_multi_aff *ma) { … } /* This function performs the same operation as isl_map_from_multi_aff, * but is considered as a function on an isl_multi_aff when exported. */ __isl_give isl_map *isl_multi_aff_as_map(__isl_take isl_multi_aff *ma) { … } /* Construct a set mapping the parameter domain the multi-affine expression * to its space, with each dimension in the space equated to the * corresponding affine expression. */ __isl_give isl_set *isl_set_from_multi_aff(__isl_take isl_multi_aff *ma) { … } /* This function performs the same operation as isl_set_from_multi_aff, * but is considered as a function on an isl_multi_aff when exported. */ __isl_give isl_set *isl_multi_aff_as_set(__isl_take isl_multi_aff *ma) { … } /* Construct a basic map mapping a domain in the given space to * to an n-dimensional range, with n the number of elements in the list, * where each coordinate in the range is prescribed by the * corresponding affine expression. * The domains of all affine expressions in the list are assumed to match * domain_space. */ __isl_give isl_basic_map *isl_basic_map_from_aff_list( __isl_take isl_space *domain_space, __isl_take isl_aff_list *list) { … } /* Construct a map with as domain the domain of pwaff and * one-dimensional range corresponding to the affine expressions. * If "pwaff" lives in a set space, then the result is actually a set. */ __isl_give isl_map *isl_map_from_pw_aff_internal(__isl_take isl_pw_aff *pwaff) { … } /* Construct a map with as domain the domain of pwaff and * one-dimensional range corresponding to the affine expressions. */ __isl_give isl_map *isl_map_from_pw_aff(__isl_take isl_pw_aff *pwaff) { … } /* This function performs the same operation as isl_map_from_pw_aff, * but is considered as a function on an isl_pw_aff when exported. */ __isl_give isl_map *isl_pw_aff_as_map(__isl_take isl_pw_aff *pa) { … } /* Construct a one-dimensional set with as parameter domain * the domain of pwaff and the single set dimension * corresponding to the affine expressions. */ __isl_give isl_set *isl_set_from_pw_aff(__isl_take isl_pw_aff *pwaff) { … } /* Construct a map mapping the domain of the piecewise multi-affine expression * to its range, with each dimension in the range equated to the * corresponding affine expression on its cell. * If "pma" lives in a set space, then the result is actually a set. * * If the domain of "pma" is rational, then so is the constructed "map". */ __isl_give isl_map *isl_map_from_pw_multi_aff_internal( __isl_take isl_pw_multi_aff *pma) { … } /* Construct a map mapping the domain of the piecewise multi-affine expression * to its range, with each dimension in the range equated to the * corresponding affine expression on its cell. */ __isl_give isl_map *isl_map_from_pw_multi_aff(__isl_take isl_pw_multi_aff *pma) { … } /* This function performs the same operation as isl_map_from_pw_multi_aff, * but is considered as a function on an isl_pw_multi_aff when exported. */ __isl_give isl_map *isl_pw_multi_aff_as_map(__isl_take isl_pw_multi_aff *pma) { … } __isl_give isl_set *isl_set_from_pw_multi_aff(__isl_take isl_pw_multi_aff *pma) { … } /* This function performs the same operation as isl_set_from_pw_multi_aff, * but is considered as a function on an isl_pw_multi_aff when exported. */ __isl_give isl_set *isl_pw_multi_aff_as_set(__isl_take isl_pw_multi_aff *pma) { … } /* Construct a set or map mapping the shared (parameter) domain * of the piecewise affine expressions to the range of "mpa" * with each dimension in the range equated to the * corresponding piecewise affine expression. * * If "mpa" has an explicit domain (i.e., it is zero-dimensional), * then return a set or map with the same (parameter) domain. */ static __isl_give isl_map *map_from_multi_pw_aff( __isl_take isl_multi_pw_aff *mpa) { … } /* Construct a map mapping the shared domain * of the piecewise affine expressions to the range of "mpa" * with each dimension in the range equated to the * corresponding piecewise affine expression. */ __isl_give isl_map *isl_map_from_multi_pw_aff(__isl_take isl_multi_pw_aff *mpa) { … } /* This function performs the same operation as isl_map_from_multi_pw_aff, * but is considered as a function on an isl_multi_pw_aff when exported. */ __isl_give isl_map *isl_multi_pw_aff_as_map(__isl_take isl_multi_pw_aff *mpa) { … } /* Construct a set mapping the shared parameter domain * of the piecewise affine expressions to the space of "mpa" * with each dimension in the range equated to the * corresponding piecewise affine expression. */ __isl_give isl_set *isl_set_from_multi_pw_aff(__isl_take isl_multi_pw_aff *mpa) { … } /* This function performs the same operation as isl_set_from_multi_pw_aff, * but is considered as a function on an isl_multi_pw_aff when exported. */ __isl_give isl_set *isl_multi_pw_aff_as_set(__isl_take isl_multi_pw_aff *mpa) { … } /* Convert "pa" to an isl_map and add it to *umap. */ static isl_stat map_from_pw_aff_entry(__isl_take isl_pw_aff *pa, void *user) { … } /* Construct a union map mapping the domain of the union * piecewise affine expression to its range, with the single output dimension * equated to the corresponding affine expressions on their cells. */ __isl_give isl_union_map *isl_union_map_from_union_pw_aff( __isl_take isl_union_pw_aff *upa) { … } /* Convert "pma" to an isl_map and add it to *umap. */ static isl_stat map_from_pw_multi_aff(__isl_take isl_pw_multi_aff *pma, void *user) { … } /* Construct a union map mapping the domain of the union * piecewise multi-affine expression to its range, with each dimension * in the range equated to the corresponding affine expression on its cell. */ __isl_give isl_union_map *isl_union_map_from_union_pw_multi_aff( __isl_take isl_union_pw_multi_aff *upma) { … } /* This function performs the same operation as * isl_union_map_from_union_pw_multi_aff, * but is considered as a function on an isl_union_pw_multi_aff when exported. */ __isl_give isl_union_map *isl_union_pw_multi_aff_as_union_map( __isl_take isl_union_pw_multi_aff *upma) { … }