54 #define MALLOC(s,t,f) malloc(s)
87 printf (
" **** alg. primal - recherche ligne pivot \n");
92 ps = ps->
succ,nb_som --);
110 for (ps = ps->
succ; ps != NULL; ps = ps->
succ) {
117 if ( ncoeff<
min || ( ncoeff ==
min &&
153 printf (
" **** alg. primal - recherche de la variable pivot \n");
175 for (pv2 = pv1; pv2 != NULL; pv2 = pv2->
succ) {
187 printf(
"variable pivot choisie: %s\n",var);
223 printf (
" *** algorithme primal du simplexe \n");
230 if (lpivot != NULL) {
232 pivoter(ps,lpivot,var_entrant,fonct);
240 printf (
" cas 4 ou le probleme n'est pas borne \n");
244 if (((ps2 = som_sys_conv(ps))) != NULL)
254 printf (
" ---- alg. primal - plus de variable pivot possible \n");
256 printf (
" ---- alg. primal - pas de solution \n");
296 printf (
" ** Algorithme du simplexe avec fonct. econom.\n");
299 if (ps != NULL && fonct!= NULL)
305 nbvars = ps->dimension;
307 ps1 = sys_som_conv(ps,&nb_som);
309 if((ps1 =
eq_in_ineq(&ps1,&nb_som,&lvbase)) != NULL) {
310 ps1 =
add_var_sup(ps1,nb_som,&lvbase,&lvsup,&nbvars,
315 printf (
" le systeme est non faisable \n");
317 if ((ps2 = som_sys_conv(ps1)) != NULL) {
345 printf (
" ** Algorithme du simplexe avec fonct. econom.\n");
348 if (ps != NULL && fonct!= NULL) {
352 nbvars = ps->dimension;
354 ps1 = sys_som_conv(ps,&nb_som);
356 if((ps1 =
eq_in_ineq(&ps1,&nb_som,&lvbase)) != NULL) {
357 ps1 =
add_var_sup(ps1,nb_som,&lvbase,&lvsup,&nbvars,
362 printf (
" le systeme est non faisable \n");
364 if ((ps2 = som_sys_conv(ps1)) != NULL) {
376 if (ps2) result =
true;
#define value_uminus(val)
unary operators on values
#define value_negz_p(val)
#define VALUE_TO_DOUBLE(val)
#define value_mod(v1, v2)
#define value_div(v1, v2)
#define value_posz_p(val)
void print_Value(Value)
io.c
int non_borne(Tableau *tp, int nvar, Entier D, int bigparm)
char * variable_default_name(Variable v)
char * variable_default_name(Variable v): returns the name of variable v
void pivoter(Psommet sys, Psommet ligne, Variable var, Psommet fonct)
Variable var_pivots(Psommet fonct)
Variable var_pivots(Psommet fonct): algorithme primal du simplexe - recherche de la variable pivot en...
Psommet primal_pivot(Psommet sys, Pvecteur *lvbase, int nb_som, Psommet fonct)
Psommet primal_pivot(Psommet sys, Pvecteur * lvbase, int nb_som, Psommet fonct): algorithme primal du...
Psysteme primal(Psysteme ps, Psommet fonct)
Psysteme primal(Psysteme ps, Psommet fonct): Algorithme primal du simplexe avec fonction economique i...
bool primal_positive(Psysteme ps, Psommet fonct)
Psommet lignes_entrant(Psommet sys, Variable var, int nb_som, int *no_som)
Psommet lignes_entrant(Psommet sys, Variable var, int nb_som, int * no_som): algorithme primal du sim...
bool sol_positive_simpl(Psommet sys, Pvecteur lvbase, Pvecteur lvsup, int nb_som)
Psommet add_var_sup(Psommet sys, int nb_som, Pvecteur *lvbase, Pvecteur *lvsup, int *nbvars, Pbase *b, Psommet fonct)
Psommet eq_in_ineq(Psommet *sys, int *nb_som, Pvecteur *lvbase)
Psommet eq_in_ineq(Psommet * sys, int * nb_som, Pvecteur * lvbase): Transformation des egalites du sy...
void lvbase_ote_no_ligne(int no_ligne, Pvecteur *lvbase)
void lvbase_ote_no_ligne(int no_ligne, Pvecteur * lvbase): Elimination de la variable de base corresp...
void lvbase_add(Variable var, int no_ligne, Pvecteur *lvbase)
void lvbase_add(Variable var, int no_ligne, Pvecteur * lvbase): ajout d'un couple (variable de base,...
void sc_rm(Psysteme ps)
void sc_rm(Psysteme ps): liberation de l'espace memoire occupe par le systeme de contraintes ps;
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...
void sommets_normalize(Psommet)
void sommets_normalize(som) Normalisation des elements d'une liste de sommets i.e.
void sommets_rm(Psommet)
void sommets_rm(Psommet ps): liberation de l'espace memoire alloue a une liste de sommets
le type des coefficients dans les vecteurs: Value est defini dans le package arithmetique
structure de donnees Sommet
#define TCST
VARIABLE REPRESENTANT LE TERME CONSTANT.
#define VECTEUR_NUL
DEFINITION DU VECTEUR NUL.
void * Variable
arithmetique is a requirement for vecteur, but I do not want to inforce it in all pips files....
#define BASE_NULLE
MACROS SUR LES BASES.
Pbase base_dup(Pbase b)
Pbase base_dup(Pbase b) Note: this function changes the value of the pointer.
Pvecteur vect_new(Variable var, Value coeff)
Pvecteur vect_new(Variable var,Value coeff): allocation d'un vecteur colineaire au vecteur de base va...
void vect_rm(Pvecteur v)
void vect_rm(Pvecteur v): desallocation des couples de v;
int vect_compare(Pvecteur *pv1, Pvecteur *pv2)
for qsort, returns:
Value vect_coeff(Variable var, Pvecteur vect)
Variable vect_coeff(Variable var, Pvecteur vect): coefficient de coordonnee var du vecteur vect —> So...
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...
Pvecteur vect_sort(Pvecteur v, int *compare)
Pvecteur vect_sort(v, compare) Pvecteur v; int (*compare)();.