55 #define MALLOC(s,t,f) malloc((unsigned)(s))
56 #define FREE(s,t,f) free((char *)(s))
90 for (i = 1; i <= nbl; i++)
158 int nblg = sys->
nb_eq;
168 bool infaisab =
false;
172 if (nbv && nblg && sys)
190 printf(
" systeme lineaire initial \n");
216 if ((((n_min==1 +
level) || (m_min==1+
level)) && !trouve ) ||
218 if (n_min >1 +
level)
231 printf (
" apres alignement du plus petit element a la premiere colonne \n");
248 printf (
" apres alignement du plus petit element a la premiere ligne \n");
252 if (m_min>0 && n_min >0) {
264 printf(
"apres division par A%d%d des termes de la %d-ieme colonne \n",
level+1,
level+
280 printf(
"apres division par A%d%d des termes de la %d-ieme ligne \n",
level+1,
level+
289 if (!n_min || !m_min)
300 printf (
" la matrice D apres transformation est la suivante :");
303 printf (
" la matrice P est \n");
306 printf (
" la matrice Q est \n");
316 printf (
" apres pre-multiplication par P \n");
322 for (i=1;i<=n && i<=m && !infaisab;i++) {
357 printf (
" systeme infaisable en nombres entiers \n");
362 printf (
" apres division par les elements diagonaux de D \n");
367 for (i=n+1; i<=m; i++,nbl++)
376 printf (
" apres pre-multiplication par Q \n");
428 bool is_faisab =
true;
430 printf (
" ** syst_smith - test de faisabilite d'un systeme avec Smith \n");
433 if ((ps->egalites != NULL) || (ps->inegalites != NULL)) {
442 nb_som = ps->nb_eq + ps->nb_ineq;
443 nbvars = ps->dimension;
450 som1 = sys_som_conv(sys2,&nb_som);
459 if ((sys2 = som_sys_conv(som1)) != NULL) {
481 is_faisab = sc_faisabilite(sys2);
484 sc_rm(sys_cond_posit);
491 printf (
" -- smith_int ==> systeme faisable \n");
492 else printf (
" -- smith_int ==> systeme non faisable \n");
#define value_sign(v)
trian operators on values
#define value_oppose(ref)
#define value_notzero_p(val)
#define value_zero_p(val)
#define value_division(ref, val)
#define value_mod(v1, v2)
char * noms_var(entity e)
comp_expr_to_pnome.c
Pcontrainte contraintes_free(Pcontrainte pc)
Pcontrainte contraintes_free(Pcontrainte pc): desallocation de toutes les contraintes de la liste pc.
Pcontrainte contrainte_new(void)
package contrainte - allocations et desallocations
#define MATRIX
FI #define NULL 0.
#define MATRIX_DENOMINATOR(matrix)
int MATRIX_DENONIMATOR(matrix): acces au denominateur global d'une matrice matrix
#define MATRIX_ELEM(matrix, i, j)
Macros d'acces aux elements d'une matrice.
Pmatrix matrix_new(int m, int n)
package matrix
void matrix_normalizec(Pmatrix MAT)
void matrix_normalizec(Pmatrix MAT): Normalisation des coefficients de la matrice MAT,...
void matrix_nulle(Pmatrix Z)
void matrix_nulle(Pmatrix Z): Initialisation de la matrice Z a la valeur matrice nulle
void matrix_multiply(const Pmatrix a, const Pmatrix b, Pmatrix c)
void matrix_multiply(Pmatrix a, Pmatrix b, Pmatrix c): multiply rational matrix a by rational matrix ...
void matrix_assign(Pmatrix A, Pmatrix B)
void matrix_assign(Pmatrix A, Pmatrix B) Copie de la matrice A dans la matrice B
void matrix_perm_col(Pmatrix, int, int)
void matrix_perm_col(Pmatrix MAT, int k, int level): Calcul de la matrice de permutation permettant ...
void matrix_print(Pmatrix)
void matrix_print(matrice a): print an (nxm) rational matrix
void matrix_maj_col(Pmatrix, Pmatrix, int)
void matrix_maj_col(Pmatrix A, matrice P, int level): Calcul de la matrice permettant de remplacer ch...
int matrix_line_el(Pmatrix, int)
int matrix_line_el(Pmatrix MAT, int level) renvoie le numero de colonne absolu du premier element non...
void matrix_identity(Pmatrix, int)
void matrix_identity(Pmatrix ID, int level) Construction d'une sous-matrice identity dans ID(level+1....
void matrix_perm_line(Pmatrix, int, int)
void matrix_perm_line(Pmatrix MAT, int k, int level): Calcul de la matrice de permutation permettant...
int matrix_col_el(Pmatrix, int)
int matrix_col_el(Pmatrix MAT, int level) renvoie le numero de ligne absolu du premier element non nu...
void matrix_min(Pmatrix, int *, int *, int)
void matrix_min(Pmatrix MAT, int * i_min, int * j_min, int level): Recherche des coordonnees (*i_min,...
void matrix_maj_line(Pmatrix, Pmatrix, int)
void matrix_maj_line(Pmatrix A, matrice Q, int level): Calcul de la matrice permettant de remplacer c...
Psommet var_ecart_sup(Psommet sys, int nb_som, Pvecteur *lvbase, int *nbvars, Pbase *b)
Psommet var_ecart_sup(Psommet sys, int nb_som, Pvecteur * lvbase, int * nbvars, Pbase *b): ajout des ...
void var_posit(Psysteme ps, Pmatrix B, int m, int nbl)
void var_posit(Psysteme ps, int B[], int m, int nbl): Recherche des inegalites que doivent respecter ...
bool syst_smith(Psysteme ps)
bool syst_smith(Psysteme ps): Test de faisabilite d'un systeme lineaire en nombres entiers positifs p...
Psysteme smith_int(Psysteme ps)
Psysteme smith_int(Psysteme ps): Resolution d'un systeme d'egalites en nombres entiers par la methode...
void sc_rm(Psysteme ps)
void sc_rm(Psysteme ps): liberation de l'espace memoire occupe par le systeme de contraintes ps;
Psysteme sc_dup(Psysteme ps)
Psysteme sc_dup(Psysteme ps): should becomes a link.
Pvecteur cp
pointeur sur l'egalite ou l'inegalite courante
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...
Psysteme sc_normalize(Psysteme ps)
Psysteme sc_normalize(Psysteme ps): normalisation d'un systeme d'equation et d'inequations lineaires ...
void sys_mat_conv(Psysteme ps, Pmatrix A, Pmatrix B, int n, int m)
package sur les polyedres
Variable creat_new_var(Psysteme ps)
char * noms_var(int i): cette fonction convertit un numero de variable en chaine de caracteres
Pvecteur vect_clean(Pvecteur v)
Pvecteur vect_clean(Pvecteur v): elimination de tous les couples dont le coefficient vaut 0 dans le v...
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.
#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_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...