1 /**
2  * Copyright 2015, SRI International.
3  *
4  * This file is part of LibPoly.
5  *
6  * LibPoly is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU Lesser General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * LibPoly is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with LibPoly.  If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 #pragma once
21 
22 #include "version.h"
23 #include "output_language.h"
24 
25 #include <stdint.h>
26 #include <stdio.h>
27 #include <gmp.h>
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
33 //
34 // Definitions of all relevant types
35 //
36 
37 /** Rationals are GMP rationals */
38 typedef __mpq_struct lp_rational_t;
39 
40 /** Integers are GMP integers */
41 typedef __mpz_struct lp_integer_t;
42 
43 
44 typedef size_t lp_variable_t;
45 
46 #define lp_variable_null ((lp_variable_t)(-1))
47 
48 typedef struct lp_variable_db_struct lp_variable_db_t;
49 typedef struct lp_variable_list_struct lp_variable_list_t;
50 typedef struct lp_variable_order_struct lp_variable_order_t;
51 typedef struct lp_variable_order_ops_struct lp_variable_order_ops_t;
52 
53 typedef struct lp_upolynomial_struct lp_upolynomial_t;
54 typedef struct lp_upolynomial_factors_struct lp_upolynomial_factors_t;
55 
56 typedef struct lp_polynomial_context_struct lp_polynomial_context_t;
57 typedef struct lp_polynomial_struct lp_polynomial_t;
58 
59 typedef struct lp_algebraic_number_struct lp_algebraic_number_t;
60 typedef struct lp_value_struct lp_value_t;
61 typedef struct lp_assignment_struct lp_assignment_t;
62 typedef struct lp_interval_assignment_struct lp_interval_assignment_t;
63 
64 typedef struct lp_rational_interval_struct lp_rational_interval_t;
65 typedef struct lp_dyadic_interval_struct lp_dyadic_interval_t;
66 typedef struct lp_interval_struct lp_interval_t;
67 
68 typedef struct lp_feasibility_set_struct lp_feasibility_set_t;
69 typedef struct lp_polynomial_hash_set_struct lp_polynomial_hash_set_t;
70 typedef struct lp_polynomial_vector_struct lp_polynomial_vector_t;
71 
72 /** Enable a given tag for tracing */
73 void lp_trace_enable(const char* tag);
74 
75 /** Disable the given that from tracing */
76 void lp_trace_disable(const char* tag);
77 
78 /** Set the output trace file (defaults to stderr) */
79 void lp_trace_set_output(FILE* file);
80 
81 /** Print statistics to a file */
82 void lp_stats_print(FILE* file);
83 
84 /** Set the output language */
85 void lp_set_output_language(lp_output_language_t lang);
86 
87 #ifdef __cplusplus
88 } /* close extern "C" { */
89 #endif
90