PIPS
plsomvb-test.c File Reference
#include <stdio.h>
#include "boolean.h"
#include "arithmetique.h"
#include "vecteur.h"
#include "contrainte.h"
#include "sc.h"
#include "sommet.h"
#include "matrix.h"
#include "plint.h"
+ Include dependency graph for plsomvb-test.c:

Go to the source code of this file.

Macros

#define MALLOC(s, t, f)   malloc(s)
 

Functions

char * malloc ()
 
bool const_negative (Psommet som)
 
bool test_borne (Psommet eq)
 
bool cout_nul (Psommet fonct, Pvecteur lvbase, int nbvars, Pbase b)
 

Macro Definition Documentation

◆ MALLOC

#define MALLOC (   s,
  t,
  f 
)    malloc(s)

Definition at line 40 of file plsomvb-test.c.

Function Documentation

◆ const_negative()

bool const_negative ( Psommet  som)

Definition at line 57 of file plsomvb-test.c.

59 {
60  Psommet ps;
61  bool result = false;
62 
63  for (ps = som;
64  ps!= NULL && value_negz_p(vect_coeff(TCST,ps->vecteur));
65  ps= ps->succ);
66  result = (ps == NULL) ? false : true;
67  return (result);
68 }
#define value_negz_p(val)
structure de donnees Sommet
Definition: sommet-local.h:64
struct typ_som * succ
Definition: sommet-local.h:68
Pvecteur vecteur
Definition: sommet-local.h:66
#define TCST
VARIABLE REPRESENTANT LE TERME CONSTANT.
Value vect_coeff(Variable var, Pvecteur vect)
Variable vect_coeff(Variable var, Pvecteur vect): coefficient de coordonnee var du vecteur vect —> So...
Definition: unaires.c:228

References typ_som::succ, TCST, value_negz_p, vect_coeff(), and typ_som::vecteur.

Referenced by plint_pas().

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

◆ cout_nul()

bool cout_nul ( Psommet  fonct,
Pvecteur  lvbase,
int  nbvars,
Pbase  b 
)

liste des variables h.base de cout nul

Definition at line 127 of file plsomvb-test.c.

132 {
133  Pvecteur liste1 = NULL; /* liste des variables h.base de cout nul */
134  Pvecteur pv=NULL;
135  Pvecteur pv2=VECTEUR_NUL;
136  register int i;
137  bool result= false;
138 
139 #ifdef TRACE
140  printf(" ** Gomory - existe-t-il une var. h.base de cout nul \n");
141 #endif
142 
143  liste1 = vect_new(vecteur_var(b),VALUE_ONE);
144  for (i = 1 ,pv2 = b->succ;
145  i< nbvars && !VECTEUR_NUL_P(pv2);
146  i++, pv2=pv2->succ)
147  vect_add_elem (&(liste1),vecteur_var(pv2),VALUE_ONE);
148  if (fonct != NULL)
149  for (pv = fonct->vecteur;pv != NULL;pv=pv->succ)
150  if (value_notzero_p(pv->val))
151  vect_chg_coeff(&liste1,pv->var,0);
152 
153  for (pv = lvbase;pv != NULL;pv=pv->succ)
154  if (value_notzero_p(pv->val))
155  vect_chg_coeff(&liste1,pv->var,0);
156  result = (liste1 != NULL) ? true : false;
157 
158  vect_rm(liste1);
159  return (result);
160 
161 }
#define value_notzero_p(val)
#define VALUE_ONE
int printf()
le type des coefficients dans les vecteurs: Value est defini dans le package arithmetique
Definition: vecteur-local.h:89
Value val
Definition: vecteur-local.h:91
Variable var
Definition: vecteur-local.h:90
struct Svecteur * succ
Definition: vecteur-local.h:92
#define vecteur_var(v)
#define VECTEUR_NUL
DEFINITION DU VECTEUR NUL.
#define VECTEUR_NUL_P(v)
Pvecteur vect_new(Variable var, Value coeff)
Pvecteur vect_new(Variable var,Value coeff): allocation d'un vecteur colineaire au vecteur de base va...
Definition: alloc.c:110
void vect_rm(Pvecteur v)
void vect_rm(Pvecteur v): desallocation des couples de v;
Definition: alloc.c:78
void vect_add_elem(Pvecteur *pvect, Variable var, Value val)
void vect_add_elem(Pvecteur * pvect, Variable var, Value val): addition d'un vecteur colineaire au ve...
Definition: unaires.c:72
void vect_chg_coeff(Pvecteur *ppv, Variable var, Value val)
void vect_chg_coeff(Pvecteur *ppv, Variable var, Value val): mise de la coordonnee var du vecteur *pp...
Definition: unaires.c:143

References printf(), Svecteur::succ, Svecteur::val, value_notzero_p, VALUE_ONE, Svecteur::var, vect_add_elem(), vect_chg_coeff(), vect_new(), vect_rm(), VECTEUR_NUL, VECTEUR_NUL_P, and vecteur_var.

Referenced by plint_pas().

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

◆ malloc()

char* malloc ( )

◆ test_borne()

bool test_borne ( Psommet  eq)

Definition at line 87 of file plsomvb-test.c.

89 {
90  Pvecteur pv = NULL;
91  bool result= false;
92 
93  if (eq) {
94  pv = eq->vecteur;
95  if (value_pos_p(vect_coeff(TCST,pv)))
96  {
97  for (pv= eq->vecteur;pv!= NULL
98  && ((pv->var ==NULL) || value_pos_p(pv->val))
99  ;pv= pv->succ);
100  result = (pv==NULL) ? false : true;
101  }
102  else result = true;
103  }
104  return (result);
105 
106 }
#define value_pos_p(val)
Pcontrainte eq
element du vecteur colonne du systeme donne par l'analyse
Definition: sc_gram.c:108
Pvecteur vecteur

References eq, Svecteur::succ, TCST, Svecteur::val, value_pos_p, Svecteur::var, vect_coeff(), and Scontrainte::vecteur.

Referenced by gomory_eq().

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