PIPS
test_chernikova.c File Reference
#include <stdio.h>
#include <string.h>
#include "boolean.h"
#include "arithmetique.h"
#include "vecteur.h"
#include "contrainte.h"
#include "ray_dte.h"
#include "sommet.h"
#include "sc.h"
#include "sg.h"
+ Include dependency graph for test_chernikova.c:

Go to the source code of this file.

Data Structures

struct  vector
 test de chernikovaa More...
 
struct  matrix
 

Typedefs

typedef struct vector vector
 test de chernikovaa More...
 
typedef struct matrix matrix
 

Functions

int main (int argc, char **argv)
 

Typedef Documentation

◆ matrix

typedef struct matrix matrix

◆ vector

typedef struct vector vector

test de chernikovaa

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 60 of file test_chernikova.c.

63 {
64  FILE * f;
65  char * filename = "stdin";
66  Psysteme sc=SC_EMPTY;
67  Psysteme sc1;
68  Ptsg sg;
69 
70  if(argc==1) {
71  f = stdin;
72  fprintf(stderr,"From stdin\n");
73  }
74  else if (argc==2) {
75  filename = strdup(argv[1]);
76  if((f = fopen(filename,"r")) == NULL) {
77  fprintf(stderr,"Cannot open file %s\n", filename);
78  return 4;
79  }
80  }
81  else {
82  fprintf(stderr,"Usage: test_chernikova [filename]\n");
83  return 1;
84  }
85 
86  sg = sg_new();
87  if(sc_fscan(f,&sc)) {
88  printf("Initial constraint system:\n");
89  sc_fprint(stdout,sc,*variable_default_name);
90 
91  sg = sc_to_sg_chernikova(sc);
92  printf("Generating system\n");
94 
95  sc1 = sc_new();
96  sc1 = sg_to_sc_chernikova(sg);
97  printf("Regenerated constraint system:\n");
98  sc_fprint(stdout,sc,*variable_default_name);
99  }
100  else {
101  fprintf(stderr,"syntax error in %s\n",filename);
102  }
103  return 0;
104 } /* main */
Psysteme sg_to_sc_chernikova(Ptsg sg)
Definition: chernikova.c:58
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
int f(int off1, int off2, int n, float r[n], float a[n], float b[n])
Definition: offsets.c:15
Psysteme sc_new(void)
Psysteme sc_new(): alloue un systeme vide, initialise tous les champs avec des valeurs nulles,...
Definition: sc_alloc.c:55
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 printf()
Ptsg sg_new()
Ptsg sg_new(): allocation d'un systeme generateur et initialisation a la valeur ensemble vide.
Definition: sg.c:55
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

References f(), fprintf(), printf(), sc_fprint(), sc_fscan(), sc_new(), sc_to_sg_chernikova(), sg, sg_fprint(), sg_new(), sg_to_sc_chernikova(), strdup(), and variable_default_name().

+ Here is the call graph for this function: