Merge branch 'maint'
[platform/upstream/isl.git] / include / isl / vec.h
1 /*
2  * Copyright 2008-2009 Katholieke Universiteit Leuven
3  *
4  * Use of this software is governed by the GNU LGPLv2.1 license
5  *
6  * Written by Sven Verdoolaege, K.U.Leuven, Departement
7  * Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium
8  */
9
10 #ifndef ISL_VEC_H
11 #define ISL_VEC_H
12
13 #include <stdio.h>
14
15 #include <isl/int.h>
16 #include <isl/ctx.h>
17 #include <isl/blk.h>
18 #include <isl/printer.h>
19
20 #if defined(__cplusplus)
21 extern "C" {
22 #endif
23
24 struct isl_vec {
25         int ref;
26
27         struct isl_ctx *ctx;
28
29         unsigned size;
30         isl_int *el;
31
32         struct isl_blk block;
33 };
34 typedef struct isl_vec isl_vec;
35
36 struct isl_vec *isl_vec_alloc(struct isl_ctx *ctx, unsigned size);
37 struct isl_vec *isl_vec_copy(struct isl_vec *vec);
38 struct isl_vec *isl_vec_cow(struct isl_vec *vec);
39 void isl_vec_free(struct isl_vec *vec);
40
41 isl_ctx *isl_vec_get_ctx(__isl_keep isl_vec *vec);
42
43 void isl_vec_dump(__isl_keep isl_vec *vec);
44 __isl_give isl_printer *isl_printer_print_vec(__isl_take isl_printer *printer,
45         __isl_keep isl_vec *vec);
46
47 void isl_vec_lcm(struct isl_vec *vec, isl_int *lcm);
48 struct isl_vec *isl_vec_ceil(struct isl_vec *vec);
49 struct isl_vec *isl_vec_normalize(struct isl_vec *vec);
50 __isl_give isl_vec *isl_vec_clr(__isl_take isl_vec *vec);
51 __isl_give isl_vec *isl_vec_scale(__isl_take isl_vec *vec, isl_int m);
52 __isl_give isl_vec *isl_vec_add(__isl_take isl_vec *vec1,
53         __isl_take isl_vec *vec2);
54 __isl_give isl_vec *isl_vec_extend(__isl_take isl_vec *vec, unsigned size);
55 __isl_give isl_vec *isl_vec_zero_extend(__isl_take isl_vec *vec, unsigned size);
56
57 __isl_give isl_vec *isl_vec_sort(__isl_take isl_vec *vec);
58
59 __isl_give isl_vec *isl_vec_read_from_file(isl_ctx *ctx, FILE *input);
60
61 #if defined(__cplusplus)
62 }
63 #endif
64
65 #endif