PIPS
sc_janus_feasibility.c
Go to the documentation of this file.
1 /*
2 
3  $Id: sc_janus_feasibility.c 1641 2016-03-02 08:20:19Z coelho $
4 
5  Copyright 1989-2016 MINES ParisTech
6 
7  This file is part of Linear/C3 Library.
8 
9  Linear/C3 Library is free software: you can redistribute it and/or modify it
10  under the terms of the GNU Lesser General Public License as published by
11  the Free Software Foundation, either version 3 of the License, or
12  any later version.
13 
14  Linear/C3 Library is distributed in the hope that it will be useful, but WITHOUT ANY
15  WARRANTY; without even the implied warranty of MERCHANTABILITY or
16  FITNESS FOR A PARTICULAR PURPOSE.
17 
18  See the GNU Lesser General Public License for more details.
19 
20  You should have received a copy of the GNU Lesser General Public License
21  along with Linear/C3 Library. If not, see <http://www.gnu.org/licenses/>.
22 
23 */
24 
25 #ifdef HAVE_CONFIG_H
26 #include "config.h"
27 #endif
28 
29 #include <stdlib.h>
30 #include <string.h>
31 #include <stdio.h>
32 
33 #include "boolean.h"
34 #include "arithmetique.h"
35 #include "vecteur.h"
36 #include "contrainte.h"
37 #include "sc.h"
38 #include "sc-private.h"
39 
40 /**
41  * Fallback function to compute feasibility with Janus, used when no custom
42  * function is set.
43  */
45 {
46  return true;
47 }
48 
49 /**
50  * Internal pointer to a custom Janus feasibility function. Is null when none
51  * is set.
52  */
54 
55 /**
56  * Compute feasibility, using custom Janus function if set, fallback function
57  * otherwise.
58  */
60 {
61  if (sc_janus_feasibility_ptr != NULL) {
62  return sc_janus_feasibility_ptr(sc);
63  }
64  else {
66  }
67 }
68 
69 /**
70  * Set custom Janus feasibility function.
71  */
72 void set_sc_janus_feasibility(bool (*sc_janus_feasibility_fct)(Psysteme))
73 {
74  sc_janus_feasibility_ptr = sc_janus_feasibility_fct;
75 }
76 
float a2sf[2] __attribute__((aligned(16)))
USER generates a user error (i.e., non fatal) by printing the given MSG according to the FMT.
Definition: 3dnow.h:3
bool sc_janus_feasibility_fallback(Psysteme sc __attribute__((unused)))
Fallback function to compute feasibility with Janus, used when no custom function is set.
static bool(* sc_janus_feasibility_ptr)(Psysteme)
Internal pointer to a custom Janus feasibility function.
bool sc_janus_feasibility(Psysteme sc)
Compute feasibility, using custom Janus function if set, fallback function otherwise.
void set_sc_janus_feasibility(bool(*sc_janus_feasibility_fct)(Psysteme))
Set custom Janus feasibility function.
int bool
we cannot use an enum or stdbool because we need to be compatible with newgen, thus boolean need to h...
Definition: newgen_types.h:78
struct Ssysteme * Psysteme