PIPS
io.c File Reference
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "linear_assert.h"
#include "boolean.h"
#include "arithmetique.h"
#include "vecteur.h"
#include "contrainte.h"
+ Include dependency graph for io.c:

Go to the source code of this file.

Functions

static Value fprint_contrainte_vecteur (FILE *fp, Pvecteur v, char *(*variable_name)(Variable))
 package contrainte - operations d'entree-sortie More...
 
void contrainte_fprint (FILE *fp, Pcontrainte c, bool is_inegalite, char *(*variable_name)(Variable))
 
void egalite_fprint (FILE *fp, Pcontrainte eg, char *(*variable_name)(Variable))
 void egalite_fprint(FILE * fp, Pcontrainte eg, char * (*variable_name)()): impression d'une egalite eg dans le fichier fp avec des noms de variables donnes par variable_name; voir contrainte_fprint More...
 
void egalite_dump (Pcontrainte c)
 void egalite_dump(Pcontrainte c): impression "physique" d'une egalite; utilise en debugging More...
 
void inegalite_fprint (FILE *fp, Pcontrainte ineg, char *(*variable_name)(Variable))
 void inegalite_fprint(FILE * fp, Pcontrainte ineg, char * (*variable_name)()): impression d'une inegalite ineg dans le fichier fp avec des noms de variables donnes par variable_name; voir contrainte_fprint More...
 
void inegalite_dump (Pcontrainte c)
 void inegalite_dump(Pcontrainte c): impression "physique" d'une inegalite; utilise en debugging More...
 
void egalites_fprint (FILE *fp, Pcontrainte eg, char *(*variable_name)(Variable))
 void egalites_fprint(FILE * fp, Pcontrainte eg, char * (*variable_name)()): impression d'une liste d'egalites eg dans le fichier fp avec des noms de variables donnes par variable_name; voir contrainte_fprint More...
 
void egalites_dump (Pcontrainte eg)
 
void inegalites_fprint (FILE *fp, Pcontrainte ineg, char *(*variable_name)(Variable))
 void inegalites_fprint(FILE * fp, Pcontrainte ineg, char * (*variable_name)()): impression d'une liste d'inegalites ineg dans le fichier fp avec des noms de variables donnes par variable_name; voir contrainte_fprint More...
 
void inegalites_dump (Pcontrainte eg)
 
void sprint_operator (char *s, bool is_inegalite, bool a_la_fortran)
 
static char * heuristique_1 (char *s, Pvecteur v, bool is_inegalite, char *(*variable_name)(Variable), bool a_la_fortran)
 
static char * heuristique_3 (char *s, Pvecteur v, bool is_inegalite, char *(*variable_name)(Variable), bool a_la_fortran)
 
char * contrainte_sprint (char *s, Pcontrainte c, bool is_inegalite, char *(*variable_name)(Variable))
 char * contrainte_sprint(char * s, Pcontrainte c, bool is_inegalite, char * (*variable_name)()): Traduction d'une contrainte c en une chaine s de caracteres ASCII. More...
 
char * contrainte_sprint_format (char *s, Pcontrainte c, bool is_inegalite, char *(*variable_name)(Variable), bool a_la_fortran)
 
char * egalite_sprint (char *s, Pcontrainte eg, char *(*variable_name)(Variable))
 void egalite_fprint(FILE * fp, Pcontrainte eg, char * (*variable_name)()): impression d'une egalite eg dans la chaine s avec des noms de variables donnes par variable_name; voir contrainte_sprint More...
 
char * inegalite_sprint (char *s, Pcontrainte ineg, char *(*variable_name)(Variable))
 
char * egalite_sprint_format (char *s, Pcontrainte eg, char *(*variable_name)(Variable), bool a_la_fortran)
 
char * inegalite_sprint_format (char *s, Pcontrainte ineg, char *(*variable_name)(Variable), bool a_la_fortran)
 

Function Documentation

◆ contrainte_fprint()

void contrainte_fprint ( FILE *  fp,
Pcontrainte  c,
bool  is_inegalite,
char * (*)(Variable variable_name 
)

Definition at line 123 of file io.c.

128 {
129  Pvecteur v;
130  Value constante = VALUE_ZERO;
131 
132  if (!CONTRAINTE_UNDEFINED_P(c))
133  v = contrainte_vecteur(c);
134  else
135  v = VECTEUR_NUL;
136 
137  assert(vect_check(v));
138 
139  constante = fprint_contrainte_vecteur(fp, v, variable_name);
140 
141  (void) fprintf(fp, " %s ", is_inegalite? "<=": "==");
142  fprint_Value(fp, value_uminus(constante));
143  fprintf(fp, " ,\n");
144 }
#define VALUE_ZERO
#define value_uminus(val)
unary operators on values
int Value
#define CONTRAINTE_UNDEFINED_P(c)
#define contrainte_vecteur(c)
passage au champ vecteur d'une contrainte "a la Newgen"
void fprint_Value(FILE *f, Value v)
Definition: io.c:42
static Value fprint_contrainte_vecteur(FILE *fp, Pvecteur v, char *(*variable_name)(Variable))
package contrainte - operations d'entree-sortie
Definition: io.c:74
bool vect_check(Pvecteur cv)
bool vect_check(Pvecteur v): renvoie true si le vecteur v est coherent avec les specifications du pac...
Definition: reductions.c:529
#define assert(ex)
Definition: newgen_assert.h:41
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
char * variable_name(Variable v)
polynome_ri.c
Definition: polynome_ri.c:73
le type des coefficients dans les vecteurs: Value est defini dans le package arithmetique
Definition: vecteur-local.h:89
#define VECTEUR_NUL
DEFINITION DU VECTEUR NUL.

References assert, CONTRAINTE_UNDEFINED_P, contrainte_vecteur, fprint_contrainte_vecteur(), fprint_Value(), fprintf(), value_uminus, VALUE_ZERO, variable_name(), vect_check(), and VECTEUR_NUL.

Referenced by egalite_fprint(), egalites_fprint(), inegalite_fprint(), and inegalites_fprint().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ contrainte_sprint()

char* contrainte_sprint ( char *  s,
Pcontrainte  c,
bool  is_inegalite,
char * (*)(Variable variable_name 
)

char * contrainte_sprint(char * s, Pcontrainte c, bool is_inegalite, char * (*variable_name)()): Traduction d'une contrainte c en une chaine s de caracteres ASCII.

Les noms des variables sont recuperes via la fonction variable_name(). Egalites et inegalites sont traitees.

La chaine s doit avoir ete allouee par le programme appelant, avec une longueur suffisante. Pour etre propre, il faudrait aussi passer cette longueur.

Plusieurs heuristiques d'impression ont ete proposees:

  • h1: mettre le terme constant en partie droite (Francois Irigoin); inconvenient: -I <= -1 au lieu de I >= 1
  • h2: minimiser le nombre de signes "moins" en prenant la contrainte opposee si necessaire; le signe du terme constant n'est pas pris en compte (Francois Irigoin); inconvenient: I == J est imprime sous la forme I - J == 0
  • h3: mettre les termes du bon cote pour ne pas avoir de signe "moins" (Michel Lenci); inconvenient: I == -1 est imprime comme I+1 == 0

Pour avoir de bons resultats, il doit sans doute falloir faire du cas par cas, distinguer les egalites des inegalites et prendre en compte le nombre de termes de la contrainte. A ameliorer experimentalement.

Note: variable_name() should return an empty string for constant terms

Modifications:

  • suppression de l'impression de la virgule de separation en fin de chaine (Francois Irigoin, 7 mai 1990)

Definition at line 424 of file io.c.

429 {
430  s = contrainte_sprint_format(s, c, is_inegalite, variable_name, false);
431  return s;
432 }
char * contrainte_sprint_format(char *s, Pcontrainte c, bool is_inegalite, char *(*variable_name)(Variable), bool a_la_fortran)
Definition: io.c:435

References contrainte_sprint_format(), and variable_name().

Referenced by egalite_sprint(), and inegalite_sprint().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ contrainte_sprint_format()

char* contrainte_sprint_format ( char *  s,
Pcontrainte  c,
bool  is_inegalite,
char *(*)(Variable variable_name,
bool  a_la_fortran 
)

Definition at line 435 of file io.c.

441 {
442  Pvecteur v;
443  int heuristique = 3;
444 
445  if (!CONTRAINTE_UNDEFINED_P(c))
446  v = contrainte_vecteur(c);
447  else
448  v = VECTEUR_NUL;
449 
450  assert(vect_check(v));
451 
452  switch(heuristique) {
453  case 1: s = heuristique_1(s, v, is_inegalite, variable_name, a_la_fortran);
454  break;
455  case 3: s = heuristique_3(s, v, is_inegalite, variable_name, a_la_fortran);
456  break;
457  default: contrainte_error("contrainte_sprint", "unknown heuristics\n");
458  }
459 
460  return s;
461 }
void contrainte_error(char *, char *,...)
error.c
Definition: error.c:49
static char * heuristique_1(char *s, Pvecteur v, bool is_inegalite, char *(*variable_name)(Variable), bool a_la_fortran)
Definition: io.c:231
static char * heuristique_3(char *s, Pvecteur v, bool is_inegalite, char *(*variable_name)(Variable), bool a_la_fortran)
Definition: io.c:275

References assert, contrainte_error(), CONTRAINTE_UNDEFINED_P, contrainte_vecteur, heuristique_1(), heuristique_3(), variable_name(), vect_check(), and VECTEUR_NUL.

Referenced by contrainte_sprint(), egalite_sprint_format(), and inegalite_sprint_format().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ egalite_dump()

void egalite_dump ( Pcontrainte  c)

void egalite_dump(Pcontrainte c): impression "physique" d'une egalite; utilise en debugging

Definition at line 160 of file io.c.

160  {
162 }
void egalite_fprint(FILE *fp, Pcontrainte eg, char *(*variable_name)(Variable))
void egalite_fprint(FILE * fp, Pcontrainte eg, char * (*variable_name)()): impression d'une egalite e...
Definition: io.c:152
char *(* variable_debug_name)(Variable)
Debug support: pointer to the function used by debug print outs.
Definition: variable.c:114

References egalite_fprint(), and variable_debug_name.

+ Here is the call graph for this function:

◆ egalite_fprint()

void egalite_fprint ( FILE *  fp,
Pcontrainte  eg,
char *(*)(Variable variable_name 
)

void egalite_fprint(FILE * fp, Pcontrainte eg, char * (*variable_name)()): impression d'une egalite eg dans le fichier fp avec des noms de variables donnes par variable_name; voir contrainte_fprint

Ancien nom: eg_print(), print_eq()

Definition at line 152 of file io.c.

153 {
154  contrainte_fprint(fp,eg,false,variable_name);
155 }
void contrainte_fprint(FILE *fp, Pcontrainte c, bool is_inegalite, char *(*variable_name)(Variable))
Definition: io.c:123

References contrainte_fprint(), and variable_name().

Referenced by egalite_dump().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ egalite_sprint()

char* egalite_sprint ( char *  s,
Pcontrainte  eg,
char * (*)(Variable variable_name 
)

void egalite_fprint(FILE * fp, Pcontrainte eg, char * (*variable_name)()): impression d'une egalite eg dans la chaine s avec des noms de variables donnes par variable_name; voir contrainte_sprint

Definition at line 468 of file io.c.

472 {
473  return contrainte_sprint(s, eg, false, variable_name);
474 }
char * contrainte_sprint(char *s, Pcontrainte c, bool is_inegalite, char *(*variable_name)(Variable))
char * contrainte_sprint(char * s, Pcontrainte c, bool is_inegalite, char * (*variable_name)()): Trad...
Definition: io.c:424

References contrainte_sprint(), and variable_name().

+ Here is the call graph for this function:

◆ egalite_sprint_format()

char* egalite_sprint_format ( char *  s,
Pcontrainte  eg,
char * (*)(Variable variable_name,
bool  a_la_fortran 
)

Definition at line 486 of file io.c.

491 {
493  (s, eg, false, variable_name, a_la_fortran);
494 }

References contrainte_sprint_format(), and variable_name().

+ Here is the call graph for this function:

◆ egalites_dump()

void egalites_dump ( Pcontrainte  eg)
Parameters
egg

Definition at line 201 of file io.c.

202 {egalites_fprint(stderr, eg, variable_debug_name);}
void egalites_fprint(FILE *fp, Pcontrainte eg, char *(*variable_name)(Variable))
void egalites_fprint(FILE * fp, Pcontrainte eg, char * (*variable_name)()): impression d'une liste d'...
Definition: io.c:192

References egalites_fprint(), and variable_debug_name.

+ Here is the call graph for this function:

◆ egalites_fprint()

void egalites_fprint ( FILE *  fp,
Pcontrainte  eg,
char * (*)(Variable variable_name 
)

void egalites_fprint(FILE * fp, Pcontrainte eg, char * (*variable_name)()): impression d'une liste d'egalites eg dans le fichier fp avec des noms de variables donnes par variable_name; voir contrainte_fprint

Ancien nom: fprint_leq()

Definition at line 192 of file io.c.

196 {
197  for( ; eg != NULL; eg = eg->succ)
198  contrainte_fprint(fp,eg,false,variable_name);
199 }
struct Scontrainte * succ

References contrainte_fprint(), Scontrainte::succ, and variable_name().

Referenced by egalites_dump().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fprint_contrainte_vecteur()

static Value fprint_contrainte_vecteur ( FILE *  fp,
Pvecteur  v,
char *(*)(Variable variable_name 
)
static

package contrainte - operations d'entree-sortie

modifications :

  • ajout du parametre a_la_fortran pour une impression compatible avec Fortran (permet a certains logiciels externes de re'cupe'rer les syste`mes sous un format compatible au leur. BA, avril 1994. INTLIBRARY void contrainte_fprint(FILE * fp, Pcontrainte c, bool is_inegalite, char * (*variable_name)()):

imprime dans le fichier fp la contrainte c, de type egalite ou inegalite suivant la valeur du booleen is_inegalite, en utilisant la fonction variable_name pour trouver les noms des variables.

Pour suivre les convention usuelles, le terme constant est imprime comme membre droit.

On considere que CONTRAINTE_UNDEFINED => CONTRAINTE_NULLE

Resultat: 2 * I - J = 4 LF -I + 3 * J <= 5 LF

Note: l'impression se termine par un LF aucun routine ne sait lire ce format ancien nom eq_print returns the constant

on admet plusieurs occurences du terme constant!?!

To handle cases where the constraint only has constant (this is a bug somewhere, we must remove the constraint). If we print: "<= constant ," then sc_fscan cannot read this output, so let's print: " constant <= constant ," which is readable by sc_fscan, and doesn't change the sc.

Definition at line 74 of file io.c.

78 {
79  short int debut = 1;
80  Value constante = VALUE_ZERO;
81 
82  while (!VECTEUR_NUL_P(v)) {
83  Variable var = var_of(v);
84  Value coeff = val_of(v);
85  if (var!=TCST) {
86  char signe;
87 
88  if (value_notzero_p(coeff)) {
89 
90  if (value_pos_p(coeff))
91  signe = (debut) ? ' ' : '+';
92  else {
93  signe = '-';
94  coeff = value_uminus(coeff);
95  };
96  debut = 0;
97  (void) fprintf(fp, "%c", signe);
98  if (value_notone_p(coeff))
99  (void) fprintf(fp, " "), fprint_Value(fp, coeff);
100  (void) fprintf(fp, " %s ", variable_name(var));
101  }
102  }
103  else
104  /* on admet plusieurs occurences du terme constant!?! */
105  value_addto(constante, coeff);
106 
107  v = v->succ;
108  }
109 
110  /* To handle cases where the constraint only has constant (this is a bug
111  somewhere, we must remove the constraint). If we print:
112  "<= constant ," then sc_fscan cannot read this output, so let's print:
113  " constant <= constant ," which is readable by sc_fscan, and doesn't change
114  the sc.
115  */
116  if (debut) {
117  (void) fprintf(fp, " "), fprint_Value(fp, constante), fprintf(fp, " ");
118  }
119 
120  return constante;
121 }
#define value_pos_p(val)
#define value_notzero_p(val)
#define value_notone_p(val)
#define value_addto(ref, val)
struct Svecteur * succ
Definition: vecteur-local.h:92
#define TCST
VARIABLE REPRESENTANT LE TERME CONSTANT.
#define val_of(varval)
#define VECTEUR_NUL_P(v)
void * Variable
arithmetique is a requirement for vecteur, but I do not want to inforce it in all pips files....
Definition: vecteur-local.h:60
#define var_of(varval)

References fprint_Value(), fprintf(), Svecteur::succ, TCST, val_of, value_addto, value_notone_p, value_notzero_p, value_pos_p, value_uminus, VALUE_ZERO, var_of, variable_name(), and VECTEUR_NUL_P.

Referenced by contrainte_fprint().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ heuristique_1()

static char* heuristique_1 ( char *  s,
Pvecteur  v,
bool  is_inegalite,
char * (*)(Variable variable_name,
bool  a_la_fortran 
)
static

on admet plusieurs occurences du terme constant!?!

Definition at line 231 of file io.c.

237 {
238  short int debut = 1;
239  Value constante = VALUE_ZERO;
240 
241  while (!VECTEUR_NUL_P(v)) {
242  Variable var = var_of(v);
243  Value coeff = val_of(v);
244  if (var!=TCST) {
245  char signe;
246 
247  if (value_notzero_p(coeff)) {
248  if (value_pos_p(coeff))
249  signe = (debut) ? ' ' : '+';
250  else {
251  signe = '-';
252  coeff = value_uminus(coeff);
253  };
254  debut = 0;
255  (void) sprintf(s+strlen(s),"%c", signe);
256  if (value_notone_p(coeff))
257  (void) sprint_Value(s+strlen(s), coeff);
258  (void) sprintf(s+strlen(s), "%s", variable_name(var));
259  }
260  }
261  else
262  /* on admet plusieurs occurences du terme constant!?! */
263  value_addto(constante, coeff);
264 
265  v = v->succ;
266  }
267 
268  (void) sprint_operator(s+strlen(s), is_inegalite, a_la_fortran);
269  (void) sprint_Value(s+strlen(s), value_uminus(constante));
270 
271  return s;
272 }
void sprint_Value(char *s, Value v)
Definition: io.c:53
void sprint_operator(char *s, bool is_inegalite, bool a_la_fortran)
Definition: io.c:224

References sprint_operator(), sprint_Value(), Svecteur::succ, TCST, val_of, value_addto, value_notone_p, value_notzero_p, value_pos_p, value_uminus, VALUE_ZERO, var_of, variable_name(), and VECTEUR_NUL_P.

Referenced by contrainte_sprint_format().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ heuristique_3()

static char* heuristique_3 ( char *  s,
Pvecteur  v,
bool  is_inegalite,
char * (*)(Variable variable_name,
bool  a_la_fortran 
)
static

Save the constant term for future use

And now, a lie... In fact, rhs_terms++

Definition at line 275 of file io.c.

281 {
282  Pvecteur coord;
283  short int debut = true;
284  int positive_terms = 0;
285  int negative_terms = 0;
286  Value const_coeff = 0;
287  bool const_coeff_p = false;
288 
289  if(!is_inegalite) {
290  for(coord = v; !VECTEUR_NUL_P(coord); coord = coord->succ) {
291  if(vecteur_var(coord)!= TCST) {
292  if(value_pos_p(vecteur_val(coord)))
293  positive_terms++;
294  else
295  negative_terms++;
296  }
297  }
298 
299  if(negative_terms > positive_terms) {
300  vect_chg_sgn(v);
301  }
302  }
303 
304  positive_terms = 0;
305  negative_terms = 0;
306 
307  for(coord = v; !VECTEUR_NUL_P(coord); coord = coord->succ) {
308  Value coeff = vecteur_val(coord);
309  Variable var = vecteur_var(coord);
310 
311  if (value_pos_p(coeff)) {
312  positive_terms++;
313  if (debut) {
314  debut = false;
315  if (value_one_p(coeff) && var!=TCST)
316  (void) sprintf(s+strlen(s),"%s",
317  variable_name(vecteur_var(coord)));
318  else if(!term_cst(coord) || is_inegalite){
319  (void) sprint_Value(s+strlen(s), coeff);
320  (void) sprintf(s+strlen(s),"%s", variable_name(var));
321  }
322  else {
323  debut = true;
324  positive_terms--;
325  }
326  }
327  else
328  if (value_one_p(coeff) && var!=TCST)
329  (void) sprintf(s+strlen(s),"+%s", variable_name(var));
330  else if(!term_cst(coord) || is_inegalite) {
331  (void) sprintf(s+strlen(s),"+");
332  (void) sprint_Value(s+strlen(s), coeff);
333  (void) sprintf(s+strlen(s),"%s", variable_name(var));
334  }
335  else
336  positive_terms--;
337  }
338  }
339 
340  if(positive_terms == 0)
341  (void) sprintf(s+strlen(s),"0");
342 
343  (void) sprint_operator(s+strlen(s), is_inegalite, a_la_fortran);
344 
345  debut = true;
346  for(coord = v; !VECTEUR_NUL_P(coord); coord = coord->succ) {
347  Value coeff = vecteur_val(coord);
348  Variable var = var_of(coord);
349 
350  if(term_cst(coord) && !is_inegalite) {
351  /* Save the constant term for future use */
352  const_coeff_p = true;
353  const_coeff = coeff;
354  /* And now, a lie... In fact, rhs_terms++ */
355  negative_terms++;
356  }
357  else if (value_neg_p(coeff)) {
358  negative_terms++;
359  if (debut == true) {
360  debut = false;
361  if (value_mone_p(coeff) && var!=TCST)
362  (void) sprintf(s+strlen(s),"%s", variable_name(var));
363  else {
364  (void) sprint_Value(s+strlen(s), value_uminus(coeff));
365  (void) sprintf(s+strlen(s),"%s", variable_name(var));
366  }
367  }
368  else
369  if (value_mone_p(coeff) && var!=TCST)
370  (void) sprintf(s+strlen(s),"+%s", variable_name(var));
371  else {
372  (void) sprintf(s+strlen(s),"+");
373  (void) sprint_Value(s+strlen(s), value_uminus(coeff));
374  (void) sprintf(s+strlen(s),"%s", variable_name(var));
375  }
376  }
377  }
378 
379  if(negative_terms == 0)
380  (void) sprintf(s+strlen(s),"0");
381  else if(const_coeff_p) {
382  assert(value_notzero_p(const_coeff));
383 
384  if(!debut && value_neg_p(const_coeff))
385  (void) sprintf(s+strlen(s), "+");
386 
387  sprint_Value(s+strlen(s), value_uminus(const_coeff));
388  }
389 
390  return s;
391 }
#define value_mone_p(val)
#define value_one_p(val)
#define value_neg_p(val)
void vect_chg_sgn(Pvecteur v)
void vect_chg_sgn(Pvecteur v): multiplie v par -1
Definition: scalaires.c:151
#define vecteur_val(v)
#define vecteur_var(v)
#define term_cst(varval)

References assert, sprint_operator(), sprint_Value(), Svecteur::succ, TCST, term_cst, value_mone_p, value_neg_p, value_notzero_p, value_one_p, value_pos_p, value_uminus, var_of, variable_name(), vect_chg_sgn(), VECTEUR_NUL_P, vecteur_val, and vecteur_var.

Referenced by contrainte_sprint_format().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ inegalite_dump()

void inegalite_dump ( Pcontrainte  c)

void inegalite_dump(Pcontrainte c): impression "physique" d'une inegalite; utilise en debugging

Definition at line 182 of file io.c.

182  {
184 }
void inegalite_fprint(FILE *fp, Pcontrainte ineg, char *(*variable_name)(Variable))
void inegalite_fprint(FILE * fp, Pcontrainte ineg, char * (*variable_name)()): impression d'une inega...
Definition: io.c:171

References inegalite_fprint(), and variable_debug_name.

+ Here is the call graph for this function:

◆ inegalite_fprint()

void inegalite_fprint ( FILE *  fp,
Pcontrainte  ineg,
char * (*)(Variable variable_name 
)

void inegalite_fprint(FILE * fp, Pcontrainte ineg, char * (*variable_name)()): impression d'une inegalite ineg dans le fichier fp avec des noms de variables donnes par variable_name; voir contrainte_fprint

Ancien nom: ineg_print(), print_ineq()

Definition at line 171 of file io.c.

175 {
176  contrainte_fprint(fp,ineg,true,variable_name);
177 }

References contrainte_fprint(), and variable_name().

Referenced by inegalite_dump().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ inegalite_sprint()

char* inegalite_sprint ( char *  s,
Pcontrainte  ineg,
char * (*)(Variable variable_name 
)

Definition at line 477 of file io.c.

481 {
482  return contrainte_sprint(s, ineg, true, variable_name);
483 }

References contrainte_sprint(), and variable_name().

+ Here is the call graph for this function:

◆ inegalite_sprint_format()

char* inegalite_sprint_format ( char *  s,
Pcontrainte  ineg,
char * (*)(Variable variable_name,
bool  a_la_fortran 
)

Definition at line 497 of file io.c.

502 {
504  (s, ineg, true, variable_name, a_la_fortran);
505 }

References contrainte_sprint_format(), and variable_name().

+ Here is the call graph for this function:

◆ inegalites_dump()

void inegalites_dump ( Pcontrainte  eg)
Parameters
egg

Definition at line 220 of file io.c.

void inegalites_fprint(FILE *fp, Pcontrainte ineg, char *(*variable_name)(Variable))
void inegalites_fprint(FILE * fp, Pcontrainte ineg, char * (*variable_name)()): impression d'une list...
Definition: io.c:211

References inegalites_fprint(), and variable_debug_name.

Referenced by build_convex_constraints_from_vertices(), check_coefficient_reduction(), and sc_bounded_normalization().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ inegalites_fprint()

void inegalites_fprint ( FILE *  fp,
Pcontrainte  ineg,
char * (*)(Variable variable_name 
)

void inegalites_fprint(FILE * fp, Pcontrainte ineg, char * (*variable_name)()): impression d'une liste d'inegalites ineg dans le fichier fp avec des noms de variables donnes par variable_name; voir contrainte_fprint

Ancien nom: fprint_lineq()

Definition at line 211 of file io.c.

215 {
216  for( ; ineg != NULL; ineg = ineg->succ)
217  contrainte_fprint(fp,ineg,true,variable_name);
218 }

References contrainte_fprint(), Scontrainte::succ, and variable_name().

Referenced by inegalites_dump().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sprint_operator()

void sprint_operator ( char *  s,
bool  is_inegalite,
bool  a_la_fortran 
)
Parameters
is_inegalites_inegalite
a_la_fortran_la_fortran

Definition at line 224 of file io.c.

225 {
226  (void) sprintf(s, "%s",(is_inegalite? (a_la_fortran? ".LE.": "<="):
227  (a_la_fortran? ".EQ.": "==")));
228 }

Referenced by heuristique_1(), and heuristique_3().

+ Here is the caller graph for this function: