PIPS
|
#include <stdio.h>
#include <stdlib.h>
#include "linear_assert.h"
#include "boolean.h"
#include "arithmetique.h"
#include "vecteur.h"
#include "contrainte.h"
Go to the source code of this file.
Functions | |
bool | contrainte_normalize (Pcontrainte c, bool is_egalite) |
package contrainte - NORMALISATION D'UN CONTRAINTE More... | |
bool | egalite_normalize (Pcontrainte eg) |
bool egalite_normalize(Pcontrainte eg): reduction d'une equation diophantienne par le pgcd de ses coefficients; l'equation est infaisable si le terme constant n'est pas divisible par ce pgcd More... | |
bool | inegalite_normalize (Pcontrainte ineg) |
bool inegalite_normalize(Pcontrainte ineg): normalisation d'une inegalite a variables entieres; voir contrainte_normalize; retourne presque toujours true car une inegalite n'ayant qu'un terme constant est toujours faisable a moins qu'il ne reste qu'un terme constant strictement positif. More... | |
bool contrainte_normalize | ( | Pcontrainte | c, |
bool | is_egalite | ||
) |
package contrainte - NORMALISATION D'UN CONTRAINTE
normalize.c
INTLIBRARY bool contrainte_normalize(Pcontrainte c, bool is_egalite): reduction par le pgcd de ses coefficients d'une egalite (is_egalite==true) ou d'une inegalite (is_egalite==false)
Dans le cas des egalites, la faisabilite est testee et retournee
Modifications:
is_c_norm: si is_egalite=true, equation faisable
pgcd des termes non constant de c
si le coefficient du terme constant est inferieur a ABS(a), on va obtenir un couple (TCST,coeff) avec un coefficient qui vaut 0, ceci est contraire a nos conventions
mise a jour du resultat de la division C if ( b0 < 0 && nb0 > 0) vect_add_elem(&(c->vecteur),0,-1); On n'en a plus besoin parce que vect_div utilise la division a reste toujours positif dont on a besoin
is_inegalite
is_egalite | s_egalite |
Definition at line 56 of file normalize.c.
References assert, TCST, term_cst, value_abs, value_mod, value_negz_p, value_notzero_p, value_uminus, VALUE_ZERO, value_zero_p, vect_chg_coeff(), vect_clean(), vect_coeff(), vect_div(), vect_pgcd_except(), vect_size(), Scontrainte::vecteur, VECTEUR_NUL_P, and vecteur_val.
Referenced by egalite_normalize(), inegalite_normalize(), sc_bounded_normalization(), sc_elim_double_constraints(), and sc_gcd_normalize().
bool egalite_normalize | ( | Pcontrainte | eg | ) |
bool egalite_normalize(Pcontrainte eg): reduction d'une equation diophantienne par le pgcd de ses coefficients; l'equation est infaisable si le terme constant n'est pas divisible par ce pgcd
Soit eg == sum ai xi = b i Soit k = pgcd ai i eg := eg/k
return b % k == 0 || all ai == 0 && b != 0;
eg | g |
Definition at line 136 of file normalize.c.
References contrainte_normalize().
Referenced by better_elim_var_with_eg(), gcd_and_constant_dependence_test(), new_elim_var_with_eg(), sc_add_normalize_eq(), sc_bounded_normalization(), sc_minmax_of_variable2(), sc_normalize(), sc_strong_normalize2(), sc_strong_normalize_and_check_feasibility(), and sc_strong_normalize_and_check_feasibility2().
bool inegalite_normalize | ( | Pcontrainte | ineg | ) |
bool inegalite_normalize(Pcontrainte ineg): normalisation d'une inegalite a variables entieres; voir contrainte_normalize; retourne presque toujours true car une inegalite n'ayant qu'un terme constant est toujours faisable a moins qu'il ne reste qu'un terme constant strictement positif.
Soit eg == sum ai xi <= b i Soit k = pgcd ai i eg := eg/k
return true unless all ai are 0 and b < 0
ineg | neg |
Definition at line 156 of file normalize.c.
References contrainte_normalize().
Referenced by sc_add_normalize_ineq(), sc_bounded_normalization(), sc_normalize(), and sc_strong_normalize_and_check_feasibility().