PIPS
sc_to_sg_test.c
Go to the documentation of this file.
1 /*
2 
3  $Id: sc_to_sg_test.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 /* test de la conversion d'un systeme d'equations et d'inequations en
26  * un systeme generateur
27  *
28  * Francois Irigoin, Decembre 1989
29  */
30 
31 #ifdef HAVE_CONFIG_H
32  #include "config.h"
33 #endif
34 
35 #include <stdio.h>
36 #include <string.h>
37 
38 #include "boolean.h"
39 #include "vecteur.h"
40 #include "contrainte.h"
41 #include "sc.h"
42 
43 #include "ray_dte.h"
44 #include "sommet.h"
45 #include "sg.h"
46 
47 #include "polyedre.h"
48 
49 /* extern int sc_to_sg_debug_level; */
50 
51 int main(argc,argv)
52 int argc;
53 char * argv[];
54 {
55  Psysteme s;
56  /* systeme generateur sg */
57  Ptsg sg;
58  FILE * f;
59  char * filename = "stdin";
60 
61  if(argc==1) {
62  f = stdin;
63  fprintf(stderr,"Lecture sur stdin\n");
64  }
65  else if(argc==2) {
66  filename = strdup(argv[1]);
67  if((f = fopen(filename,"r")) == NULL) {
68  fprintf(stderr,"Ouverture du fichier %s impossible\n",
69  filename);
70  exit(4);
71  }
72  }
73  else {
74  fprintf(stderr,"Usage: sc_fscan_print [filename]\n");
75  exit(1);
76  }
77 
78  /* lecture du systeme */
79  if(sc_fscan(f,&s)) {
80  /* sc_dump(s); */
81  fprintf(stderr,"syntaxe correcte dans %s\n",filename);
83  }
84  else {
85  fprintf(stderr,"erreur de syntaxe dans %s\n",filename);
86  exit(1);
87  }
88 
89  /* conversion */
90  /* sc_to_sg_debug_level = 9; */
93 
94  return 0;
95 }
Ptsg sc_to_sg_chernikova(Psysteme sc)
chernikova_mulprec.c
Definition: chernikova.c:42
Ptsg sg
char * variable_default_name(Variable v)
char * variable_default_name(Variable v): returns the name of variable v
Definition: variable.c:81
char * variable_dump_name(Variable v)
variable_dump_name() returns an unambiguous name for variable v, based on the pointer used to really ...
Definition: variable.c:96
#define exit(code)
Definition: misc-local.h:54
int f(int off1, int off2, int n, float r[n], float a[n], float b[n])
Definition: offsets.c:15
void sc_fprint(FILE *fp, Psysteme ps, get_variable_name_t nom_var)
void sc_fprint(FILE * f, Psysteme ps, char * (*nom_var)()): cette fonction imprime dans le fichier po...
Definition: sc_io.c:220
bool sc_fscan(FILE *f, Psysteme *ps)
bool sc_fscan(FILE * f, Psysteme * ps): construit un systeme d'inegalites et d'egalites lineaires a p...
Definition: sc_io.c:121
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
char * strdup()
int main(int argc, argv)
test de la conversion d'un systeme d'equations et d'inequations en un systeme generateur
Definition: sc_to_sg_test.c:51
void sg_fprint(FILE *f, Ptsg sg, char *(*nom_var)(Variable))
void sg_fprint(FILE * f, Ptsg sg, char * (*nom_var)()): impression d'un systeme generateur
Definition: sg.c:262
Representation d'un systeme generateur par trois ensembles de sommets de rayons et de droites.
Definition: sg-local.h:66