isl_map.c File Reference

#include <string.h>
#include <strings.h>
#include "isl_ctx.h"
#include "isl_blk.h"
#include "isl_dim.h"
#include "isl_list.h"
#include "isl_lp.h"
#include "isl_seq.h"
#include "isl_set.h"
#include "isl_map.h"
#include "isl_map_private.h"
#include "isl_map_piplib.h"
#include "isl_sample.h"
#include "isl_vec.h"

Include dependency graph for isl_map.c:

Go to the source code of this file.

Classes

struct  isl_dim_map
struct  constraint

Functions

static struct isl_dim_mapisl_dim_map_alloc (struct isl_ctx *ctx, unsigned len)
static unsigned n (struct isl_dim *dim, enum isl_dim_type type)
static unsigned pos (struct isl_dim *dim, enum isl_dim_type type)
static void isl_dim_map_dim (struct isl_dim_map *dim_map, struct isl_dim *dim, enum isl_dim_type type, unsigned dst_pos)
static void isl_dim_map_div (struct isl_dim_map *dim_map, struct isl_basic_map *bmap, unsigned dst_pos)
static void isl_dim_map_dump (struct isl_dim_map *dim_map)
unsigned isl_basic_map_dim (const struct isl_basic_map *bmap, enum isl_dim_type type)
unsigned isl_map_dim (const struct isl_map *map, enum isl_dim_type type)
unsigned isl_set_dim (const struct isl_set *set, enum isl_dim_type type)
unsigned isl_basic_map_offset (struct isl_basic_map *bmap, enum isl_dim_type type)
static unsigned map_offset (struct isl_map *map, enum isl_dim_type type)
unsigned isl_basic_set_dim (const struct isl_basic_set *bset, enum isl_dim_type type)
unsigned isl_basic_set_n_dim (const struct isl_basic_set *bset)
unsigned isl_basic_set_n_param (const struct isl_basic_set *bset)
unsigned isl_basic_set_total_dim (const struct isl_basic_set *bset)
unsigned isl_set_n_dim (const struct isl_set *set)
unsigned isl_set_n_param (const struct isl_set *set)
unsigned isl_basic_map_n_in (const struct isl_basic_map *bmap)
unsigned isl_basic_map_n_out (const struct isl_basic_map *bmap)
unsigned isl_basic_map_n_param (const struct isl_basic_map *bmap)
unsigned isl_basic_map_n_div (const struct isl_basic_map *bmap)
unsigned isl_basic_map_total_dim (const struct isl_basic_map *bmap)
unsigned isl_map_n_in (const struct isl_map *map)
unsigned isl_map_n_out (const struct isl_map *map)
unsigned isl_map_n_param (const struct isl_map *map)
int isl_map_compatible_domain (struct isl_map *map, struct isl_set *set)
int isl_basic_map_compatible_domain (struct isl_basic_map *bmap, struct isl_basic_set *bset)
int isl_basic_map_compatible_range (struct isl_basic_map *bmap, struct isl_basic_set *bset)
struct isl_dimisl_basic_set_get_dim (struct isl_basic_set *bset)
struct isl_dimisl_set_get_dim (struct isl_set *set)
static struct isl_basic_mapbasic_map_init (struct isl_ctx *ctx, struct isl_basic_map *bmap, unsigned extra, unsigned n_eq, unsigned n_ineq)
struct isl_basic_setisl_basic_set_alloc (struct isl_ctx *ctx, unsigned nparam, unsigned dim, unsigned extra, unsigned n_eq, unsigned n_ineq)
struct isl_basic_setisl_basic_set_alloc_dim (struct isl_dim *dim, unsigned extra, unsigned n_eq, unsigned n_ineq)
struct isl_basic_mapisl_basic_map_alloc_dim (struct isl_dim *dim, unsigned extra, unsigned n_eq, unsigned n_ineq)
struct isl_basic_mapisl_basic_map_alloc (struct isl_ctx *ctx, unsigned nparam, unsigned in, unsigned out, unsigned extra, unsigned n_eq, unsigned n_ineq)
static void dup_constraints (struct isl_basic_map *dst, struct isl_basic_map *src)
struct isl_basic_mapisl_basic_map_dup (struct isl_basic_map *bmap)
struct isl_basic_setisl_basic_set_dup (struct isl_basic_set *bset)
struct isl_basic_setisl_basic_set_copy (struct isl_basic_set *bset)
struct isl_setisl_set_copy (struct isl_set *set)
struct isl_basic_mapisl_basic_map_copy (struct isl_basic_map *bmap)
struct isl_mapisl_map_copy (struct isl_map *map)
void isl_basic_map_free (struct isl_basic_map *bmap)
void isl_basic_set_free (struct isl_basic_set *bset)
static int room_for_con (struct isl_basic_map *bmap, unsigned n)
int isl_basic_map_alloc_equality (struct isl_basic_map *bmap)
int isl_basic_set_alloc_equality (struct isl_basic_set *bset)
int isl_basic_map_free_equality (struct isl_basic_map *bmap, unsigned n)
int isl_basic_set_free_equality (struct isl_basic_set *bset, unsigned n)
int isl_basic_map_drop_equality (struct isl_basic_map *bmap, unsigned pos)
int isl_basic_set_drop_equality (struct isl_basic_set *bset, unsigned pos)
void isl_basic_map_inequality_to_equality (struct isl_basic_map *bmap, unsigned pos)
static int room_for_ineq (struct isl_basic_map *bmap, unsigned n)
int isl_basic_map_alloc_inequality (struct isl_basic_map *bmap)
int isl_basic_set_alloc_inequality (struct isl_basic_set *bset)
int isl_basic_map_free_inequality (struct isl_basic_map *bmap, unsigned n)
int isl_basic_set_free_inequality (struct isl_basic_set *bset, unsigned n)
int isl_basic_map_drop_inequality (struct isl_basic_map *bmap, unsigned pos)
int isl_basic_set_drop_inequality (struct isl_basic_set *bset, unsigned pos)
int isl_basic_map_alloc_div (struct isl_basic_map *bmap)
int isl_basic_set_alloc_div (struct isl_basic_set *bset)
int isl_basic_map_free_div (struct isl_basic_map *bmap, unsigned n)
static void copy_constraint (struct isl_basic_map *dst_map, isl_int *dst, struct isl_basic_map *src_map, isl_int *src, unsigned in_off, unsigned out_off, unsigned div_off)
static void copy_div (struct isl_basic_map *dst_map, isl_int *dst, struct isl_basic_map *src_map, isl_int *src, unsigned in_off, unsigned out_off, unsigned div_off)
static struct isl_basic_mapadd_constraints (struct isl_basic_map *bmap1, struct isl_basic_map *bmap2, unsigned i_pos, unsigned o_pos)
static void copy_constraint_dim_map (isl_int *dst, isl_int *src, struct isl_dim_map *dim_map)
static void copy_div_dim_map (isl_int *dst, isl_int *src, struct isl_dim_map *dim_map)
static struct isl_basic_mapadd_constraints_dim_map (struct isl_basic_map *dst, struct isl_basic_map *src, struct isl_dim_map *dim_map)
struct isl_basic_setisl_basic_set_add_constraints (struct isl_basic_set *bset1, struct isl_basic_set *bset2, unsigned pos)
struct isl_basic_mapisl_basic_map_extend_dim (struct isl_basic_map *base, struct isl_dim *dim, unsigned extra, unsigned n_eq, unsigned n_ineq)
struct isl_basic_setisl_basic_set_extend_dim (struct isl_basic_set *base, struct isl_dim *dim, unsigned extra, unsigned n_eq, unsigned n_ineq)
struct isl_basic_mapisl_basic_map_extend_constraints (struct isl_basic_map *base, unsigned n_eq, unsigned n_ineq)
struct isl_basic_mapisl_basic_map_extend (struct isl_basic_map *base, unsigned nparam, unsigned n_in, unsigned n_out, unsigned extra, unsigned n_eq, unsigned n_ineq)
struct isl_basic_setisl_basic_set_extend (struct isl_basic_set *base, unsigned nparam, unsigned dim, unsigned extra, unsigned n_eq, unsigned n_ineq)
struct isl_basic_setisl_basic_set_extend_constraints (struct isl_basic_set *base, unsigned n_eq, unsigned n_ineq)
struct isl_basic_setisl_basic_set_cow (struct isl_basic_set *bset)
struct isl_basic_mapisl_basic_map_cow (struct isl_basic_map *bmap)
struct isl_setisl_set_cow (struct isl_set *set)
struct isl_mapisl_map_cow (struct isl_map *map)
static void swap_vars (struct isl_blk blk, isl_int *a, unsigned a_len, unsigned b_len)
struct isl_basic_setisl_basic_set_swap_vars (struct isl_basic_set *bset, unsigned n)
struct isl_setisl_set_swap_vars (struct isl_set *set, unsigned n)
struct isl_basic_mapisl_basic_map_set_to_empty (struct isl_basic_map *bmap)
struct isl_basic_setisl_basic_set_set_to_empty (struct isl_basic_set *bset)
static void swap_div (struct isl_basic_map *bmap, int a, int b)
struct isl_setisl_set_eliminate_dims (struct isl_set *set, unsigned first, unsigned n)
struct isl_setisl_set_remove_dims (struct isl_set *set, unsigned first, unsigned n)
struct isl_basic_setisl_basic_set_remove_divs (struct isl_basic_set *bset)
struct isl_setisl_set_remove_divs (struct isl_set *set)
struct isl_basic_mapisl_basic_map_remove (struct isl_basic_map *bmap, enum isl_dim_type type, unsigned first, unsigned n)
struct isl_mapisl_map_remove (struct isl_map *map, enum isl_dim_type type, unsigned first, unsigned n)
struct isl_mapisl_map_remove_inputs (struct isl_map *map, unsigned first, unsigned n)
struct isl_basic_setisl_basic_set_remove_dims (struct isl_basic_set *bset, unsigned first, unsigned n)
static void dump_term (struct isl_basic_map *bmap, isl_int c, int pos, FILE *out)
static void dump_constraint_sign (struct isl_basic_map *bmap, isl_int *c, int sign, FILE *out)
static void dump_constraint (struct isl_basic_map *bmap, isl_int *c, const char *op, FILE *out, int indent)
static void dump_constraints (struct isl_basic_map *bmap, isl_int **c, unsigned n, const char *op, FILE *out, int indent)
static void dump_affine (struct isl_basic_map *bmap, isl_int *exp, FILE *out)
static void dump (struct isl_basic_map *bmap, FILE *out, int indent)
void isl_basic_set_dump (struct isl_basic_set *bset, FILE *out, int indent)
void isl_basic_map_dump (struct isl_basic_map *bmap, FILE *out, int indent)
int isl_inequality_negate (struct isl_basic_map *bmap, unsigned pos)
struct isl_setisl_set_alloc_dim (struct isl_dim *dim, int n, unsigned flags)
struct isl_setisl_set_alloc (struct isl_ctx *ctx, unsigned nparam, unsigned dim, int n, unsigned flags)
struct isl_setisl_set_dup (struct isl_set *set)
struct isl_setisl_set_from_basic_set (struct isl_basic_set *bset)
struct isl_mapisl_map_from_basic_map (struct isl_basic_map *bmap)
struct isl_setisl_set_add (struct isl_set *set, struct isl_basic_set *bset)
void isl_set_free (struct isl_set *set)
void isl_set_dump (struct isl_set *set, FILE *out, int indent)
void isl_map_dump (struct isl_map *map, FILE *out, int indent)
struct isl_basic_mapisl_basic_map_intersect_domain (struct isl_basic_map *bmap, struct isl_basic_set *bset)
struct isl_basic_mapisl_basic_map_intersect_range (struct isl_basic_map *bmap, struct isl_basic_set *bset)
static int basic_map_contains (struct isl_basic_map *bmap, struct isl_vec *vec)
int isl_basic_set_contains (struct isl_basic_set *bset, struct isl_vec *vec)
struct isl_basic_mapisl_basic_map_intersect (struct isl_basic_map *bmap1, struct isl_basic_map *bmap2)
struct isl_basic_setisl_basic_set_intersect (struct isl_basic_set *bset1, struct isl_basic_set *bset2)
struct isl_mapisl_map_intersect (struct isl_map *map1, struct isl_map *map2)
struct isl_setisl_set_intersect (struct isl_set *set1, struct isl_set *set2)
struct isl_basic_mapisl_basic_map_reverse (struct isl_basic_map *bmap)
struct isl_basic_setisl_basic_set_project_out (struct isl_basic_set *bset, unsigned n, unsigned flags)
static struct isl_basic_mapadd_divs (struct isl_basic_map *bmap, unsigned n)
struct isl_basic_mapisl_basic_map_apply_range (struct isl_basic_map *bmap1, struct isl_basic_map *bmap2)
struct isl_basic_setisl_basic_set_apply (struct isl_basic_set *bset, struct isl_basic_map *bmap)
struct isl_basic_mapisl_basic_map_apply_domain (struct isl_basic_map *bmap1, struct isl_basic_map *bmap2)
struct isl_basic_mapisl_basic_map_sum (struct isl_basic_map *bmap1, struct isl_basic_map *bmap2)
struct isl_basic_mapisl_basic_map_neg (struct isl_basic_map *bmap)
struct isl_basic_mapisl_basic_map_floordiv (struct isl_basic_map *bmap, isl_int d)
static struct isl_basic_mapvar_equal (struct isl_basic_map *bmap, unsigned pos)
static struct isl_basic_mapvar_more (struct isl_basic_map *bmap, unsigned pos)
static struct isl_basic_mapvar_less (struct isl_basic_map *bmap, unsigned pos)
struct isl_basic_mapisl_basic_map_equal (struct isl_dim *dim, unsigned n_equal)
struct isl_basic_mapisl_basic_map_less_at (struct isl_dim *dim, unsigned pos)
struct isl_basic_mapisl_basic_map_more_at (struct isl_dim *dim, unsigned pos)
struct isl_basic_mapisl_basic_map_from_basic_set (struct isl_basic_set *bset, struct isl_dim *dim)
struct isl_basic_setisl_basic_set_from_basic_map (struct isl_basic_map *bmap)
static int add_div_constraints (struct isl_basic_map *bmap, unsigned div)
struct isl_basic_setisl_basic_map_underlying_set (struct isl_basic_map *bmap)
struct isl_basic_mapisl_basic_map_overlying_set (struct isl_basic_set *bset, struct isl_basic_map *like)
struct isl_basic_setisl_basic_set_from_underlying_set (struct isl_basic_set *bset, struct isl_basic_set *like)
struct isl_setisl_set_from_underlying_set (struct isl_set *set, struct isl_basic_set *like)
struct isl_setisl_map_underlying_set (struct isl_map *map)
struct isl_setisl_set_to_underlying_set (struct isl_set *set)
struct isl_basic_setisl_basic_map_domain (struct isl_basic_map *bmap)
struct isl_basic_setisl_basic_map_range (struct isl_basic_map *bmap)
struct isl_setisl_map_range (struct isl_map *map)
struct isl_mapisl_map_from_set (struct isl_set *set, struct isl_dim *dim)
struct isl_mapisl_map_from_range (struct isl_set *set)
struct isl_setisl_set_from_map (struct isl_map *map)
struct isl_mapisl_map_alloc_dim (struct isl_dim *dim, int n, unsigned flags)
struct isl_mapisl_map_alloc (struct isl_ctx *ctx, unsigned nparam, unsigned in, unsigned out, int n, unsigned flags)
struct isl_basic_mapisl_basic_map_empty (struct isl_ctx *ctx, unsigned nparam, unsigned in, unsigned out)
struct isl_basic_setisl_basic_set_empty (struct isl_dim *dim)
struct isl_basic_mapisl_basic_map_empty_like (struct isl_basic_map *model)
struct isl_basic_mapisl_basic_map_empty_like_map (struct isl_map *model)
struct isl_basic_setisl_basic_set_empty_like (struct isl_basic_set *model)
struct isl_basic_mapisl_basic_map_universe (struct isl_dim *dim)
struct isl_basic_setisl_basic_set_universe (struct isl_dim *dim)
struct isl_basic_setisl_basic_set_universe_like (struct isl_basic_set *model)
struct isl_mapisl_map_empty (struct isl_dim *dim)
struct isl_mapisl_map_empty_like (struct isl_map *model)
struct isl_mapisl_map_empty_like_basic_map (struct isl_basic_map *model)
struct isl_setisl_set_empty (struct isl_dim *dim)
struct isl_setisl_set_empty_like (struct isl_set *model)
struct isl_mapisl_map_universe (struct isl_dim *dim)
struct isl_setisl_set_universe (struct isl_dim *dim)
struct isl_mapisl_map_dup (struct isl_map *map)
struct isl_mapisl_map_add (struct isl_map *map, struct isl_basic_map *bmap)
void isl_map_free (struct isl_map *map)
struct isl_mapisl_map_extend (struct isl_map *base, unsigned nparam, unsigned n_in, unsigned n_out)
struct isl_setisl_set_extend (struct isl_set *base, unsigned nparam, unsigned dim)
static struct isl_basic_mapisl_basic_map_fix_pos (struct isl_basic_map *bmap, unsigned pos, int value)
struct isl_basic_mapisl_basic_map_fix_si (struct isl_basic_map *bmap, enum isl_dim_type type, unsigned pos, int value)
struct isl_basic_setisl_basic_set_fix_si (struct isl_basic_set *bset, enum isl_dim_type type, unsigned pos, int value)
struct isl_basic_mapisl_basic_map_fix_input_si (struct isl_basic_map *bmap, unsigned input, int value)
struct isl_basic_setisl_basic_set_fix_dim_si (struct isl_basic_set *bset, unsigned dim, int value)
struct isl_mapisl_map_fix_si (struct isl_map *map, enum isl_dim_type type, unsigned pos, int value)
struct isl_mapisl_map_fix_input_si (struct isl_map *map, unsigned input, int value)
struct isl_setisl_set_fix_dim_si (struct isl_set *set, unsigned dim, int value)
struct isl_basic_setisl_basic_set_lower_bound_dim (struct isl_basic_set *bset, unsigned dim, isl_int value)
struct isl_setisl_set_lower_bound_dim (struct isl_set *set, unsigned dim, isl_int value)
struct isl_mapisl_map_reverse (struct isl_map *map)
struct isl_mapisl_basic_map_lexmax (struct isl_basic_map *bmap, struct isl_basic_set *dom, struct isl_set **empty)
struct isl_mapisl_basic_map_lexmin (struct isl_basic_map *bmap, struct isl_basic_set *dom, struct isl_set **empty)
struct isl_setisl_basic_set_lexmin (struct isl_basic_set *bset)
struct isl_mapisl_basic_map_compute_divs (struct isl_basic_map *bmap)
struct isl_mapisl_map_compute_divs (struct isl_map *map)
struct isl_setisl_basic_set_compute_divs (struct isl_basic_set *bset)
struct isl_setisl_set_compute_divs (struct isl_set *set)
struct isl_setisl_map_domain (struct isl_map *map)
struct isl_mapisl_map_union_disjoint (struct isl_map *map1, struct isl_map *map2)
struct isl_mapisl_map_union (struct isl_map *map1, struct isl_map *map2)
struct isl_setisl_set_union_disjoint (struct isl_set *set1, struct isl_set *set2)
struct isl_setisl_set_union (struct isl_set *set1, struct isl_set *set2)
struct isl_mapisl_map_intersect_range (struct isl_map *map, struct isl_set *set)
struct isl_mapisl_map_intersect_domain (struct isl_map *map, struct isl_set *set)
struct isl_mapisl_map_apply_domain (struct isl_map *map1, struct isl_map *map2)
struct isl_mapisl_map_apply_range (struct isl_map *map1, struct isl_map *map2)
struct isl_basic_setisl_basic_map_deltas (struct isl_basic_map *bmap)
struct isl_setisl_map_deltas (struct isl_map *map)
static struct isl_basic_mapbasic_map_identity (struct isl_dim *dims)
struct isl_basic_mapisl_basic_map_identity (struct isl_dim *set_dim)
struct isl_basic_mapisl_basic_map_identity_like (struct isl_basic_map *model)
static struct isl_mapmap_identity (struct isl_dim *dim)
struct isl_mapisl_map_identity (struct isl_dim *set_dim)
struct isl_mapisl_map_identity_like (struct isl_basic_map *model)
int isl_set_is_equal (struct isl_set *set1, struct isl_set *set2)
int isl_set_is_subset (struct isl_set *set1, struct isl_set *set2)
int isl_basic_map_is_subset (struct isl_basic_map *bmap1, struct isl_basic_map *bmap2)
int isl_basic_map_is_equal (struct isl_basic_map *bmap1, struct isl_basic_map *bmap2)
int isl_basic_set_is_equal (struct isl_basic_set *bset1, struct isl_basic_set *bset2)
int isl_map_is_empty (struct isl_map *map)
int isl_map_fast_is_empty (struct isl_map *map)
int isl_set_is_empty (struct isl_set *set)
int isl_map_is_subset (struct isl_map *map1, struct isl_map *map2)
int isl_map_is_equal (struct isl_map *map1, struct isl_map *map2)
int isl_basic_map_is_strict_subset (struct isl_basic_map *bmap1, struct isl_basic_map *bmap2)
int isl_basic_map_is_universe (struct isl_basic_map *bmap)
int isl_basic_set_is_universe (struct isl_basic_set *bset)
int isl_basic_map_is_empty (struct isl_basic_map *bmap)
int isl_basic_map_fast_is_empty (struct isl_basic_map *bmap)
int isl_basic_set_fast_is_empty (struct isl_basic_set *bset)
int isl_basic_set_is_empty (struct isl_basic_set *bset)
struct isl_mapisl_basic_map_union (struct isl_basic_map *bmap1, struct isl_basic_map *bmap2)
struct isl_setisl_basic_set_union (struct isl_basic_set *bset1, struct isl_basic_set *bset2)
static struct isl_basic_maporder_divs (struct isl_basic_map *bmap)
static int find_div (struct isl_basic_map *dst, struct isl_basic_map *src, unsigned div)
struct isl_basic_mapisl_basic_map_align_divs (struct isl_basic_map *dst, struct isl_basic_map *src)
struct isl_basic_setisl_basic_set_align_divs (struct isl_basic_set *dst, struct isl_basic_set *src)
struct isl_mapisl_map_align_divs (struct isl_map *map)
struct isl_setisl_set_align_divs (struct isl_set *set)
static struct isl_mapadd_cut_constraint (struct isl_map *dst, struct isl_basic_map *src, isl_int *c, unsigned len, int oppose)
static struct isl_mapsubtract (struct isl_map *map, struct isl_basic_map *bmap)
struct isl_mapisl_map_subtract (struct isl_map *map1, struct isl_map *map2)
struct isl_setisl_set_subtract (struct isl_set *set1, struct isl_set *set2)
struct isl_setisl_set_apply (struct isl_set *set, struct isl_map *map)
struct isl_mapisl_map_remove_empty_parts (struct isl_map *map)
struct isl_setisl_set_remove_empty_parts (struct isl_set *set)
struct isl_basic_mapisl_map_copy_basic_map (struct isl_map *map)
struct isl_basic_setisl_set_copy_basic_set (struct isl_set *set)
struct isl_mapisl_map_drop_basic_map (struct isl_map *map, struct isl_basic_map *bmap)
struct isl_setisl_set_drop_basic_set (struct isl_set *set, struct isl_basic_set *bset)
int isl_basic_set_compare_at (struct isl_basic_set *bset1, struct isl_basic_set *bset2, int pos)
static int isl_basic_map_fast_has_fixed_var (struct isl_basic_map *bmap, unsigned pos, isl_int *val)
static int isl_map_fast_has_fixed_var (struct isl_map *map, unsigned pos, isl_int *val)
static int isl_set_fast_has_fixed_var (struct isl_set *set, unsigned pos, isl_int *val)
int isl_basic_map_fast_is_fixed (struct isl_basic_map *bmap, enum isl_dim_type type, unsigned pos, isl_int *val)
int isl_set_fast_dim_is_fixed (struct isl_set *set, unsigned dim, isl_int *val)
int isl_map_fast_input_is_fixed (struct isl_map *map, unsigned in, isl_int *val)
int isl_basic_set_fast_dim_has_fixed_lower_bound (struct isl_basic_set *bset, unsigned dim, isl_int *val)
int isl_set_fast_dim_has_fixed_lower_bound (struct isl_set *set, unsigned dim, isl_int *val)
static int qsort_constraint_cmp (const void *p1, const void *p2)
static struct isl_basic_mapisl_basic_map_sort_constraints (struct isl_basic_map *bmap)
struct isl_basic_mapisl_basic_map_normalize (struct isl_basic_map *bmap)
struct isl_basic_setisl_basic_set_normalize (struct isl_basic_set *bset)
static int isl_basic_map_fast_cmp (const struct isl_basic_map *bmap1, const struct isl_basic_map *bmap2)
static int isl_basic_map_fast_is_equal (struct isl_basic_map *bmap1, struct isl_basic_map *bmap2)
static int qsort_bmap_cmp (const void *p1, const void *p2)
struct isl_mapisl_map_normalize (struct isl_map *map)
struct isl_setisl_set_normalize (struct isl_set *set)
int isl_map_fast_is_equal (struct isl_map *map1, struct isl_map *map2)
int isl_set_fast_is_equal (struct isl_set *set1, struct isl_set *set2)
struct isl_basic_setisl_basic_set_interval (struct isl_ctx *ctx, isl_int min, isl_int max)
struct isl_basic_setisl_basic_set_product (struct isl_basic_set_list *list)
struct isl_basic_mapisl_basic_map_product (struct isl_basic_map *bmap1, struct isl_basic_map *bmap2)
struct isl_mapisl_map_product (struct isl_map *map1, struct isl_map *map2)
struct isl_setisl_set_product (struct isl_set *set1, struct isl_set *set2)
uint32_t isl_basic_set_get_hash (struct isl_basic_set *bset)
uint32_t isl_set_get_hash (struct isl_set *set)
int isl_basic_set_dim_is_unique (struct isl_basic_set *bset, unsigned dim)
int isl_set_dim_is_unique (struct isl_set *set, unsigned dim)


Function Documentation

static struct isl_basic_map* add_constraints ( struct isl_basic_map bmap1,
struct isl_basic_map bmap2,
unsigned  i_pos,
unsigned  o_pos 
) [static, read]

Definition at line 705 of file isl_map.c.

00707 {
00708         int i;
00709         unsigned div_off;
00710 
00711         if (!bmap1 || !bmap2)
00712                 goto error;
00713 
00714         div_off = bmap1->n_div;
00715 
00716         for (i = 0; i < bmap2->n_eq; ++i) {
00717                 int i1 = isl_basic_map_alloc_equality(bmap1);
00718                 if (i1 < 0)
00719                         goto error;
00720                 copy_constraint(bmap1, bmap1->eq[i1], bmap2, bmap2->eq[i],
00721                                 i_pos, o_pos, div_off);
00722         }
00723 
00724         for (i = 0; i < bmap2->n_ineq; ++i) {
00725                 int i1 = isl_basic_map_alloc_inequality(bmap1);
00726                 if (i1 < 0)
00727                         goto error;
00728                 copy_constraint(bmap1, bmap1->ineq[i1], bmap2, bmap2->ineq[i],
00729                                 i_pos, o_pos, div_off);
00730         }
00731 
00732         for (i = 0; i < bmap2->n_div; ++i) {
00733                 int i1 = isl_basic_map_alloc_div(bmap1);
00734                 if (i1 < 0)
00735                         goto error;
00736                 copy_div(bmap1, bmap1->div[i1], bmap2, bmap2->div[i],
00737                          i_pos, o_pos, div_off);
00738         }
00739 
00740         isl_basic_map_free(bmap2);
00741 
00742         return bmap1;
00743 
00744 error:
00745         isl_basic_map_free(bmap1);
00746         isl_basic_map_free(bmap2);
00747         return NULL;
00748 }

Here is the call graph for this function:

static struct isl_basic_map* add_constraints_dim_map ( struct isl_basic_map dst,
struct isl_basic_map src,
struct isl_dim_map dim_map 
) [static, read]

Definition at line 770 of file isl_map.c.

00772 {
00773         int i;
00774 
00775         if (!src || !dst || !dim_map)
00776                 goto error;
00777 
00778         for (i = 0; i < src->n_eq; ++i) {
00779                 int i1 = isl_basic_map_alloc_equality(dst);
00780                 if (i1 < 0)
00781                         goto error;
00782                 copy_constraint_dim_map(dst->eq[i1], src->eq[i], dim_map);
00783         }
00784 
00785         for (i = 0; i < src->n_ineq; ++i) {
00786                 int i1 = isl_basic_map_alloc_inequality(dst);
00787                 if (i1 < 0)
00788                         goto error;
00789                 copy_constraint_dim_map(dst->ineq[i1], src->ineq[i], dim_map);
00790         }
00791 
00792         for (i = 0; i < src->n_div; ++i) {
00793                 int i1 = isl_basic_map_alloc_div(dst);
00794                 if (i1 < 0)
00795                         goto error;
00796                 copy_div_dim_map(dst->div[i1], src->div[i], dim_map);
00797         }
00798 
00799         free(dim_map);
00800         isl_basic_map_free(src);
00801 
00802         return dst;
00803 error:
00804         free(dim_map);
00805         isl_basic_map_free(src);
00806         isl_basic_map_free(dst);
00807         return NULL;
00808 }

Here is the call graph for this function:

static struct isl_map* add_cut_constraint ( struct isl_map dst,
struct isl_basic_map src,
isl_int c,
unsigned  len,
int  oppose 
) [static, read]

Definition at line 3701 of file isl_map.c.

03704 {
03705         struct isl_basic_map *copy = NULL;
03706         int is_empty;
03707         int k;
03708         unsigned total;
03709 
03710         copy = isl_basic_map_copy(src);
03711         copy = isl_basic_map_cow(copy);
03712         if (!copy)
03713                 goto error;
03714         copy = isl_basic_map_extend_constraints(copy, 0, 1);
03715         k = isl_basic_map_alloc_inequality(copy);
03716         if (k < 0)
03717                 goto error;
03718         if (oppose)
03719                 isl_seq_neg(copy->ineq[k], c, len);
03720         else
03721                 isl_seq_cpy(copy->ineq[k], c, len);
03722         total = 1 + isl_basic_map_total_dim(copy);
03723         isl_seq_clr(copy->ineq[k]+len, total - len);
03724         isl_inequality_negate(copy, k);
03725         copy = isl_basic_map_simplify(copy);
03726         copy = isl_basic_map_finalize(copy);
03727         is_empty = isl_basic_map_is_empty(copy);
03728         if (is_empty < 0)
03729                 goto error;
03730         if (!is_empty)
03731                 dst = isl_map_add(dst, copy);
03732         else
03733                 isl_basic_map_free(copy);
03734         return dst;
03735 error:
03736         isl_basic_map_free(copy);
03737         isl_map_free(dst);
03738         return NULL;
03739 }

Here is the call graph for this function:

static int add_div_constraints ( struct isl_basic_map bmap,
unsigned  div 
) [static]

Definition at line 2223 of file isl_map.c.

02224 {
02225         int i, j;
02226         unsigned total = isl_basic_map_total_dim(bmap);
02227         unsigned div_pos = 1 + total - bmap->n_div + div;
02228 
02229         i = isl_basic_map_alloc_inequality(bmap);
02230         if (i < 0)
02231                 return -1;
02232         isl_seq_cpy(bmap->ineq[i], bmap->div[div]+1, 1+total);
02233         isl_int_neg(bmap->ineq[i][div_pos], bmap->div[div][0]);
02234 
02235         j = isl_basic_map_alloc_inequality(bmap);
02236         if (j < 0)
02237                 return -1;
02238         isl_seq_neg(bmap->ineq[j], bmap->ineq[i], 1 + total);
02239         isl_int_add(bmap->ineq[j][0], bmap->ineq[j][0], bmap->ineq[j][div_pos]);
02240         isl_int_sub_ui(bmap->ineq[j][0], bmap->ineq[j][0], 1);
02241         return j;
02242 }

Here is the call graph for this function:

static struct isl_basic_map* add_divs ( struct isl_basic_map bmap,
unsigned  n 
) [static, read]

Definition at line 1833 of file isl_map.c.

01834 {
01835         int i, j;
01836 
01837         for (i = 0; i < n; ++i) {
01838                 j = isl_basic_map_alloc_div(bmap);
01839                 if (j < 0)
01840                         goto error;
01841                 isl_seq_clr(bmap->div[j], 1+1+isl_basic_map_total_dim(bmap));
01842         }
01843         return bmap;
01844 error:
01845         isl_basic_map_free(bmap);
01846         return NULL;
01847 }

Here is the call graph for this function:

static int basic_map_contains ( struct isl_basic_map bmap,
struct isl_vec vec 
) [static]

Definition at line 1608 of file isl_map.c.

01609 {
01610         int i;
01611         unsigned total;
01612         isl_int s;
01613 
01614         total = 1 + isl_basic_map_total_dim(bmap);
01615         if (total != vec->size)
01616                 return -1;
01617 
01618         isl_int_init(s);
01619 
01620         for (i = 0; i < bmap->n_eq; ++i) {
01621                 isl_seq_inner_product(vec->block.data, bmap->eq[i], total, &s);
01622                 if (!isl_int_is_zero(s)) {
01623                         isl_int_clear(s);
01624                         return 0;
01625                 }
01626         }
01627 
01628         for (i = 0; i < bmap->n_ineq; ++i) {
01629                 isl_seq_inner_product(vec->block.data, bmap->ineq[i], total, &s);
01630                 if (isl_int_is_neg(s)) {
01631                         isl_int_clear(s);
01632                         return 0;
01633                 }
01634         }
01635 
01636         isl_int_clear(s);
01637 
01638         return 1;
01639 }

Here is the call graph for this function:

static struct isl_basic_map* basic_map_identity ( struct isl_dim dims  )  [static, read]

Definition at line 3279 of file isl_map.c.

03280 {
03281         struct isl_basic_map *bmap;
03282         unsigned nparam;
03283         unsigned dim;
03284         int i;
03285 
03286         if (!dims)
03287                 return NULL;
03288 
03289         nparam = dims->nparam;
03290         dim = dims->n_out;
03291         bmap = isl_basic_map_alloc_dim(dims, 0, dim, 0);
03292         if (!bmap)
03293                 goto error;
03294 
03295         for (i = 0; i < dim; ++i) {
03296                 int j = isl_basic_map_alloc_equality(bmap);
03297                 if (j < 0)
03298                         goto error;
03299                 isl_seq_clr(bmap->eq[j], 1 + isl_basic_map_total_dim(bmap));
03300                 isl_int_set_si(bmap->eq[j][1+nparam+i], 1);
03301                 isl_int_set_si(bmap->eq[j][1+nparam+dim+i], -1);
03302         }
03303         return isl_basic_map_finalize(bmap);
03304 error:
03305         isl_basic_map_free(bmap);
03306         return NULL;
03307 }

Here is the call graph for this function:

static struct isl_basic_map* basic_map_init ( struct isl_ctx *  ctx,
struct isl_basic_map bmap,
unsigned  extra,
unsigned  n_eq,
unsigned  n_ineq 
) [static, read]

Definition at line 237 of file isl_map.c.

00240 {
00241         int i;
00242         size_t row_size = 1 + isl_dim_total(bmap->dim) + extra;
00243 
00244         bmap->block = isl_blk_alloc(ctx, (n_ineq + n_eq) * row_size);
00245         if (isl_blk_is_error(bmap->block)) {
00246                 free(bmap);
00247                 return NULL;
00248         }
00249 
00250         bmap->ineq = isl_alloc_array(ctx, isl_int *, n_ineq + n_eq);
00251         if (!bmap->ineq) {
00252                 isl_blk_free(ctx, bmap->block);
00253                 free(bmap);
00254                 return NULL;
00255         }
00256 
00257         if (extra == 0) {
00258                 bmap->block2 = isl_blk_empty();
00259                 bmap->div = NULL;
00260         } else {
00261                 bmap->block2 = isl_blk_alloc(ctx, extra * (1 + row_size));
00262                 if (isl_blk_is_error(bmap->block2)) {
00263                         free(bmap->ineq);
00264                         isl_blk_free(ctx, bmap->block);
00265                         free(bmap);
00266                         return NULL;
00267                 }
00268 
00269                 bmap->div = isl_alloc_array(ctx, isl_int *, extra);
00270                 if (!bmap->div) {
00271                         isl_blk_free(ctx, bmap->block2);
00272                         free(bmap->ineq);
00273                         isl_blk_free(ctx, bmap->block);
00274                         free(bmap);
00275                         return NULL;
00276                 }
00277         }
00278 
00279         for (i = 0; i < n_ineq + n_eq; ++i)
00280                 bmap->ineq[i] = bmap->block.data + i * row_size;
00281 
00282         for (i = 0; i < extra; ++i)
00283                 bmap->div[i] = bmap->block2.data + i * (1 + row_size);
00284 
00285         bmap->ctx = ctx;
00286         isl_ctx_ref(ctx);
00287         bmap->ref = 1;
00288         bmap->flags = 0;
00289         bmap->c_size = n_eq + n_ineq;
00290         bmap->eq = bmap->ineq + n_ineq;
00291         bmap->extra = extra;
00292         bmap->n_eq = 0;
00293         bmap->n_ineq = 0;
00294         bmap->n_div = 0;
00295         bmap->sample = NULL;
00296 
00297         return bmap;
00298 error:
00299         isl_basic_map_free(bmap);
00300         return NULL;
00301 }

Here is the call graph for this function:

static void copy_constraint ( struct isl_basic_map dst_map,
isl_int dst,
struct isl_basic_map src_map,
isl_int src,
unsigned  in_off,
unsigned  out_off,
unsigned  div_off 
) [static]

Definition at line 658 of file isl_map.c.

00661 {
00662         unsigned src_nparam = isl_basic_map_n_param(src_map);
00663         unsigned dst_nparam = isl_basic_map_n_param(dst_map);
00664         unsigned src_in = isl_basic_map_n_in(src_map);
00665         unsigned dst_in = isl_basic_map_n_in(dst_map);
00666         unsigned src_out = isl_basic_map_n_out(src_map);
00667         unsigned dst_out = isl_basic_map_n_out(dst_map);
00668         isl_int_set(dst[0], src[0]);
00669         isl_seq_cpy(dst+1, src+1, isl_min(dst_nparam, src_nparam));
00670         if (dst_nparam > src_nparam)
00671                 isl_seq_clr(dst+1+src_nparam,
00672                                 dst_nparam - src_nparam);
00673         isl_seq_clr(dst+1+dst_nparam, in_off);
00674         isl_seq_cpy(dst+1+dst_nparam+in_off,
00675                     src+1+src_nparam,
00676                     isl_min(dst_in-in_off, src_in));
00677         if (dst_in-in_off > src_in)
00678                 isl_seq_clr(dst+1+dst_nparam+in_off+src_in,
00679                                 dst_in - in_off - src_in);
00680         isl_seq_clr(dst+1+dst_nparam+dst_in, out_off);
00681         isl_seq_cpy(dst+1+dst_nparam+dst_in+out_off,
00682                     src+1+src_nparam+src_in,
00683                     isl_min(dst_out-out_off, src_out));
00684         if (dst_out-out_off > src_out)
00685                 isl_seq_clr(dst+1+dst_nparam+dst_in+out_off+src_out,
00686                                 dst_out - out_off - src_out);
00687         isl_seq_clr(dst+1+dst_nparam+dst_in+dst_out, div_off);
00688         isl_seq_cpy(dst+1+dst_nparam+dst_in+dst_out+div_off,
00689                     src+1+src_nparam+src_in+src_out,
00690                     isl_min(dst_map->extra-div_off, src_map->n_div));
00691         if (dst_map->n_div-div_off > src_map->n_div)
00692                 isl_seq_clr(dst+1+dst_nparam+dst_in+dst_out+
00693                                 div_off+src_map->n_div,
00694                                 dst_map->n_div - div_off - src_map->n_div);
00695 }

Here is the call graph for this function:

static void copy_constraint_dim_map ( isl_int dst,
isl_int src,
struct isl_dim_map dim_map 
) [static]

Definition at line 750 of file isl_map.c.

00752 {
00753         int i;
00754 
00755         for (i = 0; i < dim_map->len; ++i) {
00756                 if (dim_map->pos[i] < 0)
00757                         isl_int_set_si(dst[i], 0);
00758                 else
00759                         isl_int_set(dst[i], src[dim_map->pos[i]]);
00760         }
00761 }

static void copy_div ( struct isl_basic_map dst_map,
isl_int dst,
struct isl_basic_map src_map,
isl_int src,
unsigned  in_off,
unsigned  out_off,
unsigned  div_off 
) [static]

Definition at line 697 of file isl_map.c.

00700 {
00701         isl_int_set(dst[0], src[0]);
00702         copy_constraint(dst_map, dst+1, src_map, src+1, in_off, out_off, div_off);
00703 }

Here is the call graph for this function:

static void copy_div_dim_map ( isl_int dst,
isl_int src,
struct isl_dim_map dim_map 
) [static]

Definition at line 763 of file isl_map.c.

00765 {
00766         isl_int_set(dst[0], src[0]);
00767         copy_constraint_dim_map(dst+1, src+1, dim_map);
00768 }

Here is the call graph for this function:

static void dump ( struct isl_basic_map bmap,
FILE *  out,
int  indent 
) [static]

Definition at line 1322 of file isl_map.c.

01323 {
01324         int i;
01325 
01326         dump_constraints(bmap, bmap->eq, bmap->n_eq, "=", out, indent);
01327         dump_constraints(bmap, bmap->ineq, bmap->n_ineq, ">=", out, indent);
01328 
01329         for (i = 0; i < bmap->n_div; ++i) {
01330                 fprintf(out, "%*s", indent, "");
01331                 fprintf(out, "e%d = [(", i);
01332                 dump_affine(bmap, bmap->div[i]+1, out);
01333                 fprintf(out, ")/");
01334                 isl_int_print(out, bmap->div[i][0], 0);
01335                 fprintf(out, "]\n");
01336         }
01337 }

Here is the call graph for this function:

static void dump_affine ( struct isl_basic_map bmap,
isl_int exp,
FILE *  out 
) [static]

Definition at line 1306 of file isl_map.c.

01307 {
01308         int j;
01309         int first = 1;
01310         unsigned total = isl_basic_map_total_dim(bmap);
01311 
01312         for (j = 0; j < 1 + total; ++j) {
01313                 if (isl_int_is_zero(exp[j]))
01314                         continue;
01315                 if (!first && isl_int_is_pos(exp[j]))
01316                         fprintf(out, "+");
01317                 dump_term(bmap, exp[j], j, out);
01318                 first = 0;
01319         }
01320 }

Here is the call graph for this function:

static void dump_constraint ( struct isl_basic_map bmap,
isl_int c,
const char *  op,
FILE *  out,
int  indent 
) [static]

Definition at line 1274 of file isl_map.c.

01276 {
01277         int i;
01278 
01279         fprintf(out, "%*s", indent, "");
01280 
01281         dump_constraint_sign(bmap, c, 1, out);
01282         fprintf(out, " %s ", op);
01283         dump_constraint_sign(bmap, c, -1, out);
01284 
01285         fprintf(out, "\n");
01286 
01287         for (i = bmap->n_div; i < bmap->extra; ++i) {
01288                 if (isl_int_is_zero(c[1+isl_dim_total(bmap->dim)+i]))
01289                         continue;
01290                 fprintf(out, "%*s", indent, "");
01291                 fprintf(out, "ERROR: unused div coefficient not zero\n");
01292                 abort();
01293         }
01294 }

Here is the call graph for this function:

static void dump_constraint_sign ( struct isl_basic_map bmap,
isl_int c,
int  sign,
FILE *  out 
) [static]

Definition at line 1251 of file isl_map.c.

01253 {
01254         int i;
01255         int first;
01256         unsigned len = 1 + isl_basic_map_total_dim(bmap);
01257         isl_int v;
01258 
01259         isl_int_init(v);
01260         for (i = 0, first = 1; i < len; ++i) {
01261                 if (isl_int_sgn(c[i]) * sign <= 0)
01262                         continue;
01263                 if (!first)
01264                         fprintf(out, " + ");
01265                 first = 0;
01266                 isl_int_abs(v, c[i]);
01267                 dump_term(bmap, v, i, out);
01268         }
01269         isl_int_clear(v);
01270         if (first)
01271                 fprintf(out, "0");
01272 }

Here is the call graph for this function:

static void dump_constraints ( struct isl_basic_map bmap,
isl_int **  c,
unsigned  n,
const char *  op,
FILE *  out,
int  indent 
) [static]

Definition at line 1296 of file isl_map.c.

01299 {
01300         int i;
01301 
01302         for (i = 0; i < n; ++i)
01303                 dump_constraint(bmap, c[i], op, out, indent);
01304 }

Here is the call graph for this function:

static void dump_term ( struct isl_basic_map bmap,
isl_int  c,
int  pos,
FILE *  out 
) [static]

Definition at line 1223 of file isl_map.c.

01225 {
01226         const char *name;
01227         unsigned in = isl_basic_map_n_in(bmap);
01228         unsigned dim = in + isl_basic_map_n_out(bmap);
01229         unsigned nparam = isl_basic_map_n_param(bmap);
01230         if (!pos)
01231                 isl_int_print(out, c, 0);
01232         else {
01233                 if (!isl_int_is_one(c))
01234                         isl_int_print(out, c, 0);
01235                 if (pos < 1 + nparam) {
01236                         name = isl_dim_get_name(bmap->dim,
01237                                                 isl_dim_param, pos - 1);
01238                         if (name)
01239                                 fprintf(out, "%s", name);
01240                         else
01241                                 fprintf(out, "p%d", pos - 1);
01242                 } else if (pos < 1 + nparam + in)
01243                         fprintf(out, "i%d", pos - 1 - nparam);
01244                 else if (pos < 1 + nparam + dim)
01245                         fprintf(out, "o%d", pos - 1 - nparam - in);
01246                 else
01247                         fprintf(out, "e%d", pos - 1 - nparam - dim);
01248         }
01249 }

Here is the call graph for this function:

static void dup_constraints ( struct isl_basic_map dst,
struct isl_basic_map src 
) [static]

Definition at line 356 of file isl_map.c.

00358 {
00359         int i;
00360         unsigned total = isl_basic_map_total_dim(src);
00361 
00362         for (i = 0; i < src->n_eq; ++i) {
00363                 int j = isl_basic_map_alloc_equality(dst);
00364                 isl_seq_cpy(dst->eq[j], src->eq[i], 1+total);
00365         }
00366 
00367         for (i = 0; i < src->n_ineq; ++i) {
00368                 int j = isl_basic_map_alloc_inequality(dst);
00369                 isl_seq_cpy(dst->ineq[j], src->ineq[i], 1+total);
00370         }
00371 
00372         for (i = 0; i < src->n_div; ++i) {
00373                 int j = isl_basic_map_alloc_div(dst);
00374                 isl_seq_cpy(dst->div[j], src->div[i], 1+1+total);
00375         }
00376         ISL_F_SET(dst, ISL_BASIC_SET_FINAL);
00377 }

Here is the call graph for this function:

static int find_div ( struct isl_basic_map dst,
struct isl_basic_map src,
unsigned  div 
) [static]

Definition at line 3614 of file isl_map.c.

03616 {
03617         int i;
03618 
03619         unsigned total = isl_dim_total(src->dim);
03620 
03621         isl_assert(dst->ctx, div <= dst->n_div, return -1);
03622         for (i = div; i < dst->n_div; ++i)
03623                 if (isl_seq_eq(dst->div[i], src->div[div], 1+1+total+div) &&
03624                     isl_seq_first_non_zero(dst->div[i]+1+1+total+div,
03625                                                 dst->n_div - div) == -1)
03626                         return i;
03627         return -1;
03628 }

Here is the call graph for this function:

struct isl_basic_map* isl_basic_map_align_divs ( struct isl_basic_map dst,
struct isl_basic_map src 
) [read]

Definition at line 3630 of file isl_map.c.

03632 {
03633         int i;
03634         unsigned total = isl_dim_total(src->dim);
03635 
03636         if (!dst || !src)
03637                 goto error;
03638 
03639         if (src->n_div == 0)
03640                 return dst;
03641 
03642         for (i = 0; i < src->n_div; ++i)
03643                 isl_assert(src->ctx, !isl_int_is_zero(src->div[i][0]), goto error);
03644 
03645         src = order_divs(src);
03646         dst = isl_basic_map_cow(dst);
03647         dst = isl_basic_map_extend_dim(dst, isl_dim_copy(dst->dim),
03648                         src->n_div, 0, 2 * src->n_div);
03649         if (!dst)
03650                 return NULL;
03651         for (i = 0; i < src->n_div; ++i) {
03652                 int j = find_div(dst, src, i);
03653                 if (j < 0) {
03654                         j = isl_basic_map_alloc_div(dst);
03655                         if (j < 0)
03656                                 goto error;
03657                         isl_seq_cpy(dst->div[j], src->div[i], 1+1+total+i);
03658                         isl_seq_clr(dst->div[j]+1+1+total+i, dst->n_div - i);
03659                         if (add_div_constraints(dst, j) < 0)
03660                                 goto error;
03661                 }
03662                 if (j != i)
03663                         swap_div(dst, i, j);
03664         }
03665         return dst;
03666 error:
03667         isl_basic_map_free(dst);
03668         return NULL;
03669 }

Here is the call graph for this function:

struct isl_basic_map* isl_basic_map_alloc ( struct isl_ctx *  ctx,
unsigned  nparam,
unsigned  in,
unsigned  out,
unsigned  extra,
unsigned  n_eq,
unsigned  n_ineq 
) [read]

Definition at line 341 of file isl_map.c.

00344 {
00345         struct isl_basic_map *bmap;
00346         struct isl_dim *dim;
00347 
00348         dim = isl_dim_alloc(ctx, nparam, in, out);
00349         if (!dim)
00350                 return NULL;
00351 
00352         bmap = isl_basic_map_alloc_dim(dim, extra, n_eq, n_ineq);
00353         return bmap;
00354 }

Here is the call graph for this function:

struct isl_basic_map* isl_basic_map_alloc_dim ( struct isl_dim dim,
unsigned  extra,
unsigned  n_eq,
unsigned  n_ineq 
) [read]

Definition at line 323 of file isl_map.c.

00325 {
00326         struct isl_basic_map *bmap;
00327 
00328         if (!dim)
00329                 return NULL;
00330         bmap = isl_alloc_type(dim->ctx, struct isl_basic_map);
00331         if (!bmap)
00332                 goto error;
00333         bmap->dim = dim;
00334 
00335         return basic_map_init(dim->ctx, bmap, extra, n_eq, n_ineq);
00336 error:
00337         isl_dim_free(dim);
00338         return NULL;
00339 }

Here is the call graph for this function:

int isl_basic_map_alloc_div ( struct isl_basic_map bmap  ) 

Definition at line 627 of file isl_map.c.

00628 {
00629         if (!bmap)
00630                 return -1;
00631         isl_assert(bmap->ctx, bmap->n_div < bmap->extra, return -1);
00632         isl_seq_clr(bmap->div[bmap->n_div] +
00633                       1 + 1 + isl_basic_map_total_dim(bmap),
00634                       bmap->extra - bmap->n_div);
00635         ISL_F_CLR(bmap, ISL_BASIC_MAP_NORMALIZED_DIVS);
00636         return bmap->n_div++;
00637 }

Here is the call graph for this function:

int isl_basic_map_alloc_equality ( struct isl_basic_map bmap  ) 

Definition at line 473 of file isl_map.c.

00474 {
00475         struct isl_ctx *ctx;
00476         if (!bmap)
00477                 return -1;
00478         ctx = bmap->ctx;
00479         isl_assert(ctx, room_for_con(bmap, 1), return -1);
00480         isl_assert(ctx, (bmap->eq - bmap->ineq) + bmap->n_eq <= bmap->c_size,
00481                         return -1);
00482         ISL_F_CLR(bmap, ISL_BASIC_MAP_NORMALIZED);
00483         ISL_F_CLR(bmap, ISL_BASIC_MAP_NO_REDUNDANT);
00484         ISL_F_CLR(bmap, ISL_BASIC_MAP_NO_IMPLICIT);
00485         ISL_F_CLR(bmap, ISL_BASIC_MAP_ALL_EQUALITIES);
00486         ISL_F_CLR(bmap, ISL_BASIC_MAP_NORMALIZED_DIVS);
00487         if ((bmap->eq - bmap->ineq) + bmap->n_eq == bmap->c_size) {
00488                 isl_int *t;
00489                 int j = isl_basic_map_alloc_inequality(bmap);
00490                 if (j < 0)
00491                         return -1;
00492                 t = bmap->ineq[j];
00493                 bmap->ineq[j] = bmap->ineq[bmap->n_ineq - 1];
00494                 bmap->ineq[bmap->n_ineq - 1] = bmap->eq[-1];
00495                 bmap->eq[-1] = t;
00496                 bmap->n_eq++;
00497                 bmap->n_ineq--;
00498                 bmap->eq--;
00499                 return 0;
00500         }
00501         isl_seq_clr(bmap->eq[bmap->n_eq] + 1 + isl_basic_map_total_dim(bmap),
00502                       bmap->extra - bmap->n_div);
00503         return bmap->n_eq++;
00504 }

Here is the call graph for this function:

int isl_basic_map_alloc_inequality ( struct isl_basic_map bmap  ) 

Definition at line 569 of file isl_map.c.

00570 {
00571         struct isl_ctx *ctx;
00572         if (!bmap)
00573                 return -1;
00574         ctx = bmap->ctx;
00575         isl_assert(ctx, room_for_ineq(bmap, 1), return -1);
00576         ISL_F_CLR(bmap, ISL_BASIC_MAP_NO_IMPLICIT);
00577         ISL_F_CLR(bmap, ISL_BASIC_MAP_NO_REDUNDANT);
00578         ISL_F_CLR(bmap, ISL_BASIC_MAP_NORMALIZED);
00579         ISL_F_CLR(bmap, ISL_BASIC_MAP_ALL_EQUALITIES);
00580         isl_seq_clr(bmap->ineq[bmap->n_ineq] +
00581                       1 + isl_basic_map_total_dim(bmap),
00582                       bmap->extra - bmap->n_div);
00583         return bmap->n_ineq++;
00584 }

Here is the call graph for this function:

struct isl_basic_map* isl_basic_map_apply_domain ( struct isl_basic_map bmap1,
struct isl_basic_map bmap2 
) [read]

Definition at line 1912 of file isl_map.c.

01914 {
01915         if (!bmap1 || !bmap2)
01916                 goto error;
01917 
01918         isl_assert(ctx,
01919             isl_basic_map_n_in(bmap1) == isl_basic_map_n_in(bmap2), goto error);
01920         isl_assert(ctx,
01921             isl_basic_map_n_param(bmap1) == isl_basic_map_n_param(bmap2),
01922             goto error);
01923 
01924         bmap1 = isl_basic_map_reverse(bmap1);
01925         bmap1 = isl_basic_map_apply_range(bmap1, bmap2);
01926         return isl_basic_map_reverse(bmap1);
01927 error:
01928         isl_basic_map_free(bmap1);
01929         isl_basic_map_free(bmap2);
01930         return NULL;
01931 }

Here is the call graph for this function:

struct isl_basic_map* isl_basic_map_apply_range ( struct isl_basic_map bmap1,
struct isl_basic_map bmap2 
) [read]

Definition at line 1849 of file isl_map.c.

01851 {
01852         struct isl_dim *dim_result = NULL;
01853         struct isl_basic_map *bmap;
01854         unsigned n_in, n_out, n, nparam, total, pos;
01855         struct isl_dim_map *dim_map1, *dim_map2;
01856 
01857         if (!bmap1 || !bmap2)
01858                 goto error;
01859 
01860         dim_result = isl_dim_join(isl_dim_copy(bmap1->dim),
01861                                   isl_dim_copy(bmap2->dim));
01862 
01863         n_in = isl_basic_map_n_in(bmap1);
01864         n_out = isl_basic_map_n_out(bmap2);
01865         n = isl_basic_map_n_out(bmap1);
01866         nparam = isl_basic_map_n_param(bmap1);
01867 
01868         total = nparam + n_in + n_out + bmap1->n_div + bmap2->n_div + n;
01869         dim_map1 = isl_dim_map_alloc(bmap1->ctx, total);
01870         dim_map2 = isl_dim_map_alloc(bmap1->ctx, total);
01871         isl_dim_map_dim(dim_map1, bmap1->dim, isl_dim_param, pos = 0);
01872         isl_dim_map_dim(dim_map2, bmap2->dim, isl_dim_param, pos = 0);
01873         isl_dim_map_dim(dim_map1, bmap1->dim, isl_dim_in, pos += nparam);
01874         isl_dim_map_dim(dim_map2, bmap2->dim, isl_dim_out, pos += n_in);
01875         isl_dim_map_div(dim_map1, bmap1, pos += n_out);
01876         isl_dim_map_div(dim_map2, bmap2, pos += bmap1->n_div);
01877         isl_dim_map_dim(dim_map1, bmap1->dim, isl_dim_out, pos += bmap2->n_div);
01878         isl_dim_map_dim(dim_map2, bmap2->dim, isl_dim_in, pos);
01879 
01880         bmap = isl_basic_map_alloc_dim(dim_result,
01881                         bmap1->n_div + bmap2->n_div + n,
01882                         bmap1->n_eq + bmap2->n_eq,
01883                         bmap1->n_ineq + bmap2->n_ineq);
01884         bmap = add_constraints_dim_map(bmap, bmap1, dim_map1);
01885         bmap = add_constraints_dim_map(bmap, bmap2, dim_map2);
01886         bmap = add_divs(bmap, n);
01887         bmap = isl_basic_map_simplify(bmap);
01888         return isl_basic_map_finalize(bmap);
01889 error:
01890         isl_basic_map_free(bmap1);
01891         isl_basic_map_free(bmap2);
01892         return NULL;
01893 }

Here is the call graph for this function:

int isl_basic_map_compatible_domain ( struct isl_basic_map bmap,
struct isl_basic_set bset 
)

Definition at line 209 of file isl_map.c.

00211 {
00212         return bmap->dim->n_in == bset->dim->n_out &&
00213                bmap->dim->nparam == bset->dim->nparam;
00214 }

int isl_basic_map_compatible_range ( struct isl_basic_map bmap,
struct isl_basic_set bset 
)

Definition at line 216 of file isl_map.c.

00218 {
00219         return bmap->dim->n_out == bset->dim->n_out &&
00220                bmap->dim->nparam == bset->dim->nparam;
00221 }

struct isl_map* isl_basic_map_compute_divs ( struct isl_basic_map bmap  )  [read]

Definition at line 2952 of file isl_map.c.

02953 {
02954         int i;
02955         unsigned off;
02956 
02957         if (!bmap)
02958                 return NULL;
02959         off = isl_dim_total(bmap->dim);
02960         for (i = 0; i < bmap->n_div; ++i) {
02961                 if (isl_int_is_zero(bmap->div[i][0]))
02962                         break;
02963                 isl_assert(bmap->ctx, isl_int_is_zero(bmap->div[i][1+1+off+i]),
02964                                 goto error);
02965         }
02966         if (i == bmap->n_div)
02967                 return isl_map_from_basic_map(bmap);
02968         bmap = isl_basic_map_drop_redundant_divs(bmap);
02969         if (!bmap)
02970                 goto error;
02971         for (i = 0; i < bmap->n_div; ++i)
02972                 if (isl_int_is_zero(bmap->div[i][0]))
02973                         break;
02974         if (i == bmap->n_div)
02975                 return isl_map_from_basic_map(bmap);
02976         struct isl_map *map = isl_pip_basic_map_compute_divs(bmap);
02977         return map;
02978 error:
02979         isl_basic_map_free(bmap);
02980         return NULL;
02981 }

Here is the call graph for this function:

struct isl_basic_map* isl_basic_map_copy ( struct isl_basic_map bmap  )  [read]

Definition at line 424 of file isl_map.c.

00425 {
00426         if (!bmap)
00427                 return NULL;
00428 
00429         if (ISL_F_ISSET(bmap, ISL_BASIC_SET_FINAL)) {
00430                 bmap->ref++;
00431                 return bmap;
00432         }
00433         return isl_basic_map_dup(bmap);
00434 }

Here is the call graph for this function:

struct isl_basic_map* isl_basic_map_cow ( struct isl_basic_map bmap  )  [read]

Definition at line 926 of file isl_map.c.

00927 {
00928         if (!bmap)
00929                 return NULL;
00930 
00931         if (bmap->ref > 1) {
00932                 bmap->ref--;
00933                 bmap = isl_basic_map_dup(bmap);
00934         }
00935         ISL_F_CLR(bmap, ISL_BASIC_SET_FINAL);
00936         return bmap;
00937 }

Here is the call graph for this function:

struct isl_basic_set* isl_basic_map_deltas ( struct isl_basic_map bmap  )  [read]

Definition at line 3221 of file isl_map.c.

03222 {
03223         struct isl_basic_set *bset;
03224         unsigned dim;
03225         unsigned nparam;
03226         int i;
03227 
03228         if (!bmap)
03229                 goto error;
03230         dim = isl_basic_map_n_in(bmap);
03231         nparam = isl_basic_map_n_param(bmap);
03232         isl_assert(bmap->ctx, dim == isl_basic_map_n_out(bmap), goto error);
03233         bset = isl_basic_set_from_basic_map(bmap);
03234         bset = isl_basic_set_cow(bset);
03235         bset = isl_basic_set_extend(bset, nparam, 3*dim, 0, dim, 0);
03236         bset = isl_basic_set_swap_vars(bset, 2*dim);
03237         for (i = 0; i < dim; ++i) {
03238                 int j = isl_basic_map_alloc_equality(
03239                                             (struct isl_basic_map *)bset);
03240                 if (j < 0)
03241                         goto error;
03242                 isl_seq_clr(bset->eq[j], 1 + isl_basic_set_total_dim(bset));
03243                 isl_int_set_si(bset->eq[j][1+nparam+i], 1);
03244                 isl_int_set_si(bset->eq[j][1+nparam+dim+i], 1);
03245                 isl_int_set_si(bset->eq[j][1+nparam+2*dim+i], -1);
03246         }
03247         return isl_basic_set_project_out(bset, 2*dim, 0);
03248 error:
03249         isl_basic_map_free(bmap);
03250         return NULL;
03251 }

Here is the call graph for this function:

unsigned isl_basic_map_dim ( const struct isl_basic_map bmap,
enum isl_dim_type  type 
)

Definition at line 92 of file isl_map.c.

00094 {
00095         struct isl_dim *dim = bmap->dim;
00096         switch (type) {
00097         case isl_dim_param:
00098         case isl_dim_in:
00099         case isl_dim_out:       return isl_dim_size(bmap->dim, type);
00100         case isl_dim_div:       return bmap->n_div;
00101         case isl_dim_all:       return isl_basic_map_total_dim(bmap);
00102         }
00103 }

Here is the call graph for this function:

struct isl_basic_set* isl_basic_map_domain ( struct isl_basic_map bmap  )  [read]

Definition at line 2413 of file isl_map.c.

02414 {
02415         struct isl_basic_set *domain;
02416         unsigned n_out;
02417         if (!bmap)
02418                 return NULL;
02419         n_out = isl_basic_map_n_out(bmap);
02420         domain = isl_basic_set_from_basic_map(bmap);
02421         return isl_basic_set_project_out(domain, n_out, 0);
02422 }

Here is the call graph for this function:

int isl_basic_map_drop_equality ( struct isl_basic_map bmap,
unsigned  pos 
)

Definition at line 525 of file isl_map.c.

00526 {
00527         isl_int *t;
00528         if (!bmap)
00529                 return -1;
00530         isl_assert(bmap->ctx, pos < bmap->n_eq, return -1);
00531 
00532         if (pos != bmap->n_eq - 1) {
00533                 t = bmap->eq[pos];
00534                 bmap->eq[pos] = bmap->eq[bmap->n_eq - 1];
00535                 bmap->eq[bmap->n_eq - 1] = t;
00536         }
00537         bmap->n_eq--;
00538         return 0;
00539 }

int isl_basic_map_drop_inequality ( struct isl_basic_map bmap,
unsigned  pos 
)

Definition at line 605 of file isl_map.c.

00606 {
00607         isl_int *t;
00608         if (!bmap)
00609                 return -1;
00610         isl_assert(bmap->ctx, pos < bmap->n_ineq, return -1);
00611 
00612         if (pos != bmap->n_ineq - 1) {
00613                 t = bmap->ineq[pos];
00614                 bmap->ineq[pos] = bmap->ineq[bmap->n_ineq - 1];
00615                 bmap->ineq[bmap->n_ineq - 1] = t;
00616                 ISL_F_CLR(bmap, ISL_BASIC_MAP_NORMALIZED);
00617         }
00618         bmap->n_ineq--;
00619         return 0;
00620 }

void isl_basic_map_dump ( struct isl_basic_map bmap,
FILE *  out,
int  indent 
)

Definition at line 1353 of file isl_map.c.

01354 {
01355         if (!bmap) {
01356                 fprintf(out, "null basic map\n");
01357                 return;
01358         }
01359 
01360         fprintf(out, "%*s", indent, "");
01361         fprintf(out, "ref: %d, nparam: %d, in: %d, out: %d, extra: %d, "
01362                         "flags: %x, n_name: %d\n",
01363                 bmap->ref,
01364                 bmap->dim->nparam, bmap->dim->n_in, bmap->dim->n_out,
01365                 bmap->extra, bmap->flags, bmap->dim->n_name);
01366         dump(bmap, out, indent);
01367 }

struct isl_basic_map* isl_basic_map_dup ( struct isl_basic_map bmap  )  [read]

Definition at line 379 of file isl_map.c.

00380 {
00381         struct isl_basic_map *dup;
00382 
00383         if (!bmap)
00384                 return NULL;
00385         dup = isl_basic_map_alloc_dim(isl_dim_copy(bmap->dim),
00386                         bmap->n_div, bmap->n_eq, bmap->n_ineq);
00387         if (!dup)
00388                 return NULL;
00389         dup_constraints(dup, bmap);
00390         dup->flags = bmap->flags;
00391         dup->sample = isl_vec_copy(bmap->ctx, bmap->sample);
00392         return dup;
00393 }

Here is the call graph for this function:

struct isl_basic_map* isl_basic_map_empty ( struct isl_ctx *  ctx,
unsigned  nparam,
unsigned  in,
unsigned  out 
) [read]

Definition at line 2557 of file isl_map.c.

02559 {
02560         struct isl_basic_map *bmap;
02561         bmap = isl_basic_map_alloc(ctx, nparam, in, out, 0, 1, 0);
02562         bmap = isl_basic_map_set_to_empty(bmap);
02563         return bmap;
02564 }

Here is the call graph for this function:

struct isl_basic_map* isl_basic_map_empty_like ( struct isl_basic_map model  )  [read]

Definition at line 2574 of file isl_map.c.

02575 {
02576         struct isl_basic_map *bmap;
02577         if (!model)
02578                 return NULL;
02579         bmap = isl_basic_map_alloc_dim(isl_dim_copy(model->dim), 0, 1, 0);
02580         bmap = isl_basic_map_set_to_empty(bmap);
02581         return bmap;
02582 }

Here is the call graph for this function:

struct isl_basic_map* isl_basic_map_empty_like_map ( struct isl_map model  )  [read]

Definition at line 2584 of file isl_map.c.

02585 {
02586         struct isl_basic_map *bmap;
02587         if (!model)
02588                 return NULL;
02589         bmap = isl_basic_map_alloc_dim(isl_dim_copy(model->dim), 0, 1, 0);
02590         bmap = isl_basic_map_set_to_empty(bmap);
02591         return bmap;
02592 }

Here is the call graph for this function:

struct isl_basic_map* isl_basic_map_equal ( struct isl_dim dim,
unsigned  n_equal 
) [read]

Definition at line 2133 of file isl_map.c.

02134 {
02135         int i;
02136         struct isl_basic_map *bmap;
02137         bmap = isl_basic_map_alloc_dim(dim, 0, n_equal, 0);
02138         if (!bmap)
02139                 return NULL;
02140         for (i = 0; i < n_equal && bmap; ++i)
02141                 bmap = var_equal(bmap, i);
02142         return isl_basic_map_finalize(bmap);
02143 }

Here is the call graph for this function:

struct isl_basic_map* isl_basic_map_extend ( struct isl_basic_map base,
unsigned  nparam,
unsigned  n_in,
unsigned  n_out,
unsigned  extra,
unsigned  n_eq,
unsigned  n_ineq 
) [read]

Definition at line 886 of file isl_map.c.

00889 {
00890         struct isl_basic_map *bmap;
00891         struct isl_dim *dim;
00892 
00893         if (!base)
00894                 return NULL;
00895         dim = isl_dim_alloc(base->ctx, nparam, n_in, n_out);
00896         if (!dim)
00897                 return NULL;
00898 
00899         bmap = isl_basic_map_extend_dim(base, dim, extra, n_eq, n_ineq);
00900         return bmap;
00901 }

Here is the call graph for this function:

struct isl_basic_map* isl_basic_map_extend_constraints ( struct isl_basic_map base,
unsigned  n_eq,
unsigned  n_ineq 
) [read]

Definition at line 877 of file isl_map.c.

00879 {
00880         if (!base)
00881                 return NULL;
00882         return isl_basic_map_extend_dim(base, isl_dim_copy(base->dim),
00883                                         0, n_eq, n_ineq);
00884 }

Here is the call graph for this function:

struct isl_basic_map* isl_basic_map_extend_dim ( struct isl_basic_map base,
struct isl_dim dim,
unsigned  extra,
unsigned  n_eq,
unsigned  n_ineq 
) [read]

Definition at line 818 of file isl_map.c.

00821 {
00822         struct isl_basic_map *ext;
00823         unsigned flags;
00824         int dims_ok;
00825 
00826         if (!dim)
00827                 goto error;
00828 
00829         if (!base)
00830                 goto error;
00831 
00832         dims_ok = isl_dim_equal(base->dim, dim) &&
00833                   base->extra >= base->n_div + extra;
00834 
00835         if (dims_ok && room_for_con(base, n_eq + n_ineq) &&
00836                        room_for_ineq(base, n_ineq)) {
00837                 isl_dim_free(dim);
00838                 return base;
00839         }
00840 
00841         isl_assert(base->ctx, base->dim->nparam <= dim->nparam, goto error);
00842         isl_assert(base->ctx, base->dim->n_in <= dim->n_in, goto error);
00843         isl_assert(base->ctx, base->dim->n_out <= dim->n_out, goto error);
00844         extra += base->extra;
00845         n_eq += base->n_eq;
00846         n_ineq += base->n_ineq;
00847 
00848         ext = isl_basic_map_alloc_dim(dim, extra, n_eq, n_ineq);
00849         dim = NULL;
00850         if (!ext)
00851                 goto error;
00852 
00853         flags = base->flags;
00854         ext = add_constraints(ext, base, 0, 0);
00855         if (ext) {
00856                 ext->flags = flags;
00857                 ISL_F_CLR(ext, ISL_BASIC_SET_FINAL);
00858         }
00859 
00860         return ext;
00861 
00862 error:
00863         isl_dim_free(dim);
00864         isl_basic_map_free(base);
00865         return NULL;
00866 }

Here is the call graph for this function:

static int isl_basic_map_fast_cmp ( const struct isl_basic_map bmap1,
const struct isl_basic_map bmap2 
) [static]

Definition at line 4255 of file isl_map.c.

04257 {
04258         int i, cmp;
04259         unsigned total;
04260 
04261         if (bmap1 == bmap2)
04262                 return 0;
04263         if (isl_basic_map_n_param(bmap1) != isl_basic_map_n_param(bmap2))
04264                 return isl_basic_map_n_param(bmap1) - isl_basic_map_n_param(bmap2);
04265         if (isl_basic_map_n_in(bmap1) != isl_basic_map_n_in(bmap2))
04266                 return isl_basic_map_n_out(bmap1) - isl_basic_map_n_out(bmap2);
04267         if (isl_basic_map_n_out(bmap1) != isl_basic_map_n_out(bmap2))
04268                 return isl_basic_map_n_out(bmap1) - isl_basic_map_n_out(bmap2);
04269         if (ISL_F_ISSET(bmap1, ISL_BASIC_MAP_EMPTY) &&
04270             ISL_F_ISSET(bmap2, ISL_BASIC_MAP_EMPTY))
04271                 return 0;
04272         if (ISL_F_ISSET(bmap1, ISL_BASIC_MAP_EMPTY))
04273                 return 1;
04274         if (ISL_F_ISSET(bmap2, ISL_BASIC_MAP_EMPTY))
04275                 return -1;
04276         if (bmap1->n_eq != bmap2->n_eq)
04277                 return bmap1->n_eq - bmap2->n_eq;
04278         if (bmap1->n_ineq != bmap2->n_ineq)
04279                 return bmap1->n_ineq - bmap2->n_ineq;
04280         if (bmap1->n_div != bmap2->n_div)
04281                 return bmap1->n_div - bmap2->n_div;
04282         total = isl_basic_map_total_dim(bmap1);
04283         for (i = 0; i < bmap1->n_eq; ++i) {
04284                 cmp = isl_seq_cmp(bmap1->eq[i], bmap2->eq[i], 1+total);
04285                 if (cmp)
04286                         return cmp;
04287         }
04288         for (i = 0; i < bmap1->n_ineq; ++i) {
04289                 cmp = isl_seq_cmp(bmap1->ineq[i], bmap2->ineq[i], 1+total);
04290                 if (cmp)
04291                         return cmp;
04292         }
04293         for (i = 0; i < bmap1->n_div; ++i) {
04294                 cmp = isl_seq_cmp(bmap1->div[i], bmap2->div[i], 1+1+total);
04295                 if (cmp)
04296                         return cmp;
04297         }
04298         return 0;
04299 }

Here is the call graph for this function:

static int isl_basic_map_fast_has_fixed_var ( struct isl_basic_map bmap,
unsigned  pos,
isl_int val 
) [static]

Definition at line 4031 of file isl_map.c.

04033 {
04034         int i;
04035         int d;
04036         unsigned total;
04037 
04038         if (!bmap)
04039                 return -1;
04040         total = isl_basic_map_total_dim(bmap);
04041         for (i = 0, d = total-1; i < bmap->n_eq && d+1 > pos; ++i) {
04042                 for (; d+1 > pos; --d)
04043                         if (!isl_int_is_zero(bmap->eq[i][1+d]))
04044                                 break;
04045                 if (d != pos)
04046                         continue;
04047                 if (isl_seq_first_non_zero(bmap->eq[i]+1, d) != -1)
04048                         return 0;
04049                 if (isl_seq_first_non_zero(bmap->eq[i]+1+d+1, total-d-1) != -1)
04050                         return 0;
04051                 if (!isl_int_is_one(bmap->eq[i][1+d]))
04052                         return 0;
04053                 if (val)
04054                         isl_int_neg(*val, bmap->eq[i][0]);
04055                 return 1;
04056         }
04057         return 0;
04058 }

Here is the call graph for this function:

int isl_basic_map_fast_is_empty ( struct isl_basic_map bmap  ) 

Definition at line 3542 of file isl_map.c.

03543 {
03544         if (!bmap)
03545                 return -1;
03546         return ISL_F_ISSET(bmap, ISL_BASIC_MAP_EMPTY);
03547 }

static int isl_basic_map_fast_is_equal ( struct isl_basic_map bmap1,
struct isl_basic_map bmap2 
) [static]

Definition at line 4301 of file isl_map.c.

04303 {
04304         return isl_basic_map_fast_cmp(bmap1, bmap2) == 0;
04305 }

Here is the call graph for this function:

int isl_basic_map_fast_is_fixed ( struct isl_basic_map bmap,
enum isl_dim_type  type,
unsigned  pos,
isl_int val 
)

Definition at line 4095 of file isl_map.c.

04097 {
04098         if (pos >= isl_basic_map_dim(bmap, type))
04099                 return -1;
04100         return isl_basic_map_fast_has_fixed_var(bmap,
04101                 isl_basic_map_offset(bmap, type) - 1 + pos, val);
04102 }

Here is the call graph for this function:

struct isl_basic_map* isl_basic_map_fix_input_si ( struct isl_basic_map bmap,
unsigned  input,
int  value 
) [read]

Definition at line 2796 of file isl_map.c.

02798 {
02799         return isl_basic_map_fix_si(bmap, isl_dim_in, input, value);
02800 }

Here is the call graph for this function:

static struct isl_basic_map* isl_basic_map_fix_pos ( struct isl_basic_map bmap,
unsigned  pos,
int  value 
) [static, read]

Definition at line 2755 of file isl_map.c.

02757 {
02758         int j;
02759 
02760         bmap = isl_basic_map_cow(bmap);
02761         bmap = isl_basic_map_extend_constraints(bmap, 1, 0);
02762         j = isl_basic_map_alloc_equality(bmap);
02763         if (j < 0)
02764                 goto error;
02765         isl_seq_clr(bmap->eq[j], 1 + isl_basic_map_total_dim(bmap));
02766         isl_int_set_si(bmap->eq[j][pos], -1);
02767         isl_int_set_si(bmap->eq[j][0], value);
02768         bmap = isl_basic_map_simplify(bmap);
02769         return isl_basic_map_finalize(bmap);
02770 error:
02771         isl_basic_map_free(bmap);
02772         return NULL;
02773 }

Here is the call graph for this function:

struct isl_basic_map* isl_basic_map_fix_si ( struct isl_basic_map bmap,
enum isl_dim_type  type,
unsigned  pos,
int  value 
) [read]

Definition at line 2775 of file isl_map.c.

02777 {
02778         if (!bmap)
02779                 return NULL;
02780         isl_assert(bmap->ctx, pos < isl_basic_map_dim(bmap, type), goto error);
02781         return isl_basic_map_fix_pos(bmap, isl_basic_map_offset(bmap, type) + pos,
02782                                         value);
02783 error:
02784         isl_basic_map_free(bmap);
02785         return NULL;
02786 }

Here is the call graph for this function:

struct isl_basic_map* isl_basic_map_floordiv ( struct isl_basic_map bmap,
isl_int  d 
) [read]

Definition at line 2020 of file isl_map.c.

02022 {
02023         unsigned n_in, n_out, nparam, total, pos;
02024         struct isl_basic_map *result = NULL;
02025         struct isl_dim_map *dim_map;
02026         int i;
02027 
02028         if (!bmap)
02029                 return NULL;
02030 
02031         nparam = isl_basic_map_n_param(bmap);
02032         n_in = isl_basic_map_n_in(bmap);
02033         n_out = isl_basic_map_n_out(bmap);
02034 
02035         total = nparam + n_in + n_out + bmap->n_div + n_out;
02036         dim_map = isl_dim_map_alloc(bmap->ctx, total);
02037         isl_dim_map_dim(dim_map, bmap->dim, isl_dim_param, pos = 0);
02038         isl_dim_map_dim(dim_map, bmap->dim, isl_dim_in, pos += nparam);
02039         isl_dim_map_div(dim_map, bmap, pos += n_in + n_out);
02040         isl_dim_map_dim(dim_map, bmap->dim, isl_dim_out, pos += bmap->n_div);
02041 
02042         result = isl_basic_map_alloc_dim(isl_dim_copy(bmap->dim),
02043                         bmap->n_div + n_out,
02044                         bmap->n_eq, bmap->n_ineq + 2 * n_out);
02045         result = add_constraints_dim_map(result, bmap, dim_map);
02046         result = add_divs(result, n_out);
02047         for (i = 0; i < n_out; ++i) {
02048                 int j;
02049                 j = isl_basic_map_alloc_inequality(result);
02050                 if (j < 0)
02051                         goto error;
02052                 isl_seq_clr(result->ineq[j], 1+total);
02053                 isl_int_neg(result->ineq[j][1+nparam+n_in+i], d);
02054                 isl_int_set_si(result->ineq[j][1+pos+i], 1);
02055                 j = isl_basic_map_alloc_inequality(result);
02056                 if (j < 0)
02057                         goto error;
02058                 isl_seq_clr(result->ineq[j], 1+total);
02059                 isl_int_set(result->ineq[j][1+nparam+n_in+i], d);
02060                 isl_int_set_si(result->ineq[j][1+pos+i], -1);
02061                 isl_int_sub_ui(result->ineq[j][0], d, 1);
02062         }
02063 
02064         result = isl_basic_map_simplify(result);
02065         return isl_basic_map_finalize(result);
02066 error:
02067         isl_basic_map_free(result);
02068         return NULL;
02069 }

Here is the call graph for this function:

void isl_basic_map_free ( struct isl_basic_map bmap  ) 

Definition at line 445 of file isl_map.c.

00446 {
00447         if (!bmap)
00448                 return;
00449 
00450         if (--bmap->ref > 0)
00451                 return;
00452 
00453         isl_ctx_deref(bmap->ctx);
00454         free(bmap->div);
00455         isl_blk_free(bmap->ctx, bmap->block2);
00456         free(bmap->ineq);
00457         isl_blk_free(bmap->ctx, bmap->block);
00458         isl_vec_free(bmap->ctx, bmap->sample);
00459         isl_dim_free(bmap->dim);
00460         free(bmap);
00461 }

Here is the call graph for this function:

int isl_basic_map_free_div ( struct isl_basic_map bmap,
unsigned  n 
)

Definition at line 644 of file isl_map.c.

00645 {
00646         if (!bmap)
00647                 return -1;
00648         isl_assert(bmap->ctx, n <= bmap->n_div, return -1);
00649         bmap->n_div -= n;
00650         return 0;
00651 }

int isl_basic_map_free_equality ( struct isl_basic_map bmap,
unsigned  n 
)

Definition at line 511 of file isl_map.c.

00512 {
00513         if (!bmap)
00514                 return -1;
00515         isl_assert(bmap->ctx, n <= bmap->n_eq, return -1);
00516         bmap->n_eq -= n;
00517         return 0;
00518 }

int isl_basic_map_free_inequality ( struct isl_basic_map bmap,
unsigned  n 
)

Definition at line 591 of file isl_map.c.

00592 {
00593         if (!bmap)
00594                 return -1;
00595         isl_assert(bmap->ctx, n <= bmap->n_ineq, return -1);
00596         bmap->n_ineq -= n;
00597         return 0;
00598 }

struct isl_basic_map* isl_basic_map_from_basic_set ( struct isl_basic_set bset,
struct isl_dim dim 
) [read]

Definition at line 2173 of file isl_map.c.

02175 {
02176         struct isl_basic_map *bmap;
02177 
02178         bset = isl_basic_set_cow(bset);
02179         if (!bset || !dim)
02180                 goto error;
02181 
02182         isl_assert(bset->ctx, isl_dim_compatible(bset->dim, dim), goto error);
02183         isl_dim_free(bset->dim);
02184         bmap = (struct isl_basic_map *) bset;
02185         bmap->dim = dim;
02186         return isl_basic_map_finalize(bmap);
02187 error:
02188         isl_basic_set_free(bset);
02189         isl_dim_free(dim);
02190         return NULL;
02191 }

Here is the call graph for this function:

struct isl_basic_map* isl_basic_map_identity ( struct isl_dim set_dim  )  [read]

Definition at line 3309 of file isl_map.c.

03310 {
03311         struct isl_dim *dim = isl_dim_map(set_dim);
03312         if (!dim)
03313                 return NULL;
03314         return basic_map_identity(dim);
03315 }

Here is the call graph for this function:

struct isl_basic_map* isl_basic_map_identity_like ( struct isl_basic_map model  )  [read]

Definition at line 3317 of file isl_map.c.

03318 {
03319         if (!model || !model->dim)
03320                 return NULL;
03321         isl_assert(model->ctx,
03322                         model->dim->n_in == model->dim->n_out, return NULL);
03323         return basic_map_identity(isl_dim_copy(model->dim));
03324 }

Here is the call graph for this function:

void isl_basic_map_inequality_to_equality ( struct isl_basic_map bmap,
unsigned  pos 
)

Definition at line 546 of file isl_map.c.

00548 {
00549         isl_int *t;
00550 
00551         t = bmap->ineq[pos];
00552         bmap->ineq[pos] = bmap->ineq[bmap->n_ineq - 1];
00553         bmap->ineq[bmap->n_ineq - 1] = bmap->eq[-1];
00554         bmap->eq[-1] = t;
00555         bmap->n_eq++;
00556         bmap->n_ineq--;
00557         bmap->eq--;
00558         ISL_F_CLR(bmap, ISL_BASIC_MAP_NO_REDUNDANT);
00559         ISL_F_CLR(bmap, ISL_BASIC_MAP_NORMALIZED);
00560         ISL_F_CLR(bmap, ISL_BASIC_MAP_NORMALIZED_DIVS);
00561         ISL_F_CLR(bmap, ISL_BASIC_MAP_ALL_EQUALITIES);
00562 }

struct isl_basic_map* isl_basic_map_intersect ( struct isl_basic_map bmap1,
struct isl_basic_map bmap2 
) [read]

Definition at line 1646 of file isl_map.c.

01648 {
01649         struct isl_vec *sample = NULL;
01650 
01651         if (!bmap1 || !bmap2)
01652                 goto error;
01653 
01654         isl_assert(bmap1->ctx, isl_dim_match(bmap1->dim, isl_dim_param,
01655                                      bmap2->dim, isl_dim_param), goto error);
01656         if (isl_dim_total(bmap1->dim) ==
01657                                 isl_dim_size(bmap1->dim, isl_dim_param) &&
01658             isl_dim_total(bmap2->dim) !=
01659                                 isl_dim_size(bmap2->dim, isl_dim_param))
01660                 return isl_basic_map_intersect(bmap2, bmap1);
01661 
01662         if (isl_dim_total(bmap2->dim) !=
01663                                         isl_dim_size(bmap2->dim, isl_dim_param))
01664                 isl_assert(bmap1->ctx,
01665                             isl_dim_equal(bmap1->dim, bmap2->dim), goto error);
01666 
01667         if (bmap1->sample &&
01668             basic_map_contains(bmap1, bmap1->sample) > 0 &&
01669             basic_map_contains(bmap2, bmap1->sample) > 0)
01670                 sample = isl_vec_copy(bmap1->ctx, bmap1->sample);
01671         else if (bmap2->sample &&
01672             basic_map_contains(bmap1, bmap2->sample) > 0 &&
01673             basic_map_contains(bmap2, bmap2->sample) > 0)
01674                 sample = isl_vec_copy(bmap2->ctx, bmap2->sample);
01675 
01676         bmap1 = isl_basic_map_cow(bmap1);
01677         bmap1 = isl_basic_map_extend_dim(bmap1, isl_dim_copy(bmap1->dim),
01678                         bmap2->n_div, bmap2->n_eq, bmap2->n_ineq);
01679         if (!bmap1)
01680                 goto error;
01681         bmap1 = add_constraints(bmap1, bmap2, 0, 0);
01682 
01683         if (sample) {
01684                 isl_vec_free(bmap1->ctx, bmap1->sample);
01685                 bmap1->sample = sample;
01686         }
01687 
01688         bmap1 = isl_basic_map_simplify(bmap1);
01689         return isl_basic_map_finalize(bmap1);
01690 error:
01691         if (sample)
01692                 isl_vec_free(bmap1->ctx, sample);
01693         isl_basic_map_free(bmap1);
01694         isl_basic_map_free(bmap2);
01695         return NULL;
01696 }

Here is the call graph for this function:

struct isl_basic_map* isl_basic_map_intersect_domain ( struct isl_basic_map bmap,
struct isl_basic_set bset 
) [read]

Definition at line 1544 of file isl_map.c.

01546 {
01547         struct isl_basic_map *bmap_domain;
01548         struct isl_dim *dim;
01549 
01550         if (!bmap || !bset)
01551                 goto error;
01552 
01553         isl_assert(bset->ctx, isl_dim_match(bmap->dim, isl_dim_param,
01554                                         bset->dim, isl_dim_param), goto error);
01555 
01556         if (isl_dim_size(bset->dim, isl_dim_set) != 0)
01557                 isl_assert(bset->ctx,
01558                     isl_basic_map_compatible_domain(bmap, bset), goto error);
01559 
01560         bmap = isl_basic_map_cow(bmap);
01561         bmap = isl_basic_map_extend_dim(bmap, isl_dim_copy(bmap->dim),
01562                         bset->n_div, bset->n_eq, bset->n_ineq);
01563         if (!bmap)
01564                 goto error;
01565         dim = isl_dim_reverse(isl_dim_copy(bset->dim));
01566         bmap_domain = isl_basic_map_from_basic_set(bset, dim);
01567         bmap = add_constraints(bmap, bmap_domain, 0, 0);
01568 
01569         bmap = isl_basic_map_simplify(bmap);
01570         return isl_basic_map_finalize(bmap);
01571 error:
01572         isl_basic_map_free(bmap);
01573         isl_basic_set_free(bset);
01574         return NULL;
01575 }

Here is the call graph for this function:

struct isl_basic_map* isl_basic_map_intersect_range ( struct isl_basic_map bmap,
struct isl_basic_set bset 
) [read]

Definition at line 1577 of file isl_map.c.

01579 {
01580         struct isl_basic_map *bmap_range;
01581 
01582         if (!bmap || !bset)
01583                 goto error;
01584 
01585         isl_assert(bset->ctx, isl_dim_match(bmap->dim, isl_dim_param,
01586                                         bset->dim, isl_dim_param), goto error);
01587 
01588         if (isl_dim_size(bset->dim, isl_dim_set) != 0)
01589                 isl_assert(bset->ctx,
01590                     isl_basic_map_compatible_range(bmap, bset), goto error);
01591 
01592         bmap = isl_basic_map_cow(bmap);
01593         bmap = isl_basic_map_extend_dim(bmap, isl_dim_copy(bmap->dim),
01594                         bset->n_div, bset->n_eq, bset->n_ineq);
01595         if (!bmap)
01596                 goto error;
01597         bmap_range = isl_basic_map_from_basic_set(bset, isl_dim_copy(bset->dim));
01598         bmap = add_constraints(bmap, bmap_range, 0, 0);
01599 
01600         bmap = isl_basic_map_simplify(bmap);
01601         return isl_basic_map_finalize(bmap);
01602 error:
01603         isl_basic_map_free(bmap);
01604         isl_basic_set_free(bset);
01605         return NULL;
01606 }

Here is the call graph for this function:

int isl_basic_map_is_empty ( struct isl_basic_map bmap  ) 

Definition at line 3497 of file isl_map.c.

03498 {
03499         struct isl_basic_set *bset = NULL;
03500         struct isl_vec *sample = NULL;
03501         int empty;
03502         unsigned total;
03503 
03504         if (!bmap)
03505                 return -1;
03506 
03507         if (ISL_F_ISSET(bmap, ISL_BASIC_MAP_EMPTY))
03508                 return 1;
03509 
03510         if (ISL_F_ISSET(bmap, ISL_BASIC_MAP_RATIONAL)) {
03511                 struct isl_basic_map *copy = isl_basic_map_copy(bmap);
03512                 copy = isl_basic_map_convex_hull(copy);
03513                 empty = ISL_F_ISSET(copy, ISL_BASIC_MAP_EMPTY);
03514                 isl_basic_map_free(copy);
03515                 return empty;
03516         }
03517 
03518         total = 1 + isl_basic_map_total_dim(bmap);
03519         if (bmap->sample && bmap->sample->size == total) {
03520                 int contains = basic_map_contains(bmap, bmap->sample);
03521                 if (contains < 0)
03522                         return -1;
03523                 if (contains)
03524                         return 0;
03525         }
03526         bset = isl_basic_map_underlying_set(isl_basic_map_copy(bmap));
03527         if (!bset)
03528                 return -1;
03529         sample = isl_basic_set_sample(bset);
03530         if (!sample)
03531                 return -1;
03532         empty = sample->size == 0;
03533         if (bmap->sample)
03534                 isl_vec_free(bmap->ctx, bmap->sample);
03535         bmap->sample = sample;
03536         if (empty)
03537                 ISL_F_SET(bmap, ISL_BASIC_MAP_EMPTY);
03538 
03539         return empty;
03540 }

Here is the call graph for this function:

int isl_basic_map_is_equal ( struct isl_basic_map bmap1,
struct isl_basic_map bmap2 
)

Definition at line 3381 of file isl_map.c.

03383 {
03384         int is_subset;
03385 
03386         if (!bmap1 || !bmap2)
03387                 return -1;
03388         is_subset = isl_basic_map_is_subset(bmap1, bmap2);
03389         if (is_subset != 1)
03390                 return is_subset;
03391         is_subset = isl_basic_map_is_subset(bmap2, bmap1);
03392         return is_subset;
03393 }

Here is the call graph for this function:

int isl_basic_map_is_strict_subset ( struct isl_basic_map bmap1,
struct isl_basic_map bmap2 
)

Definition at line 3467 of file isl_map.c.

03469 {
03470         int is_subset;
03471 
03472         if (!bmap1 || !bmap2)
03473                 return -1;
03474         is_subset = isl_basic_map_is_subset(bmap1, bmap2);
03475         if (is_subset != 1)
03476                 return is_subset;
03477         is_subset = isl_basic_map_is_subset(bmap2, bmap1);
03478         if (is_subset == -1)
03479                 return is_subset;
03480         return !is_subset;
03481 }

Here is the call graph for this function:

int isl_basic_map_is_subset ( struct isl_basic_map bmap1,
struct isl_basic_map bmap2 
)

Definition at line 3360 of file isl_map.c.

03362 {
03363         int is_subset;
03364         struct isl_map *map1;
03365         struct isl_map *map2;
03366 
03367         if (!bmap1 || !bmap2)
03368                 return -1;
03369 
03370         map1 = isl_map_from_basic_map(isl_basic_map_copy(bmap1));
03371         map2 = isl_map_from_basic_map(isl_basic_map_copy(bmap2));
03372 
03373         is_subset = isl_map_is_subset(map1, map2);
03374 
03375         isl_map_free(map1);
03376         isl_map_free(map2);
03377 
03378         return is_subset;
03379 }

Here is the call graph for this function:

int isl_basic_map_is_universe ( struct isl_basic_map bmap  ) 

Definition at line 3483 of file isl_map.c.

03484 {
03485         if (!bmap)
03486                 return -1;
03487         return bmap->n_eq == 0 && bmap->n_ineq == 0;
03488 }

struct isl_basic_map* isl_basic_map_less_at ( struct isl_dim dim,
unsigned  pos 
) [read]

Definition at line 2145 of file isl_map.c.

02146 {
02147         int i;
02148         struct isl_basic_map *bmap;
02149         bmap = isl_basic_map_alloc_dim(dim, 0, pos, 1);
02150         if (!bmap)
02151                 return NULL;
02152         for (i = 0; i < pos && bmap; ++i)
02153                 bmap = var_equal(bmap, i);
02154         if (bmap)
02155                 bmap = var_less(bmap, pos);
02156         return isl_basic_map_finalize(bmap);
02157 }

Here is the call graph for this function:

struct isl_map* isl_basic_map_lexmax ( struct isl_basic_map bmap,
struct isl_basic_set dom,
struct isl_set **  empty 
) [read]

Definition at line 2910 of file isl_map.c.

02913 {
02914         return isl_pip_basic_map_lexmax(bmap, dom, empty);
02915 }

Here is the call graph for this function:

struct isl_map* isl_basic_map_lexmin ( struct isl_basic_map bmap,
struct isl_basic_set dom,
struct isl_set **  empty 
) [read]

Definition at line 2917 of file isl_map.c.

02920 {
02921         return isl_pip_basic_map_lexmin(bmap, dom, empty);
02922 }

Here is the call graph for this function:

struct isl_basic_map* isl_basic_map_more_at ( struct isl_dim dim,
unsigned  pos 
) [read]

Definition at line 2159 of file isl_map.c.

02160 {
02161         int i;
02162         struct isl_basic_map *bmap;
02163         bmap = isl_basic_map_alloc_dim(dim, 0, pos, 1);
02164         if (!bmap)
02165                 return NULL;
02166         for (i = 0; i < pos && bmap; ++i)
02167                 bmap = var_equal(bmap, i);
02168         if (bmap)
02169                 bmap = var_more(bmap, pos);
02170         return isl_basic_map_finalize(bmap);
02171 }

Here is the call graph for this function:

unsigned isl_basic_map_n_div ( const struct isl_basic_map bmap  ) 

Definition at line 178 of file isl_map.c.

00179 {
00180         return bmap->n_div;
00181 }

unsigned isl_basic_map_n_in ( const struct isl_basic_map bmap  ) 

Definition at line 163 of file isl_map.c.

00164 {
00165         return bmap->dim->n_in;
00166 }

unsigned isl_basic_map_n_out ( const struct isl_basic_map bmap  ) 

Definition at line 168 of file isl_map.c.

00169 {
00170         return bmap->dim->n_out;
00171 }

unsigned isl_basic_map_n_param ( const struct isl_basic_map bmap  ) 

Definition at line 173 of file isl_map.c.

00174 {
00175         return bmap->dim->nparam;
00176 }

struct isl_basic_map* isl_basic_map_neg ( struct isl_basic_map bmap  )  [read]

Definition at line 1994 of file isl_map.c.

01995 {
01996         int i, j;
01997         unsigned off, n;
01998 
01999         bmap = isl_basic_map_cow(bmap);
02000         if (!bmap)
02001                 return NULL;
02002 
02003         n = isl_basic_map_dim(bmap, isl_dim_out);
02004         off = isl_basic_map_offset(bmap, isl_dim_out);
02005         for (i = 0; i < bmap->n_eq; ++i)
02006                 for (j = 0; j < n; ++j)
02007                         isl_int_neg(bmap->eq[i][off+j], bmap->eq[i][off+j]);
02008         for (i = 0; i < bmap->n_ineq; ++i)
02009                 for (j = 0; j < n; ++j)
02010                         isl_int_neg(bmap->ineq[i][off+j], bmap->ineq[i][off+j]);
02011         for (i = 0; i < bmap->n_div; ++i)
02012                 for (j = 0; j < n; ++j)
02013                         isl_int_neg(bmap->div[i][1+off+j], bmap->div[i][1+off+j]);
02014         return isl_basic_map_finalize(bmap);
02015 }

Here is the call graph for this function:

struct isl_basic_map* isl_basic_map_normalize ( struct isl_basic_map bmap  )  [read]

Definition at line 4237 of file isl_map.c.

04238 {
04239         if (!bmap)
04240                 return NULL;
04241         if (ISL_F_ISSET(bmap, ISL_BASIC_MAP_NORMALIZED))
04242                 return bmap;
04243         bmap = isl_basic_map_convex_hull(bmap);
04244         bmap = isl_basic_map_sort_constraints(bmap);
04245         ISL_F_SET(bmap, ISL_BASIC_MAP_NORMALIZED);
04246         return bmap;
04247 }

Here is the call graph for this function:

unsigned isl_basic_map_offset ( struct isl_basic_map bmap,
enum isl_dim_type  type 
)

Definition at line 115 of file isl_map.c.

00117 {
00118         struct isl_dim *dim = bmap->dim;
00119         switch (type) {
00120         case isl_dim_param:     return 1;
00121         case isl_dim_in:        return 1 + dim->nparam;
00122         case isl_dim_out:       return 1 + dim->nparam + dim->n_in;
00123         case isl_dim_div:       return 1 + dim->nparam + dim->n_in + dim->n_out;
00124         }
00125 }

struct isl_basic_map* isl_basic_map_overlying_set ( struct isl_basic_set bset,
struct isl_basic_map like 
) [read]

Definition at line 2265 of file isl_map.c.

02267 {
02268         struct isl_basic_map *bmap;
02269         struct isl_ctx *ctx;
02270         unsigned total;
02271         int i;
02272 
02273         if (!bset || !like)
02274                 goto error;
02275         ctx = bset->ctx;
02276         isl_assert(ctx, bset->n_div == 0, goto error);
02277         isl_assert(ctx, isl_basic_set_n_param(bset) == 0, goto error);
02278         isl_assert(ctx, bset->dim->n_out == isl_basic_map_total_dim(like),
02279                         goto error);
02280         if (isl_dim_equal(bset->dim, like->dim) && like->n_div == 0) {
02281                 isl_basic_map_free(like);
02282                 return (struct isl_basic_map *)bset;
02283         }
02284         bset = isl_basic_set_cow(bset);
02285         if (!bset)
02286                 goto error;
02287         total = bset->dim->n_out + bset->extra;
02288         bmap = (struct isl_basic_map *)bset;
02289         isl_dim_free(bmap->dim);
02290         bmap->dim = isl_dim_copy(like->dim);
02291         if (!bmap->dim)
02292                 goto error;
02293         bmap->n_div = like->n_div;
02294         bmap->extra += like->n_div;
02295         if (bmap->extra) {
02296                 unsigned ltotal;
02297                 ltotal = total - bmap->extra + like->extra;
02298                 if (ltotal > total)
02299                         ltotal = total;
02300                 bmap->block2 = isl_blk_extend(ctx, bmap->block2,
02301                                         bmap->extra * (1 + 1 + total));
02302                 if (isl_blk_is_error(bmap->block2))
02303                         goto error;
02304                 bmap->div = isl_realloc_array(ctx, bmap->div, isl_int *,
02305                                                 bmap->extra);
02306                 if (!bmap->div)
02307                         goto error;
02308                 for (i = 0; i < bmap->extra; ++i)
02309                         bmap->div[i] = bmap->block2.data + i * (1 + 1 + total);
02310                 for (i = 0; i < like->n_div; ++i) {
02311                         isl_seq_cpy(bmap->div[i], like->div[i], 1 + 1 + ltotal);
02312                         isl_seq_clr(bmap->div[i]+1+1+ltotal, total - ltotal);
02313                 }
02314                 bmap = isl_basic_map_extend_constraints(bmap, 
02315                                                         0, 2 * like->n_div);
02316                 for (i = 0; i < like->n_div; ++i) {
02317                         if (isl_int_is_zero(bmap->div[i][0]))
02318                                 continue;
02319                         if (add_div_constraints(bmap, i) < 0)
02320                                 goto error;
02321                 }
02322         }
02323         isl_basic_map_free(like);
02324         bmap = isl_basic_map_simplify(bmap);
02325         bmap = isl_basic_map_finalize(bmap);
02326         return bmap;
02327 error:
02328         isl_basic_map_free(like);
02329         isl_basic_set_free(bset);
02330         return NULL;
02331 }

Here is the call graph for this function:

struct isl_basic_map* isl_basic_map_product ( struct isl_basic_map bmap1,
struct isl_basic_map bmap2 
) [read]

Definition at line 4478 of file isl_map.c.

04480 {
04481         struct isl_dim *dim_result = NULL;
04482         struct isl_basic_map *bmap;
04483         unsigned in1, in2, out1, out2, nparam, total, pos;
04484         struct isl_dim_map *dim_map1, *dim_map2;
04485 
04486         if (!bmap1 || !bmap2)
04487                 goto error;
04488 
04489         isl_assert(map1->ctx, isl_dim_match(bmap1->dim, isl_dim_param,
04490                                      bmap2->dim, isl_dim_param), goto error);
04491         dim_result = isl_dim_product(isl_dim_copy(bmap1->dim),
04492                                                    isl_dim_copy(bmap2->dim));
04493 
04494         in1 = isl_basic_map_n_in(bmap1);
04495         in2 = isl_basic_map_n_in(bmap2);
04496         out1 = isl_basic_map_n_out(bmap1);
04497         out2 = isl_basic_map_n_out(bmap2);
04498         nparam = isl_basic_map_n_param(bmap1);
04499 
04500         total = nparam + in1 + in2 + out1 + out2 + bmap1->n_div + bmap2->n_div;
04501         dim_map1 = isl_dim_map_alloc(bmap1->ctx, total);
04502         dim_map2 = isl_dim_map_alloc(bmap1->ctx, total);
04503         isl_dim_map_dim(dim_map1, bmap1->dim, isl_dim_param, pos = 0);
04504         isl_dim_map_dim(dim_map2, bmap2->dim, isl_dim_param, pos = 0);
04505         isl_dim_map_dim(dim_map1, bmap1->dim, isl_dim_in, pos += nparam);
04506         isl_dim_map_dim(dim_map2, bmap2->dim, isl_dim_in, pos += in1);
04507         isl_dim_map_dim(dim_map1, bmap1->dim, isl_dim_out, pos += in2);
04508         isl_dim_map_dim(dim_map2, bmap2->dim, isl_dim_out, pos += out1);
04509         isl_dim_map_div(dim_map1, bmap1, pos += out2);
04510         isl_dim_map_div(dim_map2, bmap2, pos += bmap1->n_div);
04511 
04512         bmap = isl_basic_map_alloc_dim(dim_result,
04513                         bmap1->n_div + bmap2->n_div,
04514                         bmap1->n_eq + bmap2->n_eq,
04515                         bmap1->n_ineq + bmap2->n_ineq);
04516         bmap = add_constraints_dim_map(bmap, bmap1, dim_map1);
04517         bmap = add_constraints_dim_map(bmap, bmap2, dim_map2);
04518         bmap = isl_basic_map_simplify(bmap);
04519         return isl_basic_map_finalize(bmap);
04520 error:
04521         isl_basic_map_free(bmap1);
04522         isl_basic_map_free(bmap2);
04523         return NULL;
04524 }

Here is the call graph for this function:

struct isl_basic_set* isl_basic_map_range ( struct isl_basic_map bmap  )  [read]

Definition at line 2424 of file isl_map.c.

02425 {
02426         return isl_basic_map_domain(isl_basic_map_reverse(bmap));
02427 }

Here is the call graph for this function:

struct isl_basic_map* isl_basic_map_remove ( struct isl_basic_map bmap,
enum isl_dim_type  type,
unsigned  first,
unsigned  n 
) [read]

Definition at line 1161 of file isl_map.c.

01163 {
01164         if (!bmap)
01165                 return NULL;
01166         isl_assert(bmap->ctx, first + n <= isl_basic_map_dim(bmap, type),
01167                         goto error);
01168         if (n == 0)
01169                 return bmap;
01170         bmap = isl_basic_map_eliminate_vars(bmap,
01171                         isl_basic_map_offset(bmap, type) - 1 + first, n);
01172         bmap = isl_basic_map_drop(bmap, type, first, n);
01173         return bmap;
01174 error:
01175         isl_basic_map_free(bmap);
01176         return NULL;
01177 }

Here is the call graph for this function:

struct isl_basic_map* isl_basic_map_reverse ( struct isl_basic_map bmap  )  [read]

Definition at line 1764 of file isl_map.c.

01765 {
01766         struct isl_dim *dim;
01767         struct isl_basic_set *bset;
01768         unsigned in;
01769 
01770         if (!bmap)
01771                 return NULL;
01772         bmap = isl_basic_map_cow(bmap);
01773         if (!bmap)
01774                 return NULL;
01775         dim = isl_dim_reverse(isl_dim_copy(bmap->dim));
01776         in = isl_basic_map_n_in(bmap);
01777         bset = isl_basic_set_from_basic_map(bmap);
01778         bset = isl_basic_set_swap_vars(bset, in);
01779         return isl_basic_map_from_basic_set(bset, dim);
01780 }

Here is the call graph for this function:

struct isl_basic_map* isl_basic_map_set_to_empty ( struct isl_basic_map bmap  )  [read]

Definition at line 1035 of file isl_map.c.

01036 {
01037         int i = 0;
01038         unsigned total;
01039         if (!bmap)
01040                 goto error;
01041         total = isl_basic_map_total_dim(bmap);
01042         isl_basic_map_free_div(bmap, bmap->n_div);
01043         isl_basic_map_free_inequality(bmap, bmap->n_ineq);
01044         if (bmap->n_eq > 0)
01045                 isl_basic_map_free_equality(bmap, bmap->n_eq-1);
01046         else {
01047                 isl_basic_map_alloc_equality(bmap);
01048                 if (i < 0)
01049                         goto error;
01050         }
01051         isl_int_set_si(bmap->eq[i][0], 1);
01052         isl_seq_clr(bmap->eq[i]+1, total);
01053         ISL_F_SET(bmap, ISL_BASIC_MAP_EMPTY);
01054         return isl_basic_map_finalize(bmap);
01055 error:
01056         isl_basic_map_free(bmap);
01057         return NULL;
01058 }

Here is the call graph for this function:

static struct isl_basic_map* isl_basic_map_sort_constraints ( struct isl_basic_map bmap  )  [static, read]

Definition at line 4210 of file isl_map.c.

04212 {
04213         int i;
04214         struct constraint *c;
04215         unsigned total;
04216 
04217         if (!bmap)
04218                 return NULL;
04219         total = isl_basic_map_total_dim(bmap);
04220         c = isl_alloc_array(bmap->ctx, struct constraint, bmap->n_ineq);
04221         if (!c)
04222                 goto error;
04223         for (i = 0; i < bmap->n_ineq; ++i) {
04224                 c[i].size = total;
04225                 c[i].c = bmap->ineq[i];
04226         }
04227         qsort(c, bmap->n_ineq, sizeof(struct constraint), qsort_constraint_cmp);
04228         for (i = 0; i < bmap->n_ineq; ++i)
04229                 bmap->ineq[i] = c[i].c;
04230         free(c);
04231         return bmap;
04232 error:
04233         isl_basic_map_free(bmap);
04234         return NULL;
04235 }

Here is the call graph for this function:

struct isl_basic_map* isl_basic_map_sum ( struct isl_basic_map bmap1,
struct isl_basic_map bmap2 
) [read]

Definition at line 1936 of file isl_map.c.

01938 {
01939         unsigned n_in, n_out, nparam, total, pos;
01940         struct isl_basic_map *bmap = NULL;
01941         struct isl_dim_map *dim_map1, *dim_map2;
01942         int i;
01943 
01944         if (!bmap1 || !bmap2)
01945                 goto error;
01946 
01947         isl_assert(bmap1->ctx, isl_dim_equal(bmap1->dim, bmap2->dim),
01948                 goto error);
01949 
01950         nparam = isl_basic_map_n_param(bmap1);
01951         n_in = isl_basic_map_n_in(bmap1);
01952         n_out = isl_basic_map_n_out(bmap1);
01953 
01954         total = nparam + n_in + n_out + bmap1->n_div + bmap2->n_div + 2 * n_out;
01955         dim_map1 = isl_dim_map_alloc(bmap1->ctx, total);
01956         dim_map2 = isl_dim_map_alloc(bmap2->ctx, total);
01957         isl_dim_map_dim(dim_map1, bmap1->dim, isl_dim_param, pos = 0);
01958         isl_dim_map_dim(dim_map2, bmap2->dim, isl_dim_param, pos);
01959         isl_dim_map_dim(dim_map1, bmap1->dim, isl_dim_in, pos += nparam);
01960         isl_dim_map_dim(dim_map2, bmap2->dim, isl_dim_in, pos);
01961         isl_dim_map_div(dim_map1, bmap1, pos += n_in + n_out);
01962         isl_dim_map_div(dim_map2, bmap2, pos += bmap1->n_div);
01963         isl_dim_map_dim(dim_map1, bmap1->dim, isl_dim_out, pos += bmap2->n_div);
01964         isl_dim_map_dim(dim_map2, bmap2->dim, isl_dim_out, pos += n_out);
01965 
01966         bmap = isl_basic_map_alloc_dim(isl_dim_copy(bmap1->dim),
01967                         bmap1->n_div + bmap2->n_div + 2 * n_out,
01968                         bmap1->n_eq + bmap2->n_eq + n_out,
01969                         bmap1->n_ineq + bmap2->n_ineq);
01970         for (i = 0; i < n_out; ++i) {
01971                 int j = isl_basic_map_alloc_equality(bmap);
01972                 if (j < 0)
01973                         goto error;
01974                 isl_seq_clr(bmap->eq[j], 1+total);
01975                 isl_int_set_si(bmap->eq[j][1+nparam+n_in+i], -1);
01976                 isl_int_set_si(bmap->eq[j][1+pos+i], 1);
01977                 isl_int_set_si(bmap->eq[j][1+pos-n_out+i], 1);
01978         }
01979         bmap = add_constraints_dim_map(bmap, bmap1, dim_map1);
01980         bmap = add_constraints_dim_map(bmap, bmap2, dim_map2);
01981         bmap = add_divs(bmap, 2 * n_out);
01982 
01983         bmap = isl_basic_map_simplify(bmap);
01984         return isl_basic_map_finalize(bmap);
01985 error:
01986         isl_basic_map_free(bmap);
01987         isl_basic_map_free(bmap1);
01988         isl_basic_map_free(bmap2);
01989         return NULL;
01990 }

Here is the call graph for this function:

unsigned isl_basic_map_total_dim ( const struct isl_basic_map bmap  ) 

Definition at line 183 of file isl_map.c.

00184 {
00185         return isl_dim_total(bmap->dim) + bmap->n_div;
00186 }

Here is the call graph for this function:

struct isl_basic_set* isl_basic_map_underlying_set ( struct isl_basic_map bmap  )  [read]

Definition at line 2244 of file isl_map.c.

02246 {
02247         if (!bmap)
02248                 goto error;
02249         if (bmap->dim->nparam == 0 && bmap->dim->n_in == 0 && bmap->n_div == 0)
02250                 return (struct isl_basic_set *)bmap;
02251         bmap = isl_basic_map_cow(bmap);
02252         if (!bmap)
02253                 goto error;
02254         bmap->dim = isl_dim_underlying(bmap->dim, bmap->n_div);
02255         if (!bmap->dim)
02256                 goto error;
02257         bmap->extra -= bmap->n_div;
02258         bmap->n_div = 0;
02259         bmap = isl_basic_map_finalize(bmap);
02260         return (struct isl_basic_set *)bmap;
02261 error:
02262         return NULL;
02263 }

Here is the call graph for this function:

struct isl_map* isl_basic_map_union ( struct isl_basic_map bmap1,
struct isl_basic_map bmap2 
) [read]

Definition at line 3561 of file isl_map.c.

03563 {
03564         struct isl_map *map;
03565         if (!bmap1 || !bmap2)
03566                 return NULL;
03567 
03568         isl_assert(map1->ctx, isl_dim_equal(bmap1->dim, bmap2->dim), goto error);
03569 
03570         map = isl_map_alloc_dim(isl_dim_copy(bmap1->dim), 2, 0);
03571         if (!map)
03572                 goto error;
03573         map = isl_map_add(map, bmap1);
03574         map = isl_map_add(map, bmap2);
03575         return map;
03576 error:
03577         isl_basic_map_free(bmap1);
03578         isl_basic_map_free(bmap2);
03579         return NULL;
03580 }

Here is the call graph for this function:

struct isl_basic_map* isl_basic_map_universe ( struct isl_dim dim  )  [read]

Definition at line 2604 of file isl_map.c.

02605 {
02606         struct isl_basic_map *bmap;
02607         bmap = isl_basic_map_alloc_dim(dim, 0, 0, 0);
02608         return bmap;
02609 }

Here is the call graph for this function:

struct isl_basic_set* isl_basic_set_add_constraints ( struct isl_basic_set bset1,
struct isl_basic_set bset2,
unsigned  pos 
) [read]

Definition at line 810 of file isl_map.c.

00812 {
00813         return (struct isl_basic_set *)
00814                 add_constraints((struct isl_basic_map *)bset1,
00815                                 (struct isl_basic_map *)bset2, 0, pos);
00816 }

Here is the call graph for this function:

struct isl_basic_set* isl_basic_set_align_divs ( struct isl_basic_set dst,
struct isl_basic_set src 
) [read]

Definition at line 3671 of file isl_map.c.

03673 {
03674         return (struct isl_basic_set *)isl_basic_map_align_divs(
03675                 (struct isl_basic_map *)dst, (struct isl_basic_map *)src);
03676 }

Here is the call graph for this function:

struct isl_basic_set* isl_basic_set_alloc ( struct isl_ctx *  ctx,
unsigned  nparam,
unsigned  dim,
unsigned  extra,
unsigned  n_eq,
unsigned  n_ineq 
) [read]

Definition at line 303 of file isl_map.c.

00306 {
00307         struct isl_basic_map *bmap;
00308         bmap = isl_basic_map_alloc(ctx, nparam, 0, dim, extra, n_eq, n_ineq);
00309         return (struct isl_basic_set *)bmap;
00310 }

Here is the call graph for this function:

struct isl_basic_set* isl_basic_set_alloc_dim ( struct isl_dim dim,
unsigned  extra,
unsigned  n_eq,
unsigned  n_ineq 
) [read]

Definition at line 312 of file isl_map.c.

00314 {
00315         struct isl_basic_map *bmap;
00316         if (!dim)
00317                 return NULL;
00318         isl_assert(dim->ctx, dim->n_in == 0, return NULL);
00319         bmap = isl_basic_map_alloc_dim(dim, extra, n_eq, n_ineq);
00320         return (struct isl_basic_set *)bmap;
00321 }

Here is the call graph for this function:

int isl_basic_set_alloc_div ( struct isl_basic_set bset  ) 

Definition at line 639 of file isl_map.c.

00640 {
00641         return isl_basic_map_alloc_div((struct isl_basic_map *)bset);
00642 }

Here is the call graph for this function:

int isl_basic_set_alloc_equality ( struct isl_basic_set bset  ) 

Definition at line 506 of file isl_map.c.

00507 {
00508         return isl_basic_map_alloc_equality((struct isl_basic_map *)bset);
00509 }

Here is the call graph for this function:

int isl_basic_set_alloc_inequality ( struct isl_basic_set bset  ) 

Definition at line 586 of file isl_map.c.

00587 {
00588         return isl_basic_map_alloc_inequality((struct isl_basic_map *)bset);
00589 }

Here is the call graph for this function:

struct isl_basic_set* isl_basic_set_apply ( struct isl_basic_set bset,
struct isl_basic_map bmap 
) [read]

Definition at line 1895 of file isl_map.c.

01897 {
01898         if (!bset || !bmap)
01899                 goto error;
01900 
01901         isl_assert(set->ctx, isl_basic_map_compatible_domain(bmap, bset),
01902                     goto error);
01903 
01904         return (struct isl_basic_set *)
01905                 isl_basic_map_apply_range((struct isl_basic_map *)bset, bmap);
01906 error:
01907         isl_basic_set_free(bset);
01908         isl_basic_map_free(bmap);
01909         return NULL;
01910 }

Here is the call graph for this function:

int isl_basic_set_compare_at ( struct isl_basic_set bset1,
struct isl_basic_set bset2,
int  pos 
)

Definition at line 3966 of file isl_map.c.

03968 {
03969         struct isl_dim *dims;
03970         struct isl_basic_map *bmap1 = NULL;
03971         struct isl_basic_map *bmap2 = NULL;
03972         struct isl_ctx *ctx;
03973         struct isl_vec *obj;
03974         unsigned total;
03975         unsigned nparam;
03976         unsigned dim1, dim2;
03977         isl_int num, den;
03978         enum isl_lp_result res;
03979         int cmp;
03980 
03981         if (!bset1 || !bset2)
03982                 return -2;
03983 
03984         nparam = isl_basic_set_n_param(bset1);
03985         dim1 = isl_basic_set_n_dim(bset1);
03986         dim2 = isl_basic_set_n_dim(bset2);
03987         dims = isl_dim_alloc(bset1->ctx, nparam, pos, dim1 - pos);
03988         bmap1 = isl_basic_map_from_basic_set(isl_basic_set_copy(bset1), dims);
03989         dims = isl_dim_alloc(bset2->ctx, nparam, pos, dim2 - pos);
03990         bmap2 = isl_basic_map_from_basic_set(isl_basic_set_copy(bset2), dims);
03991         if (!bmap1 || !bmap2)
03992                 goto error;
03993         bmap1 = isl_basic_map_cow(bmap1);
03994         bmap1 = isl_basic_map_extend(bmap1, nparam,
03995                         pos, (dim1 - pos) + (dim2 - pos),
03996                         bmap2->n_div, bmap2->n_eq, bmap2->n_ineq);
03997         bmap1 = add_constraints(bmap1, bmap2, 0, dim1 - pos);
03998         if (!bmap1)
03999                 goto error;
04000         total = isl_basic_map_total_dim(bmap1);
04001         ctx = bmap1->ctx;
04002         obj = isl_vec_alloc(ctx, 1 + total);
04003         isl_seq_clr(obj->block.data, 1 + total);
04004         isl_int_set_si(obj->block.data[1+nparam+pos], 1);
04005         isl_int_set_si(obj->block.data[1+nparam+pos+(dim1-pos)], -1);
04006         if (!obj)
04007                 goto error;
04008         isl_int_init(num);
04009         isl_int_init(den);
04010         res = isl_solve_lp(bmap1, 0, obj->block.data, ctx->one, &num, &den);
04011         if (res == isl_lp_empty)
04012                 cmp = 0;
04013         else if (res == isl_lp_ok && isl_int_is_pos(num))
04014                 cmp = 1;
04015         else if ((res == isl_lp_ok && isl_int_is_neg(num)) ||
04016                   res == isl_lp_unbounded)
04017                 cmp = -1;
04018         else
04019                 cmp = -2;
04020         isl_int_clear(num);
04021         isl_int_clear(den);
04022         isl_basic_map_free(bmap1);
04023         isl_vec_free(ctx, obj);
04024         return cmp;
04025 error:
04026         isl_basic_map_free(bmap1);
04027         isl_basic_map_free(bmap2);
04028         return -2;
04029 }

Here is the call graph for this function:

struct isl_set* isl_basic_set_compute_divs ( struct isl_basic_set bset  )  [read]

Definition at line 3006 of file isl_map.c.

03007 {
03008         return (struct isl_set *)
03009                 isl_basic_map_compute_divs((struct isl_basic_map *)bset);
03010 }

Here is the call graph for this function:

int isl_basic_set_contains ( struct isl_basic_set bset,
struct isl_vec vec 
)

Definition at line 1641 of file isl_map.c.

01642 {
01643         return basic_map_contains((struct isl_basic_map *)bset, vec);
01644 }

Here is the call graph for this function:

struct isl_basic_set* isl_basic_set_copy ( struct isl_basic_set bset  )  [read]

Definition at line 403 of file isl_map.c.

00404 {
00405         if (!bset)
00406                 return NULL;
00407 
00408         if (ISL_F_ISSET(bset, ISL_BASIC_SET_FINAL)) {
00409                 bset->ref++;
00410                 return bset;
00411         }
00412         return isl_basic_set_dup(bset);
00413 }

Here is the call graph for this function:

struct isl_basic_set* isl_basic_set_cow ( struct isl_basic_set bset  )  [read]

Definition at line 920 of file isl_map.c.

00921 {
00922         return (struct isl_basic_set *)
00923                 isl_basic_map_cow((struct isl_basic_map *)bset);
00924 }

Here is the call graph for this function:

unsigned isl_basic_set_dim ( const struct isl_basic_set bset,
enum isl_dim_type  type 
)

Definition at line 132 of file isl_map.c.

00134 {
00135         return isl_basic_map_dim((const struct isl_basic_map*)bset, type);
00136 }

Here is the call graph for this function:

int isl_basic_set_dim_is_unique ( struct isl_basic_set bset,
unsigned  dim 
)

Definition at line 4645 of file isl_map.c.

04646 {
04647         int i;
04648         unsigned nparam;
04649 
04650         if (!bset)
04651                 return -1;
04652         nparam = isl_basic_set_n_param(bset);
04653         for (i = 0; i < bset->n_eq; ++i)
04654                 if (!isl_int_is_zero(bset->eq[i][1 + nparam + dim]))
04655                         return 1;
04656         return 0;
04657 }

Here is the call graph for this function:

int isl_basic_set_drop_equality ( struct isl_basic_set bset,
unsigned  pos 
)

Definition at line 541 of file isl_map.c.

00542 {
00543         return isl_basic_map_drop_equality((struct isl_basic_map *)bset, pos);
00544 }

Here is the call graph for this function:

int isl_basic_set_drop_inequality ( struct isl_basic_set bset,
unsigned  pos 
)

Definition at line 622 of file isl_map.c.

00623 {
00624         return isl_basic_map_drop_inequality((struct isl_basic_map *)bset, pos);
00625 }

Here is the call graph for this function:

void isl_basic_set_dump ( struct isl_basic_set bset,
FILE *  out,
int  indent 
)

Definition at line 1339 of file isl_map.c.

01340 {
01341         if (!bset) {
01342                 fprintf(out, "null basic set\n");
01343                 return;
01344         }
01345 
01346         fprintf(out, "%*s", indent, "");
01347         fprintf(out, "ref: %d, nparam: %d, dim: %d, extra: %d, flags: %x\n",
01348                         bset->ref, bset->dim->nparam, bset->dim->n_out,
01349                         bset->extra, bset->flags);
01350         dump((struct isl_basic_map *)bset, out, indent);
01351 }

struct isl_basic_set* isl_basic_set_dup ( struct isl_basic_set bset  )  [read]

Definition at line 395 of file isl_map.c.

00396 {
00397         struct isl_basic_map *dup;
00398 
00399         dup = isl_basic_map_dup((struct isl_basic_map *)bset);
00400         return (struct isl_basic_set *)dup;
00401 }

Here is the call graph for this function:

struct isl_basic_set* isl_basic_set_empty ( struct isl_dim dim  )  [read]

Definition at line 2566 of file isl_map.c.

02567 {
02568         struct isl_basic_set *bset;
02569         bset = isl_basic_set_alloc_dim(dim, 0, 1, 0);
02570         bset = isl_basic_set_set_to_empty(bset);
02571         return bset;
02572 }

Here is the call graph for this function:

struct isl_basic_set* isl_basic_set_empty_like ( struct isl_basic_set model  )  [read]

Definition at line 2594 of file isl_map.c.

02595 {
02596         struct isl_basic_set *bset;
02597         if (!model)
02598                 return NULL;
02599         bset = isl_basic_set_alloc_dim(isl_dim_copy(model->dim), 0, 1, 0);
02600         bset = isl_basic_set_set_to_empty(bset);
02601         return bset;
02602 }

Here is the call graph for this function:

struct isl_basic_set* isl_basic_set_extend ( struct isl_basic_set base,
unsigned  nparam,
unsigned  dim,
unsigned  extra,
unsigned  n_eq,
unsigned  n_ineq 
) [read]

Definition at line 903 of file isl_map.c.

00906 {
00907         return (struct isl_basic_set *)
00908                 isl_basic_map_extend((struct isl_basic_map *)base,
00909                                         nparam, 0, dim, extra, n_eq, n_ineq);
00910 }

Here is the call graph for this function:

struct isl_basic_set* isl_basic_set_extend_constraints ( struct isl_basic_set base,
unsigned  n_eq,
unsigned  n_ineq 
) [read]

Definition at line 912 of file isl_map.c.

00914 {
00915         return (struct isl_basic_set *)
00916                 isl_basic_map_extend_constraints((struct isl_basic_map *)base,
00917                                                     n_eq, n_ineq);
00918 }

Here is the call graph for this function:

struct isl_basic_set* isl_basic_set_extend_dim ( struct isl_basic_set base,
struct isl_dim dim,
unsigned  extra,
unsigned  n_eq,
unsigned  n_ineq 
) [read]

Definition at line 868 of file isl_map.c.

00871 {
00872         return (struct isl_basic_set *)
00873                 isl_basic_map_extend_dim((struct isl_basic_map *)base, dim,
00874                                                         extra, n_eq, n_ineq);
00875 }

Here is the call graph for this function:

int isl_basic_set_fast_dim_has_fixed_lower_bound ( struct isl_basic_set bset,
unsigned  dim,
isl_int val 
)

Definition at line 4123 of file isl_map.c.

04125 {
04126         int i, i_eq = -1, i_ineq = -1;
04127         isl_int *c;
04128         unsigned total;
04129         unsigned nparam;
04130 
04131         if (!bset)
04132                 return -1;
04133         total = isl_basic_set_total_dim(bset);
04134         nparam = isl_basic_set_n_param(bset);
04135         for (i = 0; i < bset->n_eq; ++i) {
04136                 if (isl_int_is_zero(bset->eq[i][1+nparam+dim]))
04137                         continue;
04138                 if (i_eq != -1)
04139                         return 0;
04140                 i_eq = i;
04141         }
04142         for (i = 0; i < bset->n_ineq; ++i) {
04143                 if (!isl_int_is_pos(bset->ineq[i][1+nparam+dim]))
04144                         continue;
04145                 if (i_eq != -1 || i_ineq != -1)
04146                         return 0;
04147                 i_ineq = i;
04148         }
04149         if (i_eq == -1 && i_ineq == -1)
04150                 return 0;
04151         c = i_eq != -1 ? bset->eq[i_eq] : bset->ineq[i_ineq];
04152         /* The coefficient should always be one due to normalization. */
04153         if (!isl_int_is_one(c[1+nparam+dim]))
04154                 return 0;
04155         if (isl_seq_first_non_zero(c+1, nparam+dim) != -1)
04156                 return 0;
04157         if (isl_seq_first_non_zero(c+1+nparam+dim+1,
04158                                         total - nparam - dim - 1) != -1)
04159                 return 0;
04160         if (val)
04161                 isl_int_neg(*val, c[0]);
04162         return 1;
04163 }

Here is the call graph for this function:

int isl_basic_set_fast_is_empty ( struct isl_basic_set bset  ) 

Definition at line 3549 of file isl_map.c.

03550 {
03551         if (!bset)
03552                 return -1;
03553         return ISL_F_ISSET(bset, ISL_BASIC_SET_EMPTY);
03554 }

struct isl_basic_set* isl_basic_set_fix_dim_si ( struct isl_basic_set bset,
unsigned  dim,
int  value 
) [read]

Definition at line 2802 of file isl_map.c.

02804 {
02805         return (struct isl_basic_set *)
02806                 isl_basic_map_fix_si((struct isl_basic_map *)bset,
02807                                         isl_dim_set, dim, value);
02808 }

Here is the call graph for this function:

struct isl_basic_set* isl_basic_set_fix_si ( struct isl_basic_set bset,
enum isl_dim_type  type,
unsigned  pos,
int  value 
) [read]

Definition at line 2788 of file isl_map.c.

02790 {
02791         return (struct isl_basic_set *)
02792                 isl_basic_map_fix_si((struct isl_basic_map *)bset,
02793                                         type, pos, value);
02794 }

Here is the call graph for this function:

void isl_basic_set_free ( struct isl_basic_set bset  ) 

Definition at line 463 of file isl_map.c.

00464 {
00465         isl_basic_map_free((struct isl_basic_map *)bset);
00466 }

Here is the call graph for this function:

int isl_basic_set_free_equality ( struct isl_basic_set bset,
unsigned  n 
)

Definition at line 520 of file isl_map.c.

00521 {
00522         return isl_basic_map_free_equality((struct isl_basic_map *)bset, n);
00523 }

Here is the call graph for this function:

int isl_basic_set_free_inequality ( struct isl_basic_set bset,
unsigned  n 
)

Definition at line 600 of file isl_map.c.

00601 {
00602         return isl_basic_map_free_inequality((struct isl_basic_map *)bset, n);
00603 }

Here is the call graph for this function:

struct isl_basic_set* isl_basic_set_from_basic_map ( struct isl_basic_map bmap  )  [read]

Definition at line 2193 of file isl_map.c.

02194 {
02195         if (!bmap)
02196                 goto error;
02197         if (bmap->dim->n_in == 0)
02198                 return (struct isl_basic_set *)bmap;
02199         bmap = isl_basic_map_cow(bmap);
02200         if (!bmap)
02201                 goto error;
02202         bmap->dim = isl_dim_cow(bmap->dim);
02203         if (!bmap->dim)
02204                 goto error;
02205         bmap->dim->n_out += bmap->dim->n_in;
02206         bmap->dim->n_in = 0;
02207         bmap = isl_basic_map_finalize(bmap);
02208         return (struct isl_basic_set *)bmap;
02209 error:
02210         isl_basic_map_free(bmap);
02211         return NULL;
02212 }

Here is the call graph for this function:

struct isl_basic_set* isl_basic_set_from_underlying_set ( struct isl_basic_set bset,
struct isl_basic_set like 
) [read]

Definition at line 2333 of file isl_map.c.

02335 {
02336         return (struct isl_basic_set *)
02337                 isl_basic_map_overlying_set(bset, (struct isl_basic_map *)like);
02338 }

Here is the call graph for this function:

struct isl_dim* isl_basic_set_get_dim ( struct isl_basic_set bset  )  [read]

Definition at line 223 of file isl_map.c.

00224 {
00225         if (!bset)
00226                 return NULL;
00227         return isl_dim_copy(bset->dim);
00228 }

Here is the call graph for this function:

uint32_t isl_basic_set_get_hash ( struct isl_basic_set bset  ) 

Definition at line 4579 of file isl_map.c.

04580 {
04581         int i;
04582         uint32_t hash;
04583         unsigned total;
04584 
04585         if (!bset)
04586                 return 0;
04587         bset = isl_basic_set_copy(bset);
04588         bset = isl_basic_set_normalize(bset);
04589         if (!bset)
04590                 return 0;
04591         total = isl_basic_set_total_dim(bset);
04592         isl_hash_byte(hash, bset->n_eq & 0xFF);
04593         for (i = 0; i < bset->n_eq; ++i) {
04594                 uint32_t c_hash;
04595                 c_hash = isl_seq_get_hash(bset->eq[i], 1 + total);
04596                 isl_hash_hash(hash, c_hash);
04597         }
04598         isl_hash_byte(hash, bset->n_ineq & 0xFF);
04599         for (i = 0; i < bset->n_ineq; ++i) {
04600                 uint32_t c_hash;
04601                 c_hash = isl_seq_get_hash(bset->ineq[i], 1 + total);
04602                 isl_hash_hash(hash, c_hash);
04603         }
04604         isl_hash_byte(hash, bset->n_div & 0xFF);
04605         for (i = 0; i < bset->n_div; ++i) {
04606                 uint32_t c_hash;
04607                 if (isl_int_is_zero(bset->div[i][0]))
04608                         continue;
04609                 isl_hash_byte(hash, i & 0xFF);
04610                 c_hash = isl_seq_get_hash(bset->div[i], 1 + 1 + total);
04611                 isl_hash_hash(hash, c_hash);
04612         }
04613         isl_basic_set_free(bset);
04614         return hash;
04615 }

Here is the call graph for this function:

struct isl_basic_set* isl_basic_set_intersect ( struct isl_basic_set bset1,
struct isl_basic_set bset2 
) [read]

Definition at line 1698 of file isl_map.c.

01700 {
01701         return (struct isl_basic_set *)
01702                 isl_basic_map_intersect(
01703                         (struct isl_basic_map *)bset1,
01704                         (struct isl_basic_map *)bset2);
01705 }

Here is the call graph for this function:

struct isl_basic_set* isl_basic_set_interval ( struct isl_ctx *  ctx,
isl_int  min,
isl_int  max 
) [read]

Definition at line 4402 of file isl_map.c.

04404 {
04405         int k;
04406         struct isl_basic_set *bset = NULL;
04407 
04408         bset = isl_basic_set_alloc(ctx, 0, 1, 0, 0, 2);
04409         if (!bset)
04410                 goto error;
04411 
04412         k = isl_basic_set_alloc_inequality(bset);
04413         if (k < 0)
04414                 goto error;
04415         isl_int_set_si(bset->ineq[k][1], 1);
04416         isl_int_neg(bset->ineq[k][0], min);
04417 
04418         k = isl_basic_set_alloc_inequality(bset);
04419         if (k < 0)
04420                 goto error;
04421         isl_int_set_si(bset->ineq[k][1], -1);
04422         isl_int_set(bset->ineq[k][0], max);
04423 
04424         return bset;
04425 error:
04426         isl_basic_set_free(bset);
04427         return NULL;
04428 }

Here is the call graph for this function:

int isl_basic_set_is_empty ( struct isl_basic_set bset  ) 

Definition at line 3556 of file isl_map.c.

03557 {
03558         return isl_basic_map_is_empty((struct isl_basic_map *)bset);
03559 }

Here is the call graph for this function:

int isl_basic_set_is_equal ( struct isl_basic_set bset1,
struct isl_basic_set bset2 
)

Definition at line 3395 of file isl_map.c.

03397 {
03398         return isl_basic_map_is_equal(
03399                 (struct isl_basic_map *)bset1, (struct isl_basic_map *)bset2);
03400 }

Here is the call graph for this function:

int isl_basic_set_is_universe ( struct isl_basic_set bset  ) 

Definition at line 3490 of file isl_map.c.

03491 {
03492         if (!bset)
03493                 return -1;
03494         return bset->n_eq == 0 && bset->n_ineq == 0;
03495 }

struct isl_set* isl_basic_set_lexmin ( struct isl_basic_set bset  )  [read]

Definition at line 2924 of file isl_map.c.

02925 {
02926         struct isl_basic_map *bmap = NULL;
02927         struct isl_basic_set *dom = NULL;
02928         struct isl_map *min;
02929         struct isl_dim *param_dim;
02930 
02931         if (!bset)
02932                 goto error;
02933         bmap = isl_basic_map_from_basic_set(bset, isl_dim_copy(bset->dim));
02934         if (!bmap)
02935                 goto error;
02936         param_dim = isl_dim_domain(isl_dim_copy(bmap->dim));
02937         dom = isl_basic_set_universe(param_dim);
02938         if (!dom)
02939                 goto error;
02940         min = isl_basic_map_lexmin(bmap, dom, NULL);
02941         return isl_map_range(min);
02942 error:
02943         isl_basic_map_free(bmap);
02944         return NULL;
02945 }

Here is the call graph for this function:

struct isl_basic_set* isl_basic_set_lower_bound_dim ( struct isl_basic_set bset,
unsigned  dim,
isl_int  value 
) [read]

Definition at line 2844 of file isl_map.c.

02846 {
02847         int j;
02848         unsigned nparam;
02849 
02850         bset = isl_basic_set_cow(bset);
02851         bset = isl_basic_set_extend_constraints(bset, 0, 1);
02852         j = isl_basic_set_alloc_inequality(bset);
02853         if (j < 0)
02854                 goto error;
02855         isl_seq_clr(bset->ineq[j], 1 + isl_basic_set_total_dim(bset));
02856         isl_int_set_si(bset->ineq[j][1 + isl_basic_set_n_param(bset) + dim], 1);
02857         isl_int_neg(bset->ineq[j][0], value);
02858         bset = isl_basic_set_simplify(bset);
02859         return isl_basic_set_finalize(bset);
02860 error:
02861         isl_basic_set_free(bset);
02862         return NULL;
02863 }

Here is the call graph for this function:

unsigned isl_basic_set_n_dim ( const struct isl_basic_set bset  ) 

Definition at line 138 of file isl_map.c.

00139 {
00140         return bset->dim->n_out;
00141 }

unsigned isl_basic_set_n_param ( const struct isl_basic_set bset  ) 

Definition at line 143 of file isl_map.c.

00144 {
00145         return bset->dim->nparam;
00146 }

struct isl_basic_set* isl_basic_set_normalize ( struct isl_basic_set bset  )  [read]

Definition at line 4249 of file isl_map.c.

04250 {
04251         return (struct isl_basic_set *)isl_basic_map_normalize(
04252                                                 (struct isl_basic_map *)bset);
04253 }

Here is the call graph for this function:

struct isl_basic_set* isl_basic_set_product ( struct isl_basic_set_list list  )  [read]

Definition at line 4432 of file isl_map.c.

04433 {
04434         int i;
04435         unsigned dim;
04436         unsigned nparam;
04437         unsigned extra;
04438         unsigned n_eq;
04439         unsigned n_ineq;
04440         struct isl_basic_set *product = NULL;
04441 
04442         if (!list)
04443                 goto error;
04444         isl_assert(list->ctx, list->n > 0, goto error);
04445         isl_assert(list->ctx, list->p[0], goto error);
04446         nparam = isl_basic_set_n_param(list->p[0]);
04447         dim = isl_basic_set_n_dim(list->p[0]);
04448         extra = list->p[0]->n_div;
04449         n_eq = list->p[0]->n_eq;
04450         n_ineq = list->p[0]->n_ineq;
04451         for (i = 1; i < list->n; ++i) {
04452                 isl_assert(list->ctx, list->p[i], goto error);
04453                 isl_assert(list->ctx,
04454                     nparam == isl_basic_set_n_param(list->p[i]), goto error);
04455                 dim += isl_basic_set_n_dim(list->p[i]);
04456                 extra += list->p[i]->n_div;
04457                 n_eq += list->p[i]->n_eq;
04458                 n_ineq += list->p[i]->n_ineq;
04459         }
04460         product = isl_basic_set_alloc(list->ctx, nparam, dim, extra,
04461                                         n_eq, n_ineq);
04462         if (!product)
04463                 goto error;
04464         dim = 0;
04465         for (i = 0; i < list->n; ++i) {
04466                 isl_basic_set_add_constraints(product,
04467                                         isl_basic_set_copy(list->p[i]), dim);
04468                 dim += isl_basic_set_n_dim(list->p[i]);
04469         }
04470         isl_basic_set_list_free(list);
04471         return product;
04472 error:
04473         isl_basic_set_free(product);
04474         isl_basic_set_list_free(list);
04475         return NULL;
04476 }

Here is the call graph for this function:

struct isl_basic_set* isl_basic_set_project_out ( struct isl_basic_set bset,
unsigned  n,
unsigned  flags 
) [read]

Definition at line 1784 of file isl_map.c.

01786 {
01787         int i;
01788         size_t row_size;
01789         isl_int **new_div;
01790         isl_int *old;
01791 
01792         if (!bset)
01793                 return NULL;
01794 
01795         isl_assert(bset->ctx, n <= isl_basic_set_n_dim(bset), goto error);
01796 
01797         if (n == 0)
01798                 return bset;
01799 
01800         bset = isl_basic_set_cow(bset);
01801 
01802         row_size = 1 + isl_dim_total(bset->dim) + bset->extra;
01803         old = bset->block2.data;
01804         bset->block2 = isl_blk_extend(bset->ctx, bset->block2,
01805                                         (bset->extra + n) * (1 + row_size));
01806         if (!bset->block2.data)
01807                 goto error;
01808         new_div = isl_alloc_array(ctx, isl_int *, bset->extra + n);
01809         if (!new_div)
01810                 goto error;
01811         for (i = 0; i < n; ++i) {
01812                 new_div[i] = bset->block2.data +
01813                                 (bset->extra + i) * (1 + row_size);
01814                 isl_seq_clr(new_div[i], 1 + row_size);
01815         }
01816         for (i = 0; i < bset->extra; ++i)
01817                 new_div[n + i] = bset->block2.data + (bset->div[i] - old);
01818         free(bset->div);
01819         bset->div = new_div;
01820         bset->n_div += n;
01821         bset->extra += n;
01822         bset->dim = isl_dim_drop_outputs(bset->dim,
01823                                             isl_basic_set_n_dim(bset) - n, n);
01824         if (!bset->dim)
01825                 goto error;
01826         bset = isl_basic_set_simplify(bset);
01827         return isl_basic_set_finalize(bset);
01828 error:
01829         isl_basic_set_free(bset);
01830         return NULL;
01831 }

Here is the call graph for this function:

struct isl_basic_set* isl_basic_set_remove_dims ( struct isl_basic_set bset,
unsigned  first,
unsigned  n 
) [read]

Definition at line 1214 of file isl_map.c.

01216 {
01217         unsigned nparam = isl_basic_set_n_param(bset);
01218         bset = isl_basic_set_eliminate_vars(bset, nparam + first, n);
01219         bset = isl_basic_set_drop_dims(bset, first, n);
01220         return bset;
01221 }

Here is the call graph for this function:

struct isl_basic_set* isl_basic_set_remove_divs ( struct isl_basic_set bset  )  [read]

Definition at line 1127 of file isl_map.c.

01128 {
01129         bset = isl_basic_set_eliminate_vars(bset, isl_dim_total(bset->dim),
01130                                                 bset->n_div);
01131         if (!bset)
01132                 return NULL;
01133         bset->n_div = 0;
01134         return bset;
01135 }

Here is the call graph for this function:

struct isl_basic_set* isl_basic_set_set_to_empty ( struct isl_basic_set bset  )  [read]

Definition at line 1060 of file isl_map.c.

01061 {
01062         return (struct isl_basic_set *)
01063                 isl_basic_map_set_to_empty((struct isl_basic_map *)bset);
01064 }

Here is the call graph for this function:

struct isl_basic_set* isl_basic_set_swap_vars ( struct isl_basic_set bset,
unsigned  n 
) [read]

Definition at line 969 of file isl_map.c.

00971 {
00972         int i;
00973         struct isl_blk blk;
00974         unsigned dim;
00975         unsigned nparam;
00976 
00977         if (!bset)
00978                 goto error;
00979 
00980         nparam = isl_basic_set_n_param(bset);
00981         dim = isl_basic_set_n_dim(bset);
00982         isl_assert(bset->ctx, n <= dim, goto error);
00983 
00984         if (n == dim)
00985                 return bset;
00986 
00987         bset = isl_basic_set_cow(bset);
00988         if (!bset)
00989                 return NULL;
00990 
00991         blk = isl_blk_alloc(bset->ctx, dim);
00992         if (isl_blk_is_error(blk))
00993                 goto error;
00994 
00995         for (i = 0; i < bset->n_eq; ++i)
00996                 swap_vars(blk,
00997                           bset->eq[i]+1+nparam, n, dim - n);
00998 
00999         for (i = 0; i < bset->n_ineq; ++i)
01000                 swap_vars(blk,
01001                           bset->ineq[i]+1+nparam, n, dim - n);
01002 
01003         for (i = 0; i < bset->n_div; ++i)
01004                 swap_vars(blk,
01005                           bset->div[i]+1+1+nparam, n, dim - n);
01006 
01007         isl_blk_free(bset->ctx, blk);
01008 
01009         ISL_F_CLR(bset, ISL_BASIC_SET_NORMALIZED);
01010         return bset;
01011 
01012 error:
01013         isl_basic_set_free(bset);
01014         return NULL;
01015 }

Here is the call graph for this function:

unsigned isl_basic_set_total_dim ( const struct isl_basic_set bset  ) 

Definition at line 148 of file isl_map.c.

00149 {
00150         return isl_dim_total(bset->dim) + bset->n_div;
00151 }

Here is the call graph for this function:

struct isl_set* isl_basic_set_union ( struct isl_basic_set bset1,
struct isl_basic_set bset2 
) [read]

Definition at line 3582 of file isl_map.c.

03584 {
03585         return (struct isl_set *)isl_basic_map_union(
03586                                             (struct isl_basic_map *)bset1,
03587                                             (struct isl_basic_map *)bset2);
03588 }

Here is the call graph for this function:

struct isl_basic_set* isl_basic_set_universe ( struct isl_dim dim  )  [read]

Definition at line 2611 of file isl_map.c.

02612 {
02613         struct isl_basic_set *bset;
02614         bset = isl_basic_set_alloc_dim(dim, 0, 0, 0);
02615         return bset;
02616 }

Here is the call graph for this function:

struct isl_basic_set* isl_basic_set_universe_like ( struct isl_basic_set model  )  [read]

Definition at line 2618 of file isl_map.c.

02619 {
02620         if (!model)
02621                 return NULL;
02622         return isl_basic_set_alloc_dim(isl_dim_copy(model->dim), 0, 0, 0);
02623 }

Here is the call graph for this function:

static struct isl_dim_map* isl_dim_map_alloc ( struct isl_ctx *  ctx,
unsigned  len 
) [static, read]

Definition at line 22 of file isl_map.c.

00023 {
00024         int i;
00025         struct isl_dim_map *dim_map;
00026         dim_map = isl_alloc(ctx, struct isl_dim_map,
00027                                 sizeof(struct isl_dim_map) + len * sizeof(int));
00028         if (!dim_map)
00029                 return NULL;
00030         dim_map->len = 1 + len;
00031         dim_map->pos[0] = 0;
00032         for (i = 0; i < len; ++i)
00033                 dim_map->pos[1 + i] = -1;
00034         return dim_map;
00035 }

static void isl_dim_map_dim ( struct isl_dim_map dim_map,
struct isl_dim dim,
enum isl_dim_type  type,
unsigned  dst_pos 
) [static]

Definition at line 55 of file isl_map.c.

00057 {
00058         int i;
00059         unsigned src_pos;
00060 
00061         if (!dim_map || !dim)
00062                 return;
00063         
00064         src_pos = pos(dim, type);
00065         for (i = 0; i < n(dim, type); ++i)
00066                 dim_map->pos[1 + dst_pos + i] = src_pos + i;
00067 }

Here is the call graph for this function:

static void isl_dim_map_div ( struct isl_dim_map dim_map,
struct isl_basic_map bmap,
unsigned  dst_pos 
) [static]

Definition at line 69 of file isl_map.c.

00071 {
00072         int i;
00073         unsigned src_pos;
00074 
00075         if (!dim_map || !bmap)
00076                 return;
00077         
00078         src_pos = 1 + isl_dim_total(bmap->dim);
00079         for (i = 0; i < bmap->n_div; ++i)
00080                 dim_map->pos[1 + dst_pos + i] = src_pos + i;
00081 }

Here is the call graph for this function:

static void isl_dim_map_dump ( struct isl_dim_map dim_map  )  [static]

Definition at line 83 of file isl_map.c.

00084 {
00085         int i;
00086 
00087         for (i = 0; i < dim_map->len; ++i)
00088                 fprintf(stderr, "%d -> %d; ", i, dim_map->pos[i]);
00089         fprintf(stderr, "\n");
00090 }

int isl_inequality_negate ( struct isl_basic_map bmap,
unsigned  pos 
)

Definition at line 1369 of file isl_map.c.

01370 {
01371         unsigned total;
01372         if (!bmap)
01373                 return -1;
01374         total = isl_basic_map_total_dim(bmap);
01375         isl_assert(bmap->ctx, pos < bmap->n_ineq, return -1);
01376         isl_seq_neg(bmap->ineq[pos], bmap->ineq[pos], 1 + total);
01377         isl_int_sub_ui(bmap->ineq[pos][0], bmap->ineq[pos][0], 1);
01378         ISL_F_CLR(bmap, ISL_BASIC_MAP_NORMALIZED);
01379         return 0;
01380 }

Here is the call graph for this function:

struct isl_map* isl_map_add ( struct isl_map map,
struct isl_basic_map bmap 
) [read]

Definition at line 2689 of file isl_map.c.

02690 {
02691         if (!bmap || !map)
02692                 goto error;
02693         isl_assert(map->ctx, isl_dim_equal(map->dim, bmap->dim), goto error);
02694         isl_assert(map->ctx, map->n < map->size, goto error);
02695         map->p[map->n] = bmap;
02696         map->n++;
02697         ISL_F_CLR(map, ISL_MAP_NORMALIZED);
02698         return map;
02699 error:
02700         if (map)
02701                 isl_map_free(map);
02702         if (bmap)
02703                 isl_basic_map_free(bmap);
02704         return NULL;
02705 }

Here is the call graph for this function:

struct isl_map* isl_map_align_divs ( struct isl_map map  )  [read]

Definition at line 3678 of file isl_map.c.

03679 {
03680         int i;
03681 
03682         map = isl_map_compute_divs(map);
03683         map = isl_map_cow(map);
03684         if (!map)
03685                 return NULL;
03686 
03687         for (i = 1; i < map->n; ++i)
03688                 map->p[0] = isl_basic_map_align_divs(map->p[0], map->p[i]);
03689         for (i = 1; i < map->n; ++i)
03690                 map->p[i] = isl_basic_map_align_divs(map->p[i], map->p[0]);
03691 
03692         ISL_F_CLR(map, ISL_MAP_NORMALIZED);
03693         return map;
03694 }

Here is the call graph for this function:

struct isl_map* isl_map_alloc ( struct isl_ctx *  ctx,
unsigned  nparam,
unsigned  in,
unsigned  out,
int  n,
unsigned  flags 
) [read]

Definition at line 2542 of file isl_map.c.

02545 {
02546         struct isl_map *map;
02547         struct isl_dim *dims;
02548 
02549         dims = isl_dim_alloc(ctx, nparam, in, out);
02550         if (!dims)
02551                 return NULL;
02552 
02553         map = isl_map_alloc_dim(dims, n, flags);
02554         return map;
02555 }

Here is the call graph for this function:

struct isl_map* isl_map_alloc_dim ( struct isl_dim dim,
int  n,
unsigned  flags 
) [read]

Definition at line 2516 of file isl_map.c.

02517 {
02518         struct isl_map *map;
02519 
02520         if (!dim)
02521                 return NULL;
02522         isl_assert(dim->ctx, n >= 0, return NULL);
02523         map = isl_alloc(dim->ctx, struct isl_map,
02524                         sizeof(struct isl_map) +
02525                         n * sizeof(struct isl_basic_map *));
02526         if (!map)
02527                 goto error;
02528 
02529         map->ctx = dim->ctx;
02530         isl_ctx_ref(map->ctx);
02531         map->ref = 1;
02532         map->size = n;
02533         map->n = 0;
02534         map->dim = dim;
02535         map->flags = flags;
02536         return map;
02537 error:
02538         isl_dim_free(dim);
02539         return NULL;
02540 }

Here is the call graph for this function:

struct isl_map* isl_map_apply_domain ( struct isl_map map1,
struct isl_map map2 
) [read]

Definition at line 3165 of file isl_map.c.

03167 {
03168         if (!map1 || !map2)
03169                 goto error;
03170         map1 = isl_map_reverse(map1);
03171         map1 = isl_map_apply_range(map1, map2);
03172         return isl_map_reverse(map1);
03173 error:
03174         isl_map_free(map1);
03175         isl_map_free(map2);
03176         return NULL;
03177 }

Here is the call graph for this function:

struct isl_map* isl_map_apply_range ( struct isl_map map1,
struct isl_map map2 
) [read]

Definition at line 3179 of file isl_map.c.

03181 {
03182         struct isl_dim *dim_result;
03183         struct isl_map *result;
03184         int i, j;
03185         unsigned nparam;
03186         unsigned n_in;
03187         unsigned n_out;
03188 
03189         if (!map1 || !map2)
03190                 goto error;
03191 
03192         dim_result = isl_dim_join(isl_dim_copy(map1->dim),
03193                                   isl_dim_copy(map2->dim));
03194 
03195         result = isl_map_alloc_dim(dim_result, map1->n * map2->n, 0);
03196         if (!result)
03197                 goto error;
03198         for (i = 0; i < map1->n; ++i)
03199                 for (j = 0; j < map2->n; ++j) {
03200                         result = isl_map_add(result,
03201                             isl_basic_map_apply_range(
03202                                 isl_basic_map_copy(map1->p[i]),
03203                                 isl_basic_map_copy(map2->p[j])));
03204                         if (!result)
03205                                 goto error;
03206                 }
03207         isl_map_free(map1);
03208         isl_map_free(map2);
03209         if (result && result->n <= 1)
03210                 ISL_F_SET(result, ISL_MAP_DISJOINT);
03211         return result;
03212 error:
03213         isl_map_free(map1);
03214         isl_map_free(map2);
03215         return NULL;
03216 }

Here is the call graph for this function:

int isl_map_compatible_domain ( struct isl_map map,
struct isl_set set 
)

Definition at line 203 of file isl_map.c.

00204 {
00205         return map->dim->n_in == set->dim->n_out &&
00206                map->dim->nparam == set->dim->nparam;
00207 }

struct isl_map* isl_map_compute_divs ( struct isl_map map  )  [read]

Definition at line 2983 of file isl_map.c.

02984 {
02985         int i;
02986         struct isl_map *res;
02987 
02988         if (!map)
02989                 return NULL;
02990         if (map->n == 0)
02991                 return map;
02992         res = isl_basic_map_compute_divs(isl_basic_map_copy(map->p[0]));
02993         for (i = 1 ; i < map->n; ++i) {
02994                 struct isl_map *r2;
02995                 r2 = isl_basic_map_compute_divs(isl_basic_map_copy(map->p[i]));
02996                 if (ISL_F_ISSET(map, ISL_MAP_DISJOINT))
02997                         res = isl_map_union_disjoint(res, r2);
02998                 else
02999                         res = isl_map_union(res, r2);
03000         }
03001         isl_map_free(map);
03002 
03003         return res;
03004 }

Here is the call graph for this function:

struct isl_map* isl_map_copy ( struct isl_map map  )  [read]

Definition at line 436 of file isl_map.c.

00437 {
00438         if (!map)
00439                 return NULL;
00440 
00441         map->ref++;
00442         return map;
00443 }

struct isl_basic_map* isl_map_copy_basic_map ( struct isl_map map  )  [read]

Definition at line 3904 of file isl_map.c.

03905 {
03906         struct isl_basic_map *bmap;
03907         if (!map || map->n == 0)
03908                 return NULL;
03909         bmap = map->p[map->n-1];
03910         isl_assert(map->ctx, ISL_F_ISSET(bmap, ISL_BASIC_SET_FINAL), return NULL);
03911         return isl_basic_map_copy(bmap);
03912 }

Here is the call graph for this function:

struct isl_map* isl_map_cow ( struct isl_map map  )  [read]

Definition at line 950 of file isl_map.c.

00951 {
00952         if (!map)
00953                 return NULL;
00954 
00955         if (map->ref == 1)
00956                 return map;
00957         map->ref--;
00958         return isl_map_dup(map);
00959 }

Here is the call graph for this function:

struct isl_set* isl_map_deltas ( struct isl_map map  )  [read]

Definition at line 3256 of file isl_map.c.

03257 {
03258         int i;
03259         struct isl_set *result;
03260 
03261         if (!map)
03262                 return NULL;
03263 
03264         isl_assert(map->ctx, isl_map_n_in(map) == isl_map_n_out(map), goto error);
03265         result = isl_set_alloc(map->ctx, isl_map_n_param(map),
03266                                         isl_map_n_in(map), map->n, map->flags);
03267         if (!result)
03268                 goto error;
03269         for (i = 0; i < map->n; ++i)
03270                 result = isl_set_add(result,
03271                           isl_basic_map_deltas(isl_basic_map_copy(map->p[i])));
03272         isl_map_free(map);
03273         return result;
03274 error:
03275         isl_map_free(map);
03276         return NULL;
03277 }

Here is the call graph for this function:

unsigned isl_map_dim ( const struct isl_map map,
enum isl_dim_type  type 
)

Definition at line 105 of file isl_map.c.

00106 {
00107         return n(map->dim, type);
00108 }

Here is the call graph for this function:

struct isl_set* isl_map_domain ( struct isl_map map  )  [read]

Definition at line 3018 of file isl_map.c.

03019 {
03020         int i;
03021         struct isl_set *set;
03022 
03023         if (!map)
03024                 goto error;
03025 
03026         map = isl_map_cow(map);
03027         if (!map)
03028                 return NULL;
03029 
03030         set = (struct isl_set *)map;
03031         set->dim = isl_dim_domain(set->dim);
03032         if (!set->dim)
03033                 goto error;
03034         for (i = 0; i < map->n; ++i) {
03035                 set->p[i] = isl_basic_map_domain(map->p[i]);
03036                 if (!set->p[i])
03037                         goto error;
03038         }
03039         ISL_F_CLR(set, ISL_MAP_DISJOINT);
03040         ISL_F_CLR(set, ISL_SET_NORMALIZED);
03041         return set;
03042 error:
03043         isl_map_free(map);
03044         return NULL;
03045 }

Here is the call graph for this function:

struct isl_map* isl_map_drop_basic_map ( struct isl_map map,
struct isl_basic_map bmap 
) [read]

Definition at line 3919 of file isl_map.c.

03921 {
03922         int i;
03923 
03924         if (!map || !bmap)
03925                 goto error;
03926         for (i = map->n-1; i >= 0; --i) {
03927                 if (map->p[i] != bmap)
03928                         continue;
03929                 map = isl_map_cow(map);
03930                 if (!map)
03931                         goto error;
03932                 isl_basic_map_free(map->p[i]);
03933                 if (i != map->n-1) {
03934                         ISL_F_CLR(map, ISL_SET_NORMALIZED);
03935                         map->p[i] = map->p[map->n-1];
03936                 }
03937                 map->n--;
03938                 return map;
03939         }
03940         isl_basic_map_free(bmap);
03941         return map;
03942 error:
03943         isl_map_free(map);
03944         isl_basic_map_free(bmap);
03945         return NULL;
03946 }

Here is the call graph for this function:

void isl_map_dump ( struct isl_map map,
FILE *  out,
int  indent 
)

Definition at line 1523 of file isl_map.c.

01524 {
01525         int i;
01526 
01527         if (!map) {
01528                 fprintf(out, "null map\n");
01529                 return;
01530         }
01531 
01532         fprintf(out, "%*s", indent, "");
01533         fprintf(out, "ref: %d, n: %d, nparam: %d, in: %d, out: %d, "
01534                      "flags: %x, n_name: %d\n",
01535                         map->ref, map->n, map->dim->nparam, map->dim->n_in,
01536                         map->dim->n_out, map->flags, map->dim->n_name);
01537         for (i = 0; i < map->n; ++i) {
01538                 fprintf(out, "%*s", indent, "");
01539                 fprintf(out, "basic map %d:\n", i);
01540                 isl_basic_map_dump(map->p[i], out, indent+4);
01541         }
01542 }

Here is the call graph for this function:

struct isl_map* isl_map_dup ( struct isl_map map  )  [read]

Definition at line 2676 of file isl_map.c.

02677 {
02678         int i;
02679         struct isl_map *dup;
02680 
02681         if (!map)
02682                 return NULL;
02683         dup = isl_map_alloc_dim(isl_dim_copy(map->dim), map->n, map->flags);
02684         for (i = 0; i < map->n; ++i)
02685                 dup = isl_map_add(dup, isl_basic_map_copy(map->p[i]));
02686         return dup;
02687 }

Here is the call graph for this function:

struct isl_map* isl_map_empty ( struct isl_dim dim  )  [read]

Definition at line 2625 of file isl_map.c.

02626 {
02627         return isl_map_alloc_dim(dim, 0, ISL_MAP_DISJOINT);
02628 }

Here is the call graph for this function:

struct isl_map* isl_map_empty_like ( struct isl_map model  )  [read]

Definition at line 2630 of file isl_map.c.

02631 {
02632         if (!model)
02633                 return NULL;
02634         return isl_map_alloc_dim(isl_dim_copy(model->dim), 0, ISL_MAP_DISJOINT);
02635 }

Here is the call graph for this function:

struct isl_map* isl_map_empty_like_basic_map ( struct isl_basic_map model  )  [read]

Definition at line 2637 of file isl_map.c.

02638 {
02639         if (!model)
02640                 return NULL;
02641         return isl_map_alloc_dim(isl_dim_copy(model->dim), 0, ISL_MAP_DISJOINT);
02642 }

Here is the call graph for this function:

struct isl_map* isl_map_extend ( struct isl_map base,
unsigned  nparam,
unsigned  n_in,
unsigned  n_out 
) [read]

Definition at line 2724 of file isl_map.c.

02726 {
02727         int i;
02728 
02729         base = isl_map_cow(base);
02730         if (!base)
02731                 return NULL;
02732 
02733         base->dim = isl_dim_extend(base->dim, nparam, n_in, n_out);
02734         if (!base->dim)
02735                 goto error;
02736         for (i = 0; i < base->n; ++i) {
02737                 base->p[i] = isl_basic_map_extend_dim(base->p[i],
02738                                 isl_dim_copy(base->dim), 0, 0, 0);
02739                 if (!base->p[i])
02740                         goto error;
02741         }
02742         return base;
02743 error:
02744         isl_map_free(base);
02745         return NULL;
02746 }

Here is the call graph for this function:

static int isl_map_fast_has_fixed_var ( struct isl_map map,
unsigned  pos,
isl_int val 
) [static]

Definition at line 4060 of file isl_map.c.

04062 {
04063         int i;
04064         isl_int v;
04065         isl_int tmp;
04066         int fixed;
04067 
04068         if (!map)
04069                 return -1;
04070         if (map->n == 0)
04071                 return 0;
04072         if (map->n == 1)
04073                 return isl_basic_map_fast_has_fixed_var(map->p[0], pos, val); 
04074         isl_int_init(v);
04075         isl_int_init(tmp);
04076         fixed = isl_basic_map_fast_has_fixed_var(map->p[0], pos, &v); 
04077         for (i = 1; fixed == 1 && i < map->n; ++i) {
04078                 fixed = isl_basic_map_fast_has_fixed_var(map->p[i], pos, &tmp); 
04079                 if (fixed == 1 && isl_int_ne(tmp, v))
04080                         fixed = 0;
04081         }
04082         if (val)
04083                 isl_int_set(*val, v);
04084         isl_int_clear(tmp);
04085         isl_int_clear(v);
04086         return fixed;
04087 }

Here is the call graph for this function:

int isl_map_fast_input_is_fixed ( struct isl_map map,
unsigned  in,
isl_int val 
)

Definition at line 4115 of file isl_map.c.

04116 {
04117         return isl_map_fast_has_fixed_var(map, isl_map_n_param(map) + in, val);
04118 }

Here is the call graph for this function:

int isl_map_fast_is_empty ( struct isl_map map  ) 

Definition at line 3419 of file isl_map.c.

03420 {
03421         return map->n == 0;
03422 }

int isl_map_fast_is_equal ( struct isl_map map1,
struct isl_map map2 
)

Definition at line 4360 of file isl_map.c.

04361 {
04362         int i;
04363         int equal;
04364 
04365         if (!map1 || !map2)
04366                 return -1;
04367 
04368         if (map1 == map2)
04369                 return 1;
04370         if (!isl_dim_equal(map1->dim, map2->dim))
04371                 return 0;
04372 
04373         map1 = isl_map_copy(map1);
04374         map2 = isl_map_copy(map2);
04375         map1 = isl_map_normalize(map1);
04376         map2 = isl_map_normalize(map2);
04377         if (!map1 || !map2)
04378                 goto error;
04379         equal = map1->n == map2->n;
04380         for (i = 0; equal && i < map1->n; ++i) {
04381                 equal = isl_basic_map_fast_is_equal(map1->p[i], map2->p[i]);
04382                 if (equal < 0)
04383                         goto error;
04384         }
04385         isl_map_free(map1);
04386         isl_map_free(map2);
04387         return equal;
04388 error:
04389         isl_map_free(map1);
04390         isl_map_free(map2);
04391         return -1;
04392 }

Here is the call graph for this function:

struct isl_map* isl_map_fix_input_si ( struct isl_map map,
unsigned  input,
int  value 
) [read]

Definition at line 2832 of file isl_map.c.

02834 {
02835         return isl_map_fix_si(map, isl_dim_in, input, value);
02836 }

Here is the call graph for this function:

struct isl_map* isl_map_fix_si ( struct isl_map map,
enum isl_dim_type  type,
unsigned  pos,
int  value 
) [read]

Definition at line 2810 of file isl_map.c.

02812 {
02813         int i;
02814 
02815         map = isl_map_cow(map);
02816         if (!map)
02817                 return NULL;
02818 
02819         isl_assert(ctx, pos < isl_map_dim(map, type), goto error);
02820         for (i = 0; i < map->n; ++i) {
02821                 map->p[i] = isl_basic_map_fix_si(map->p[i], type, pos, value);
02822                 if (!map->p[i])
02823                         goto error;
02824         }
02825         ISL_F_CLR(map, ISL_MAP_NORMALIZED);
02826         return map;
02827 error:
02828         isl_map_free(map);
02829         return NULL;
02830 }

Here is the call graph for this function:

void isl_map_free ( struct isl_map map  ) 

Definition at line 2707 of file isl_map.c.

02708 {
02709         int i;
02710 
02711         if (!map)
02712                 return;
02713 
02714         if (--map->ref > 0)
02715                 return;
02716 
02717         isl_ctx_deref(map->ctx);
02718         for (i = 0; i < map->n; ++i)
02719                 isl_basic_map_free(map->p[i]);
02720         isl_dim_free(map->dim);
02721         free(map);
02722 }

Here is the call graph for this function:

struct isl_map* isl_map_from_basic_map ( struct isl_basic_map bmap  )  [read]

Definition at line 1454 of file isl_map.c.

01455 {
01456         struct isl_map *map;
01457 
01458         if (!bmap)
01459                 return NULL;
01460 
01461         map = isl_map_alloc_dim(isl_dim_copy(bmap->dim), 1, ISL_MAP_DISJOINT);
01462         if (!map) {
01463                 isl_basic_map_free(bmap);
01464                 return NULL;
01465         }
01466         return isl_map_add(map, bmap);
01467 }

Here is the call graph for this function:

struct isl_map* isl_map_from_range ( struct isl_set set  )  [read]

Definition at line 2484 of file isl_map.c.

02485 {
02486         return (struct isl_map *)set;
02487 }

struct isl_map* isl_map_from_set ( struct isl_set set,
struct isl_dim dim 
) [read]

Definition at line 2459 of file isl_map.c.

02460 {
02461         int i;
02462         struct isl_map *map = NULL;
02463 
02464         set = isl_set_cow(set);
02465         if (!set || !dim)
02466                 goto error;
02467         isl_assert(set->ctx, isl_dim_compatible(set->dim, dim), goto error);
02468         map = (struct isl_map *)set;
02469         for (i = 0; i < set->n; ++i) {
02470                 map->p[i] = isl_basic_map_from_basic_set(
02471                                 set->p[i], isl_dim_copy(dim));
02472                 if (!map->p[i])
02473                         goto error;
02474         }
02475         isl_dim_free(map->dim);
02476         map->dim = dim;
02477         return map;
02478 error:
02479         isl_dim_free(dim);
02480         isl_set_free(set);
02481         return NULL;
02482 }

Here is the call graph for this function:

struct isl_map* isl_map_identity ( struct isl_dim set_dim  )  [read]

Definition at line 3332 of file isl_map.c.

03333 {
03334         struct isl_dim *dim = isl_dim_map(set_dim);
03335         if (!dim)
03336                 return NULL;
03337         return map_identity(dim);
03338 }

Here is the call graph for this function:

struct isl_map* isl_map_identity_like ( struct isl_basic_map model  )  [read]

Definition at line 3340 of file isl_map.c.

03341 {
03342         if (!model || !model->dim)
03343                 return NULL;
03344         isl_assert(model->ctx,
03345                         model->dim->n_in == model->dim->n_out, return NULL);
03346         return map_identity(isl_dim_copy(model->dim));
03347 }

Here is the call graph for this function:

struct isl_map* isl_map_intersect ( struct isl_map map1,
struct isl_map map2 
) [read]

Definition at line 1707 of file isl_map.c.

01708 {
01709         unsigned flags = 0;
01710         struct isl_map *result;
01711         int i, j;
01712 
01713         if (!map1 || !map2)
01714                 goto error;
01715 
01716         isl_assert(map1->ctx, isl_dim_match(map1->dim, isl_dim_param,
01717                                          map2->dim, isl_dim_param), goto error);
01718         if (isl_dim_total(map1->dim) ==
01719                                 isl_dim_size(map1->dim, isl_dim_param) &&
01720             isl_dim_total(map2->dim) != isl_dim_size(map2->dim, isl_dim_param))
01721                 return isl_map_intersect(map2, map1);
01722 
01723         if (isl_dim_total(map2->dim) != isl_dim_size(map2->dim, isl_dim_param))
01724                 isl_assert(map1->ctx,
01725                             isl_dim_equal(map1->dim, map2->dim), goto error);
01726 
01727         if (ISL_F_ISSET(map1, ISL_MAP_DISJOINT) &&
01728             ISL_F_ISSET(map2, ISL_MAP_DISJOINT))
01729                 ISL_FL_SET(flags, ISL_MAP_DISJOINT);
01730 
01731         result = isl_map_alloc_dim(isl_dim_copy(map1->dim),
01732                                 map1->n * map2->n, flags);
01733         if (!result)
01734                 goto error;
01735         for (i = 0; i < map1->n; ++i)
01736                 for (j = 0; j < map2->n; ++j) {
01737                         struct isl_basic_map *part;
01738                         part = isl_basic_map_intersect(
01739                                     isl_basic_map_copy(map1->p[i]),
01740                                     isl_basic_map_copy(map2->p[j]));
01741                         if (isl_basic_map_is_empty(part))
01742                                 isl_basic_map_free(part);
01743                         else
01744                                 result = isl_map_add(result, part);
01745                         if (!result)
01746                                 goto error;
01747                 }
01748         isl_map_free(map1);
01749         isl_map_free(map2);
01750         return result;
01751 error:
01752         isl_map_free(map1);
01753         isl_map_free(map2);
01754         return NULL;
01755 }

Here is the call graph for this function:

struct isl_map* isl_map_intersect_domain ( struct isl_map map,
struct isl_set set 
) [read]

Definition at line 3158 of file isl_map.c.

03160 {
03161         return isl_map_reverse(
03162                 isl_map_intersect_range(isl_map_reverse(map), set));
03163 }

Here is the call graph for this function:

struct isl_map* isl_map_intersect_range ( struct isl_map map,
struct isl_set set 
) [read]

Definition at line 3122 of file isl_map.c.

03124 {
03125         unsigned flags = 0;
03126         struct isl_map *result;
03127         int i, j;
03128 
03129         if (!map || !set)
03130                 goto error;
03131 
03132         if (ISL_F_ISSET(map, ISL_MAP_DISJOINT) &&
03133             ISL_F_ISSET(set, ISL_MAP_DISJOINT))
03134                 ISL_FL_SET(flags, ISL_MAP_DISJOINT);
03135 
03136         result = isl_map_alloc_dim(isl_dim_copy(map->dim),
03137                                         map->n * set->n, flags);
03138         if (!result)
03139                 goto error;
03140         for (i = 0; i < map->n; ++i)
03141                 for (j = 0; j < set->n; ++j) {
03142                         result = isl_map_add(result,
03143                             isl_basic_map_intersect_range(
03144                                 isl_basic_map_copy(map->p[i]),
03145                                 isl_basic_set_copy(set->p[j])));
03146                         if (!result)
03147                                 goto error;
03148                 }
03149         isl_map_free(map);
03150         isl_set_free(set);
03151         return result;
03152 error:
03153         isl_map_free(map);
03154         isl_set_free(set);
03155         return NULL;
03156 }

Here is the call graph for this function:

int isl_map_is_empty ( struct isl_map map  ) 

Definition at line 3402 of file isl_map.c.

03403 {
03404         int i;
03405         int is_empty;
03406 
03407         if (!map)
03408                 return -1;
03409         for (i = 0; i < map->n; ++i) {
03410                 is_empty = isl_basic_map_is_empty(map->p[i]);
03411                 if (is_empty < 0)
03412                         return -1;
03413                 if (!is_empty)
03414                         return 0;
03415         }
03416         return 1;
03417 }

Here is the call graph for this function:

int isl_map_is_equal ( struct isl_map map1,
struct isl_map map2 
)

Definition at line 3454 of file isl_map.c.

03455 {
03456         int is_subset;
03457 
03458         if (!map1 || !map2)
03459                 return -1;
03460         is_subset = isl_map_is_subset(map1, map2);
03461         if (is_subset != 1)
03462                 return is_subset;
03463         is_subset = isl_map_is_subset(map2, map1);
03464         return is_subset;
03465 }

Here is the call graph for this function:

int isl_map_is_subset ( struct isl_map map1,
struct isl_map map2 
)

Definition at line 3429 of file isl_map.c.

03430 {
03431         int i;
03432         int is_subset = 0;
03433         struct isl_map *diff;
03434 
03435         if (!map1 || !map2)
03436                 return -1;
03437 
03438         if (isl_map_is_empty(map1))
03439                 return 1;
03440 
03441         if (isl_map_is_empty(map2))
03442                 return 0;
03443 
03444         diff = isl_map_subtract(isl_map_copy(map1), isl_map_copy(map2));
03445         if (!diff)
03446                 return -1;
03447 
03448         is_subset = isl_map_is_empty(diff);
03449         isl_map_free(diff);
03450 
03451         return is_subset;
03452 }

Here is the call graph for this function:

unsigned isl_map_n_in ( const struct isl_map map  ) 

Definition at line 188 of file isl_map.c.

00189 {
00190         return map->dim->n_in;
00191 }

unsigned isl_map_n_out ( const struct isl_map map  ) 

Definition at line 193 of file isl_map.c.

00194 {
00195         return map->dim->n_out;
00196 }

unsigned isl_map_n_param ( const struct isl_map map  ) 

Definition at line 198 of file isl_map.c.

00199 {
00200         return map->dim->nparam;
00201 }

struct isl_map* isl_map_normalize ( struct isl_map map  )  [read]

Definition at line 4319 of file isl_map.c.

04320 {
04321         int i, j;
04322         struct isl_basic_map *bmap;
04323 
04324         if (!map)
04325                 return NULL;
04326         if (ISL_F_ISSET(map, ISL_MAP_NORMALIZED))
04327                 return map;
04328         for (i = 0; i < map->n; ++i) {
04329                 bmap = isl_basic_map_normalize(isl_basic_map_copy(map->p[i]));
04330                 if (!bmap)
04331                         goto error;
04332                 isl_basic_map_free(map->p[i]);
04333                 map->p[i] = bmap;
04334         }
04335         qsort(map->p, map->n, sizeof(struct isl_basic_map *), qsort_bmap_cmp);
04336         ISL_F_SET(map, ISL_MAP_NORMALIZED);
04337         map = isl_map_remove_empty_parts(map);
04338         if (!map)
04339                 return NULL;
04340         for (i = map->n - 1; i >= 1; --i) {
04341                 if (!isl_basic_map_fast_is_equal(map->p[i-1], map->p[i]))
04342                         continue;
04343                 isl_basic_map_free(map->p[i-1]);
04344                 for (j = i; j < map->n; ++j)
04345                         map->p[j-1] = map->p[j];
04346                 map->n--;
04347         }
04348         return map;
04349 error:
04350         isl_map_free(map);
04351         return NULL;
04352 
04353 }

Here is the call graph for this function:

struct isl_map* isl_map_product ( struct isl_map map1,
struct isl_map map2 
) [read]

Definition at line 4528 of file isl_map.c.

04529 {
04530         unsigned flags = 0;
04531         struct isl_map *result;
04532         int i, j;
04533 
04534         if (!map1 || !map2)
04535                 goto error;
04536 
04537         isl_assert(map1->ctx, isl_dim_match(map1->dim, isl_dim_param,
04538                                          map2->dim, isl_dim_param), goto error);
04539 
04540         if (ISL_F_ISSET(map1, ISL_MAP_DISJOINT) &&
04541             ISL_F_ISSET(map2, ISL_MAP_DISJOINT))
04542                 ISL_FL_SET(flags, ISL_MAP_DISJOINT);
04543 
04544         result = isl_map_alloc_dim(isl_dim_product(isl_dim_copy(map1->dim),
04545                                                    isl_dim_copy(map2->dim)),
04546                                 map1->n * map2->n, flags);
04547         if (!result)
04548                 goto error;
04549         for (i = 0; i < map1->n; ++i)
04550                 for (j = 0; j < map2->n; ++j) {
04551                         struct isl_basic_map *part;
04552                         part = isl_basic_map_product(
04553                                     isl_basic_map_copy(map1->p[i]),
04554                                     isl_basic_map_copy(map2->p[j]));
04555                         if (isl_basic_map_is_empty(part))
04556                                 isl_basic_map_free(part);
04557                         else
04558                                 result = isl_map_add(result, part);
04559                         if (!result)
04560                                 goto error;
04561                 }
04562         isl_map_free(map1);
04563         isl_map_free(map2);
04564         return result;
04565 error:
04566         isl_map_free(map1);
04567         isl_map_free(map2);
04568         return NULL;
04569 }

Here is the call graph for this function:

struct isl_set* isl_map_range ( struct isl_map map  )  [read]

Definition at line 2429 of file isl_map.c.

02430 {
02431         int i;
02432         struct isl_set *set;
02433 
02434         if (!map)
02435                 goto error;
02436         map = isl_map_cow(map);
02437         if (!map)
02438                 goto error;
02439 
02440         set = (struct isl_set *) map;
02441         if (set->dim->n_in != 0) {
02442                 set->dim = isl_dim_drop_inputs(set->dim, 0, set->dim->n_in);
02443                 if (!set->dim)
02444                         goto error;
02445         }
02446         for (i = 0; i < map->n; ++i) {
02447                 set->p[i] = isl_basic_map_range(map->p[i]);
02448                 if (!set->p[i])
02449                         goto error;
02450         }
02451         ISL_F_CLR(set, ISL_MAP_DISJOINT);
02452         ISL_F_CLR(set, ISL_SET_NORMALIZED);
02453         return set;
02454 error:
02455         isl_map_free(map);
02456         return NULL;
02457 }

Here is the call graph for this function:

struct isl_map* isl_map_remove ( struct isl_map map,
enum isl_dim_type  type,
unsigned  first,
unsigned  n 
) [read]

Definition at line 1179 of file isl_map.c.

01181 {
01182         int i;
01183         unsigned nparam;
01184 
01185         if (n == 0)
01186                 return map;
01187 
01188         map = isl_map_cow(map);
01189         if (!map)
01190                 return NULL;
01191         isl_assert(map->ctx, first + n <= isl_map_dim(map, type), goto error);
01192         
01193         for (i = 0; i < map->n; ++i) {
01194                 map->p[i] = isl_basic_map_eliminate_vars(map->p[i],
01195                         isl_basic_map_offset(map->p[i], type) - 1 + first, n);
01196                 if (!map->p[i])
01197                         goto error;
01198         }
01199         map = isl_map_drop(map, type, first, n);
01200         return map;
01201 error:
01202         isl_map_free(map);
01203         return NULL;
01204 }

Here is the call graph for this function:

struct isl_map* isl_map_remove_empty_parts ( struct isl_map map  )  [read]

Definition at line 3877 of file isl_map.c.

03878 {
03879         int i;
03880 
03881         if (!map)
03882                 return NULL;
03883 
03884         for (i = map->n-1; i >= 0; --i) {
03885                 if (!ISL_F_ISSET(map->p[i], ISL_BASIC_MAP_EMPTY))
03886                         continue;
03887                 isl_basic_map_free(map->p[i]);
03888                 if (i != map->n-1) {
03889                         ISL_F_CLR(map, ISL_MAP_NORMALIZED);
03890                         map->p[i] = map->p[map->n-1];
03891                 }
03892                 map->n--;
03893         }
03894 
03895         return map;
03896 }

Here is the call graph for this function:

struct isl_map* isl_map_remove_inputs ( struct isl_map map,
unsigned  first,
unsigned  n 
) [read]

Definition at line 1207 of file isl_map.c.

01209 {
01210         return isl_map_remove(map, isl_dim_in, first, n);
01211 }

Here is the call graph for this function:

struct isl_map* isl_map_reverse ( struct isl_map map  )  [read]

Definition at line 2886 of file isl_map.c.

02887 {
02888         int i;
02889         unsigned t;
02890 
02891         map = isl_map_cow(map);
02892         if (!map)
02893                 return NULL;
02894 
02895         map->dim = isl_dim_reverse(map->dim);
02896         if (!map->dim)
02897                 goto error;
02898         for (i = 0; i < map->n; ++i) {
02899                 map->p[i] = isl_basic_map_reverse(map->p[i]);
02900                 if (!map->p[i])
02901                         goto error;
02902         }
02903         ISL_F_CLR(map, ISL_MAP_NORMALIZED);
02904         return map;
02905 error:
02906         isl_map_free(map);
02907         return NULL;
02908 }

Here is the call graph for this function:

struct isl_map* isl_map_subtract ( struct isl_map map1,
struct isl_map map2 
) [read]

Definition at line 3824 of file isl_map.c.

03825 {
03826         int i;
03827         if (!map1 || !map2)
03828                 goto error;
03829 
03830         isl_assert(map1->ctx, isl_dim_equal(map1->dim, map2->dim), goto error);
03831 
03832         if (isl_map_is_empty(map2)) {
03833                 isl_map_free(map2);
03834                 return map1;
03835         }
03836 
03837         map1 = isl_map_compute_divs(map1);
03838         map2 = isl_map_compute_divs(map2);
03839         if (!map1 || !map2)
03840                 goto error;
03841 
03842         for (i = 0; map1 && i < map2->n; ++i)
03843                 map1 = subtract(map1, map2->p[i]);
03844 
03845         isl_map_free(map2);
03846         return map1;
03847 error:
03848         isl_map_free(map1);
03849         isl_map_free(map2);
03850         return NULL;
03851 }

Here is the call graph for this function:

struct isl_set* isl_map_underlying_set ( struct isl_map map  )  [read]

Definition at line 2374 of file isl_map.c.

02375 {
02376         int i;
02377 
02378         map = isl_map_cow(map);
02379         if (!map)
02380                 return NULL;
02381         map->dim = isl_dim_cow(map->dim);
02382         if (!map->dim)
02383                 goto error;
02384 
02385         for (i = 1; i < map->n; ++i)
02386                 isl_assert(map->ctx, map->p[0]->n_div == map->p[i]->n_div,
02387                                 goto error);
02388         for (i = 0; i < map->n; ++i) {
02389                 map->p[i] = (struct isl_basic_map *)
02390                                 isl_basic_map_underlying_set(map->p[i]);
02391                 if (!map->p[i])
02392                         goto error;
02393         }
02394         if (map->n == 0)
02395                 map->dim = isl_dim_underlying(map->dim, 0);
02396         else {
02397                 isl_dim_free(map->dim);
02398                 map->dim = isl_dim_copy(map->p[0]->dim);
02399         }
02400         if (!map->dim)
02401                 goto error;
02402         return (struct isl_set *)map;
02403 error:
02404         isl_map_free(map);
02405         return NULL;
02406 }

Here is the call graph for this function:

struct isl_map* isl_map_union ( struct isl_map map1,
struct isl_map map2 
) [read]

Definition at line 3098 of file isl_map.c.

03099 {
03100         map1 = isl_map_union_disjoint(map1, map2);
03101         if (!map1)
03102                 return NULL;
03103         if (map1->n > 1)
03104                 ISL_F_CLR(map1, ISL_MAP_DISJOINT);
03105         return map1;
03106 }

Here is the call graph for this function:

struct isl_map* isl_map_union_disjoint ( struct isl_map map1,
struct isl_map map2 
) [read]

Definition at line 3047 of file isl_map.c.

03049 {
03050         int i;
03051         unsigned flags = 0;
03052         struct isl_map *map = NULL;
03053 
03054         if (!map1 || !map2)
03055                 goto error;
03056 
03057         if (map1->n == 0) {
03058                 isl_map_free(map1);
03059                 return map2;
03060         }
03061         if (map2->n == 0) {
03062                 isl_map_free(map2);
03063                 return map1;
03064         }
03065 
03066         isl_assert(map1->ctx, isl_dim_equal(map1->dim, map2->dim), goto error);
03067 
03068         if (ISL_F_ISSET(map1, ISL_MAP_DISJOINT) &&
03069             ISL_F_ISSET(map2, ISL_MAP_DISJOINT))
03070                 ISL_FL_SET(flags, ISL_MAP_DISJOINT);
03071 
03072         map = isl_map_alloc_dim(isl_dim_copy(map1->dim),
03073                                 map1->n + map2->n, flags);
03074         if (!map)
03075                 goto error;
03076         for (i = 0; i < map1->n; ++i) {
03077                 map = isl_map_add(map,
03078                                   isl_basic_map_copy(map1->p[i]));
03079                 if (!map)
03080                         goto error;
03081         }
03082         for (i = 0; i < map2->n; ++i) {
03083                 map = isl_map_add(map,
03084                                   isl_basic_map_copy(map2->p[i]));
03085                 if (!map)
03086                         goto error;
03087         }
03088         isl_map_free(map1);
03089         isl_map_free(map2);
03090         return map;
03091 error:
03092         isl_map_free(map);
03093         isl_map_free(map1);
03094         isl_map_free(map2);
03095         return NULL;
03096 }

Here is the call graph for this function:

struct isl_map* isl_map_universe ( struct isl_dim dim  )  [read]

Definition at line 2656 of file isl_map.c.

02657 {
02658         struct isl_map *map;
02659         if (!dim)
02660                 return NULL;
02661         map = isl_map_alloc_dim(isl_dim_copy(dim), 1, ISL_MAP_DISJOINT);
02662         map = isl_map_add(map, isl_basic_map_universe(dim));
02663         return map;
02664 }

Here is the call graph for this function:

struct isl_set* isl_set_add ( struct isl_set set,
struct isl_basic_set bset 
) [read]

Definition at line 1469 of file isl_map.c.

01470 {
01471         if (!bset || !set)
01472                 goto error;
01473         isl_assert(set->ctx, isl_dim_equal(set->dim, bset->dim), goto error);
01474         isl_assert(set->ctx, set->n < set->size, goto error);
01475         set->p[set->n] = bset;
01476         set->n++;
01477         return set;
01478 error:
01479         if (set)
01480                 isl_set_free(set);
01481         if (bset)
01482                 isl_basic_set_free(bset);
01483         return NULL;
01484 }

Here is the call graph for this function:

struct isl_set* isl_set_align_divs ( struct isl_set set  )  [read]

Definition at line 3696 of file isl_map.c.

03697 {
03698         return (struct isl_set *)isl_map_align_divs((struct isl_map *)set);
03699 }

Here is the call graph for this function:

struct isl_set* isl_set_alloc ( struct isl_ctx *  ctx,
unsigned  nparam,
unsigned  dim,
int  n,
unsigned  flags 
) [read]

Definition at line 1409 of file isl_map.c.

01411 {
01412         struct isl_set *set;
01413         struct isl_dim *dims;
01414 
01415         dims = isl_dim_alloc(ctx, nparam, 0, dim);
01416         if (!dims)
01417                 return NULL;
01418 
01419         set = isl_set_alloc_dim(dims, n, flags);
01420         return set;
01421 }

Here is the call graph for this function:

struct isl_set* isl_set_alloc_dim ( struct isl_dim dim,
int  n,
unsigned  flags 
) [read]

Definition at line 1382 of file isl_map.c.

01383 {
01384         struct isl_set *set;
01385 
01386         if (!dim)
01387                 return NULL;
01388         isl_assert(dim->ctx, dim->n_in == 0, return NULL);
01389         isl_assert(dim->ctx, n >= 0, return NULL);
01390         set = isl_alloc(dim->ctx, struct isl_set,
01391                         sizeof(struct isl_set) +
01392                         n * sizeof(struct isl_basic_set *));
01393         if (!set)
01394                 goto error;
01395 
01396         set->ctx = dim->ctx;
01397         isl_ctx_ref(set->ctx);
01398         set->ref = 1;
01399         set->size = n;
01400         set->n = 0;
01401         set->dim = dim;
01402         set->flags = flags;
01403         return set;
01404 error:
01405         isl_dim_free(dim);
01406         return NULL;
01407 }

Here is the call graph for this function:

struct isl_set* isl_set_apply ( struct isl_set set,
struct isl_map map 
) [read]

Definition at line 3860 of file isl_map.c.

03861 {
03862         if (!set || !map)
03863                 goto error;
03864         isl_assert(set->ctx, isl_map_compatible_domain(map, set), goto error);
03865         map = isl_map_intersect_domain(map, set);
03866         set = isl_map_range(map);
03867         return set;
03868 error:
03869         isl_set_free(set);
03870         isl_map_free(map);
03871         return NULL;
03872 }

Here is the call graph for this function:

struct isl_set* isl_set_compute_divs ( struct isl_set set  )  [read]

Definition at line 3012 of file isl_map.c.

03013 {
03014         return (struct isl_set *)
03015                 isl_map_compute_divs((struct isl_map *)set);
03016 }

Here is the call graph for this function:

struct isl_set* isl_set_copy ( struct isl_set set  )  [read]

Definition at line 415 of file isl_map.c.

00416 {
00417         if (!set)
00418                 return NULL;
00419 
00420         set->ref++;
00421         return set;
00422 }

struct isl_basic_set* isl_set_copy_basic_set ( struct isl_set set  )  [read]

Definition at line 3914 of file isl_map.c.

03915 {
03916         (struct isl_basic_set *)isl_map_copy_basic_map((struct isl_map *)set);
03917 }

Here is the call graph for this function:

struct isl_set* isl_set_cow ( struct isl_set set  )  [read]

Definition at line 939 of file isl_map.c.

00940 {
00941         if (!set)
00942                 return NULL;
00943 
00944         if (set->ref == 1)
00945                 return set;
00946         set->ref--;
00947         return isl_set_dup(set);
00948 }

Here is the call graph for this function:

unsigned isl_set_dim ( const struct isl_set set,
enum isl_dim_type  type 
)

Definition at line 110 of file isl_map.c.

00111 {
00112         return n(set->dim, type);
00113 }

Here is the call graph for this function:

int isl_set_dim_is_unique ( struct isl_set set,
unsigned  dim 
)

Definition at line 4664 of file isl_map.c.

04665 {
04666         int i;
04667 
04668         if (!set)
04669                 return -1;
04670         for (i = 0; i < set->n; ++i) {
04671                 int unique;
04672                 unique = isl_basic_set_dim_is_unique(set->p[i], dim);
04673                 if (unique != 1)
04674                         return unique;
04675         }
04676         return 1;
04677 }

Here is the call graph for this function:

struct isl_set* isl_set_drop_basic_set ( struct isl_set set,
struct isl_basic_set bset 
) [read]

Definition at line 3948 of file isl_map.c.

03950 {
03951         (struct isl_set *)isl_map_drop_basic_map((struct isl_map *)set,
03952                                                 (struct isl_basic_map *)bset);
03953 }

Here is the call graph for this function:

void isl_set_dump ( struct isl_set set,
FILE *  out,
int  indent 
)

Definition at line 1503 of file isl_map.c.

01504 {
01505         int i;
01506 
01507         if (!set) {
01508                 fprintf(out, "null set\n");
01509                 return;
01510         }
01511 
01512         fprintf(out, "%*s", indent, "");
01513         fprintf(out, "ref: %d, n: %d, nparam: %d, dim: %d, flags: %x\n",
01514                         set->ref, set->n, set->dim->nparam, set->dim->n_out,
01515                         set->flags);
01516         for (i = 0; i < set->n; ++i) {
01517                 fprintf(out, "%*s", indent, "");
01518                 fprintf(out, "basic set %d:\n", i);
01519                 isl_basic_set_dump(set->p[i], out, indent+4);
01520         }
01521 }

Here is the call graph for this function:

struct isl_set* isl_set_dup ( struct isl_set set  )  [read]

Definition at line 1423 of file isl_map.c.

01424 {
01425         int i;
01426         struct isl_set *dup;
01427 
01428         if (!set)
01429                 return NULL;
01430 
01431         dup = isl_set_alloc_dim(isl_dim_copy(set->dim), set->n, set->flags);
01432         if (!dup)
01433                 return NULL;
01434         for (i = 0; i < set->n; ++i)
01435                 dup = isl_set_add(dup, isl_basic_set_copy(set->p[i]));
01436         return dup;
01437 }

Here is the call graph for this function:

struct isl_set* isl_set_eliminate_dims ( struct isl_set set,
unsigned  first,
unsigned  n 
) [read]

Definition at line 1089 of file isl_map.c.

01091 {
01092         int i;
01093         unsigned nparam;
01094 
01095         if (!set)
01096                 return NULL;
01097         if (n == 0)
01098                 return set;
01099 
01100         set = isl_set_cow(set);
01101         if (!set)
01102                 return NULL;
01103         isl_assert(set->ctx, first+n <= isl_set_n_dim(set), goto error);
01104         nparam = isl_set_n_param(set);
01105         
01106         for (i = 0; i < set->n; ++i) {
01107                 set->p[i] = isl_basic_set_eliminate_vars(set->p[i],
01108                                                             nparam + first, n);
01109                 if (!set->p[i])
01110                         goto error;
01111         }
01112         return set;
01113 error:
01114         isl_set_free(set);
01115         return NULL;
01116 }

Here is the call graph for this function:

struct isl_set* isl_set_empty ( struct isl_dim dim  )  [read]

Definition at line 2644 of file isl_map.c.

02645 {
02646         return isl_set_alloc_dim(dim, 0, ISL_MAP_DISJOINT);
02647 }

Here is the call graph for this function:

struct isl_set* isl_set_empty_like ( struct isl_set model  )  [read]

Definition at line 2649 of file isl_map.c.

02650 {
02651         if (!model)
02652                 return NULL;
02653         return isl_set_empty(isl_dim_copy(model->dim));
02654 }

Here is the call graph for this function:

struct isl_set* isl_set_extend ( struct isl_set base,
unsigned  nparam,
unsigned  dim 
) [read]

Definition at line 2748 of file isl_map.c.

02750 {
02751         return (struct isl_set *)isl_map_extend((struct isl_map *)base,
02752                                                         nparam, 0, dim);
02753 }

Here is the call graph for this function:

int isl_set_fast_dim_has_fixed_lower_bound ( struct isl_set set,
unsigned  dim,
isl_int val 
)

Definition at line 4165 of file isl_map.c.

04167 {
04168         int i;
04169         isl_int v;
04170         isl_int tmp;
04171         int fixed;
04172 
04173         if (!set)
04174                 return -1;
04175         if (set->n == 0)
04176                 return 0;
04177         if (set->n == 1)
04178                 return isl_basic_set_fast_dim_has_fixed_lower_bound(set->p[0],
04179                                                                 dim, val);
04180         isl_int_init(v);
04181         isl_int_init(tmp);
04182         fixed = isl_basic_set_fast_dim_has_fixed_lower_bound(set->p[0],
04183                                                                 dim, &v);
04184         for (i = 1; fixed == 1 && i < set->n; ++i) {
04185                 fixed = isl_basic_set_fast_dim_has_fixed_lower_bound(set->p[i],
04186                                                                 dim, &tmp);
04187                 if (fixed == 1 && isl_int_ne(tmp, v))
04188                         fixed = 0;
04189         }
04190         if (val)
04191                 isl_int_set(*val, v);
04192         isl_int_clear(tmp);
04193         isl_int_clear(v);
04194         return fixed;
04195 }

Here is the call graph for this function:

int isl_set_fast_dim_is_fixed ( struct isl_set set,
unsigned  dim,
isl_int val 
)

Definition at line 4107 of file isl_map.c.

04108 {
04109         return isl_set_fast_has_fixed_var(set, isl_set_n_param(set) + dim, val);
04110 }

Here is the call graph for this function:

static int isl_set_fast_has_fixed_var ( struct isl_set set,
unsigned  pos,
isl_int val 
) [static]

Definition at line 4089 of file isl_map.c.

04091 {
04092         return isl_map_fast_has_fixed_var((struct isl_map *)set, pos, val);
04093 }

Here is the call graph for this function:

int isl_set_fast_is_equal ( struct isl_set set1,
struct isl_set set2 
)

Definition at line 4394 of file isl_map.c.

04395 {
04396         return isl_map_fast_is_equal((struct isl_map *)set1,
04397                                                 (struct isl_map *)set2);
04398 }

Here is the call graph for this function:

struct isl_set* isl_set_fix_dim_si ( struct isl_set set,
unsigned  dim,
int  value 
) [read]

Definition at line 2838 of file isl_map.c.

02839 {
02840         return (struct isl_set *)
02841                 isl_map_fix_si((struct isl_map *)set, isl_dim_set, dim, value);
02842 }

Here is the call graph for this function:

void isl_set_free ( struct isl_set set  ) 

Definition at line 1486 of file isl_map.c.

01487 {
01488         int i;
01489 
01490         if (!set)
01491                 return;
01492 
01493         if (--set->ref > 0)
01494                 return;
01495 
01496         isl_ctx_deref(set->ctx);
01497         for (i = 0; i < set->n; ++i)
01498                 isl_basic_set_free(set->p[i]);
01499         isl_dim_free(set->dim);
01500         free(set);
01501 }

Here is the call graph for this function:

struct isl_set* isl_set_from_basic_set ( struct isl_basic_set bset  )  [read]

Definition at line 1439 of file isl_map.c.

01440 {
01441         struct isl_set *set;
01442 
01443         if (!bset)
01444                 return NULL;
01445 
01446         set = isl_set_alloc_dim(isl_dim_copy(bset->dim), 1, ISL_MAP_DISJOINT);
01447         if (!set) {
01448                 isl_basic_set_free(bset);
01449                 return NULL;
01450         }
01451         return isl_set_add(set, bset);
01452 }

Here is the call graph for this function:

struct isl_set* isl_set_from_map ( struct isl_map map  )  [read]

Definition at line 2489 of file isl_map.c.

02490 {
02491         int i;
02492         struct isl_set *set = NULL;
02493 
02494         if (!map)
02495                 return NULL;
02496         map = isl_map_cow(map);
02497         if (!map)
02498                 return NULL;
02499         map->dim = isl_dim_cow(map->dim);
02500         if (!map->dim)
02501                 goto error;
02502         map->dim->n_out += map->dim->n_in;
02503         map->dim->n_in = 0;
02504         set = (struct isl_set *)map;
02505         for (i = 0; i < map->n; ++i) {
02506                 set->p[i] = isl_basic_set_from_basic_map(map->p[i]);
02507                 if (!set->p[i])
02508                         goto error;
02509         }
02510         return set;
02511 error:
02512         isl_map_free(map);
02513         return NULL;
02514 }

Here is the call graph for this function:

struct isl_set* isl_set_from_underlying_set ( struct isl_set set,
struct isl_basic_set like 
) [read]

Definition at line 2340 of file isl_map.c.

02342 {
02343         int i;
02344 
02345         if (!set || !like)
02346                 goto error;
02347         isl_assert(set->ctx, set->dim->n_out == isl_basic_set_total_dim(like),
02348                     goto error);
02349         if (isl_dim_equal(set->dim, like->dim) && like->n_div == 0) {
02350                 isl_basic_set_free(like);
02351                 return set;
02352         }
02353         set = isl_set_cow(set);
02354         if (!set)
02355                 goto error;
02356         for (i = 0; i < set->n; ++i) {
02357                 set->p[i] = isl_basic_set_from_underlying_set(set->p[i],
02358                                                       isl_basic_set_copy(like));
02359                 if (!set->p[i])
02360                         goto error;
02361         }
02362         isl_dim_free(set->dim);
02363         set->dim = isl_dim_copy(like->dim);
02364         if (!set->dim)
02365                 goto error;
02366         isl_basic_set_free(like);
02367         return set;
02368 error:
02369         isl_basic_set_free(like);
02370         isl_set_free(set);
02371         return NULL;
02372 }

Here is the call graph for this function:

struct isl_dim* isl_set_get_dim ( struct isl_set set  )  [read]

Definition at line 230 of file isl_map.c.

00231 {
00232         if (!set)
00233                 return NULL;
00234         return isl_dim_copy(set->dim);
00235 }

Here is the call graph for this function:

uint32_t isl_set_get_hash ( struct isl_set set  ) 

Definition at line 4617 of file isl_map.c.

04618 {
04619         int i;
04620         uint32_t hash;
04621 
04622         if (!set)
04623                 return 0;
04624         set = isl_set_copy(set);
04625         set = isl_set_normalize(set);
04626         if (!set)
04627                 return 0;
04628 
04629         hash = isl_hash_init();
04630         for (i = 0; i < set->n; ++i) {
04631                 uint32_t bset_hash;
04632                 bset_hash = isl_basic_set_get_hash(set->p[i]);
04633                 isl_hash_hash(hash, bset_hash);
04634         }
04635                 
04636         isl_set_free(set);
04637 
04638         return hash;
04639 }

Here is the call graph for this function:

struct isl_set* isl_set_intersect ( struct isl_set set1,
struct isl_set set2 
) [read]

Definition at line 1757 of file isl_map.c.

01758 {
01759         return (struct isl_set *)
01760                 isl_map_intersect((struct isl_map *)set1,
01761                                   (struct isl_map *)set2);
01762 }

Here is the call graph for this function:

int isl_set_is_empty ( struct isl_set set  ) 

Definition at line 3424 of file isl_map.c.

03425 {
03426         return isl_map_is_empty((struct isl_map *)set);
03427 }

Here is the call graph for this function:

int isl_set_is_equal ( struct isl_set set1,
struct isl_set set2 
)

Definition at line 3349 of file isl_map.c.

03350 {
03351         return isl_map_is_equal((struct isl_map *)set1, (struct isl_map *)set2);
03352 }

Here is the call graph for this function:

int isl_set_is_subset ( struct isl_set set1,
struct isl_set set2 
)

Definition at line 3354 of file isl_map.c.

03355 {
03356         return isl_map_is_subset(
03357                         (struct isl_map *)set1, (struct isl_map *)set2);
03358 }

Here is the call graph for this function:

struct isl_set* isl_set_lower_bound_dim ( struct isl_set set,
unsigned  dim,
isl_int  value 
) [read]

Definition at line 2865 of file isl_map.c.

02867 {
02868         int i;
02869 
02870         set = isl_set_cow(set);
02871         if (!set)
02872                 return NULL;
02873 
02874         isl_assert(set->ctx, dim < isl_set_n_dim(set), goto error);
02875         for (i = 0; i < set->n; ++i) {
02876                 set->p[i] = isl_basic_set_lower_bound_dim(set->p[i], dim, value);
02877                 if (!set->p[i])
02878                         goto error;
02879         }
02880         return set;
02881 error:
02882         isl_set_free(set);
02883         return NULL;
02884 }

Here is the call graph for this function:

unsigned isl_set_n_dim ( const struct isl_set set  ) 

Definition at line 153 of file isl_map.c.

00154 {
00155         return set->dim->n_out;
00156 }

unsigned isl_set_n_param ( const struct isl_set set  ) 

Definition at line 158 of file isl_map.c.

00159 {
00160         return set->dim->nparam;
00161 }

struct isl_set* isl_set_normalize ( struct isl_set set  )  [read]

Definition at line 4355 of file isl_map.c.

04356 {
04357         return (struct isl_set *)isl_map_normalize((struct isl_map *)set);
04358 }

Here is the call graph for this function:

struct isl_set* isl_set_product ( struct isl_set set1,
struct isl_set set2 
) [read]

Definition at line 4573 of file isl_map.c.

04574 {
04575         return (struct isl_set *)isl_map_product((struct isl_map *)set1,
04576                                                  (struct isl_map *)set2);
04577 }

Here is the call graph for this function:

struct isl_set* isl_set_remove_dims ( struct isl_set set,
unsigned  first,
unsigned  n 
) [read]

Definition at line 1119 of file isl_map.c.

01121 {
01122         set = isl_set_eliminate_dims(set, first, n);
01123         set = isl_set_drop_dims(set, first, n);
01124         return set;
01125 }

Here is the call graph for this function:

struct isl_set* isl_set_remove_divs ( struct isl_set set  )  [read]

Definition at line 1137 of file isl_map.c.

01138 {
01139         int i;
01140 
01141         if (!set)
01142                 return NULL;
01143         if (set->n == 0)
01144                 return set;
01145 
01146         set = isl_set_cow(set);
01147         if (!set)
01148                 return NULL;
01149         
01150         for (i = 0; i < set->n; ++i) {
01151                 set->p[i] = isl_basic_set_remove_divs(set->p[i]);
01152                 if (!set->p[i])
01153                         goto error;
01154         }
01155         return set;
01156 error:
01157         isl_set_free(set);
01158         return NULL;
01159 }

Here is the call graph for this function:

struct isl_set* isl_set_remove_empty_parts ( struct isl_set set  )  [read]

Definition at line 3898 of file isl_map.c.

03899 {
03900         return (struct isl_set *)
03901                 isl_map_remove_empty_parts((struct isl_map *)set);
03902 }

Here is the call graph for this function:

struct isl_set* isl_set_subtract ( struct isl_set set1,
struct isl_set set2 
) [read]

Definition at line 3853 of file isl_map.c.

03854 {
03855         return (struct isl_set *)
03856                 isl_map_subtract(
03857                         (struct isl_map *)set1, (struct isl_map *)set2);
03858 }

Here is the call graph for this function:

struct isl_set* isl_set_swap_vars ( struct isl_set set,
unsigned  n 
) [read]

Definition at line 1017 of file isl_map.c.

01018 {
01019         int i;
01020         set = isl_set_cow(set);
01021         if (!set)
01022                 return NULL;
01023 
01024         for (i = 0; i < set->n; ++i) {
01025                 set->p[i] = isl_basic_set_swap_vars(set->p[i], n);
01026                 if (!set->p[i]) {
01027                         isl_set_free(set);
01028                         return NULL;
01029                 }
01030         }
01031         ISL_F_CLR(set, ISL_SET_NORMALIZED);
01032         return set;
01033 }

Here is the call graph for this function:

struct isl_set* isl_set_to_underlying_set ( struct isl_set set  )  [read]

Definition at line 2408 of file isl_map.c.

02409 {
02410         return (struct isl_set *)isl_map_underlying_set((struct isl_map *)set);
02411 }

Here is the call graph for this function:

struct isl_set* isl_set_union ( struct isl_set set1,
struct isl_set set2 
) [read]

Definition at line 3116 of file isl_map.c.

03117 {
03118         return (struct isl_set *)
03119                 isl_map_union((struct isl_map *)set1, (struct isl_map *)set2);
03120 }

Here is the call graph for this function:

struct isl_set* isl_set_union_disjoint ( struct isl_set set1,
struct isl_set set2 
) [read]

Definition at line 3108 of file isl_map.c.

03110 {
03111         return (struct isl_set *)
03112                 isl_map_union_disjoint(
03113                         (struct isl_map *)set1, (struct isl_map *)set2);
03114 }

Here is the call graph for this function:

struct isl_set* isl_set_universe ( struct isl_dim dim  )  [read]

Definition at line 2666 of file isl_map.c.

02667 {
02668         struct isl_set *set;
02669         if (!dim)
02670                 return NULL;
02671         set = isl_set_alloc_dim(isl_dim_copy(dim), 1, ISL_MAP_DISJOINT);
02672         set = isl_set_add(set, isl_basic_set_universe(dim));
02673         return set;
02674 }

Here is the call graph for this function:

static struct isl_map* map_identity ( struct isl_dim dim  )  [static, read]

Definition at line 3326 of file isl_map.c.

03327 {
03328         struct isl_map *map = isl_map_alloc_dim(dim, 1, ISL_MAP_DISJOINT);
03329         return isl_map_add(map, basic_map_identity(isl_dim_copy(dim)));
03330 }

Here is the call graph for this function:

static unsigned map_offset ( struct isl_map map,
enum isl_dim_type  type 
) [static]

Definition at line 127 of file isl_map.c.

00128 {
00129         return pos(map->dim, type);
00130 }

Here is the call graph for this function:

static unsigned n ( struct isl_dim dim,
enum isl_dim_type  type 
) [static]

Definition at line 37 of file isl_map.c.

00038 {
00039         switch (type) {
00040         case isl_dim_param:     return dim->nparam;
00041         case isl_dim_in:        return dim->n_in;
00042         case isl_dim_out:       return dim->n_out;
00043         }
00044 }

static struct isl_basic_map* order_divs ( struct isl_basic_map bmap  )  [static, read]

Definition at line 3591 of file isl_map.c.

03592 {
03593         int i;
03594         unsigned off = isl_dim_total(bmap->dim);
03595 
03596         for (i = 0; i < bmap->n_div; ++i) {
03597                 int pos;
03598                 pos = isl_seq_first_non_zero(bmap->div[i]+1+1+off+i,
03599                                                             bmap->n_div-i);
03600                 if (pos == -1)
03601                         continue;
03602                 swap_div(bmap, i, i + pos);
03603                 --i;
03604         }
03605         return bmap;
03606 }

Here is the call graph for this function:

static unsigned pos ( struct isl_dim dim,
enum isl_dim_type  type 
) [static]

Definition at line 46 of file isl_map.c.

00047 {
00048         switch (type) {
00049         case isl_dim_param:     return 1;
00050         case isl_dim_in:        return 1 + dim->nparam;
00051         case isl_dim_out:       return 1 + dim->nparam + dim->n_in;
00052         }
00053 }

static int qsort_bmap_cmp ( const void *  p1,
const void *  p2 
) [static]

Definition at line 4307 of file isl_map.c.

04308 {
04309         const struct isl_basic_map *bmap1 = *(const struct isl_basic_map **)p1;
04310         const struct isl_basic_map *bmap2 = *(const struct isl_basic_map **)p2;
04311 
04312         return isl_basic_map_fast_cmp(bmap1, bmap2);
04313 }

Here is the call graph for this function:

static int qsort_constraint_cmp ( const void *  p1,
const void *  p2 
) [static]

Definition at line 4202 of file isl_map.c.

04203 {
04204         const struct constraint *c1 = (const struct constraint *)p1;
04205         const struct constraint *c2 = (const struct constraint *)p2;
04206         unsigned size = isl_min(c1->size, c2->size);
04207         return isl_seq_cmp(c1->c, c2->c, size);
04208 }

Here is the call graph for this function:

static int room_for_con ( struct isl_basic_map bmap,
unsigned  n 
) [static]

Definition at line 468 of file isl_map.c.

00469 {
00470         return bmap->n_eq + bmap->n_ineq + n <= bmap->c_size;
00471 }

static int room_for_ineq ( struct isl_basic_map bmap,
unsigned  n 
) [static]

Definition at line 564 of file isl_map.c.

00565 {
00566         return bmap->n_ineq + n <= bmap->eq - bmap->ineq;
00567 }

static struct isl_map* subtract ( struct isl_map map,
struct isl_basic_map bmap 
) [static, read]

Definition at line 3741 of file isl_map.c.

03742 {
03743         int i, j, k;
03744         unsigned flags = 0;
03745         struct isl_map *rest = NULL;
03746         unsigned max;
03747         unsigned total = isl_basic_map_total_dim(bmap);
03748 
03749         assert(bmap);
03750 
03751         if (!map)
03752                 goto error;
03753 
03754         if (ISL_F_ISSET(map, ISL_MAP_DISJOINT))
03755                 ISL_FL_SET(flags, ISL_MAP_DISJOINT);
03756 
03757         max = map->n * (2 * bmap->n_eq + bmap->n_ineq);
03758         rest = isl_map_alloc_dim(isl_dim_copy(map->dim), max, flags);
03759         if (!rest)
03760                 goto error;
03761 
03762         for (i = 0; i < map->n; ++i) {
03763                 map->p[i] = isl_basic_map_align_divs(map->p[i], bmap);
03764                 if (!map->p[i])
03765                         goto error;
03766         }
03767 
03768         for (j = 0; j < map->n; ++j)
03769                 map->p[j] = isl_basic_map_cow(map->p[j]);
03770 
03771         for (i = 0; i < bmap->n_eq; ++i) {
03772                 for (j = 0; j < map->n; ++j) {
03773                         rest = add_cut_constraint(rest,
03774                                 map->p[j], bmap->eq[i], 1+total, 0);
03775                         if (!rest)
03776                                 goto error;
03777 
03778                         rest = add_cut_constraint(rest,
03779                                 map->p[j], bmap->eq[i], 1+total, 1);
03780                         if (!rest)
03781                                 goto error;
03782 
03783                         map->p[j] = isl_basic_map_extend_constraints(map->p[j],
03784                                 1, 0);
03785                         if (!map->p[j])
03786                                 goto error;
03787                         k = isl_basic_map_alloc_equality(map->p[j]);
03788                         if (k < 0)
03789                                 goto error;
03790                         isl_seq_cpy(map->p[j]->eq[k], bmap->eq[i], 1+total);
03791                         isl_seq_clr(map->p[j]->eq[k]+1+total,
03792                                         map->p[j]->n_div - bmap->n_div);
03793                 }
03794         }
03795 
03796         for (i = 0; i < bmap->n_ineq; ++i) {
03797                 for (j = 0; j < map->n; ++j) {
03798                         rest = add_cut_constraint(rest,
03799                                 map->p[j], bmap->ineq[i], 1+total, 0);
03800                         if (!rest)
03801                                 goto error;
03802 
03803                         map->p[j] = isl_basic_map_extend_constraints(map->p[j],
03804                                 0, 1);
03805                         if (!map->p[j])
03806                                 goto error;
03807                         k = isl_basic_map_alloc_inequality(map->p[j]);
03808                         if (k < 0)
03809                                 goto error;
03810                         isl_seq_cpy(map->p[j]->ineq[k], bmap->ineq[i], 1+total);
03811                         isl_seq_clr(map->p[j]->ineq[k]+1+total,
03812                                         map->p[j]->n_div - bmap->n_div);
03813                 }
03814         }
03815 
03816         isl_map_free(map);
03817         return rest;
03818 error:
03819         isl_map_free(map);
03820         isl_map_free(rest);
03821         return NULL;
03822 }

Here is the call graph for this function:

static void swap_div ( struct isl_basic_map bmap,
int  a,
int  b 
) [static]

Definition at line 1066 of file isl_map.c.

01067 {
01068         int i;
01069         unsigned off = isl_dim_total(bmap->dim);
01070         isl_int *t = bmap->div[a];
01071         bmap->div[a] = bmap->div[b];
01072         bmap->div[b] = t;
01073 
01074         for (i = 0; i < bmap->n_eq; ++i)
01075                 isl_int_swap(bmap->eq[i][1+off+a], bmap->eq[i][1+off+b]);
01076 
01077         for (i = 0; i < bmap->n_ineq; ++i)
01078                 isl_int_swap(bmap->ineq[i][1+off+a], bmap->ineq[i][1+off+b]);
01079 
01080         for (i = 0; i < bmap->n_div; ++i)
01081                 isl_int_swap(bmap->div[i][1+1+off+a], bmap->div[i][1+1+off+b]);
01082         ISL_F_CLR(bmap, ISL_BASIC_MAP_NORMALIZED);
01083 }

Here is the call graph for this function:

static void swap_vars ( struct isl_blk  blk,
isl_int a,
unsigned  a_len,
unsigned  b_len 
) [static]

Definition at line 961 of file isl_map.c.

00963 {
00964         isl_seq_cpy(blk.data, a+a_len, b_len);
00965         isl_seq_cpy(blk.data+b_len, a, a_len);
00966         isl_seq_cpy(a, blk.data, b_len+a_len);
00967 }

Here is the call graph for this function:

static struct isl_basic_map* var_equal ( struct isl_basic_map bmap,
unsigned  pos 
) [static, read]

Definition at line 2071 of file isl_map.c.

02072 {
02073         int i;
02074         unsigned nparam;
02075         unsigned n_in;
02076 
02077         i = isl_basic_map_alloc_equality(bmap);
02078         if (i < 0)
02079                 goto error;
02080         nparam = isl_basic_map_n_param(bmap);
02081         n_in = isl_basic_map_n_in(bmap);
02082         isl_seq_clr(bmap->eq[i], 1 + isl_basic_map_total_dim(bmap));
02083         isl_int_set_si(bmap->eq[i][1+nparam+pos], -1);
02084         isl_int_set_si(bmap->eq[i][1+nparam+n_in+pos], 1);
02085         return isl_basic_map_finalize(bmap);
02086 error:
02087         isl_basic_map_free(bmap);
02088         return NULL;
02089 }

Here is the call graph for this function:

static struct isl_basic_map* var_less ( struct isl_basic_map bmap,
unsigned  pos 
) [static, read]

Definition at line 2112 of file isl_map.c.

02113 {
02114         int i;
02115         unsigned nparam;
02116         unsigned n_in;
02117 
02118         i = isl_basic_map_alloc_inequality(bmap);
02119         if (i < 0)
02120                 goto error;
02121         nparam = isl_basic_map_n_param(bmap);
02122         n_in = isl_basic_map_n_in(bmap);
02123         isl_seq_clr(bmap->ineq[i], 1 + isl_basic_map_total_dim(bmap));
02124         isl_int_set_si(bmap->ineq[i][0], -1);
02125         isl_int_set_si(bmap->ineq[i][1+nparam+pos], 1);
02126         isl_int_set_si(bmap->ineq[i][1+nparam+n_in+pos], -1);
02127         return isl_basic_map_finalize(bmap);
02128 error:
02129         isl_basic_map_free(bmap);
02130         return NULL;
02131 }

Here is the call graph for this function:

static struct isl_basic_map* var_more ( struct isl_basic_map bmap,
unsigned  pos 
) [static, read]

Definition at line 2091 of file isl_map.c.

02092 {
02093         int i;
02094         unsigned nparam;
02095         unsigned n_in;
02096 
02097         i = isl_basic_map_alloc_inequality(bmap);
02098         if (i < 0)
02099                 goto error;
02100         nparam = isl_basic_map_n_param(bmap);
02101         n_in = isl_basic_map_n_in(bmap);
02102         isl_seq_clr(bmap->ineq[i], 1 + isl_basic_map_total_dim(bmap));
02103         isl_int_set_si(bmap->ineq[i][0], -1);
02104         isl_int_set_si(bmap->ineq[i][1+nparam+pos], -1);
02105         isl_int_set_si(bmap->ineq[i][1+nparam+n_in+pos], 1);
02106         return isl_basic_map_finalize(bmap);
02107 error:
02108         isl_basic_map_free(bmap);
02109         return NULL;
02110 }

Here is the call graph for this function: