merge kaps
[libfirm] / ir / kaps / pbqp_t.h
1 /*
2  * Copyright (C) 1995-2008 University of Karlsruhe.  All right reserved.
3  *
4  * This file is part of libFirm.
5  *
6  * This file may be distributed and/or modified under the terms of the
7  * GNU General Public License version 2 as published by the Free Software
8  * Foundation and appearing in the file LICENSE.GPL included in the
9  * packaging of this file.
10  *
11  * Licensees holding valid libFirm Professional Edition licenses may use
12  * this file in accordance with the libFirm Commercial License.
13  * Agreement provided with the Software.
14  *
15  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17  * PURPOSE.
18  */
19
20 /**
21  * @file
22  * @brief   PBQP data types.
23  * @date    02.10.2008
24  * @author  Sebastian Buchwald
25  * @version $Id$
26  */
27 #ifndef KAPS_PBQP_T_H
28 #define KAPS_PBQP_T_H
29
30 #include <limits.h>
31 #include <stdint.h>
32 #include <stdio.h>
33
34 #include "adt/obstack.h"
35
36 #define KAPS_DUMP 0
37 #define KAPS_ENABLE_VECTOR_NAMES 0
38 #define KAPS_STATISTIC 0
39 #define KAPS_TIMING 0
40 #define KAPS_USE_UNSIGNED 1
41
42 #if KAPS_USE_UNSIGNED
43         typedef unsigned num;
44         static const num INF_COSTS = UINT_MAX;
45 #else
46         typedef intmax_t num;
47         static const num INF_COSTS = INTMAX_MAX;
48 #endif
49
50 #include "matrix_t.h"
51 #include "vector_t.h"
52
53 typedef struct pbqp_edge_t pbqp_edge_t;
54 typedef struct pbqp_node_t pbqp_node_t;
55 typedef struct pbqp_t      pbqp_t;
56
57 struct pbqp_t {
58         struct obstack obstack;            /* Obstack. */
59         num            solution;           /* Computed solution. */
60         size_t         num_nodes;          /* Number of PBQP nodes. */
61         pbqp_node_t  **nodes;              /* Nodes of PBQP. */
62         FILE          *dump_file;          /* File to dump in. */
63 #if KAPS_STATISTIC
64         unsigned       num_bf;             /* Number of brute force reductions. */
65         unsigned       num_edges;          /* Number of independent edges. */
66         unsigned       num_r0;             /* Number of trivial solved nodes. */
67         unsigned       num_r1;             /* Number of R1 reductions. */
68         unsigned       num_r2;             /* Number of R2 reductions. */
69         unsigned       num_rm;             /* Number of RM reductions. */
70         unsigned       num_rn;             /* Number of RN reductions. */
71 #endif
72 };
73
74 #endif /* KAPS_PBQP_T_H */