25 #include "pips_config.h"
60 #include "constants.h"
68 #include "prgm_mapping.h"
71 #define VV_VAR(x) var_val_variable(x)
72 #define VV_COEFF(x) expression_to_int(var_val_value(x))
73 #define VV_VAL_(x) normalized_linear_(expression_normalized(var_val_value(x)))
74 #define VV_VAL(x) normalized_linear(expression_normalized(var_val_value(x)))
75 #define MAKE_VV(var, coeff, val) make_var_val(var, \
76 make_expression(make_syntax(is_syntax_call, \
77 make_call(make_integer_constant_entity(coeff), \
79 make_normalized(is_normalized_linear, val)))
97 for(vec = pv; vec != NULL; vec = vec->
succ) {
136 for(l = vvs; !
ENDP(l);
POP(l)) {
151 fprintf(fp,
"Var_vals Empty\n");
203 for(l1 = vv1; !
ENDP(l1);
POP(l1)) {
209 for(l2 = new_vvs; !
ENDP(l2);
POP(l2)) {
216 list il, el, aux_vvs;
233 user_error(
"vvs_on_vvs",
"There are more than one vv\n");
277 list l1, l2, p2, cvv1, cvv2;
291 for(l1 = cvv1; !
ENDP(l1);
POP(l1)) {
298 for(l2 = cvv2; !
ENDP(l2);
POP(l2)) {
305 list il, el, aux_vvs;
330 user_error(
"compose_vvs",
"There are more than one vv\n");
339 int g =
pgcd(cc2, c1);
348 for(l1 = cvv2; !
ENDP(l1);
POP(l1)) {
353 for(l2 = cvv1; !
ENDP(l2);
POP(l2)) {
359 user_error(
"compose_vvs",
"Entities should be different\n");
364 int g =
pgcd(cc2, c1);
391 for(pc = sc->egalites ; pc != NULL; pc = pc->
succ, var_l =
CDR(var_l))
393 bool var_not_found =
true;
399 if( ((pv->
val == 1) || (pv->
val == -1)) && (pv->
var !=
TCST) )
402 var_not_found =
false;
422 user_error(
"sc_to_vvs",
"The var must in the equality\n");
434 for( ; !
ENDP(vvs) ;
POP(vvs)) {
469 list avvs, used_vars;
483 user_error(
"vvs_on_polynome",
"Coeff is not 1\n");
492 for(avvs = vvs; !
ENDP(avvs) && !
ENDP(used_vars);
POP(avvs)) {
500 user_error(
"vvs_on_polynome",
"Coeff is not 1\n");
502 for(curr = used_vars, prec =
NIL; !
ENDP(curr) && (!found);
POP(curr)) {
506 used_vars =
CDR(used_vars);
539 for(avvs = vvs; !
ENDP(avvs) ;
POP(avvs)) {
547 user_error(
"vvs_on_vecteur",
"Coeff is not 1\n");
577 for(avvs = vvs; !
ENDP(avvs) ;
POP(avvs)) {
624 user_error(
"make_vvs_from_sc",
"Value should not be equal to zero\n");
646 vv =
MAKE_VV(var, val, new_vec);
687 var_not_found =
true;
688 for(; (lc !=
NIL) && var_not_found; lc =
CDR(lc)) {
691 if((crt_val == 1) || (crt_val == -1))
692 var_not_found =
false;
694 if(! var_not_found) {
698 vvs =
make_vvs(crt_var, 1, pv_elim);
702 fprintf(stderr,
"[plc_make_vvs_with_dist] \t\t\tDist vvs:\n");
#define pgcd(a, b)
Pour la recherche de performance, selection d'une implementation particuliere des fonctions.
void const char const char const int
Value ppcm(Value, Value)
ppcm.c
#define newgen_Pvecteur(p)
Pcontrainte contrainte_make(Pvecteur pv)
Pcontrainte contrainte_make(Pvecteur pv): allocation et initialisation d'une contrainte avec un vecte...
#define ENDP(l)
Test if a list is empty.
#define POP(l)
Modify a list pointer to point on the next element of the list.
#define NIL
The empty list (nil in Lisp)
list gen_concatenate(const list l1x, const list l2x)
concatenate two lists.
#define CONS(_t_, _i_, _l_)
List element cell constructor (insert an element at the beginning of a list)
list gen_nconc(list cp1, list cp2)
physically concatenates CP1 and CP2 but do not duplicates the elements
#define CAR(pcons)
Get the value of the first element of a list.
#define CDR(pcons)
Get the list less its first element.
list base_to_list(Pbase base)
Most includes are centralized here.
#define user_error(fn,...)
int get_debug_level(void)
GET_DEBUG_LEVEL returns the current debugging level.
int bool
we cannot use an enum or stdbool because we need to be compatible with newgen, thus boolean need to h...
list general_merge_sort(list, bool(*)(void))
Psysteme elim_var_with_eg(Psysteme, list *, list *)
===========================================================================
void pu_vect_fprint(FILE *, Pvecteur)
===========================================================================
void substitute_var_with_vec(Psysteme, entity, Value, Pvecteur)
===========================================================================
list vecteur_to_list(Pvecteur)
===========================================================================
bool pu_is_inferior_var(Variable, Variable)
Ppolynome prototype_var_subst(Ppolynome, Variable, Ppolynome)
=================================================================
#define var_val_variable(x)
#define VAR_VAL(x)
VAR_VAL.
Ppolynome make_polynome(float coeff, Variable var, Value expo)
Ppolynome make_polynome(float coeff, Variable var, Value expo) PRIVATE allocates space for,...
Ppolynome vecteur_to_polynome(Pvecteur pv)
===========================================================================
Pbase polynome_used_var(Ppolynome pp, int *is_inferior_var)
Pbase polynome_used_var(Ppolynome pp, bool *is_inferior_var()) PRIVATE Returns, in a Pbase,...
#define polynome_succ(pp)
bool compare_coeff(chunk *c1, chunk *c2)
========================================================================
const char * entity_local_name(entity e)
entity_local_name modified so that it does not core when used in vect_fprint, since someone thought t...
bool same_entity_p(entity e1, entity e2)
predicates on entities
#define expression_syntax(x)
void sc_creer_base(Psysteme ps)
void sc_creer_base(Psysteme ps): initialisation des parametres dimension et base d'un systeme lineair...
void sc_add_egalite(Psysteme p, Pcontrainte e)
void sc_add_egalite(Psysteme p, Pcontrainte e): macro ajoutant une egalite e a un systeme p; la base ...
Psysteme sc_new(void)
Psysteme sc_new(): alloue un systeme vide, initialise tous les champs avec des valeurs nulles,...
bool sc_rational_feasibility_ofl_ctrl(Psysteme sc, int ofl_ctrl, bool ofl_res)
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
void vect_chg_sgn(Pvecteur v)
void vect_chg_sgn(Pvecteur v): multiplie v par -1
struct Scontrainte * succ
le type des coefficients dans les vecteurs: Value est defini dans le package arithmetique
The structure used to build lists in NewGen.
#define TCST
VARIABLE REPRESENTANT LE TERME CONSTANT.
struct Svecteur * Pvecteur
void * Variable
arithmetique is a requirement for vecteur, but I do not want to inforce it in all pips files....
Pvecteur vect_dup(Pvecteur v_in)
Pvecteur vect_dup(Pvecteur v_in): duplication du vecteur v_in; allocation de et copie dans v_out;.
Pvecteur vect_new(Variable var, Value coeff)
Pvecteur vect_new(Variable var,Value coeff): allocation d'un vecteur colineaire au vecteur de base va...
Pvecteur vect_cl2_ofl_ctrl(Value x1, Pvecteur v1, Value x2, Pvecteur v2, int ofl_ctrl)
Pvecteur vect_cl2_ofl(Value x1, Pvecteur v1, Value x2, Pvecteur v2): allocation d'un vecteur v dont l...
Pvecteur vect_cl_ofl_ctrl(Pvecteur v, Value lambda, Pvecteur u, int ofl_ctrl)
Pvecteur vect_cl_ofl_ctrl(Pvecteur v, Value lambda, Pvecteur u, int ofl_ctrl): etape d'acculumulation...
void vect_erase_var(Pvecteur *ppv, Variable v)
void vect_erase_var(Pvecteur * ppv, Variable v): projection du vecteur *ppv selon la direction v (i....
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...
Pvecteur vect_del_var(Pvecteur v_in, Variable var)
Pvecteur vect_del_var(Pvecteur v_in, Variable var): allocation d'un nouveau vecteur egal a la project...
Value vect_coeff(Variable var, Pvecteur vect)
Variable vect_coeff(Variable var, Pvecteur vect): coefficient de coordonnee var du vecteur vect —> So...
#define VV_VAR(x)
Name : substitution.c Package : prgm_mapping Author : Platonoff Alexis Date : 4 october 1993 Historic...
list dup_vvs(list vvs)
========================================================================
Ppolynome my_vecteur_to_polynome(Pvecteur pv)
Global variables
void fprint_vvs(FILE *fp, list vvs)
========================================================================
list sc_to_vvs(Psysteme sc, list var_l)
========================================================================
list compose_vvs(list vv1, list vv2)
========================================================================
bool vvs_faisabilite(list vvs)
========================================================================
list make_vvs_from_sc(Psysteme ps_aux, list var_l)
========================================================================
var_val dup_vv(var_val vv)
========================================================================
Psysteme vvs_to_sc(list vvs)
========================================================================
list vvs_on_vvs(list vv1, list vv2)
========================================================================
Ppolynome vvs_on_polynome(list vvs, Ppolynome pp)
========================================================================
Psysteme vvs_on_systeme(list vvs, Psysteme ps)
========================================================================
void fprint_vv(FILE *fp, var_val vv)
========================================================================
bool(* argh)(Pvecteur *, Pvecteur *)
list plc_make_vvs_with_vector(Pvecteur v)
========================================================================
Pvecteur vvs_on_vecteur(list vvs, Pvecteur pv)
========================================================================
list make_vvs(entity var, int coeff, Pvecteur val)
========================================================================
#define MAKE_VV(var, coeff, val)