PIPS
vecteur.h File Reference
#include "arithmetique.h"
+ Include dependency graph for vecteur.h:

Go to the source code of this file.

Data Structures

struct  Svecteur
 le type des coefficients dans les vecteurs: Value est defini dans le package arithmetique More...
 

Macros

#define VECTEUR   1006 /**constante associee a un vecteur */
 Warning! Do not modify this file that is automatically generated! More...
 
#define VARIABLE_UNDEFINED   ((Variable) 0)
 
#define VARIABLE_UNDEFINED_P(v)   ((v)==VARIABLE_UNDEFINED)
 
#define VARIABLE_DEFINED_P(v)   ((v)!=VARIABLE_UNDEFINED)
 
#define VECTEUR_NUL   ((Pvecteur) 0)
 DEFINITION DU VECTEUR NUL. More...
 
#define VECTEUR_NUL_P(v)   ((v)==VECTEUR_NUL)
 
#define VECTEUR_UNDEFINED   ((Pvecteur) 0)
 
#define VECTEUR_UNDEFINED_P(v)   ((v)==VECTEUR_UNDEFINED)
 
#define PlinX   Pvecteur
 definition de la valeur de type PlinX==Pvecteur qui correspond a un vecteur indefini parce que l'expression correspondante n'est pas lineaire (Malik Imadache, Jean Goubault ?) More...
 
#define NONEXPLIN   ((PlinX)-1)
 
#define print_vect(s)   vect_fprint(stdout,(s))
 MACROS SUR LES VECTEURS. More...
 
#define var_of(varval)   ((varval)->var)
 
#define val_of(varval)   ((varval)->val)
 
#define vecteur_var(v)   ((v)->var)
 
#define vecteur_val(v)   ((v)->val)
 
#define vecteur_succ(v)   ((v)->succ)
 
#define TCST   ((Variable) 0)
 VARIABLE REPRESENTANT LE TERME CONSTANT. More...
 
#define term_cst(varval)   ((varval)->var == TCST)
 
#define BASE_NULLE   VECTEUR_NUL
 MACROS SUR LES BASES. More...
 
#define BASE_NULLE_P(b)   ((b)==VECTEUR_NUL)
 
#define BASE_UNDEFINED   ((Pbase) 0)
 
#define BASE_UNDEFINED_P(b)   ((b)==BASE_UNDEFINED)
 
#define base_dimension(b)   vect_size((Pvecteur)(b))
 
#define base_add_dimension(b, v)   vect_chg_coeff((Pvecteur *)(b),(v),VALUE_ONE)
 
#define base_rm(b)   (vect_rm((Pvecteur)(b)), (b)=BASE_NULLE)
 
#define BASE_FOREACH(v, b)
 
#define OFL_CTRL   2 /**overflows are treated in the called procedure */
 I do thing that overflows are managed in a very poor manner. More...
 
#define FWD_OFL_CTRL   1 /**overflows are treated by the calling procedure */
 
#define NO_OFL_CTRL   0 /**overflows are not trapped at all (dangerous !) */
 

Typedefs

typedef void * Variable
 arithmetique is a requirement for vecteur, but I do not want to inforce it in all pips files... More...
 
typedef char *(* get_variable_name_t) (Variable)
 
typedef struct Svecteur Svecteur
 le type des coefficients dans les vecteurs: Value est defini dans le package arithmetique More...
 
typedef struct SvecteurPvecteur
 
typedef struct Svecteur Sbase
 STRUCTURE D'UNE BASE. More...
 
typedef struct SvecteurPbase
 
typedef struct linear_hashtable_stlinear_hashtable_pt
 

Functions

Pvecteur vect_dup (Pvecteur)
 end of vecteur-local.h More...
 
void vect_rm (Pvecteur)
 void vect_rm(Pvecteur v): desallocation des couples de v; More...
 
Pvecteur vect_new (Variable, Value)
 Pvecteur vect_new(Variable var,Value coeff): allocation d'un vecteur colineaire au vecteur de base var et de coefficient coeff (i.e. More...
 
void dbg_vect_rm (Pvecteur, char *)
 
Pvecteur vect_make (Pvecteur, Variable, Value,...)
 Pvecteur vect_make(v, [var, val,]* 0, val) Pvecteur v; // may be NULL, use assigne anyway Variable var; Value val;. More...
 
Pvecteur vect_make_dense (Pbase, Value,...)
 Allocate a new vector v whose coefficient are given by the list of values ad whose dimension is given by b. More...
 
Pvecteur vect_make_1D (Value, Variable, Value)
 Generate a sparse vector a x + b TCST. More...
 
Pbase vect_copy (Pvecteur)
 direct duplication. More...
 
Pbase base_dup (Pbase)
 Pbase base_dup(Pbase b) Note: this function changes the value of the pointer. More...
 
Pbase base_copy (Pbase)
 Direct duplication. More...
 
Pvecteur vect_add (Pvecteur, Pvecteur)
 binaires.c More...
 
Pvecteur vect_substract (Pvecteur, Pvecteur)
 Pvecteur vect_substract(Pvecteur v1, Pvecteur v2): allocation d'un vecteur v dont la valeur est la difference des deux vecteurs v1 et v2. More...
 
Pvecteur vect_substitute_dimension (Pvecteur, Variable, Pvecteur)
 Pvecteur vect_substitute_dimension(Pvecteur v, Variable i, Pvecteur s) More...
 
Pvecteur vect_cl_ofl_ctrl (Pvecteur, Value, Pvecteur, int)
 Pvecteur vect_cl_ofl_ctrl(Pvecteur v, Value lambda, Pvecteur u, int ofl_ctrl): etape d'acculumulation dans une combinaison lineaire; aucun sharing entre v et u n'est cree (allocation implicite) Le controle de l'overflow est effectue et traite par le retour du contexte correspondant au dernier CATCH(overflow_error) effectue. More...
 
Pvecteur vect_cl_ofl (Pvecteur, Value, Pvecteur)
 
Pvecteur vect_cl (Pvecteur, Value, Pvecteur)
 
Pvecteur vect_cl2_ofl_ctrl (Value, Pvecteur, Value, Pvecteur, int)
 Pvecteur vect_cl2_ofl(Value x1, Pvecteur v1, Value x2, Pvecteur v2): allocation d'un vecteur v dont la valeur est la combinaison lineaire des deux vecteurs v1 et v2 avec les coefficients respectifs x1 et x2 Le controle de l'overflow est effectue par vect_cl_ofl et traite par le retour du contexte correspondant au dernier CATCH(overflow_error) effectue. More...
 
Pvecteur vect_cl2_ofl (Value, Pvecteur, Value, Pvecteur)
 
Pvecteur vect_cl2 (Value, Pvecteur, Value, Pvecteur)
 
Pvecteur vect_subst (Variable, Pvecteur, Pvecteur)
 Pvecteur vect_subst(Variable v, Pvecteur v1, Pvecteur v2): calcul d'un vecteur v3 tel que l'intersection des hyperplans definis par v1 et v2 soit egale a l'intersection des hyperplans definis par v1 et v3, et que v appartiennent a l'hyperplan defini par v3. More...
 
Pvecteur vect_read (Pbase *)
 io.c More...
 
void vect_fprint (FILE *, Pvecteur, get_variable_name_t)
 void vect_fprint(FILE * f, Pvecteur v, char * (*variable_name)()): impression d'un vecteur creux v sur le fichier f; le nom de chaque coordonnee est donne par la fonction variable_name() More...
 
void vect_fprint_as_dense (FILE *, Pvecteur, Pbase)
 void vect_fprint_as_dense(FILE * f, Pvecteur v, Pbase b): More...
 
void vect_fprint_as_monome (FILE *, Pvecteur, Pbase, get_variable_name_t, char *)
 void vect_fprint_as_monome(FILE * f, Pvecteur v, Pbase b, char * (*variable_name)(), char *mult_symbol): impression d'un vecteur creux considere comme un monome sans coefficient. More...
 
char * vect_sprint_as_monome (Pvecteur, Pbase, get_variable_name_t, char *)
 char *vect_sprint_as_monome(Pvecteur v, Pbase b, char * (*variable_name)(), char *mult_symbol): Retourne dans une chaine le Pvecteur considere comme un monome sans coefficient. More...
 
void vect_dump (Pvecteur)
 void vect_dump(Pvecteur v): print sparse vector v on stderr. More...
 
void vect_print (Pvecteur, get_variable_name_t)
 void vect_print(Pvecteur v, char * (*variable_name)()): impression d'un vecteur creux v sur stdout; le nom de chaque coordonnee est donne par la fonction variable_name(); voir vect_fprint() More...
 
void vect_fdump (FILE *, Pvecteur)
 void vect_fdump(FILE * f, Pvecteur v): impression d'un vecteur creux par vect_fprint() avec passage de la fonction variable_debug_name() More...
 
void base_fprint (FILE *, Pbase, get_variable_name_t)
 void base_fprint(FILE * f, Pbase b, char * (*variable_name)()): impression d'une base sur le fichier f; le nom de chaque coordonnee est donne par la fonction variable_name() More...
 
int vect_size (Pvecteur)
 reductions.c More...
 
int vect_dimension (Pvecteur)
 int vect_dimension(Pvecteur v): calcul du nombre de composantes non nulles et non constantes d'un vecteur More...
 
Value vect_prod_scal (Pvecteur, Pvecteur)
 Value vect_prod_scal(v1,v2): produit scalaire de v1 et de v2. More...
 
Value vect_pgcd_all (Pvecteur)
 Value vect_pgcd(Pvecteur v): calcul du pgcd de tous les coefficients non nul d'un vecteur v. More...
 
Value vect_pgcd_except (Pvecteur, Variable)
 Value vect_pgcd_except(Pvecteur v, Variable var): calcul du pgcd de tous les coefficients non nul d'un vecteur v, sauf le coefficient correspondant a la variable var. More...
 
Value vect_max0 (Pvecteur)
 Value vect_max0(Pvecteur v): recherche du coefficient maximum d'un vecteur v; ce coefficient est toujours au moins egal a 0 car on ne dispose pas d'une base pour verifier que TOUS les coefficients sont negatifs. More...
 
Value vect_min0 (Pvecteur)
 Value vect_min0(Pvecteur v): recherche du coefficient minimum d'un vecteur v; ce coefficient est toujours au moins egal a 0 car on ne dispose pas d'une base pour verifier que TOUS les coefficients sont negatifs. More...
 
Value vect_min (Pvecteur)
 Value vect_min(Pvecteur v): recherche du coefficient non nul minimum d'un vecteur v; aborte sur le vecteur 0 puisqu'il faudrait renvoyer plus l'infini. More...
 
Value vect_max (Pvecteur)
 Value vect_max(Pvecteur v): recherche du coefficient non nul maximum d'un vecteur v; aborte sur le vecteur 0 puisqu'il faudrait renvoyer plus l'infini. More...
 
Value vect_sum (Pvecteur)
 Value vect_sum(Pvecteur v): somme des coefficients d'un vecteur (i.e. More...
 
bool vect_equal (Pvecteur, Pvecteur)
 bool vect_equal(Pvecteur v1, Pvecteur v2): test a egalite de deux vecteurs More...
 
bool vect_equal_except (Pvecteur, Pvecteur, Variable)
 bool vect_equal_except(Pvecteur v1, Pvecteur v2, Variable var): test a egalite des projections selon la coordonnees var de deux vecteurs -> Soit e un vecteur de base quelconque: -> -> -> -> return <v1 . More...
 
bool vect_oppos (Pvecteur, Pvecteur)
 bool vect_oppos(Pvecteur v1, Pvecteur v2): test de l'opposition de deux vecteurs More...
 
bool vect_opposite_except (Pvecteur, Pvecteur, Variable)
 bool vect_opposite_except(Pvecteur v1, Pvecteur v2, Variable var): test a egalite des projections selon la coordonnees var de deux vecteurs -> Soit e un vecteur de base quelconque: -> -> -> -> return <v1 . More...
 
int vect_proport (Pvecteur, Pvecteur)
 int vect_proport(Pvecteur v1, Pvecteur v2): test de la colinearite de deux vecteurs et de leur direction. More...
 
bool vect_colin_base (Pvecteur, Variable)
 bool vect_colin_base(Pvecteur vec, Variable var): renvoie true si --> --> vec = k var More...
 
bool vect_check (Pvecteur)
 bool vect_check(Pvecteur v): renvoie true si le vecteur v est coherent avec les specifications du package; aucun des coefficients effectivement conserves en memoire ne doit etre nul (la cellule aurait du etre liberee) et aucune dimension (i.e. More...
 
bool vect_consistent_p (Pvecteur)
 To ease retrieval of vect_check() More...
 
bool vect_larger_coef_p (Pvecteur, Value)
 
void vect_normalize (Pvecteur)
 unaires.c More...
 
void vect_add_elem (Pvecteur *, Variable, Value)
 void vect_add_elem(Pvecteur * pvect, Variable var, Value val): addition d'un vecteur colineaire au vecteur de base var au vecteur vect More...
 
void vect_erase_var (Pvecteur *, Variable)
 void vect_erase_var(Pvecteur * ppv, Variable v): projection du vecteur *ppv selon la direction v (i.e. More...
 
void vect_chg_coeff (Pvecteur *, Variable, Value)
 void vect_chg_coeff(Pvecteur *ppv, Variable var, Value val): mise de la coordonnee var du vecteur *ppv a la valeur val More...
 
void vect_chg_var (Pvecteur *, Variable, Variable)
 void vect_chg_var(Pvecteur *ppv, Variable v_old, Variable v_new) replace the variable v_old by v_new More...
 
Variable vect_one_coeff_if_any (Pvecteur)
 
Pvecteur vect_del_var (Pvecteur, Variable)
 Pvecteur vect_del_var(Pvecteur v_in, Variable var): allocation d'un nouveau vecteur egal a la projection de v_in selon la direction var (i.e. More...
 
Value vect_coeff (Variable, Pvecteur)
 Variable vect_coeff(Variable var, Pvecteur vect): coefficient de coordonnee var du vecteur vect —> Soit evar le vecteur de base de nom var: More...
 
Value vect_coeff_sum (Pvecteur)
 Value vect_coeff_sum(Pvecteur vect): coefficient sum de tout les val de ce vecteur (devrait etre dans reduction? FC) More...
 
Pvecteur vect_sign (Pvecteur)
 Pvecteur vect_sign(Pvecteur v): application de l'operation signe au vecteur v. More...
 
void vect_sort_in_place (Pvecteur *, int(*)(Pvecteur *, Pvecteur *))
 
Pvecteur vect_sort (Pvecteur, int(*)(Pvecteur *, Pvecteur *))
 
int vect_compare (Pvecteur *, Pvecteur *)
 for qsort, returns: More...
 
void Pvecteur_separate_on_sign (Pvecteur, Pvecteur *, Pvecteur *)
 void Pvecteur_separate_on_sign(v, pvpos, pvneg) Pvecteur v, *pvpos, *pvneg; More...
 
bool vect_common_variables_p (Pvecteur, Pvecteur)
 bool vect_common_variables_p(Pvecteur v1, v2) BA 19/05/94 input : two vectors. More...
 
bool vect_contains_variable_p (Pvecteur, Variable)
 bool vect_contains_variable_p(Pvecteur v, Variable var) BA 19/05/94 input : a vector and a variable output : true if var appears as a component of v, false otherwise. More...
 
int vect_lexicographic_compare (Pvecteur, Pvecteur, int(*)(Pvecteur *, Pvecteur *))
 qsort() is not safe if the comparison function is not antisymmetric. More...
 
int vect_lexicographic_compare2 (Pvecteur, Pvecteur, int(*)(Pvecteur *, Pvecteur *))
 Version for inequalities. More...
 
int vect_lexicographic_unsafe_compare (Pvecteur, Pvecteur, int(*)(Pvecteur *, Pvecteur *))
 
int vect_lexicographic_unsafe_compare2 (Pvecteur, Pvecteur, int(*)(Pvecteur *, Pvecteur *))
 
int vect_lexicographic_unsafe_compare_generic (Pvecteur, Pvecteur, int(*)(Pvecteur *, Pvecteur *), bool)
 
Pbase vect_add_variable (Pbase, Variable)
 base.c More...
 
Pbase base_add_variable (Pbase, Variable)
 Pbase base_add_variable(Pbase b, Variable v): add variable v as a new dimension to basis b at the end of the base list; if variable v is already in basis b, do nothing; this is not clean but convenient to avoid a test;. More...
 
Pbase make_base_from_vect (Pvecteur)
 
Pbase base_remove_variable (Pbase, Variable)
 Pbase base_remove_variable(b, v): remove basis vector relative to v from b; abort if v is not in b;. More...
 
bool base_contains_variable_p (Pbase, Variable)
 bool base_contains_variable_p(Pbase b, Variable v): returns true if variable v is one of b's elements; More...
 
Variable base_find_variable (Pbase, Variable)
 Variable base_find_variable(Pbase b, Variable v): returns variable v if variable v is one of b's elements (returns a pointer to the copy of v that's pointed to by basis b); else returns VARIABLE_UNDEFINED. More...
 
Variable base_find_variable_name (Pbase, Variable, char *(*)(Variable))
 
int base_find_variable_rank (Pbase, Variable, char *(*)(Variable))
 
Pbase base_reversal (Pbase)
 Pbase base_reversal(Pbase b_in): produces a basis b_out, having the same basis vectors as b_in, but in reverse order. More...
 
Pvecteur vect_rename (Pvecteur, Pbase, char *(*)(Variable))
 
Pvecteur vect_rename_variables (Pvecteur, bool(*)(Variable), Variable(*)(Variable))
 Pvecteur vect_rename_variables(v, renamed_p, new_variable) Pvecteur v; bool (*renamed_p)(Variable); Variable (*new_variable)(Variable);. More...
 
Pvecteur vect_translate (Pvecteur, Pbase, char *(*)(Variable))
 
bool vect_in_basis_p (Pvecteur, Pbase)
 Pvecteur vect_in_basis_p(Pvecteur v, Pbase b): check that all coordinates in v are in b, i.e. More...
 
Pvecteur vect_variable_rename (Pvecteur, Variable, Variable)
 Pvecteur vect_variable_rename(Pvecteur v, Variable v_old, Variable v_new): rename the potential coordinate v_old in v as v_new. More...
 
void base_append (Pbase *, Pbase)
 appends b2 to b1. More...
 
Pbase base_union (Pbase, Pbase)
 Pbase base_union(Pbase b1, Pbase b2): compute a new basis containing all elements of b1 and all elements of b2, in an unkown order. More...
 
Pbase base_intersection (Pbase, Pbase)
 Return variables/dimensions present in bases b1 and b2. More...
 
int rank_of_variable (Pbase, Variable)
 this function returns the rank of the variable var in the base 0 encodes TCST, but I do not know why, TCST may be in base, sometimes -1 encodes an error More...
 
Variable variable_of_rank (Pbase, int)
 Variable variable_of_rank(): this function returns the variable of rank "rank". More...
 
int search_higher_rank (Pvecteur, Pbase)
 int search_higher_rank(): this fonction returns the rank of the variable of higher rank in the vecteur More...
 
Variable search_var_of_higher_rank (Pvecteur, Pbase, Variable)
 this function returns the variable of higher rank, after the variable var, in the vecteur pvect More...
 
Pvecteur search_i_element (Pbase, int)
 Pvecteur search_i_element(): recherche du i-ieme couple (var,val) dans la Pbase b. More...
 
Pbase base_normalize (Pbase)
 
bool base_normalized_p (Pbase)
 
Pbase base_difference (Pbase, Pbase)
 Pbase base_difference(Pbase b1, Pbase b2): allocate b; b = b1 - b2 – with the set meaning return b;. More...
 
bool base_included_p (Pbase, Pbase)
 Pbase base_included_p(Pbase b1, Pbase b2): include_p = b1 is included in b2 – with the set meaning return b;. More...
 
bool bases_strictly_equal_p (Pbase, Pbase)
 Make sure that each dimension of b1 is the same dimension in b2. More...
 
void vect_error (char *, char *,...)
 error.c More...
 
Pvecteur vect_chain (Pvecteur, Variable, Value)
 private.c More...
 
Pvecteur vect_elem (Pvecteur, Variable)
 PRIVATE: introduit du sharing; never used... More...
 
Pvecteur vect_extract (Pvecteur, Variable)
 UNUSED - NOT TESTED. More...
 
Variable vect_first_var (Pvecteur)
 PRIVATE: marquage du couple var_val comme visite par remplacement de var par -var dans le couple (OBSOLETE) More...
 
Pvecteur vect_reversal (Pvecteur)
 Pvecteur vect_reversal(Pvecteur vect_in); produces the reversal vector of the vect_in. More...
 
Pvecteur vect_div (Pvecteur, Value)
 scalaires.c More...
 
Pvecteur vect_clean (Pvecteur)
 Pvecteur vect_clean(Pvecteur v): elimination de tous les couples dont le coefficient vaut 0 dans le vecteur v et renvoie de v. More...
 
Pvecteur vect_multiply (Pvecteur, Value)
 Pvecteur vect_multiply(Pvecteur v, Value x): multiplication du vecteur v par le scalaire x, si x est different de 0. More...
 
void vect_chg_sgn (Pvecteur)
 void vect_chg_sgn(Pvecteur v): multiplie v par -1 More...
 
bool variable_equal (Variable, Variable)
 variable.c More...
 
char * variable_default_name (Variable)
 char * variable_default_name(Variable v): returns the name of variable v More...
 
char * variable_dump_name (Variable)
 variable_dump_name() returns an unambiguous name for variable v, based on the pointer used to really identify variables in the vecteur package; the name starts with the letter X and contains the hexadecimal representation of v More...
 
void init_variable_debug_name (char *(*)(Variable))
 
void reset_variable_debug_name (void)
 
Variable variable_make (char *)
 Variable variable_make(char * name): defines a new variable of a given name. More...
 
void linear_hashtable_dump (linear_hashtable_pt)
 hashpointer.c More...
 
bool linear_hashtable_coherent_p (linear_hashtable_pt)
 check hashtable coherency More...
 
linear_hashtable_pt linear_hashtable_make (void)
 constructor. More...
 
void linear_hashtable_free (linear_hashtable_pt)
 destructor More...
 
void linear_hashtable_put (linear_hashtable_pt, void *, void *)
 
void linear_hashtable_put_once (linear_hashtable_pt, void *, void *)
 
bool linear_hashtable_isin (linear_hashtable_pt, void *)
 
bool linear_hashtable_remove (linear_hashtable_pt, void *)
 
void * linear_hashtable_get (linear_hashtable_pt, void *)
 
int linear_hashtable_nitems (linear_hashtable_pt)
 

Variables

char *(* variable_debug_name )(Variable)
 Debug support: pointer to the function used by debug print outs. More...
 

Macro Definition Documentation

◆ base_add_dimension

#define base_add_dimension (   b,
 
)    vect_chg_coeff((Pvecteur *)(b),(v),VALUE_ONE)

Definition at line 148 of file vecteur.h.

◆ base_dimension

#define base_dimension (   b)    vect_size((Pvecteur)(b))

Definition at line 147 of file vecteur.h.

◆ BASE_FOREACH

#define BASE_FOREACH (   v,
 
)
Value:
Pbase v ## _base = b; \
Variable v = v ## _base? v ## _base->var: NULL; \
for(; v ## _base != BASE_NULLE; v ## _base = v ## _base->succ, v = v ## _base? v ## _base->var: NULL)
le type des coefficients dans les vecteurs: Value est defini dans le package arithmetique
Definition: vecteur-local.h:89
Variable var
Definition: vecteur-local.h:90
#define BASE_NULLE
MACROS SUR LES BASES.
Definition: vecteur.h:143

Definition at line 150 of file vecteur.h.

◆ BASE_NULLE

#define BASE_NULLE   VECTEUR_NUL

MACROS SUR LES BASES.

Definition at line 143 of file vecteur.h.

◆ BASE_NULLE_P

#define BASE_NULLE_P (   b)    ((b)==VECTEUR_NUL)

Definition at line 144 of file vecteur.h.

◆ base_rm

#define base_rm (   b)    (vect_rm((Pvecteur)(b)), (b)=BASE_NULLE)

Definition at line 149 of file vecteur.h.

◆ BASE_UNDEFINED

#define BASE_UNDEFINED   ((Pbase) 0)

Definition at line 145 of file vecteur.h.

◆ BASE_UNDEFINED_P

#define BASE_UNDEFINED_P (   b)    ((b)==BASE_UNDEFINED)

Definition at line 146 of file vecteur.h.

◆ FWD_OFL_CTRL

#define FWD_OFL_CTRL   1 /**overflows are treated by the calling procedure */

Definition at line 192 of file vecteur.h.

◆ NO_OFL_CTRL

#define NO_OFL_CTRL   0 /**overflows are not trapped at all (dangerous !) */

Definition at line 193 of file vecteur.h.

◆ NONEXPLIN

#define NONEXPLIN   ((PlinX)-1)

Definition at line 128 of file vecteur.h.

◆ OFL_CTRL

#define OFL_CTRL   2 /**overflows are treated in the called procedure */

I do thing that overflows are managed in a very poor manner.

FC. It should be all or not, as provided by any os that would raise integer overflows. Thus we should have thought of a sofware mecanism compatible with such a hardware and os approach. maybe by defining a mult_Value macro to check explicitely for overflows if needed, and defined to a simple product if not. functions would have an additional argument for returning a conservative answer in case of overflow. Maybe some global variable could count the number of overflow that occured so that some caller could check whether sg got wrong and thus could warn about the result and this fact. then we would have either the library compiled for these soft checks or for none, but without any difference or explicite requirements from the user of these functions.

instead of that, we have the two versions at the same time with explicite control required from the user. I heard that for some functions this is not used... thus allowing good performance (each time some result is false someone tracks down the not checked function and checks overflow explicitely, thus it is not a very good approach). moreover the most costly functions (simplexe, chernikova) are also those in which the exceptions occurs thus they are all checked. the the impact on performances is definitely low. as far as software engineering is concerned, the current solution adds low level switch for calling different versions (controled or not) of pieces of code... this will have to be removed if some good os is to host this software... OVERFLOW CONTROL some OVERFLOW CONTROL is allowed

Definition at line 191 of file vecteur.h.

◆ PlinX

#define PlinX   Pvecteur

definition de la valeur de type PlinX==Pvecteur qui correspond a un vecteur indefini parce que l'expression correspondante n'est pas lineaire (Malik Imadache, Jean Goubault ?)

Definition at line 127 of file vecteur.h.

◆ print_vect

#define print_vect (   s)    vect_fprint(stdout,(s))

MACROS SUR LES VECTEURS.

Definition at line 131 of file vecteur.h.

◆ TCST

#define TCST   ((Variable) 0)

VARIABLE REPRESENTANT LE TERME CONSTANT.

Definition at line 139 of file vecteur.h.

◆ term_cst

#define term_cst (   varval)    ((varval)->var == TCST)

Definition at line 140 of file vecteur.h.

◆ val_of

#define val_of (   varval)    ((varval)->val)

Definition at line 133 of file vecteur.h.

◆ var_of

#define var_of (   varval)    ((varval)->var)

Definition at line 132 of file vecteur.h.

◆ VARIABLE_DEFINED_P

#define VARIABLE_DEFINED_P (   v)    ((v)!=VARIABLE_UNDEFINED)

Definition at line 74 of file vecteur.h.

◆ VARIABLE_UNDEFINED

#define VARIABLE_UNDEFINED   ((Variable) 0)

Definition at line 72 of file vecteur.h.

◆ VARIABLE_UNDEFINED_P

#define VARIABLE_UNDEFINED_P (   v)    ((v)==VARIABLE_UNDEFINED)

Definition at line 73 of file vecteur.h.

◆ VECTEUR

#define VECTEUR   1006 /**constante associee a un vecteur */

Warning! Do not modify this file that is automatically generated!

Modify src/Libs/vecteur/vecteur-local.h instead, to add your own modifications. header file built by cproto vecteur-local.h package sur les vecteurs creux et les bases

Malik Imadache, Corinne Ancourt, Neil Butler, Francois Irigoin, Remi Triolet

Modifications:

  • les fonctions d'interface avec GenPgm dont les noms commencent par "_gC_" ont ete deplacees dans _gC_lib
  • passage a "char *" pour le type Variable au lieu de "int" (Linear-C3) et de "entity *" (Linear/C3 Library); le package n'est pas independant de la definition du type "Variable"; il faudrait ameliorer ca avec un package "Variable"
  • ajout des fonctions d'interface avec Newgen: (RT, 27/11/89)
  • ajout de la notion de base, comme cas particulier de vecteur (FI, 27/11/89) ou le champ "Value" n'a pas de signification
  • suppression de l'include de vecteur-basic-types.h; la fusion entre les versions C3 et Linear/C3 Library ne necessite plus cette distinction; il y a tellement peu de code a ecrire pour les variables et les valeurs qu'il est inutile d'avoir une directory differente pour lui
  • rapatriement de la definition du terme constant TCST et de la macro term_cst (du package contrainte) (PB, 06/06/90)

trop creux a mon avis. il faudrait une liste de petits tableaux ? FC.

Definition at line 59 of file vecteur.h.

◆ VECTEUR_NUL

#define VECTEUR_NUL   ((Pvecteur) 0)

DEFINITION DU VECTEUR NUL.

Definition at line 118 of file vecteur.h.

◆ VECTEUR_NUL_P

#define VECTEUR_NUL_P (   v)    ((v)==VECTEUR_NUL)

Definition at line 119 of file vecteur.h.

◆ vecteur_succ

#define vecteur_succ (   v)    ((v)->succ)

Definition at line 136 of file vecteur.h.

◆ VECTEUR_UNDEFINED

#define VECTEUR_UNDEFINED   ((Pvecteur) 0)

Definition at line 120 of file vecteur.h.

◆ VECTEUR_UNDEFINED_P

#define VECTEUR_UNDEFINED_P (   v)    ((v)==VECTEUR_UNDEFINED)

Definition at line 121 of file vecteur.h.

◆ vecteur_val

#define vecteur_val (   v)    ((v)->val)

Definition at line 135 of file vecteur.h.

◆ vecteur_var

#define vecteur_var (   v)    ((v)->var)

Definition at line 134 of file vecteur.h.

Typedef Documentation

◆ get_variable_name_t

typedef char*(* get_variable_name_t) (Variable)

Definition at line 70 of file vecteur.h.

◆ linear_hashtable_pt

Definition at line 198 of file vecteur.h.

◆ Pbase

typedef struct Svecteur * Pbase

Definition at line 115 of file vecteur.h.

◆ Pvecteur

typedef struct Svecteur * Pvecteur

◆ Sbase

typedef struct Svecteur Sbase

STRUCTURE D'UNE BASE.

Une base est definie par son vecteur diagonal

Les tests d'appartenance sont effectues par comparaison des pointeurs et non par des strcmp.

Rien ne contraint les coefficients a valoir 1 et le package plint mais meme certains coefficients a 0, ce qui devrait revenir a faire disparaitre la variable (i.e. la coordonnee) correspondante de la base.

Definition at line 70 of file vecteur.h.

◆ Svecteur

typedef struct Svecteur Svecteur

le type des coefficients dans les vecteurs: Value est defini dans le package arithmetique

STRUCTURE D'UN VECTEUR

Un vecteur est defini par une suite de couples Variable (i.e. element de la base) et Valeur (valeur du coefficient correspondant). Les coordonnees nulles ne sont pas representees et n'existe qu'implicitement par rapport a une base (hypothetique) definie via la package "variable".

En consequence, le vecteur nul est (malencontreusement) represente par NULL. Cela gene toutes les procedures succeptibles de retourner une valeur vecteur nul par effet de bord. Il faut alors passer en argument un POINTEUR vers un Pvecteur. En general, nous avons prefere retourner explicitement le vecteur calcule, a la maniere de ce qui est fait dans string.h

Il n'existe pas non plus de VECTEUR_UNDEFINED, puisque sa valeur devrait logiquement etre NULL.

◆ Variable

typedef void* Variable

arithmetique is a requirement for vecteur, but I do not want to inforce it in all pips files...

thus here it is le type des variables (ou coordonnees) dans les vecteurs

Definition at line 68 of file vecteur.h.

Function Documentation

◆ base_add_variable()

Pbase base_add_variable ( Pbase  b,
Variable  var 
)

Pbase base_add_variable(Pbase b, Variable v): add variable v as a new dimension to basis b at the end of the base list; if variable v is already in basis b, do nothing; this is not clean but convenient to avoid a test;.

Note that basis b contains a pointer towards variable v and not a copy of it. So some sharing is introduced.

A routine to check variable equality, variable_equal(), is used.

Parameters
varar

Definition at line 88 of file base.c.

91 {
92  Pbase b1 = b;
93  Pbase result = b;
94 
95 
96  if (!VECTEUR_NUL_P(b1)) {
97  for(; !VECTEUR_NUL_P(b1) && !variable_equal(vecteur_var(b1), var);
98  b1 = b1->succ);
99  if (VECTEUR_NUL_P(b1)) {
100  for (b1 = b; !VECTEUR_NUL_P(b1->succ); b1=b1->succ);
101  b1->succ = vect_new(var, VALUE_ONE);
102  }
103  }
104  else { result = vect_new(var, VALUE_ONE);
105  }
106  return(result);
107 }
#define VALUE_ONE
bool variable_equal(Variable v1, Variable v2)
package vecteur - routines sur les variables
Definition: variable.c:62
Value b1
booleen indiquant quel membre est en cours d'analyse
Definition: sc_gram.c:105
#define vecteur_var(v)
#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

References b1, VALUE_ONE, variable_equal(), vect_new(), VECTEUR_NUL_P, and vecteur_var.

Referenced by add_constraint_on_x(), base_intersection(), build_and_test_dependence_context(), copy_write_statement_with_cumulated_regions(), generic_minmax_to_transformer(), include_parameters_in_sc(), local_tile_constraints(), main(), make_base_from_vect(), make_base_phi_variables(), new_system_with_only_live_variable(), region_to_com_nest(), region_to_loop_nest(), sc_safe_append(), TestDependence(), transformer_add_loop_index_incrementation(), transformer_add_sign_information(), transformer_add_value_update(), transformer_add_variable_update(), transformer_derivative_fix_point(), transformer_list_generic_transitive_closure(), and vect_change_base().

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

◆ base_append()

void base_append ( Pbase pb1,
Pbase  b2 
)

appends b2 to b1.

modifies b1. b2 is not modified.

Parameters
pb1b1
b22

Definition at line 384 of file base.c.

385 {
386  if (BASE_NULLE_P(*pb1))
387  *pb1 = base_copy(b2);
388  else
389  {
390  Pvecteur v;
392  for (v=*pb1; v; v=v->succ)
393  {
394  Variable var = var_of(v);
395  if (var!=TCST) linear_hashtable_put_once(seen, var, var);
396  }
397 
398  for (v=b2; v; v=v->succ)
399  {
400  Variable var = var_of(v);
401  if (var!=TCST && !linear_hashtable_isin(seen, var))
402  {
403  linear_hashtable_put_once(seen, var, var);
404  *pb1 = vect_chain(*pb1, var, VALUE_ONE);
405  }
406  }
407 
409  }
410 }
static hash_table seen
static function to store whether a module has been seen during the recursive generation of the daVinc...
Definition: graph.c:85
bool linear_hashtable_isin(linear_hashtable_pt h, void *k)
Definition: hashpointer.c:273
void linear_hashtable_put_once(linear_hashtable_pt h, void *k, void *v)
Definition: hashpointer.c:268
linear_hashtable_pt linear_hashtable_make(void)
constructor.
Definition: hashpointer.c:165
void linear_hashtable_free(linear_hashtable_pt h)
destructor
Definition: hashpointer.c:189
Pvecteur vect_chain(Pvecteur v_in, Variable var, Value coeff)
package vecteur routines internes au package
Definition: private.c:69
Value b2
Definition: sc_gram.c:105
struct Svecteur * succ
Definition: vecteur-local.h:92
hidden structure to store the hashtable.
Definition: hashpointer.c:66
#define TCST
VARIABLE REPRESENTANT LE TERME CONSTANT.
void * Variable
arithmetique is a requirement for vecteur, but I do not want to inforce it in all pips files....
Definition: vecteur-local.h:60
#define var_of(varval)
#define BASE_NULLE_P(b)
Pbase base_copy(Pbase b)
Direct duplication.
Definition: alloc.c:300

References b2, base_copy(), BASE_NULLE_P, linear_hashtable_free(), linear_hashtable_isin(), linear_hashtable_make(), linear_hashtable_put_once(), seen, Svecteur::succ, TCST, VALUE_ONE, var_of, and vect_chain().

Referenced by sc_append().

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

◆ base_contains_variable_p()

bool base_contains_variable_p ( Pbase  b,
Variable  v 
)

bool base_contains_variable_p(Pbase b, Variable v): returns true if variable v is one of b's elements;

Based on variable_equal()

Definition at line 136 of file base.c.

139 {
140  bool in_base;
141 
142  for(; !VECTEUR_NUL_P(b) && !variable_equal(vecteur_var(b), v); b = b->succ)
143  ;
144 
145  in_base = !VECTEUR_NUL_P(b);
146  return(in_base);
147 }

References variable_equal(), VECTEUR_NUL_P, and vecteur_var.

Referenced by add_bounding_box_constraints(), add_type_information(), base_difference(), base_intersection(), base_remove_variable(), build_transfer_equations(), cell_reference_sc_exact_projection_along_variable(), fortran_user_call_to_transformer(), include_trans_on_LC_in_ref(), my_system_remove_variables(), new_ident(), new_system_with_only_live_variable(), partial_eval_reference(), precondition_intra_to_inter(), region_exact_projection_along_parameters(), region_exact_projection_along_variable(), safe_transformer_projection(), sc_minmax_of_variable2(), sc_multiply_constant_terms(), sc_projection_ofl_along_list_of_variables(), separate_variables(), separate_variables_2(), simplify_dimension(), simplify_predicate(), sub_basis_p(), system_contains_var(), transform_in_ineq(), transformer_add_value_update(), transformer_add_variable_update(), transformer_argument_general_consistency_p(), transformer_arguments_projection(), transformer_combine(), transformer_convex_hulls(), transformer_filter(), transformer_projection_with_redundancy_elimination_and_check(), transformer_range(), transformer_to_1D_lattice(), transformer_to_domain(), transformer_value_substitutable_p(), transformer_value_substitute(), translate_global_value(), translate_to_module_frame(), vect_in_basis_p(), and vect_read().

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

◆ base_copy()

Pbase base_copy ( Pbase  b)

Direct duplication.

The initial Pbase is assumed to be valid. Absolutely the same with base_dup, but base_up is the only function that maintains the old order. So recopy here for use with copy version including vect_copy, contrainte_copy, contraintes_copy, sc_copy (DN,24/6/02) Does not change the parameter. Did have a look at all copy version (DN,1/7/2002)

Definition at line 300 of file alloc.c.

301 {
302  Pbase n = BASE_NULLE, p = BASE_NULLE, r = BASE_NULLE, tmp = b;
303 
304  for (; tmp!=BASE_NULLE; tmp=tmp->succ)
305  {
306  n = (Pvecteur) MALLOC(sizeof(Svecteur),VECTEUR,"base_copy");
307  if (n == NULL) {
308  fprintf(stderr,"[base_copy] out of memory space\n");
309  abort();
310  }
311  var_of(n) = var_of(tmp);
312  val_of(n) = VALUE_ONE;
313  n->succ = NULL;
314  if (r==BASE_NULLE) r = n;
315  if (p!=BASE_NULLE) p->succ = n;
316  p = n;
317  }
318 
319  return r;
320 }
#define abort()
Definition: misc-local.h:53
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
#define val_of(varval)
struct Svecteur * Pvecteur
#define BASE_NULLE
MACROS SUR LES BASES.
#define VECTEUR
package sur les vecteurs creux et les bases
Definition: vecteur-local.h:51
#define MALLOC(s, t, f)
INTLIBRARY.
Definition: alloc.c:42

References abort, BASE_NULLE, fprintf(), MALLOC, Svecteur::succ, val_of, VALUE_ONE, var_of, and VECTEUR.

Referenced by base_append(), base_union(), build_integer_sc_nredund(), new_system_with_only_live_variable(), region_sc_projection_along_variables_ofl_ctrl(), regions_must_convex_hull(), sc_base_dup(), sc_copy(), sc_fm_project_variables(), sc_init_with_sc(), sc_of_constrs(), sc_projection_concat_proj_on_variables(), sc_safe_build_sc_nredund_1pass(), sc_safe_build_sc_nredund_2pass(), sc_safe_elim_redund(), sc_strong_normalize2(), sc_strong_normalize_and_check_feasibility2(), and sg_of_rays().

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

◆ base_difference()

Pbase base_difference ( Pbase  b1,
Pbase  b2 
)

Pbase base_difference(Pbase b1, Pbase b2): allocate b; b = b1 - b2 – with the set meaning return b;.

Parameters
b11
b22

Definition at line 621 of file base.c.

622 {
623  Pbase b = BASE_NULLE;
624  Pbase eb = BASE_UNDEFINED;
625 
626  for(eb = b1; !BASE_NULLE_P(eb); eb = eb->succ) {
627  Variable v = vecteur_var(eb);
628 
630  b = vect_add_variable(b, v);
631  }
632 
633  return b;
634 }
bool base_contains_variable_p(Pbase b, Variable v)
bool base_contains_variable_p(Pbase b, Variable v): returns true if variable v is one of b's elements...
Definition: base.c:136
Pbase vect_add_variable(Pbase b, Variable v)
package vecteur - routines sur les bases
Definition: base.c:61
#define BASE_UNDEFINED

References b1, b2, base_contains_variable_p(), BASE_NULLE, BASE_NULLE_P, BASE_UNDEFINED, Svecteur::succ, vect_add_variable(), and vecteur_var.

Referenced by algorithm_row_echelon_generic(), build_transfer_equations(), get_other_constraints(), sc_consistent_p(), and set_sort_context().

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

◆ base_dup()

Pbase base_dup ( Pbase  b)

Pbase base_dup(Pbase b) Note: this function changes the value of the pointer.

Use base_copy instead. Should become a link, not a function. For the moment, it's a function, because of the sc.h cannot be updated without installation, due to decision of integration of Janus or not? DN 12/5/03

return base_copy(b);

Definition at line 268 of file alloc.c.

269 {
270  /* return base_copy(b);*/
271 
272  Pbase n = BASE_NULLE, p = BASE_NULLE, r = BASE_NULLE;
273 
274  for (; b!=BASE_NULLE; b=b->succ)
275  {
276  n = (Pvecteur) MALLOC(sizeof(Svecteur),VECTEUR,"base_dup");
277  if (n == NULL) {
278  fprintf(stderr,"[base_dup] out of memory space\n");
279  abort();
280  }
281  var_of(n) = var_of(b);
282  val_of(n) = VALUE_ONE;
283  n->succ = NULL;
284  if (r==BASE_NULLE) r = n;
285  if (p!=BASE_NULLE) p->succ = n;
286  p = n;
287  }
288  return r;
289 }

References abort, BASE_NULLE, fprintf(), MALLOC, Svecteur::succ, val_of, VALUE_ONE, var_of, and VECTEUR.

Referenced by add_var_sup(), build_image_base(), build_sc_nredund_1pass_ofl_ctrl(), dependence_cone_positive(), dual_pivot(), loop_nest_to_wp65_code(), main(), movement_computation(), pip_solve(), pip_solve_min_with_big(), plint(), plreal(), primal(), primal_positive(), region_sc_minimal(), region_sc_projection_ofl_along_parameter(), regions_must_convex_hull(), sc_enveloppe_chernikova_ofl_ctrl(), sc_faisabilite_optim(), sc_projection_optim_along_vecteur_ofl(), sg_dup(), sort_psysteme(), syst_smith(), TestDependence(), transformer_convex_hulls(), transformer_derivative_fix_point(), transformer_equality_fix_point(), transformer_normalize(), transformer_projection_with_redundancy_elimination_and_check(), update_basis(), and var_ecart_sup().

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

◆ base_find_variable()

Variable base_find_variable ( Pbase  b,
Variable  v 
)

Variable base_find_variable(Pbase b, Variable v): returns variable v if variable v is one of b's elements (returns a pointer to the copy of v that's pointed to by basis b); else returns VARIABLE_UNDEFINED.

Based on variable_equal()

Definition at line 155 of file base.c.

158 {
159  for(; !VECTEUR_NUL_P(b) && !variable_equal(vecteur_var(b), v); b = b->succ)
160  ;
161 
163 }
#define VARIABLE_UNDEFINED
Definition: vecteur-local.h:64

References variable_equal(), VARIABLE_UNDEFINED, VECTEUR_NUL_P, and vecteur_var.

Referenced by matrice_index_sys(), rec_ident(), and vect_read().

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

◆ base_find_variable_name()

Variable base_find_variable_name ( Pbase  ,
Variable  ,
char *  *)(Variable 
)

◆ base_find_variable_rank()

int base_find_variable_rank ( Pbase  ,
Variable  ,
char *  *)(Variable 
)

◆ base_fprint()

void base_fprint ( FILE *  f,
Pbase  b,
get_variable_name_t  variable_name 
)

void base_fprint(FILE * f, Pbase b, char * (*variable_name)()): impression d'une base sur le fichier f; le nom de chaque coordonnee est donne par la fonction variable_name()

Par exemple, la base b -> -> -> -> b == ( i j k ) est imprime sous la forme i j k LF ou les symboles i, j et k sont obtenus via la fonction pointee par variable_name()

Le base vide est represente par base vide LF

Note: attention au linefeed final il n'existe pas de fonction relisant une base sous cette forme

Parameters
variable_nameariable_name

Definition at line 342 of file io.c.

344  {
345  if(VECTEUR_NUL_P(b))
346  (void) fprintf(f,"base vide\n");
347  else
348  for ( ; !VECTEUR_NUL_P(b); b = b->succ) {
349  (void) fprintf(f,"%s", variable_name(b->var));
350  if (!VECTEUR_NUL_P(b->succ)) {
351  (void) fprintf(f,", ");
352  }
353  }
354  (void) fprintf(f," \n");
355 }
int f(int off1, int off2, int n, float r[n], float a[n], float b[n])
Definition: offsets.c:15
char * variable_name(Variable v)
polynome_ri.c
Definition: polynome_ri.c:73

References f(), fprintf(), Svecteur::succ, Svecteur::var, variable_name(), and VECTEUR_NUL_P.

Referenced by build_transfer_equations(), create_tile_basis(), hyperplane(), loop_nest_to_wp65_code(), print_dependence_cone(), print_loopnest_dependence_cone(), sc_default_dump(), sc_default_dump_to_files(), sc_dump(), sc_fprint_for_sc_fscan(), and sc_image_computation().

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

◆ base_included_p()

bool base_included_p ( Pbase  b1,
Pbase  b2 
)

Pbase base_included_p(Pbase b1, Pbase b2): include_p = b1 is included in b2 – with the set meaning return b;.

Parameters
b11
b22

Definition at line 640 of file base.c.

641 {
642  Pbase b;
643  bool included_p = true;
645 
646  for (b=b2; b; b=b->succ)
647  if (var_of(b)!=TCST)
649 
650  for (b=b1; b && included_p; b=b->succ)
651  if (var_of(b)!=TCST && !linear_hashtable_isin(seen, var_of(b)))
652  included_p = false;
653 
655 
656  return included_p;
657 }

References b1, b2, linear_hashtable_free(), linear_hashtable_isin(), linear_hashtable_make(), linear_hashtable_put_once(), seen, Svecteur::succ, TCST, and var_of.

Referenced by sc_weak_consistent_p().

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

◆ base_intersection()

Pbase base_intersection ( Pbase  b1,
Pbase  b2 
)

Return variables/dimensions present in bases b1 and b2.

Order is not preserved.

Parameters
b11
b22

Definition at line 473 of file base.c.

474 {
475  Pbase b = BASE_NULLE;
476  bool
477  bn1 = BASE_NULLE_P(b1),
478  bn2 = BASE_NULLE_P(b2);
479 
480  if(!bn1 && !bn2) {
481  Pbase bc;
482  for(bc=b1; !BASE_UNDEFINED_P(bc); bc = vecteur_succ(bc)) {
483  Variable var = vecteur_var(bc);
484  if(base_contains_variable_p(b2, var)) {
485  b = base_add_variable(b, var);
486  }
487  }
488  }
489 
490  return b;
491 }
Pbase base_add_variable(Pbase b, Variable var)
Pbase base_add_variable(Pbase b, Variable v): add variable v as a new dimension to basis b at the end...
Definition: base.c:88
#define BASE_UNDEFINED_P(b)
#define vecteur_succ(v)

References b1, b2, base_add_variable(), base_contains_variable_p(), BASE_NULLE, BASE_NULLE_P, BASE_UNDEFINED_P, vecteur_succ, and vecteur_var.

Referenced by sc_projection_optim_along_vecteur_ofl().

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

◆ base_normalize()

Pbase base_normalize ( Pbase  b)

Definition at line 594 of file base.c.

596 {
597  Pbase eb;
598 
599  for (eb = b ; !BASE_NULLE_P(eb) ; eb=eb->succ)
600  vecteur_val(eb) = VALUE_ONE;
601  return b;
602 }
#define vecteur_val(v)

References BASE_NULLE_P, Svecteur::succ, VALUE_ONE, and vecteur_val.

Referenced by pip_solve(), pip_solve_min_with_big(), set_sort_context(), and vars_read_and_written().

+ Here is the caller graph for this function:

◆ base_normalized_p()

bool base_normalized_p ( Pbase  b)

Definition at line 604 of file base.c.

606 {
607  Pbase eb;
608 
609  for (eb = b ;
610  !BASE_NULLE_P(eb) && value_one_p(vecteur_val(eb));
611  eb=eb->succ)
612  ;
613  return BASE_NULLE_P(eb) && vect_check((Pvecteur) b);
614 }
#define value_one_p(val)
bool vect_check(Pvecteur cv)
bool vect_check(Pvecteur v): renvoie true si le vecteur v est coherent avec les specifications du pac...
Definition: reductions.c:529

References BASE_NULLE_P, Svecteur::succ, value_one_p, vect_check(), and vecteur_val.

Referenced by sc_consistent_p(), and sc_weak_consistent_p().

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

◆ base_remove_variable()

Pbase base_remove_variable ( Pbase  b,
Variable  v 
)

Pbase base_remove_variable(b, v): remove basis vector relative to v from b; abort if v is not in b;.

Definition at line 122 of file base.c.

125 {
127  vect_erase_var(&b, v);
128  return b;
129 }
#define assert(ex)
Definition: newgen_assert.h:41
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....
Definition: unaires.c:106

References assert, base_contains_variable_p(), and vect_erase_var().

Referenced by main(), sc_base_remove_variable(), transformer_derivative_fix_point(), and transformer_list_generic_transitive_closure().

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

◆ base_reversal()

Pbase base_reversal ( Pbase  b_in)

Pbase base_reversal(Pbase b_in): produces a basis b_out, having the same basis vectors as b_in, but in reverse order.

Basis b_in is not touched.

Example: b_in = { e1, e2, e3 } -> b_out = { e3, e2, e1}

Parameters
b_in_in

Definition at line 221 of file base.c.

223 {
224  Pbase b_out = VECTEUR_NUL;
225 
226  for( ; !VECTEUR_NUL_P(b_in); b_in = b_in->succ)
227  vect_add_elem(&b_out, vecteur_var(b_in), vecteur_val(b_in));
228 
229  return b_out;
230 }
#define VECTEUR_NUL
DEFINITION DU VECTEUR NUL.
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

References vect_add_elem(), VECTEUR_NUL, VECTEUR_NUL_P, vecteur_val, and vecteur_var.

Referenced by adg_sc_dup(), algorithm_row_echelon_generic(), build_image_base(), code_generation(), compute_iteration_domain(), create_tile_basis(), derive_new_basis(), list_to_base(), loop_nest_to_wp65_code(), matrices_to_loop_sc(), matrices_to_sc(), parallel_tiling(), sc_projection_concat_proj_on_variables(), set_sort_context(), and tiling_transformation().

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

◆ base_union()

Pbase base_union ( Pbase  b1,
Pbase  b2 
)

Pbase base_union(Pbase b1, Pbase b2): compute a new basis containing all elements of b1 and all elements of b2, in an unkown order.

b := b1 u b2; return b;

Bases b1 and b2 are not modified. Basis vectors are compared for equality using variable_equal()

Modifications:

  • Pbase b = (Pbase)vect_add((Pvecteur) b1, (Pvecteur) b2); This is the definition of b at the beginning. This ignored one case that when addition of two values is zero, vect_add will call vect_add_elem, where there is vect_erase_var. We'll miss the variable Lei Zhou. 15/07/91
Parameters
b11
b22

Definition at line 428 of file base.c.

429 {
430  Pbase b = BASE_NULLE;
431  bool
432  bn1 = BASE_NULLE_P(b1),
433  bn2 = BASE_NULLE_P(b2);
434 
435  if (!bn1 && bn2)
436  b = base_copy(b1);
437  else if (bn1 && !bn2)
438  b = base_copy(b2);
439  else if (!bn1 && !bn2)
440  {
442  Pvecteur v;
443  Variable var;
444 
445  for (v = b1; v; v=v->succ)
446  {
447  var = var_of(v);
448  if (var!=TCST)
449  {
450  linear_hashtable_put_once(seen, var, var);
451  b = vect_chain(b, var, VALUE_ONE);
452  }
453  }
454 
455  for (v = b2; v; v=v->succ)
456  {
457  var = var_of(v);
458  if (var!=TCST)
459  if (!linear_hashtable_isin(seen, var))
460  {
461  linear_hashtable_put_once(seen, var, var);
462  b = vect_chain(b, var, VALUE_ONE);
463  }
464  }
465 
467  }
468 
469  return b;
470 }

References b1, b2, base_copy(), BASE_NULLE, BASE_NULLE_P, linear_hashtable_free(), linear_hashtable_isin(), linear_hashtable_make(), linear_hashtable_put_once(), seen, Svecteur::succ, TCST, VALUE_ONE, var_of, and vect_chain().

Referenced by actual_convex_union(), elementary_convex_union(), gcd_and_constant_dependence_test(), is_inferior_monome(), matrices_to_constraints_with_sym_cst(), matrices_to_contraintes_with_sym_cst(), pip_solve(), pip_solve_min_with_big(), polynome_used_var(), regions_must_convex_hull(), sc_constraint_add(), sc_cute_convex_hull(), sc_elim_redund_with_first_ofl_ctrl(), sg_union(), simplify_float_constraint_system(), sl_fprint_tab(), transformer_add_loop_index_initialization(), transformer_convex_hulls(), and transformer_list_generic_transitive_closure().

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

◆ bases_strictly_equal_p()

bool bases_strictly_equal_p ( Pbase  b1,
Pbase  b2 
)

Make sure that each dimension of b1 is the same dimension in b2.

Parameters
b11
b22

Definition at line 660 of file base.c.

661 {
662  int s1 = base_dimension(b1);
663  int s2 = base_dimension(b2);
664  bool strictly_equal_p = true;
665 
666  if(s1==s2) {
667  int i;
668  for(i=1; i<= s1 && strictly_equal_p; i++) {
669  Variable d1 = variable_of_rank(b1, i);
670  Variable d2 = variable_of_rank(b2, i);
671  strictly_equal_p = (d1==d2);
672  }
673  }
674  else
675  strictly_equal_p = false;
676 
677  return strictly_equal_p;
678 }
Variable variable_of_rank(Pbase base, int rank)
Variable variable_of_rank(): this function returns the variable of rank "rank".
Definition: base.c:520
s1
Definition: set.c:247
#define base_dimension(b)

References b1, b2, base_dimension, s1, and variable_of_rank().

Referenced by sc_union().

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

◆ dbg_vect_rm()

void dbg_vect_rm ( Pvecteur  ,
char *   
)

◆ init_variable_debug_name()

void init_variable_debug_name ( char *  *)(Variable)

◆ linear_hashtable_coherent_p()

bool linear_hashtable_coherent_p ( linear_hashtable_pt  h)

check hashtable coherency

coherent size/nitems.

check number of item stored.

check key index

Definition at line 128 of file hashpointer.c.

129 {
130  uintptr_t i, n;
131 
132  /* coherent size/nitems. */
133  if (h->nitems >= h->size)
134  return false;
135 
136  /* check number of item stored. */
137  for(i=0, n=0; i<h->size; i++)
138  {
139  void * k = h->contents[i].key;
140  if (k!=FREE_CHUNK && k!=EMPTIED_CHUNK)
141  {
142  /* check key index */
143  uintptr_t index = key_location(h, k, true);
144  if (index!=i) return false;
145  n++;
146  }
147  }
148 
149  if (n!=h->nitems)
150  return false;
151 
152  return true;
153 }
#define FREE_CHUNK
Definition: hashpointer.c:55
static uintptr_t key_location(linear_hashtable_pt h, void *k, bool toget)
returns the location to put or get k in h.
Definition: hashpointer.c:75
#define EMPTIED_CHUNK
Definition: hashpointer.c:56
#define uintptr_t
Definition: stdint.in.h:295
size_t size
number of association stored
Definition: hashpointer.c:68
paire * contents
size of internal array
Definition: hashpointer.c:69
void * key
Definition: hashpointer.c:59

References linear_hashtable_st::contents, EMPTIED_CHUNK, FREE_CHUNK, paire::key, key_location(), linear_hashtable_st::nitems, linear_hashtable_st::size, and uintptr_t.

+ Here is the call graph for this function:

◆ linear_hashtable_dump()

void linear_hashtable_dump ( linear_hashtable_pt  h)

hashpointer.c

hashpointer.c

Definition at line 122 of file hashpointer.c.

123 {
124  linear_hashtable_print(stderr, h);
125 }
static void linear_hashtable_print(FILE *file, linear_hashtable_pt h)
Definition: hashpointer.c:102

References linear_hashtable_print().

+ Here is the call graph for this function:

◆ linear_hashtable_free()

void linear_hashtable_free ( linear_hashtable_pt  h)

destructor

Definition at line 189 of file hashpointer.c.

190 {
192 
193  free(h->contents);
194  free(h);
195 }
void free(void *)
#define debug_assert_coherent(h)
Definition: hashpointer.c:53

References linear_hashtable_st::contents, debug_assert_coherent, and free().

Referenced by base_append(), base_included_p(), base_union(), fortran_data_to_prec_for_variables(), sc_to_minimal_basis(), transitive_closure_from_two_bases(), and vect_check().

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

◆ linear_hashtable_get()

void* linear_hashtable_get ( linear_hashtable_pt  h,
void *  k 
)

Definition at line 293 of file hashpointer.c.

294 {
295  register int index = key_location(h, k, true);
296  return h->contents[index].key==k ? h->contents[index].val: FREE_CHUNK;
297 }
void * val
Definition: hashpointer.c:60

References linear_hashtable_st::contents, FREE_CHUNK, paire::key, key_location(), and paire::val.

+ Here is the call graph for this function:

◆ linear_hashtable_isin()

bool linear_hashtable_isin ( linear_hashtable_pt  h,
void *  k 
)

Definition at line 273 of file hashpointer.c.

274 {
275  return h->contents[key_location(h, k, true)].key==k;
276 }

References linear_hashtable_st::contents, paire::key, and key_location().

Referenced by base_append(), base_included_p(), base_to_set(), base_union(), contains_variables(), fortran_data_to_prec_for_variables(), sc_to_minimal_basis(), and vect_check().

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

◆ linear_hashtable_make()

linear_hashtable_pt linear_hashtable_make ( void  )

constructor.

returns a newly allocated hashtable.

check malloc

check malloc

Definition at line 165 of file hashpointer.c.

166 {
168  register int i, size = HASHTABLE_INITIAL_SIZE;
169 
170  h = (linear_hashtable_pt) malloc(sizeof(struct linear_hashtable_st));
171  assert(h); /* check malloc */
172 
173  h->size = size;
174  h->nitems = 0;
175  h->contents = (paire*) malloc(sizeof(paire)*size);
176 
177  assert(h->contents); /* check malloc */
178 
179  for (i=0; i<size; i++)
180  h->contents[i].key = FREE_CHUNK,
181  h->contents[i].val = FREE_CHUNK;
182 
184 
185  return h;
186 }
void * malloc(YYSIZE_T)
struct linear_hashtable_st * linear_hashtable_pt
hidden structure to store the hashtable.
#define HASHTABLE_INITIAL_SIZE
size of internal table.
Definition: hashpointer.c:160

References assert, linear_hashtable_st::contents, debug_assert_coherent, FREE_CHUNK, HASHTABLE_INITIAL_SIZE, paire::key, malloc(), linear_hashtable_st::nitems, linear_hashtable_st::size, and paire::val.

Referenced by base_append(), base_included_p(), base_union(), fortran_data_to_prec_for_variables(), sc_to_minimal_basis(), transitive_closure_from_two_bases(), and vect_check().

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

◆ linear_hashtable_nitems()

int linear_hashtable_nitems ( linear_hashtable_pt  h)

Definition at line 299 of file hashpointer.c.

300 {
301  return h->nitems;
302 }

References linear_hashtable_st::nitems.

◆ linear_hashtable_put()

void linear_hashtable_put ( linear_hashtable_pt  h,
void *  k,
void *  v 
)

Definition at line 263 of file hashpointer.c.

264 {
265  linear_hashtable_internal_put(h, k, v, false);
266 }
static void linear_hashtable_internal_put(linear_hashtable_pt h, void *k, void *v, bool once)
Definition: hashpointer.c:237

References linear_hashtable_internal_put().

Referenced by base_to_set(), and vect_check().

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

◆ linear_hashtable_put_once()

void linear_hashtable_put_once ( linear_hashtable_pt  h,
void *  k,
void *  v 
)

Definition at line 268 of file hashpointer.c.

269 {
270  linear_hashtable_internal_put(h, k, v, true);
271 }

References linear_hashtable_internal_put().

Referenced by base_append(), base_included_p(), base_union(), fortran_data_to_prec_for_variables(), and sc_to_minimal_basis().

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

◆ linear_hashtable_remove()

bool linear_hashtable_remove ( linear_hashtable_pt  h,
void *  k 
)

Definition at line 278 of file hashpointer.c.

279 {
280  register int index = key_location(h, k, true);
281 
282  if (h->contents[index].key==k)
283  {
284  h->contents[index].key = EMPTIED_CHUNK;
285  h->contents[index].val = FREE_CHUNK;
286  h->nitems--;
287  return true;
288  }
289 
290  return false;
291 }

References linear_hashtable_st::contents, EMPTIED_CHUNK, FREE_CHUNK, paire::key, key_location(), linear_hashtable_st::nitems, and paire::val.

+ Here is the call graph for this function:

◆ make_base_from_vect()

Pbase make_base_from_vect ( Pvecteur  pv)
Parameters
pvv

Definition at line 109 of file base.c.

110 {
111  Pbase b = (Pbase) NULL;
112  for(;!VECTEUR_NUL_P(pv);pv=pv->succ)
113  if (pv->var != TCST)
114  b = base_add_variable(b,pv->var);
115  return(b);
116 }
struct Svecteur * Pbase

References base_add_variable(), Svecteur::succ, TCST, Svecteur::var, and VECTEUR_NUL_P.

Referenced by efficient_sc_check_inequality_feasibility(), sc_normalize2(), and transformer_add_loop_index_initialization().

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

◆ Pvecteur_separate_on_sign()

void Pvecteur_separate_on_sign ( Pvecteur  v,
Pvecteur pvpos,
Pvecteur pvneg 
)

void Pvecteur_separate_on_sign(v, pvpos, pvneg) Pvecteur v, *pvpos, *pvneg;

IN: v

OUT: pvpos, pvneg

this function builds 2 vectors composed of the positive and negative parts of the initial vector v which is not modified.

(c) FC 16/05/94

Parameters
pvposvpos
pvnegvneg

Definition at line 369 of file unaires.c.

371 {
372  Pvecteur vc;
373  Value val;
374  Variable var;
375 
376  *pvneg = VECTEUR_NUL,
377  *pvpos = VECTEUR_NUL;
378 
379  for(vc=v; vc; vc=vc->succ)
380  {
381  var = var_of(vc),
382  val = val_of(vc);
383  if (value_neg_p(val))
384  vect_add_elem(pvneg, var, value_uminus(val));
385  else
386  vect_add_elem(pvpos, var, val);
387  }
388 }
#define value_uminus(val)
unary operators on values
int Value
#define value_neg_p(val)

References Svecteur::succ, val_of, value_neg_p, value_uminus, var_of, vect_add_elem(), and VECTEUR_NUL.

Referenced by Pcontrainte_to_expression_list().

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

◆ rank_of_variable()

int rank_of_variable ( Pbase  base,
Variable  var 
)

this function returns the rank of the variable var in the base 0 encodes TCST, but I do not know why, TCST may be in base, sometimes -1 encodes an error

not found

Parameters
basease
varar

Definition at line 497 of file base.c.

500 {
501  int rank=1;
502  register Pvecteur pv;
503 
504  if (var!=TCST)
505  {
506  for(pv=base;
507  !VECTEUR_NUL_P(pv) && !(vecteur_var(pv) ==var);
508  pv=pv->succ, rank++);
509  if (VECTEUR_NUL_P(pv)) rank = -1; /* not found */
510  }
511  else
512  rank = 0;
513 
514  return(rank);
515 }
bdt base
Current expression.
Definition: bdt_read_paf.c:100
static entity rank

References base, rank, Svecteur::succ, TCST, VECTEUR_NUL_P, and vecteur_var.

Referenced by bound_generation(), build_transfer_matrix(), compare_variables_in_base(), constraint_distribution(), constraint_integer_combination(), contrainte_extract(), reference_conversion_computation(), reference_conversion_expression(), reference_translation(), sc_elim_triang_integer_redund_constraint_p(), sc_integer_projection_information(), sc_normalize2(), search_higher_rank(), search_var_of_higher_rank(), and transformer_to_1D_lattice().

+ Here is the caller graph for this function:

◆ reset_variable_debug_name()

void reset_variable_debug_name ( void  )

Definition at line 121 of file variable.c.

122 {
124 }
char * variable_dump_name(Variable v)
variable_dump_name() returns an unambiguous name for variable v, based on the pointer used to really ...
Definition: variable.c:96
char *(* variable_debug_name)(Variable)
Debug support: pointer to the function used by debug print outs.
Definition: variable.c:114

References variable_debug_name, and variable_dump_name().

+ Here is the call graph for this function:

◆ search_higher_rank()

int search_higher_rank ( Pvecteur  vect,
Pbase  base 
)

int search_higher_rank(): this fonction returns the rank of the variable of higher rank in the vecteur

Parameters
vectect
basease

Definition at line 541 of file base.c.

544 {
545  int rank_pv = 0;
546  int rv=0;
547  register Pvecteur pv;
548 
549  for (pv=vect;!VECTEUR_NUL_P(pv);pv=pv->succ){
550  if ((rv =rank_of_variable(base,vecteur_var(pv))) > rank_pv)
551  rank_pv = rv;
552  }
553  return(rank_pv);
554 }
int rank_of_variable(Pbase base, Variable var)
this function returns the rank of the variable var in the base 0 encodes TCST, but I do not know why,...
Definition: base.c:497

References base, rank_of_variable(), Svecteur::succ, VECTEUR_NUL_P, and vecteur_var.

Referenced by bound_distribution(), build_integer_sc_nredund(), constraint_distribution(), contrainte_extract(), egalite_distribution(), elim_redund_sc_with_sc(), lower_bound_generation(), sc_integer_projection_information(), test_bound_generation(), and upper_bound_generation().

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

◆ search_i_element()

Pvecteur search_i_element ( Pbase  b,
int  i 
)

Pvecteur search_i_element(): recherche du i-ieme couple (var,val) dans la Pbase b.

Definition at line 583 of file base.c.

586 {
587  Pbase b1;
588  int j;
589 
590  for (b1=b, j=1; j<i; b1=b1->succ,j++);
591  return(b1);
592 }

References b1.

◆ search_var_of_higher_rank()

Variable search_var_of_higher_rank ( Pvecteur  pvect,
Pbase  base,
Variable  var 
)

this function returns the variable of higher rank, after the variable var, in the vecteur pvect

Parameters
pvectvect
basease
varar

Definition at line 561 of file base.c.

565 {
566  int rv,rank_pv = 0;
567  Variable higher_var=TCST;
568  register Pvecteur pv;
569 
570  for (pv=pvect;!VECTEUR_NUL_P(pv);pv=pv->succ)
571  if ((vecteur_var(pv) != var)
572  && ((rv =rank_of_variable(base,vecteur_var(pv))) > rank_pv)) {
573  rank_pv = rv;
574  higher_var = vecteur_var(pv);
575  }
576 
577  return(higher_var);
578 }

References base, rank_of_variable(), Svecteur::succ, TCST, VECTEUR_NUL_P, and vecteur_var.

+ Here is the call graph for this function:

◆ variable_default_name()

char* variable_default_name ( Variable  v)

char * variable_default_name(Variable v): returns the name of variable v

Type variable is assumed here to be char *

Definition at line 81 of file variable.c.

83 {
84  return((char *)v);
85 }

Referenced by add_var_sup(), eq_in_ineq(), main(), primal(), primal_pivot(), primal_positive(), rec_ident(), sc_variable_name_init(), show_nredund(), test_file(), and var_ecart_sup().

+ Here is the caller graph for this function:

◆ variable_dump_name()

char* variable_dump_name ( Variable  v)

variable_dump_name() returns an unambiguous name for variable v, based on the pointer used to really identify variables in the vecteur package; the name starts with the letter X and contains the hexadecimal representation of v

Bugs:

  • the name is build in a local buffer; so a call to this function overwrite the previous returned value

Room for X0x1234567812345678\0 for example on 64 bit address architecture since Variable is a pointer to something:

Definition at line 96 of file variable.c.

96  {
97  /* Room for X0x1234567812345678\0 for example on 64 bit address
98  architecture since Variable is a pointer to something: */
99  static char buffer[sizeof(void *)*2+4];
100 
101  buffer[0] = 'X';
102  (void) sprintf(&buffer[1],"%p", v);
103  return(buffer);
104 }
static string buffer
Definition: string.c:113

References buffer.

Referenced by fprint_message(), main(), mk_rn(), reset_variable_debug_name(), sg_dump(), and sg_without_line().

+ Here is the caller graph for this function:

◆ variable_equal()

bool variable_equal ( Variable  v1,
Variable  v2 
)

variable.c

variable.c

Francois Irigoin

Notes:

Modifications: INTLIBRARY bool variable_equal(Variable v1, Variable v2): returns true if variables v1 and v2 have the same VALUE

Type Variable is assumed here to be char *

Modifications:

  • no assumptions are made on type Variable; v1 and v2 may be of any type; all computations in vecteur.dir are based on pointer comparisons (FI, 28/12/89); this may lead to disaster for unit testing (FI, 11/12/2011)
Parameters
v11
v22

Definition at line 62 of file variable.c.

65 {
66  /*
67  * if(v1==NULL&&v2==NULL)
68  * return(true);
69  * else if (v1==NULL||v2==NULL)
70  * return(false);
71  *
72  * return(!strcmp(v1,v2));
73  */
74  return v1==v2;
75 }

Referenced by base_add_variable(), base_contains_variable_p(), base_find_variable(), sc_base_add_variable(), vect_add_variable(), and vect_contains_variable_p().

+ Here is the caller graph for this function:

◆ variable_make()

Variable variable_make ( char *  name)

Variable variable_make(char * name): defines a new variable of a given name.

Parameters
nameame

Definition at line 129 of file variable.c.

131 {
132  return((Variable) strdup(name));
133 }
char * strdup()

References strdup().

Referenced by creat_new_var(), and vect_read().

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

◆ variable_of_rank()

Variable variable_of_rank ( Pbase  base,
int  rank 
)

Variable variable_of_rank(): this function returns the variable of rank "rank".

Parameters
basease
rankank

Definition at line 520 of file base.c.

523 {
524  int i;
525  register Pvecteur pv;
526 
527  if (rank ==0) return(TCST);
528  else {
529  for(pv=base, i=1;
530  !VECTEUR_NUL_P(pv) && i != rank; pv=pv->succ, i++);
531  if (!VECTEUR_NUL_P(pv))
532  return(vecteur_var(pv));
533  else return (TCST);
534  }
535 }

References base, rank, Svecteur::succ, TCST, VECTEUR_NUL_P, and vecteur_var.

Referenced by bases_strictly_equal_p().

+ Here is the caller graph for this function:

◆ vect_add()

Pvecteur vect_add ( Pvecteur  v1,
Pvecteur  v2 
)

binaires.c

binaires.c

INTLIBRARY Pvecteur vect_add(Pvecteur v1, Pvecteur v2): allocation d'un vecteur v dont la valeur est la somme des deux vecteurs v1 et v2

     ->

allocate v; -> -> -> v := v1 + v2; -> return v;

RT: j'ai besoin d'un vect_add a effet de bord pour la normalisation d'expression lineaire. idem pour vect_substract, vect_mult, ...

Parameters
v11
v22

Definition at line 53 of file binaires.c.

56 {
57  Pvecteur v = vect_dup (v1);
58 
59  for ( ; v2!= NULL; v2=v2->succ)
60  vect_add_elem (&v,var_of(v2),val_of(v2));
61 
62  return (v);
63 }
Pvecteur vect_dup(Pvecteur v_in)
Pvecteur vect_dup(Pvecteur v_in): duplication du vecteur v_in; allocation de et copie dans v_out;.
Definition: alloc.c:51

References Svecteur::succ, val_of, var_of, vect_add_elem(), and vect_dup().

Referenced by adg_dataflowgraph(), adg_max_of_leaves(), align_check(), analyze_expression(), array_indices_communication(), bounds_equal_p(), broadcast_of_dataflow(), build_list_of_min(), build_sc_machine(), build_third_comb(), c_convex_effects_on_actual_parameter_forward_translation(), contrainte_parallele(), count_eq_occ(), dj_system_complement(), do_gather_all_expressions_perms(), eq_in_ineq(), expression_equal_in_context_p(), expression_less_than_in_context(), find_implicit_equation(), find_pattern(), generate_one_message(), include_trans_on_LC_in_ref(), invariant_vector_p(), loop_index_domaine_to_contrainte(), loop_nest_to_wp65_code(), make_datum_movement(), make_dual(), make_lin_op_exp(), make_load_blocks(), make_movements_loop_body_wp65(), make_store_blocks(), matrices_to_loop_sc(), matrix_to_system(), MergeLinExprs(), monome_monome_mult(), my_vect_var_subst(), normalize_intrinsic(), NormalizeIntrinsic(), one_message_guards_and_neighbour(), pa_path_to_few_disjunct_ofl_ctrl(), parallel_tiling(), sc_elim_double_constraints(), sc_transform_ineg_in_eg(), simplify_constraint_with_bounding_box(), simplify_dimension(), simplify_float_constraint(), simplify_predicate(), system_new_var_subst(), tiling_transformation(), update_basis(), vect_change_base(), and vect_var_subst().

+ Here is the call graph for this function:

◆ vect_add_elem()

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 vecteur de base var au vecteur vect

--—> --—> —> *pvect := *pvect + val evar

Parameters
pvectvect
varar
valal

Definition at line 72 of file unaires.c.

73 {
74  if (val!=0)
75  {
76  Pvecteur vect;
77  for (vect=(*pvect); vect!=NULL; vect=vect->succ)
78  {
79  if (var_of(vect)==var)
80  {
81  value_addto(val_of(vect), val);
82  if (value_zero_p(val_of(vect)))
83  vect_erase_var(pvect, var_of(vect));
84  return;
85  }
86  }
87  // else: le coefficient valait 0 et n'etait pas represente
88  *pvect = vect_chain(*pvect, var, val);
89  }
90  // sinon, le vecteur est inchange et on ne fait rien
91 }
#define value_zero_p(val)
#define value_addto(ref, val)

References Svecteur::succ, val_of, value_addto, value_zero_p, var_of, vect_chain(), and vect_erase_var().

Referenced by add_affine_bound_conditions(), add_declaration_list_information(), add_elem_to_list_of_Pvecteur(), add_equivalence_equality(), add_fin_mat(), add_loop_index_exit_value(), add_loop_skip_condition(), add_var_sup(), adg_list_to_vect(), affine_to_transformer(), array_indices_communication(), base_reversal(), bitwise_xor_to_transformer(), bounds_equal_p(), build_image_base(), build_sc_machine(), cell_reference_sc_exact_projection_along_variable(), check_range_wrt_precondition(), complex_bound_computation(), compute_x_and_y_bounds(), constraints_to_loop_bound(), contrainte_reverse(), converti_psysmin_psysmax(), cout_nul(), dependence_cone_positive(), dependence_system_add_lci_and_di(), do_solve_hardware_constraints_on_nb_proc(), ecrit_coeff1(), eval_var(), expression_flt(), expression_less_than_in_context(), expression_multiply_sizeof_to_transformer(), find_motif(), find_pattern(), fonct_max_all(), fonct_max_d(), fonct_min_all(), fonct_min_d(), fonct_read(), formal_and_actual_parameters_association(), free_guards(), full_linearization(), gcd_and_constant_dependence_test(), generic_abs_to_transformer(), generic_equality_to_transformer(), generic_minmax_to_transformer(), hpfc_compute_lid(), iabs_to_transformer(), integer_divide_to_transformer(), integer_left_shift_to_transformer(), integer_minmax_to_transformer(), integer_multiply_to_transformer(), integer_power_to_transformer(), integer_right_shift_to_transformer(), invariant_vector_p(), list_to_base(), local_tile_constraints(), logical_binary_function_to_transformer(), logical_binary_operation_to_transformer(), logical_constant_to_transformer(), logical_unary_operation_to_transformer(), loop_bound_evaluation_to_transformer(), loop_bounds_to_tile_bounds(), loop_index_domaine_to_contrainte(), loop_regions_normalize(), lower_bound_generation(), make_base_of_nest(), make_constraint_expression(), make_context_of_loop(), make_datum_movement(), make_loop_indice_equation(), make_movements_loop_body_wp65(), make_scanning_over_one_tile(), make_tile_constraints(), my_system_remove_variables(), my_vect_substract(), new_constraint_for_coefficient_reduction_with_bounding_box(), partial_linearization(), pivoter_pas(), plint_degen(), polynome_roots(), polynome_sscanf(), polynome_to_vecteur(), Pvecteur_separate_on_sign(), reduce_loop_bound(), region_exact_projection_along_parameters(), region_exact_projection_along_variable(), relation_to_transformer(), remove_temporal_variables_from_system(), sc_add_di(), sc_add_dsi(), sc_bounded_normalization(), sc_find_equalities(), sc_minmax_of_variable_optim(), sc_multiply_constant_terms(), sc_of_constrs(), sc_proj_optim_on_di_ofl(), sc_projection_ofl_along_list_of_variables(), scanning_base_to_vect(), set_dimensions_of_local_variable_family(), simple_addition_to_transformer(), simplify_constraint_with_bounding_box(), simplify_float_constraint(), simplify_minmax_contrainte(), small_positive_slope_reduce_coefficients_with_bounding_box(), sys_int_redond(), test_bound_generation(), tile_change_of_basis(), tile_hyperplane_constraints(), tile_membership(), tile_membership_constraints(), transformer_add_3d_affine_constraint(), transformer_add_condition_information_updown(), transformer_add_equality(), transformer_add_equality_with_affine_term(), transformer_add_equality_with_integer_constant(), transformer_add_identity(), transformer_add_inequality(), transformer_add_inequality_with_affine_term(), transformer_add_inequality_with_integer_constraint(), transformer_add_integer_relation_information(), transformer_add_loop_index_initialization(), transformer_add_sign_information(), transformer_convex_hulls(), transformer_equality_fix_point(), transformer_logical_inequalities_add(), translate_global_value(), translate_to_module_frame(), update_lower_and_upper_bounds(), update_lower_or_upper_bound(), var_ecart_sup(), variables_in_declaration_list(), vars_read_and_written(), vect_add(), vect_cl_ofl_ctrl(), vect_gen_read(), vect_make(), vect_make_1D(), vect_make_dense(), vect_make_line(), vect_printout_order(), vect_reversal(), vect_substract(), vecteur_of_zvec(), vvs_to_sc(), xml_Chain_Graph(), xml_GlobalVariables(), xml_LocalVariables(), xml_Loops(), xml_Pattern_Paving(), xml_TaskParameters(), and xml_tiling().

+ Here is the call graph for this function:

◆ vect_add_variable()

Pbase vect_add_variable ( Pbase  b,
Variable  v 
)

base.c

base.c

Francois Irigoin

The function variable_name should be inlined as much as possible to improve performances. It has to be used to be generic over the "Variable" type. For instance, variables represented by a character string cannot be decided equal by a simple pointer comparison.

Modifications: INTLIBRARY Pbase vect_add_variable(Pbase b, Variable v): add variable v as a new dimension to basis b; if variable v is already in basis b, do nothing; this is not clean but convenient to avoid a test;

Note that basis b contains a pointer towards variable v and not a copy of it. So some sharing is introduced.

A routine to check variable equality, variable_equal(), is used.

Definition at line 61 of file base.c.

64 {
65  Pbase b1 = b;
66 
67  for(; !VECTEUR_NUL_P(b1) && !variable_equal(vecteur_var(b1), v);
68  b1 = b1->succ)
69  ;
70 
71  if(b1 == VECTEUR_NUL) {
72  base_add_dimension(&b,v);
73  }
74 
75  return(b);
76 }
#define base_add_dimension(b, v)

References b1, base_add_dimension, variable_equal(), VECTEUR_NUL, VECTEUR_NUL_P, and vecteur_var.

Referenced by add_var_sup(), args_to_transformer(), base_difference(), build_sc_machine(), build_sc_with_several_uniform_ref(), create_tile_basis(), equations_to_bases(), filter_transformer(), loop_bounds_to_tile_bounds(), loop_index_domaine_to_contrainte(), MakeDibaseinorder(), module_to_wp65_modules(), new_ident(), sc_add_new_variable_name(), set_dimensions_of_local_variable_family(), transformer_add_modified_variable(), transformer_add_modified_variable_entity(), transformer_add_variable_incrementation(), var_ecart_sup(), and vect_read().

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

◆ vect_chain()

Pvecteur vect_chain ( Pvecteur  v_in,
Variable  var,
Value  coeff 
)

private.c

private.c

INTLIBRARY PRIVATE: introduit du sharing, ne garantit pas l'unicite de chaque composante

Pvecteur vect_chain(Pvecteur v_in, Variable var, Value coeff): ajout d'un vecteur colineaire au vecteur de base var et de coefficient coeff au vecteur v_in; si la composante var de v_in etait nulle:

si <v_in . evar> == 0 alors -—> allocate v_out; -—> —> --> v_out = v_in + coeff var; —> destroy v_in; sinon chaos!

v_in ne doit plus etre utilise ulterieurement; l'utilisation standard est donc: v = vect_chain(v,var,coeff);

Pour preserver la coherence des vecteurs, l'utilisateur doit appeler vect_add_elem(v,var,coeff) qui teste l'existence d'un coefficient var nul dans v avant de creer un nouveau couple (var,coeff)

On pourrait preferer le passage d'un Pvecteur * comme premier argument et un return void.

very expensive for EDF... FC/CA 06/07/2000. useless?

assert(vect_coeff(var, v_in)==0);

Parameters
v_in_in
varar
coeffoeff

Definition at line 69 of file private.c.

73 {
74  Pvecteur v_out;
75 
76  /* very expensive for EDF... FC/CA 06/07/2000. useless? */
77  /* assert(vect_coeff(var, v_in)==0); */
78 
79  v_out = vect_new(var, coeff);
80  v_out->succ = v_in;
81 
82  return (v_out);
83 }

References Svecteur::succ, and vect_new().

Referenced by base_append(), base_union(), sc_to_minimal_basis(), vect_add_elem(), vect_chg_coeff(), and vect_dup().

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

◆ vect_check()

bool vect_check ( Pvecteur  cv)

bool vect_check(Pvecteur v): renvoie true si le vecteur v est coherent avec les specifications du package; aucun des coefficients effectivement conserves en memoire ne doit etre nul (la cellule aurait du etre liberee) et aucune dimension (i.e.

variable) ne peut apparaitre deux fois.

Ces conditions ne sont pas verifiees par Corinne dans ses routines du package "sommet".

new version to test linear_hashtable. better for large vectors, but much worse for small ones I guess. FC.

Especially for the NULL vector. FI.

Parameters
cvv

Definition at line 529 of file reductions.c.

530 {
531  Pvecteur v = cv;
532  register bool
533  consistent = true,
534  tcst_seen = false;
536 
537  for(; v!=NULL && consistent; v=v->succ)
538  {
539  consistent = value_notzero_p(val_of(v));
540  if (var_of(v))
541  {
543  consistent = false;
544  linear_hashtable_put(seen, var_of(v), (void*) 1);
545  }
546  else {
547  if (tcst_seen) consistent = false;
548  tcst_seen = true;
549  }
550  }
551 
553  return consistent;
554 }
#define value_notzero_p(val)
void linear_hashtable_put(linear_hashtable_pt h, void *k, void *v)
Definition: hashpointer.c:263

References linear_hashtable_free(), linear_hashtable_isin(), linear_hashtable_make(), linear_hashtable_put(), seen, Svecteur::succ, val_of, value_notzero_p, and var_of.

Referenced by adg_contrainte_fprint(), base_normalized_p(), contrainte_fprint(), contrainte_sprint_format(), contrainte_text_format(), monome_check(), pu_contrainte_fprint(), and vect_consistent_p().

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

◆ vect_chg_coeff()

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 *ppv a la valeur val

—> —> —> —> —> —> *ppv = *ppv - <*ppv . evar> evar + val evar

on n'a pas trouve de composante var

Parameters
ppvpv
varar
valal

Definition at line 143 of file unaires.c.

147 {
148  Pvecteur pvcour;
149 
150  if (val == 0) {
151  vect_erase_var(ppv, var);
152  }
153  else {
154  for (pvcour = (*ppv); pvcour != NULL; pvcour = pvcour->succ) {
155  if (pvcour->var == var) {
156  pvcour->val = val;
157  return;
158  }
159  }
160  /* on n'a pas trouve de composante var */
161  *ppv = vect_chain(*ppv,var,val);
162  }
163 }
Value val
Definition: vecteur-local.h:91

References Svecteur::succ, Svecteur::val, Svecteur::var, vect_chain(), and vect_erase_var().

Referenced by build_sc_with_several_uniform_ref(), complex_bound_computation(), contrainte_normalize(), cout_nul(), eval_var(), find_eg(), find_vbase(), free_guards(), get_exp_schedule(), gomory_trait_eq(), loop_nest_to_offset(), loop_nest_to_tile(), loop_nest_to_wp65_code(), lower_bound_generation(), mat_sys_conv(), matrice_index_sys(), matrices_to_constraints(), matrices_to_constraints_with_sym_cst(), matrices_to_contraintes_with_sym_cst(), matrices_to_loop_sc(), matrices_to_sc(), movement_computation(), my_contrainte_normalize(), my_matrices_to_constraints_with_sym_cst(), my_matrices_to_constraints_with_sym_cst_2(), oter_lvbase(), pivoter_pas(), plint_degen(), print_call_precondition(), pu_matrices_to_contraintes(), sc_consistent_p(), sc_image_computation(), sc_weak_consistent_p(), test_bound_generation(), transformer_add_variable_incrementation(), transformer_convex_hulls(), update_basis(), update_coefficient_signs_in_vector(), upper_bound_generation(), var_pivotd(), var_pivots(), var_posit(), vect_subst(), xml_Chain_Graph(), and xml_Compute_and_Need().

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

◆ vect_chg_sgn()

void vect_chg_sgn ( Pvecteur  v)

void vect_chg_sgn(Pvecteur v): multiplie v par -1

-> -> v := - v

Definition at line 151 of file scalaires.c.

153 {
154  for( ;v != NULL; v = v->succ)
155  value_oppose(val_of(v));
156 }
#define value_oppose(ref)

References val_of, and value_oppose.

Referenced by __attribute__(), add_affine_bound_conditions(), adg_get_conjonctions(), adg_max_of_leaves(), build_sc_with_several_uniform_ref(), calculate_delay(), change_base_in_sc(), check_positive_dependence(), complex_bound_computation(), constraint_to_bound(), constraints_to_loop_bound(), contrainte_chg_sgn(), contrainte_to_text_2(), create_farkas_poly(), creer_ineg(), dj_simple_inegs_to_eg(), dj_system_complement(), eq_in_ineq(), find_pattern(), get_bounds_expression(), get_exp_schedule(), gomory_trait_eq(), heuristique_3(), loop_executed_approximation(), loop_index_domaine_to_contrainte(), make_constraint_expression(), make_dual(), make_vvs_from_sc(), monome_monome_div(), my_substitute_var_with_vec(), negate_expression(), normalize_intrinsic(), NormalizeIntrinsic(), outliner_smart_references_computation(), pa_path_to_few_disjunct_ofl_ctrl(), print_loopnest_dependence_cone(), Pvecteur_to_assign_statement(), ray_oppose(), sc_of_constrs(), sc_supress_same_constraints(), sc_transform_eg_in_ineg(), separate_variables(), simplify_minmax_contrainte(), substitute_var_with_vec(), sys_int_redond(), test_bound_generation(), tile_hyperplane_constraints(), tile_membership_constraints(), transform_in_ineq(), translate_to_module_frame(), upper_bound_generation(), vect_cl_ofl_ctrl(), vect_div(), vect_multiply(), and xml_Region_Range().

◆ vect_chg_var()

void vect_chg_var ( Pvecteur ppv,
Variable  v_old,
Variable  v_new 
)

void vect_chg_var(Pvecteur *ppv, Variable v_old, Variable v_new) replace the variable v_old by v_new

Parameters
ppvpv
v_old_old
v_new_new

Definition at line 168 of file unaires.c.

171 {
172  Pvecteur pvcour;
173 
174  for (pvcour = (*ppv); pvcour != NULL; pvcour = pvcour->succ) {
175  if (pvcour->var == v_old){
176  pvcour->var = v_new;
177  return;
178  }
179  }
180 }

References Svecteur::succ, and Svecteur::var.

Referenced by gcd_and_constant_dependence_test(), poly_chg_var(), polynome_chg_var(), polynome_roots(), and sc_chg_var().

+ Here is the caller graph for this function:

◆ vect_cl()

Pvecteur vect_cl ( Pvecteur  v,
Value  lambda,
Pvecteur  u 
)
Parameters
lambdaambda

Definition at line 181 of file binaires.c.

185 {
186  return vect_cl_ofl_ctrl(v, lambda, u, NO_OFL_CTRL);
187 }
#define NO_OFL_CTRL
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...
Definition: binaires.c:128

References NO_OFL_CTRL, and vect_cl_ofl_ctrl().

Referenced by add_loop_index_exit_value(), constraints_eliminate_constant_terms(), and vect_substitute_dimension().

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

◆ vect_cl2()

Pvecteur vect_cl2 ( Value  x1,
Pvecteur  v1,
Value  x2,
Pvecteur  v2 
)
Parameters
x11
v11
x22
v22

Definition at line 247 of file binaires.c.

252 {
253  return(vect_cl2_ofl_ctrl(x1,v1,x2,v2, NO_OFL_CTRL));
254 }
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...
Definition: binaires.c:204

References NO_OFL_CTRL, and vect_cl2_ofl_ctrl().

Referenced by find_pattern(), lower_bound_generation(), upper_bound_generation(), and vect_subst().

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

◆ vect_cl2_ofl()

Pvecteur vect_cl2_ofl ( Value  x1,
Pvecteur  v1,
Value  x2,
Pvecteur  v2 
)
Parameters
x11
v11
x22
v22

Definition at line 238 of file binaires.c.

243 {
244  return(vect_cl2_ofl_ctrl(x1,v1,x2,v2, FWD_OFL_CTRL));
245 }
#define FWD_OFL_CTRL

References FWD_OFL_CTRL, and vect_cl2_ofl_ctrl().

+ Here is the call graph for this function:

◆ vect_cl2_ofl_ctrl()

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 la valeur est la combinaison lineaire des deux vecteurs v1 et v2 avec les coefficients respectifs x1 et x2 Le controle de l'overflow est effectue par vect_cl_ofl et traite par le retour du contexte correspondant au dernier CATCH(overflow_error) effectue.

-> allocate v; -> -> -> v := x1 v1 + x2 v2; -> return v;

le bout de l'horreur sur ces vecteurs creux dont les composantes ne sont pas triees; Malik a essaye d'eviter les allocations inutiles en "marquant" les coefficients de v2 qui ont ete vus lors du parcours des coefficients non-nuls de v1; puis il ajoute a ce premier resultat la partie de x2 v2 qui n'a pas encore ete prise en compte parce que le coefficient correspondant dans v1 etait nul;

la variable de nom 0 est traitee a part car la procedure de marquage (multiplication par -1) ne la marque pas

Une autre solution, presque aussi efficace, consisterait a allouer et calculer x1 v1 puis a y ajouter x2 v2 a coups de vect_add_elem; on n'a pas de procedure faisant simultanement l'allocation et la multiplication par un scalaire; on n'a pas de procedure faisant l'addition sans allocation (accumulation);

Francois Irigoin, 2 juin 1989

Parameters
x11
v11
x22
v22
ofl_ctrlfl_ctrl

Definition at line 204 of file binaires.c.

210 {
211  /* le bout de l'horreur sur ces vecteurs creux dont les composantes ne
212  sont pas triees; Malik a essaye d'eviter les allocations inutiles
213  en "marquant" les coefficients de v2 qui ont ete vus lors du parcours
214  des coefficients non-nuls de v1; puis il ajoute a ce premier resultat
215  la partie de x2 v2 qui n'a pas encore ete prise en compte parce
216  que le coefficient correspondant dans v1 etait nul;
217 
218  la variable de nom 0 est traitee a part car la procedure de
219  marquage (multiplication par -1) ne la marque pas
220 
221  Une autre solution, presque aussi efficace, consisterait a
222  allouer et calculer x1 v1 puis a y ajouter x2 v2 a coups
223  de vect_add_elem; on n'a pas de procedure faisant simultanement
224  l'allocation et la multiplication par un scalaire; on n'a pas
225  de procedure faisant l'addition sans allocation (accumulation);
226 
227  Francois Irigoin, 2 juin 1989 */
228 
229  Pvecteur v = NULL;
230 
231  v = vect_cl_ofl_ctrl(v,x1,v1, ofl_ctrl);
232  v = vect_cl_ofl_ctrl(v,x2,v2, ofl_ctrl);
233 
234  return(v);
235 }

References vect_cl_ofl_ctrl().

Referenced by compose_vvs(), contrainte_subst_ofl_ctrl(), elim_var_with_eg(), inegalite_comb_ofl_ctrl(), my_substitute_var_with_vec(), plc_elim_var_with_eg(), plc_make_vvs_with_vector(), sc_to_vvs(), substitute_var_with_vec(), valuer(), vect_cl2(), vect_cl2_ofl(), and vvs_on_vvs().

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

◆ vect_cl_ofl()

Pvecteur vect_cl_ofl ( Pvecteur  v,
Value  lambda,
Pvecteur  u 
)
Parameters
lambdaambda

Definition at line 173 of file binaires.c.

177 {
178  return vect_cl_ofl_ctrl(v, lambda, u, FWD_OFL_CTRL);
179 }

References FWD_OFL_CTRL, and vect_cl_ofl_ctrl().

+ Here is the call graph for this function:

◆ vect_cl_ofl_ctrl()

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 dans une combinaison lineaire; aucun sharing entre v et u n'est cree (allocation implicite) Le controle de l'overflow est effectue et traite par le retour du contexte correspondant au dernier CATCH(overflow_error) effectue.

-> -> -> v := v + lambda u; -> return v;

Modifications:

  • exploitation des lambdas 1 et -1; ca rallonge mechamment le code; non teste; u est casse mais en principe ce n'est pas grave car il n'est utilise qu'une seule fois (Francois Irigoin, 26/03/90)
  • add the cu variable to avoid side effects on parameter u; (Francois Irigoin, 17 December 1991)
  • add assert() to try to avoid most integer overflow; this is likely to (uselessly) slow down dependence tests since overflows occur only (?) in code generation phases; (Francois Irigoin, 17 December 1991)

ancienne version for( ;u!=NULL;u=u->succ) v = vect_chain(v,var_of(u),lambda*val_of(u));

== 1

== -1

bof, FC

Parameters
lambdaambda
ofl_ctrlfl_ctrl

Definition at line 128 of file binaires.c.

133 {
134  Pvecteur cu;
135 
136  if(lambda==VALUE_ZERO)
137  return v;
138  else if(v==NULL) {
139  /* ancienne version
140  * for( ;u!=NULL;u=u->succ)
141  * v = vect_chain(v,var_of(u),lambda*val_of(u));
142  */
143  v = vect_dup(u);
144  if (value_notone_p(lambda)) {
145  if (value_mone_p(lambda))
146  vect_chg_sgn(v);
147  else
148  v = vect_multiply(v, lambda);
149  }
150  }
151  else
152  if (value_one_p(lambda)) /* == 1 */
153  for(cu=u ;cu!=NULL;cu=cu->succ)
154  vect_add_elem(&v, var_of(cu), val_of(cu));
155  else if (value_mone_p(lambda)) /* == -1 */
156  for(cu=u ;cu!=NULL;cu=cu->succ)
157  vect_add_elem(&v, var_of(cu), value_uminus(val_of(cu)));
158  else
159  for(cu=u ;cu!=NULL;cu=cu->succ) {
160  /* bof, FC */
161  Value x = ofl_ctrl!=NO_OFL_CTRL?
162  value_protected_mult(lambda,val_of(cu)):
163  value_mult(lambda,val_of(cu));
164 
165  vect_add_elem(&v, var_of(cu), x);
166  }
167 
168  return v;
169 }
#define VALUE_ZERO
#define value_mone_p(val)
#define value_notone_p(val)
#define value_protected_mult(v, w)
protected versions
#define value_mult(v, w)
whether the default is protected or not this define makes no sense any more...
void vect_chg_sgn(Pvecteur v)
void vect_chg_sgn(Pvecteur v): multiplie v par -1
Definition: scalaires.c:151
Pvecteur vect_multiply(Pvecteur v, Value x)
Pvecteur vect_multiply(Pvecteur v, Value x): multiplication du vecteur v par le scalaire x,...
Definition: scalaires.c:123
static char * x
Definition: split_file.c:159

References NO_OFL_CTRL, Svecteur::succ, val_of, value_mone_p, value_mult, value_notone_p, value_one_p, value_protected_mult, value_uminus, VALUE_ZERO, var_of, vect_add_elem(), vect_chg_sgn(), vect_dup(), vect_multiply(), and x.

Referenced by calculate_delay(), converti_psysmin_psysmax(), loop_regions_normalize(), put_source_ind(), vect_cl(), vect_cl2_ofl_ctrl(), vect_cl_ofl(), and vvs_on_vecteur().

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

◆ vect_clean()

Pvecteur vect_clean ( Pvecteur  v)

Pvecteur vect_clean(Pvecteur v): elimination de tous les couples dont le coefficient vaut 0 dans le vecteur v et renvoie de v.

Ne devrait JAMAIS etre utilise en dehors de la bibliotheque vecteur. Ne sert qu'a corriger le resultat de vect_div quand la division entiere fait apparaitre un 0. Dans ces cas, vect_div n'est pas lineaire.

Definition at line 80 of file scalaires.c.

82 {
83  Pvecteur v1,v2;
84  Pvecteur pred = v;
85  Pvecteur result=v;
86 
87  for (v1 = v; ((v1!= NULL) && (v1->val != 0)); pred = v1,v1=v1->succ);
88 
89  for (v2 = v1;v2 != NULL; v2 = v2->succ)
90  {
91  if (v2->val == 0)
92  {
93  if (v2 == v)
94  {
95  result = v2->succ;
96  pred = v;
97 
98  }
99  else {
100  pred->succ = v2->succ;
101  v2->succ = NULL;
102  FREE((char*)v2,VECTEUR,"vect_clean");
103  v2 = pred;
104  }
105  }
106  else
107  pred = v2;
108 
109  }
110  return (result);
111 }
#define FREE(p, t, f)
package vecteur - operations vecteur x scalaire
Definition: scalaires.c:39

References FREE, Svecteur::succ, Svecteur::val, and VECTEUR.

Referenced by contrainte_normalize(), gomory_trait_eq(), my_contrainte_normalize(), var_posit(), and vect_div().

+ Here is the caller graph for this function:

◆ vect_coeff()

Value vect_coeff ( Variable  var,
Pvecteur  vect 
)

Variable vect_coeff(Variable var, Pvecteur vect): coefficient de coordonnee var du vecteur vect —> Soit evar le vecteur de base de nom var:

    --->   --->

return <vect . evar>; (i.e. return vect[var])

Parameters
varar
vectect

Definition at line 228 of file unaires.c.

231 {
232  for ( ; vect != NULL ; vect = vect->succ)
233  if (var_of(vect) == var) {
234  assert(val_of(vect)!=VALUE_ZERO);
235  return(val_of(vect));
236  }
237  return VALUE_ZERO;
238 }

References assert, Svecteur::succ, val_of, VALUE_ZERO, and var_of.

Referenced by add_bounding_box_constraints(), add_declaration_list_information(), add_reference_information(), add_var_sup(), affine_expression_of_loop_index_p(), aligned_p(), alignment_p(), array_access_to_array_ranges(), array_indices_communication(), array_overflow(), atomize_one_message(), bound_distribution(), bound_redund_with_sc_p(), bounds_equal_p(), build_integer_sc_nredund(), build_list_of_min(), build_sc_machine(), build_third_comb(), calculate_delay(), call_rwt(), change_base_in_sc(), check_coefficient_reduction(), combiner_ofl_with_test(), compare_the_constraints(), complex_bound_computation(), compose_vvs(), compute_receive_content(), compute_receive_domain(), compute_x_and_y_bounds(), const_negative(), constraint_distribution(), constraint_integer_combination(), constraint_to_bound(), constraint_without_vars(), constraints_eliminate_constant_terms(), constraints_for_bounds(), constraints_to_loop_bound(), constraints_to_matrices(), constraints_with_sym_cst_to_matrices(), constrs_of_sc(), contrainte_dup_extract(), contrainte_eval(), contrainte_normalize(), contrainte_parallele(), contrainte_subst_ofl_ctrl(), contrainte_to_matrix_ligne(), contrainte_var_min_coeff(), contraintes_to_expression(), contraintes_with_sym_cst_to_matrices(), convert_bound_expression(), convex_in_effect_loop_range_fix(), cost_of_constant_operations(), cst_vector_p(), dj_variable_substitution_with_eqs_ofl_ctrl(), do_group_statement_constant(), ecrit_ligne(), eligible_for_coefficient_reduction_with_bounding_box_p(), elim_var_with_eg(), eq_diff_const(), eq_sum_const(), eq_var_nophi_min_coeff(), eq_var_phi(), eval(), eval_2D_vecteur(), eval_var(), expression_and_precondition_to_integer_interval(), expression_integer_constant_p(), expression_to_int(), find_eg(), find_first_integer_point_in_between(), find_motif(), find_pattern(), find_vbase(), free_guards(), gcd_and_constant_dependence_test(), generate_one_message(), get_bounds_expression(), get_const_diff(), get_const_off(), gomory_eq(), gomory_trait_eq(), hpfc_broadcast_buffers(), hpfc_compute_lid(), hpfc_integer_constant_expression_p(), HpfcExpressionToInt(), include_trans_on_LC_in_ref(), inegalite_comb_ofl_ctrl(), initialize_offsets(), intersection(), is_good_direction_p(), is_inferior_monome(), Lbound(), legal_point_p(), ligne_pivot(), lignes_entrant(), loop_bounds_to_tile_bounds(), loop_flt(), loop_index_in_several_indices(), loop_regions_normalize(), loop_sc_to_matrices(), lower_bound_generation(), make_bounds(), make_constraint_expression(), make_loop_indice_equation(), make_vvs_from_sc(), message_larger_p(), message_manageable_p(), monome_sprint(), my_constraints_with_sym_cst_to_matrices(), my_contrainte_normalize(), my_substitute_var_with_vec(), my_vect_var_subst(), new_constraint_for_coefficient_reduction_with_bounding_box(), new_ecrit_ligne(), one_message_guards_and_neighbour(), one_receive_message(), outliner_smart_references_computation(), partial_broadcast_coefficients(), phi_free_contraints_to_expressions(), pivoter(), pivoter_pas(), plc_elim_var_with_eg(), plc_make_dim(), plc_make_vvs_with_vector(), plint(), plint_pas(), polynome_contains_var(), polynome_degree(), polynome_factorize(), polynome_roots(), polynome_var_subst(), print_call_precondition(), print_cone_vecteur(), print_vect_in_vertice_val(), pu_contraintes_to_matrices(), Pvecteur_to_assign_statement(), pvecteur_to_polynome(), region_projection_along_index_safe_p(), region_range_nul_p(), sc_add_di(), sc_add_dsi(), sc_bounded_normalization(), sc_constrains_variable_p(), sc_elim_double_constraints(), sc_elim_triang_integer_redund_constraint_p(), sc_elim_var(), sc_eliminate_constant_terms(), sc_find_equalities(), sc_integer_projection_information(), sc_minmax_of_variable(), sc_minmax_of_variable_optim(), sc_normalize2(), sc_safe_elim_db_constraints(), sc_simplex_feasibility_ofl_ctrl_fixprec(), sc_to_iproblem(), sc_to_matrices(), sc_variable_rename(), separate_variables(), set_dimensions_of_local_variable_family(), sg_fprint_as_ddv(), shift_expression_of_loop_index_p(), signed_integer_constant_expression_value(), simple_indices_p(), simplify_constraint_with_bounding_box(), simplify_dimension(), simplify_minmax_contrainte(), simplify_predicate(), small_positive_slope_reduce_coefficients_with_bounding_box(), small_slope_and_first_quadrant_p(), sol_entiere(), sol_finale(), sol_positive(), sol_positive_simpl(), sort_tile_indices(), st_one_message(), stmt_bdt_directions(), substitute_var_with_vec(), supported_ref_p(), sys_mat_conv(), sys_matrice_index(), system_new_var_subst(), test_borne(), test_bound_generation(), tile_change_of_basis(), tile_hyperplane_constraints(), tile_membership_constraints(), transform_in_ineq(), transformer_affect_linear_p(), translate_to_module_frame(), Ubound(), update_coefficient_signs_in_vector(), update_indices_for_local_computation(), update_lower_and_upper_bounds(), update_lower_or_upper_bound(), upper_bound_generation(), var_in_lcontrainte_p(), var_pivotd(), var_pivots(), var_with_unity_coeff_p(), vars_in_vect_p(), vect_const_p(), vect_equal(), vect_equal_except(), vect_fprint_as_dense(), vect_in_p(), vect_oppos(), vect_opposite_except(), vect_prod_scal(), vect_product(), vect_proport(), vect_sprint_as_monome(), vect_subst(), vect_substitute_dimension(), vect_var_subst(), vvs_on_vecteur(), vvs_on_vvs(), which_array_dimension(), xml_Chain_Graph(), xml_Compute_and_Need(), xml_ConstOffset(), xml_GlobalVariables(), xml_LocalVariables(), xml_LoopOffset(), xml_Pattern_Paving(), xml_Region_Range(), xml_TaskParameter(), xml_tiling(), and zmat_set_row().

◆ vect_coeff_sum()

Value vect_coeff_sum ( Pvecteur  vect)

Value vect_coeff_sum(Pvecteur vect): coefficient sum de tout les val de ce vecteur (devrait etre dans reduction? FC)

return Value Lei Zhou Mar.25, 91

Parameters
vectect

Definition at line 246 of file unaires.c.

248 {
249  Value val = VALUE_ZERO;
250 
251  if ( vect->var == TCST )
252  return val;
253  for (; vect != NULL ; vect = vect->succ) {
254  value_addto(val,vecteur_val(vect));
255  assert(value_notzero_p(val_of(vect)));
256  }
257  return val;
258 }

References assert, Svecteur::succ, TCST, val_of, value_addto, value_notzero_p, VALUE_ZERO, Svecteur::var, and vecteur_val.

Referenced by is_inferior_monome().

+ Here is the caller graph for this function:

◆ vect_colin_base()

bool vect_colin_base ( Pvecteur  vec,
Variable  var 
)

bool vect_colin_base(Pvecteur vec, Variable var): renvoie true si --> --> vec = k var

false sinon

Attention: le vecteur nul est colineaire a tous les vecteurs de base

Parameters
vecec
varar

Definition at line 508 of file reductions.c.

511 {
512  return(vec==NULL || (vec->succ==NULL && var_of(vec)==var));
513 }

References var_of.

◆ vect_common_variables_p()

bool vect_common_variables_p ( Pvecteur  v1,
Pvecteur  v2 
)

bool vect_common_variables_p(Pvecteur v1, v2) BA 19/05/94 input : two vectors.

output : true if they have at least one common variable, false otherwise. modifies : nothing.

Parameters
v11
v22

Definition at line 397 of file unaires.c.

399 {
400  Pvecteur ev;
401 
402  for(ev = v1; !VECTEUR_NUL_P(ev); ev = ev->succ) {
404  return true;
405  }
406  return false;
407 }
bool vect_contains_variable_p(Pvecteur v, Variable var)
bool vect_contains_variable_p(Pvecteur v, Variable var) BA 19/05/94 input : a vector and a variable o...
Definition: unaires.c:415

References Svecteur::succ, vect_contains_variable_p(), VECTEUR_NUL_P, and vecteur_var.

Referenced by elementary_convex_union(), and sc_restricted_to_variables_transitive_closure().

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

◆ vect_compare()

int vect_compare ( Pvecteur pv1,
Pvecteur pv2 
)

for qsort, returns:

  • if v1 < v2 0 if v1 = v2
  • if v1 > v2
Parameters
pv1v1
pv2v2

Definition at line 352 of file unaires.c.

354 {
355  return(strcmp((char *)&var_of(*pv1), (char *)&var_of(*pv2)));
356 }

References var_of.

Referenced by find_vbase(), MaxBoundary(), MinBoundary(), polynome_sort(), var_pivotd(), and var_pivots().

+ Here is the caller graph for this function:

◆ vect_consistent_p()

bool vect_consistent_p ( Pvecteur  v)

To ease retrieval of vect_check()

Definition at line 557 of file reductions.c.

557 { return vect_check(v);}

References vect_check().

+ Here is the call graph for this function:

◆ vect_contains_variable_p()

bool vect_contains_variable_p ( Pvecteur  v,
Variable  var 
)

bool vect_contains_variable_p(Pvecteur v, Variable var) BA 19/05/94 input : a vector and a variable output : true if var appears as a component of v, false otherwise.

modifies : nothing

Parameters
varar

Definition at line 415 of file unaires.c.

418 {
419  bool in_base;
420 
421  for(; !VECTEUR_NUL_P(v) && !variable_equal(vecteur_var(v), var); v = v->succ)
422  ;
423  in_base = !VECTEUR_NUL_P(v);
424  return(in_base);
425 }

References variable_equal(), VECTEUR_NUL_P, and vecteur_var.

Referenced by DivExists(), translate_to_module_frame(), vect_common_variables_p(), and vect_same_variables_p().

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

◆ vect_copy()

Pbase vect_copy ( Pvecteur  b)

direct duplication.

vect_dup() and vect_reversal() do the same thing : duplicate the vector with the reversal order. vect_copy duplicate the vector with the same order. in use of sc_copy. (DN,24/6/02) Does not change parameter b (DN,28/06/02)

Definition at line 240 of file alloc.c.

241 {
242  Pvecteur n = VECTEUR_NUL, p = VECTEUR_NUL, r = VECTEUR_NUL, tmp = b;
243 
244  for (; tmp!=VECTEUR_NUL; tmp=tmp->succ)
245  {
246  n = (Pvecteur) MALLOC(sizeof(Svecteur),VECTEUR,"vect_copy");
247  if (n == NULL) {
248  fprintf(stderr,"[vect_copy] out of memory space\n");
249  abort();
250  }
251  var_of(n) = var_of(tmp);
252  val_of(n) = val_of(tmp);
253  n->succ = NULL;
254  if (r==VECTEUR_NUL) r = n;
255  if (p!=VECTEUR_NUL) p->succ = n;
256  p = n;
257  }
258 
259  return r;
260 }

References abort, fprintf(), MALLOC, Svecteur::succ, val_of, var_of, VECTEUR, and VECTEUR_NUL.

Referenced by add_type_information(), c_convex_effects_on_actual_parameter_forward_translation(), check_positive_dependence(), contrainte_copy(), contrainte_parallele(), find_motif(), find_pattern(), main(), make_bound_expression(), print_call_precondition(), print_loopnest_dependence_cone(), sc_copy(), sc_elim_double_constraints(), sc_minmax_of_variable(), sc_projection_concat_proj_on_variables(), small_positive_slope_reduce_coefficients_with_bounding_box(), vect_gen_copy_tree(), xml_GlobalVariables(), and xml_LocalVariables().

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

◆ vect_del_var()

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 projection de v_in selon la direction var (i.e.

le coefficient de la coordonnee var est mis a 0)

Soit evar le vecteur de base correspondant a var:

      ---->

allocate v_out;

-—> —> -—> —> —> v_out := v_in - <v_out . evar> evar

  ---->

return v_out;

Parameters
v_in_in
varar

Definition at line 206 of file unaires.c.

209 {
210  if(v_in!=NULL){
211  Pvecteur v_out = vect_dup(v_in);
212  vect_erase_var(&v_out,var);
213  return(v_out);
214  }
215  else
216  return(NULL);
217 }

References vect_dup(), and vect_erase_var().

Referenced by affine_expression_of_loop_index_p(), array_access_to_array_ranges(), build_list_of_min(), constraint_to_bound(), constraints_to_loop_bound(), contraintes_to_expression(), do_group_statement_constant(), get_bounds_expression(), hpfc_integer_constant_expression_p(), make_vvs_from_sc(), monome_del_var(), outliner_smart_references_computation(), polynome_roots(), shift_expression_of_loop_index_p(), the_index_of_vect(), and translate_to_module_frame().

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

◆ vect_dimension()

int vect_dimension ( Pvecteur  v)

int vect_dimension(Pvecteur v): calcul du nombre de composantes non nulles et non constantes d'un vecteur

sum abs(sgn(v[i])) i

Definition at line 64 of file reductions.c.

66 {
67  Pvecteur el;
68  int nb_elem = 0;
69 
70  for (el=v; el != NULL; el=el->succ)
71  if(!term_cst(el))
72  nb_elem++;
73 
74  return (nb_elem);
75 }
#define term_cst(varval)

References Svecteur::succ, and term_cst.

Referenced by choose_pattern(), find_pattern(), print_call_precondition(), sc_minmax_of_variable2(), sc_strong_normalize_and_check_feasibility2(), and xml_Pattern_Paving().

+ Here is the caller graph for this function:

◆ vect_div()

Pvecteur vect_div ( Pvecteur  v,
Value  x 
)

scalaires.c

scalaires.c

-> -> v := v / x; -> -> Si x vaut 0, la procedure aborte meme si v == 0 -> Attention, si x ne divise pas le pgcd des coefficients de v, la valeur retournee n'est pas colineaire a la valeur initiale

Definition at line 52 of file scalaires.c.

55 {
56  if(value_zero_p(x)) {
57  vect_error("vect_div","vector zero divide\n");
58  }
59  else if (value_one_p(x))
60  ;
61  else if(value_mone_p(x))
62  vect_chg_sgn(v);
63  else {
64  Pvecteur coord;
65 
66  for (coord = v ;coord!=NULL;coord=coord->succ) {
67  value_pdivision(val_of(coord),x);
68  }
69  }
70  return vect_clean(v);
71 }
#define value_pdivision(ref, val)
Pvecteur vect_clean(Pvecteur v)
Pvecteur vect_clean(Pvecteur v): elimination de tous les couples dont le coefficient vaut 0 dans le v...
Definition: scalaires.c:80
void vect_error(char *name, char *fmt,...)
package vecteur
Definition: error.c:50

References Svecteur::succ, val_of, value_mone_p, value_one_p, value_pdivision, value_zero_p, vect_chg_sgn(), vect_clean(), vect_error(), and x.

Referenced by analyze_expression(), calculate_delay(), contrainte_normalize(), make_array_bounds(), make_rational_exp(), my_contrainte_normalize(), sc_find_equalities(), sommet_normalize(), and vect_normalize().

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

◆ vect_dump()

void vect_dump ( Pvecteur  v)

void vect_dump(Pvecteur v): print sparse vector v on stderr.

By default, each dimension/variable is represented by an X followed by its hexadeximal address.

Intended for debug purposes. Its behavior depends on the setting of pointer variable_debug_name by init_variable_debug_name(). Different names can be returned for each variable, more useful than a pointer value.

Definition at line 304 of file io.c.

304  {
305  vect_fprint(stderr, v, variable_debug_name);
306 }
void vect_fprint(FILE *f, Pvecteur v, get_variable_name_t variable_name)
void vect_fprint(FILE * f, Pvecteur v, char * (*variable_name)()): impression d'un vecteur creux v su...
Definition: io.c:124

References variable_debug_name, and vect_fprint().

Referenced by affine_to_transformer(), check_coefficient_reduction(), compute_x_and_y_bounds(), find_first_integer_point_in_between(), make_loop_indice_equation(), new_constraint_for_coefficient_reduction_with_bounding_box(), sc_bounded_normalization(), sc_consistent_p(), sc_projection_optim_along_vecteur_ofl(), simple_affine_to_transformer(), simplify_constraint_with_bounding_box(), and Tiling_buffer_allocation().

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

◆ vect_dup()

Pvecteur vect_dup ( Pvecteur  v_in)

end of vecteur-local.h

cproto-generated files alloc.c

end of vecteur-local.h

allocate v_out; v_out := v_in;

Parameters
v_in_in

Definition at line 51 of file alloc.c.

53 {
54  Pvecteur v_out;
55  Pvecteur v;
56 
57  v_out = NULL;
58  for(v=v_in; v!=NULL; v=v->succ) {
59  v_out = vect_chain(v_out,var_of(v),val_of(v));
60  }
61 
62  return v_out;
63 }

References Svecteur::succ, val_of, var_of, and vect_chain().

Referenced by __attribute__(), add_affine_bound_conditions(), adg_sc_dup(), affine_to_transformer(), array_indices_communication(), block_to_complexity(), bounds_equal_p(), broadcast_of_dataflow(), build_list_of_min(), build_sc_machine(), build_sc_with_several_uniform_ref(), build_third_comb(), calculate_delay(), change_base_in_sc(), check_range_wrt_precondition(), complex_bound_computation(), constraint_to_bound(), contrainte_dup(), CopyAccVec(), create_farkas_poly(), dependence_system_add_lci_and_di(), dj_simple_inegs_to_eg(), dj_system_complement(), dup_list_of_Pvecteur(), dup_vv(), elim_var_with_eg(), eq_in_ineq(), expression_to_affine(), final_statement_to_complexity_evaluation(), find_eg(), find_pattern(), formal_and_actual_parameters_association(), free_guards(), fusion_buffer(), gcd_and_constant_dependence_test(), get_bounds_expression(), gomory_trait_eq(), include_trans_on_LC_in_ref(), integer_divide_to_transformer(), integer_power_to_transformer(), integer_right_shift_to_transformer(), loop_executed_approximation(), loop_index_domaine_to_contrainte(), loop_nest_to_wp65_code(), lower_bound_generation(), make_constraint_expression(), make_context_of_loop(), make_datum_movement(), make_dual(), make_load_blocks(), make_movements_loop_body_wp65(), make_reindex(), make_store_blocks(), matrices_to_loop_sc(), matrices_to_sc(), matrix_to_system(), MaxBoundary(), MinBoundary(), monome_dup(), monome_monome_div(), monome_monome_mult(), movement_computation(), my_vect_substract(), negate_expression(), normalize_intrinsic(), pa_path_to_few_disjunct_ofl_ctrl(), parallel_tiling(), Pcontrainte_separate_on_vars(), pivoter_pas(), plc_elim_var_with_eg(), plint_degen(), Pvecteur_to_assign_statement(), ray_dte_dup(), sc_dup1(), sc_find_equalities(), sc_image_computation(), sc_lexicographic_sort(), sc_projection_optim_along_vecteur_ofl(), sc_supress_same_constraints(), sc_to_tableau(), separate_variables(), set_dimensions_of_local_variable_family(), simple_affine_to_transformer(), simplify_deducable_variables(), simplify_dimension(), simplify_minmax_contrainte(), simplify_predicate(), sommet_dup(), substitute_and_create(), tile_hyperplane_constraints(), tile_membership_constraints(), Tiling_buffer_allocation(), tiling_transformation(), transformer_add_integer_relation_information(), transformer_add_loop_index_initialization(), transformer_equalities_add(), transformer_pattern_fix_point(), translate_global_values(), update_basis(), upper_bound_generation(), vect_add(), vect_add_first(), vect_change_base(), vect_cl_ofl_ctrl(), vect_del_var(), vect_extract(), vect_sort(), vect_substract(), xml_Compute_and_Need(), xml_Pattern_Paving(), and xml_Region_Range().

+ Here is the call graph for this function:

◆ vect_elem()

Pvecteur vect_elem ( Pvecteur  vect,
Variable  var 
)

PRIVATE: introduit du sharing; never used...

Pvecteur vect_elem(Pvecteur vect, Variable var): retourne la valeur du pointeur vers le couple correspondant a la variable var dans le vecteur vect, s'il existe ou NULL sinon.

Parameters
vectect
varar

Definition at line 91 of file private.c.

94 {
95  for( ;vect!=NULL;vect=vect->succ) {
96  if (var_of(vect)==var) {
97  return(vect);
98  }
99  }
100  return (NULL);
101 }

References var_of.

◆ vect_equal()

bool vect_equal ( Pvecteur  v1,
Pvecteur  v2 
)

bool vect_equal(Pvecteur v1, Pvecteur v2): test a egalite de deux vecteurs

   ->    ->

return v1 == v2 ;

Note: le test n'est pas optimal puisque v2 est parcouru et compare a v1 meme si ces coefficients ont ete deja ete compare lors du parcours de v1; mais cela evite le "marquage" des coefficients vus;

shorter version, FC 28/09/94

v1 must be preserved for the second loop: use v

now v2 may be lost: use v2

Parameters
v11
v22

Definition at line 278 of file reductions.c.

280 {
281  /* Note: le test n'est pas optimal puisque v2 est parcouru et compare
282  * a v1 meme si ces coefficients ont ete deja ete compare lors du
283  * parcours de v1; mais cela evite le "marquage" des coefficients vus;
284  *
285  * shorter version, FC 28/09/94
286  */
287  Pvecteur v;
288  register bool
289  result = true;
290 
291  if (!v1 || !v2)
292  return(!v1 && !v2);
293 
294  /* v1 must be preserved for the second loop: use v
295  */
296  for (v=v1;
297  v && result;
298  v=v->succ)
299  result = value_eq(val_of(v),vect_coeff(var_of(v),v2));
300 
301  /* now v2 may be lost: use v2
302  */
303  for (;
304  v2 && result;
305  v2=v2->succ)
306  result = value_eq(val_of(v2),vect_coeff(var_of(v2),v1));
307 
308  return result;
309 }
#define value_eq(v1, v2)
bool operators on values
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 Svecteur::succ, val_of, value_eq, var_of, and vect_coeff().

Referenced by adg_quast_leaf_solution_equal_p(), adg_suppress_2nd_in_1st_ps(), call_rwt(), contrainte_equal(), contrainte_in_liste(), dte_in_sg_p(), egaliste_rd(), egalite_equal(), egalite_in_liste(), exp_equals_p(), free_guards(), monome_colin(), monome_equal(), polynome_constant_p(), polynome_TCST(), ray_in_sg_p(), rd_in_liste(), same_expression_p(), semantics_is_inferior_pvarval(), som_in_liste(), sommet_egal(), sommet_in_sg_p(), suppress_sc_in_sc(), and vect_lexicographic_unsafe_compare_generic().

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

◆ vect_equal_except()

bool vect_equal_except ( Pvecteur  v1,
Pvecteur  v2,
Variable  var 
)

bool vect_equal_except(Pvecteur v1, Pvecteur v2, Variable var): test a egalite des projections selon la coordonnees var de deux vecteurs -> Soit e un vecteur de base quelconque: -> -> -> -> return <v1 .

e> == <v2 . e>; e!=var

Parameters
v11
v22
varar

Definition at line 319 of file reductions.c.

322 {
323  Pvecteur pv;
324  /*
325  * Note: le test n'est pas optimal puisque v2 est parcouru et compare
326  * a v1 meme si ces coefficients ont ete deja ete compare lors du
327  * parcours de v1; mais cela evite le "marquage" des coefficients vus;
328  */
329  bool result;
330 
331  if(v1==NULL && v2==NULL)
332  result = true;
333  else if(v1==NULL)
334  result = v2->succ==NULL && var_of(v2)==var;
335  else if(v2 == NULL)
336  result = v1->succ==NULL && var_of(v1)==var;
337  else {
338  result = true;
339 
340  for (pv = v1; pv != NULL && result == true; pv = pv->succ)
341  if (var_of(pv) != var)
342  result = value_eq(val_of(pv),vect_coeff(var_of(pv), v2));
343 
344  for (pv = v2; pv != NULL && result == true; pv = pv->succ)
345  if (var_of(pv) != var)
346  result = value_eq(val_of(pv),vect_coeff(var_of(pv), v1));
347 
348  }
349 
350  return result;
351 }

References Svecteur::succ, val_of, value_eq, var_of, and vect_coeff().

Referenced by eq_smg(), and sc_elim_double_constraints().

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

◆ vect_erase_var()

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.e.

mise a zero de la coordonnee v du vecteur pointe par ppv)

Soit ev le vecteur de base correspondant a v:

—> —> —> -> -> *ppv := *ppv - <*ppv . ev> ev

Note: cette routine ne fait pas l'hypothese que chaque coordonnee n'apparait qu'une fois; on pourrait l'accelerer en forcant pvcour a NULL des que la coordonnee est trouvee.

A-t-on trouve la composante v?

Si oui, est-il possible de la dechainer?

elle n'est pas en tete de liste

Elle est en tete de liste; il faut modifier ppv

Non, on passe a la composante suivante...

Parameters
ppvpv

Definition at line 106 of file unaires.c.

109 {
110  Pvecteur pvprec, pvcour;
111 
112  for (pvprec = NULL, pvcour = (*ppv); pvcour != NULL;) {
113  /* A-t-on trouve la composante v? */
114  if (pvcour->var == v) {
115  /* Si oui, est-il possible de la dechainer? */
116  if (pvprec != NULL) {
117  /* elle n'est pas en tete de liste */
118  Pvecteur pvprim = pvcour;
119  pvcour = pvprec->succ = pvcour->succ;
120  FREE((char *)pvprim, VECTEUR, "vect_erase_var");
121  }
122  else {
123  /* Elle est en tete de liste; il faut modifier ppv */
124  *ppv = pvcour->succ;
125  FREE((char *)pvcour,VECTEUR,"vect_erase_var");
126  pvcour = *ppv;
127  }
128  }
129  else {
130  /* Non, on passe a la composante suivante... */
131  pvprec = pvcour;
132  pvcour = pvcour->succ;
133  }
134  }
135 }
#define FREE(p, t, f)
Definition: unaires.c:42

References FREE, Svecteur::succ, Svecteur::var, and VECTEUR.

Referenced by algorithm_row_echelon_generic(), base_remove_variable(), build_third_comb(), change_base_in_sc(), compose_vvs(), constraints_to_loop_bound(), find_motif(), find_pattern(), free_guards(), include_trans_on_LC_in_ref(), is_inferior_monome(), make_constraint_expression(), movement_computation(), my_substitute_var_with_vec(), my_vect_var_subst(), new_system_with_only_live_variable(), pip_solve(), pip_solve_min_with_big(), Pvecteur_to_assign_statement(), sc_find_equalities(), sc_fm_project_variables(), sc_force_variable_to_zero(), simplify_minmax_contrainte(), system_new_var_subst(), the_index_of_vect(), transform_in_ineq(), update_basis(), vect_add_elem(), vect_add_first(), vect_change_base(), vect_chg_coeff(), vect_del_var(), vect_printout_order(), vect_var_subst(), vvs_on_vecteur(), vvs_on_vvs(), xml_Boxes(), and xml_Region_Range().

+ Here is the caller graph for this function:

◆ vect_error()

void vect_error ( char *  name,
char *  fmt,
  ... 
)

error.c

error.c

INTLIBRARY void vect_error(va_dcl va_list): should be called to terminate execution and to core dump when data structures are corrupted or when an undefined operation is requested (zero divide for instance). VECT_ERROR should be called as:

VECT_ERROR(function_name, format, expression-list)

where function_name is a string containing the name of the function calling VECT_ERROR, and where format and expression-list are passed as arguments to vprintf. VECT_ERROR terminates execution with abort. ARARGS0

print name of function causing error

print out remainder of message

create a core file for debug

Parameters
nameame
fmtmt

Definition at line 50 of file error.c.

51 {
52  va_list args;
53  va_start(args, fmt);
54 
55  /* print name of function causing error */
56  (void) fprintf(stderr, "vecteur error in %s: ", name);
57 
58  /* print out remainder of message */
59  (void) vfprintf(stderr, fmt, args);
60  va_end(args);
61 
62  /* create a core file for debug */
63  (void) abort();
64 }

References abort, and fprintf().

Referenced by vect_div(), vect_max(), vect_min(), and vect_proport().

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

◆ vect_extract()

Pvecteur vect_extract ( Pvecteur  pvec,
Variable  var 
)

UNUSED - NOT TESTED.

Pvecteur vect_extract(Pvecteur pvec, Variable var): fonction qui extrait le couple (variable,coefficient) du vecteur et renvoie l'adresse d'un nouveau vecteur vers ce couple. On a donc un effet de bord sur pvec (qui est impossible a assurer dans tous les cas) et un retour de valeur

—> —> —> --> --> pvec := pvec - <pvec . var> var; -—> allocate pvec1; -—> —> --> --> return(pvec1 := <pvec . var> var);

Notes:

  • ca ne peut pas marcher si var apparait dans le premier couple du vecteur car on n'a pas moyen de changer pvec, vu la passage par valeur; il faudrait donc soit changer le type de la procedure et passer un Pvecteur *, soit autoriser les couples de valeur 0;
  • cette fonction n'est utile que si elle diminue le nombre d'allocations; elle commence malencontreusement par un vect_dup inconditionnel.

le couple interessant se trouve en tete

Sinon, c'est le vecteur 0

Parameters
pvecvec
varar

Definition at line 126 of file private.c.

129 {
130  Pvecteur pvec1 = vect_dup(pvec);
131  Pvecteur var_val = pvec1;
132  Pvecteur var_pred = pvec1;
133 
134  if (var_val != NULL) {
135  if ( var_of(var_pred)== var) {
136  /* le couple interessant se trouve en tete */
137  pvec1 = var_pred->succ;
138  var_pred->succ = NULL;
139  return (var_pred);
140  }
141  else {
142  for(var_val=(var_val->succ);var_val!=NULL;var_pred = var_val,
143  var_val=var_val->succ) {
144  if (var_of(var_val)==var) {
145  var_pred->succ = var_val->succ;
146  var_val->succ = NULL;
147  return(var_val);
148  }
149  }
150 
151  }
152  }
153 
154  /* Sinon, c'est le vecteur 0 */
155  return (NULL);
156 }

References Svecteur::succ, var_of, and vect_dup().

+ Here is the call graph for this function:

◆ vect_fdump()

void vect_fdump ( FILE *  f,
Pvecteur  v 
)

void vect_fdump(FILE * f, Pvecteur v): impression d'un vecteur creux par vect_fprint() avec passage de la fonction variable_debug_name()

Definition at line 320 of file io.c.

320  {
322 }

References f(), variable_debug_name, and vect_fprint().

+ Here is the call graph for this function:

◆ vect_first_var()

Variable vect_first_var ( Pvecteur  pvec)

PRIVATE: marquage du couple var_val comme visite par remplacement de var par -var dans le couple (OBSOLETE)

Value vect_coeff_m(Variable var, Pvecteur vect)

static Value vect_coeff_m(var,vect) Variable var; Pvecteur vect; { for (; vect != NULL ; vect = vect->succ) if (var_of(vect) == var) { marquer(vect); return(val_of(vect)); } return(0); } PRIVATE Pvecteur vect_tri_old(Pvecteur pvec): allocation d'un vecteur prenant une valeur egale a celle de pvec mais dont les couples (variable,valeur) sont tries dans "l'ordre croissant" des vecteurs de base (i.e. des variables) Variable vect_first_var(Pvecteur pvec) retourne la premiere variable (au sens CAR) du vecteur pvec routine sale mais qui permet d'iterer sur les variables formant un vecteur ou une base. 20/06/90 PB

Parameters
pvecvec

Definition at line 227 of file private.c.

229 {
230  return(pvec->var);
231 }

Referenced by is_inferior_monome(), and pvecteur_to_polynome().

+ Here is the caller graph for this function:

◆ vect_fprint()

void vect_fprint ( FILE *  f,
Pvecteur  v,
get_variable_name_t  variable_name 
)

void vect_fprint(FILE * f, Pvecteur v, char * (*variable_name)()): impression d'un vecteur creux v sur le fichier f; le nom de chaque coordonnee est donne par la fonction variable_name()

Par exemple, le vecteur v -> -> -> -> v == 2 i - 3 j + k est imprime sous la forme 2 * i - 3 * j + k LF ou les symboles i, j et k sont obtenus via la fonction pointee par variable_name()

Le vecteur nul est represente par vecteur nul LF

Note: attention au linefeed final il n'existe pas de fonction relisant des vecteurs sous cette forme (pour le moment...)

Modifications:

  • suppression du cas special du terme constant Resultat : core dump (FC, 28/11/94) Fixed, (BC, 6/12/94)
Parameters
variable_nameariable_name

Definition at line 124 of file io.c.

124  {
125  Pvecteur p;
126 
127  if(v==NULL)
128  (void) fprintf(f,"nul vector\n");
129  else
130  for (p = v; p != NULL; p = p->succ)
131  {
132  if (p->var != TCST) {
133  fprint_Value(f, p->val);
134  (void) fprintf(f," * %s ", variable_name(p->var));
135  }
136  else {
137  (void) fprint_Value(f, p->val);
138  fprintf(f, " ");
139  }
140 
141  if (p->succ != NULL) {
142  (void) fprintf(f,"+ ");}
143  else {
144  (void) fprintf(f,"\n");}
145  }
146 }
void fprint_Value(FILE *f, Value v)
Definition: io.c:42

References f(), fprint_Value(), fprintf(), Svecteur::succ, TCST, Svecteur::val, Svecteur::var, and variable_name().

Referenced by add_loop_skip_condition(), chose_variable_to_project_for_feasability(), compute_iteration_domain(), create_tile_basis(), dbg_ray_dte_rm(), dj_variable_substitution_with_eqs_ofl_ctrl(), eval_var(), find_iteration_domain(), fprint_message(), invariant_vector_p(), loop_iteration_domaine_to_sc(), loop_nest_to_wp65_code(), module_to_wp65_modules(), movement_computation(), new_system_with_only_live_variable(), pa_path_to_few_disjunct_ofl_ctrl(), parallel_tiling(), pvecteur_to_polynome(), ray_dte_fprint(), reduce_coefficients_with_bounding_box(), reg_v_debug(), sc_elim_redund_with_first_ofl_ctrl(), small_positive_slope_reduce_coefficients_with_bounding_box(), sommet_fprint(), tiling_transformation(), transformer_pattern_fix_point(), vect_debug(), vect_dump(), vect_fdump(), and vect_print().

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

◆ vect_fprint_as_dense()

void vect_fprint_as_dense ( FILE *  f,
Pvecteur  v,
Pbase  b 
)

void vect_fprint_as_dense(FILE * f, Pvecteur v, Pbase b):

Par exemple, le vecteur v -> -> -> -> v == 2 i - 3 j + k est imprime sous la forme ( 2 -3 1) dans la base (i j k)

No constant term TCST is expected.

I do not know what should be done for constant terms...

Definition at line 159 of file io.c.

163 {
164  if(vect_in_basis_p(v, b)) {
165  Pvecteur coord;
166 
167  fputc('(', f);
168 
169  for(coord = b; !VECTEUR_NUL_P(coord); coord = coord->succ) {
170  Variable var = vecteur_var(coord);
171 
172  if(VARIABLE_DEFINED_P(var)) {
173  fprint_Value(f, vect_coeff(var, v));
174  if(VECTEUR_NUL_P(coord->succ)) {
175  fputc(')', f);
176  }
177  else {
178  fputc(',', f);
179  }
180  }
181  else {
182  /* I do not know what should be done for constant terms... */
183  abort();
184  }
185  }
186  }
187  else
188  abort();
189 }
bool vect_in_basis_p(Pvecteur v, Pbase b)
Pvecteur vect_in_basis_p(Pvecteur v, Pbase b): check that all coordinates in v are in b,...
Definition: base.c:342
#define VARIABLE_DEFINED_P(v)
Definition: vecteur-local.h:66

References abort, f(), fprint_Value(), Svecteur::succ, VARIABLE_DEFINED_P, vect_coeff(), vect_in_basis_p(), VECTEUR_NUL_P, and vecteur_var.

Referenced by ray_dte_fprint_as_dense(), and sommet_fprint_as_dense().

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

◆ vect_fprint_as_monome()

void vect_fprint_as_monome ( FILE *  f,
Pvecteur  v,
Pbase  b,
get_variable_name_t  variable_name,
char *  mult_symbol 
)

void vect_fprint_as_monome(FILE * f, Pvecteur v, Pbase b, char * (*variable_name)(), char *mult_symbol): impression d'un vecteur creux considere comme un monome sans coefficient.

Par ex.: le vecteur 2 * i - 3 * j + k est ecrit: "i^2 * j^(-3) * k". Le nom de chaque variable est donne par la fonction variable_name(). L'ordre dans lequel sont ecrites les inconnues du monome est fixe par la base b. Le symbole "multiplication" est passe dans (char *) mult_symbol: " * ", ".", "x", "", ... le vecteur de base special TCST n'est pas affiche: seulement son coefficient. Pas de
a la fin de l'affichage.

Parameters
variable_nameariable_name
mult_symbolult_symbol

Definition at line 201 of file io.c.

205  {
206  char *s = vect_sprint_as_monome(v, b, variable_name, mult_symbol);
207 
208  fprintf(f, "%s", s);
209  free(s);
210 }
char * vect_sprint_as_monome(Pvecteur v, Pbase b, get_variable_name_t variable_name, char *mult_symbol)
char *vect_sprint_as_monome(Pvecteur v, Pbase b, char * (*variable_name)(), char *mult_symbol): Retou...
Definition: io.c:217

References f(), fprintf(), free(), variable_name(), and vect_sprint_as_monome().

Referenced by prv().

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

◆ vect_in_basis_p()

bool vect_in_basis_p ( Pvecteur  v,
Pbase  b 
)

Pvecteur vect_in_basis_p(Pvecteur v, Pbase b): check that all coordinates in v are in b, i.e.

vector v is a membre of the space generated by b

Bugs:

  • TCST and VARIABLE_UNDEFINED are equal; a dirty test is performed to screen TCST terms; on top of that, the special variable TCST is not kept in bases!

I do not know what should be done for constant terms...

Definition at line 342 of file base.c.

345 {
346  Pvecteur coord;
347 
348  for(coord = v; !VECTEUR_NUL_P(coord); coord = coord->succ) {
349 
350  if(VARIABLE_DEFINED_P(vecteur_var(coord))) {
351  if(!base_contains_variable_p(b, vecteur_var(coord))) {
352  return(false);
353  }
354  }
355  else {
356  /* I do not know what should be done for constant terms... */
357  abort();
358  }
359  }
360  return true;
361 }

References abort, base_contains_variable_p(), Svecteur::succ, VARIABLE_DEFINED_P, VECTEUR_NUL_P, and vecteur_var.

Referenced by algorithm_row_echelon_generic(), gcd_and_constant_dependence_test(), legal_point_p(), print_cone_vecteur(), and vect_fprint_as_dense().

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

◆ vect_larger_coef_p()

bool vect_larger_coef_p ( Pvecteur  v,
Value  val 
)
Returns
whether one coef in v is greater than abs(val), but CST
Parameters
vvecteur being scanned
valmaximum absolute value allowed, or 0 to ignore
Parameters
valal

Definition at line 564 of file reductions.c.

565 {
566  linear_assert("positive value", value_posz_p(val));
567  if (value_zero_p(val)) return false;
568  for (; v!=NULL; v=v->succ)
569  if (var_of(v) &&
570  (value_lt(val_of(v), value_uminus(val)) || value_gt(val_of(v), val)))
571  return true;
572  return false;
573 }
#define value_gt(v1, v2)
#define value_lt(v1, v2)
#define value_posz_p(val)
#define linear_assert(msg, ex)
Definition: linear_assert.h:51

References linear_assert, Svecteur::succ, val_of, value_gt, value_lt, value_posz_p, value_uminus, value_zero_p, and var_of.

Referenced by contrainte_remove_large_coef().

+ Here is the caller graph for this function:

◆ vect_lexicographic_compare()

int vect_lexicographic_compare ( Pvecteur  v1,
Pvecteur  v2,
int(*)(Pvecteur *, Pvecteur *)  compare 
)

qsort() is not safe if the comparison function is not antisymmetric.

It wanders out of the array to be sorted. It's a pain to debug. Let's play safe. Version for equations

Parameters
v11
v22

Definition at line 433 of file unaires.c.

435 {
436  int cmp12 = 0;
437  int cmp21 = 0;
438 
439  cmp12 = vect_lexicographic_unsafe_compare(v1, v2, compare);
440  cmp21 = vect_lexicographic_unsafe_compare(v2, v1, compare);
441 
442  assert(cmp12 == -cmp21);
443 
444  return cmp12;
445 }
int vect_lexicographic_unsafe_compare(Pvecteur v1, Pvecteur v2, int(*compare)(Pvecteur *, Pvecteur *))
Definition: unaires.c:464

References assert, and vect_lexicographic_unsafe_compare().

Referenced by equation_lexicographic_compare(), and sc_lexicographic_sort().

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

◆ vect_lexicographic_compare2()

int vect_lexicographic_compare2 ( Pvecteur  v1,
Pvecteur  v2,
int(*)(Pvecteur *, Pvecteur *)  compare 
)

Version for inequalities.

Parameters
v11
v22

Definition at line 449 of file unaires.c.

451 {
452  int cmp12 = 0;
453  int cmp21 = 0;
454 
455  cmp12 = vect_lexicographic_unsafe_compare2(v1, v2, compare);
456  cmp21 = vect_lexicographic_unsafe_compare2(v2, v1, compare);
457 
458  assert(cmp12 == -cmp21);
459 
460  return cmp12;
461 }
int vect_lexicographic_unsafe_compare2(Pvecteur v1, Pvecteur v2, int(*compare)(Pvecteur *, Pvecteur *))
Definition: unaires.c:474

References assert, and vect_lexicographic_unsafe_compare2().

Referenced by inequality_lexicographic_compare().

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

◆ vect_lexicographic_unsafe_compare()

int vect_lexicographic_unsafe_compare ( Pvecteur  v1,
Pvecteur  v2,
int(*)(Pvecteur *, Pvecteur *)  compare 
)
Parameters
v11
v22

Definition at line 464 of file unaires.c.

466 {
467  int cmp = 0;
468 
469  cmp = vect_lexicographic_unsafe_compare_generic(v1, v2, compare, true);
470 
471  return cmp;
472 }
int vect_lexicographic_unsafe_compare_generic(Pvecteur v1, Pvecteur v2, int(*compare)(Pvecteur *, Pvecteur *), bool is_equation __attribute__((unused)))
This function is a trade-off between a real lexicographic sort and a prettyprinting function also use...
Definition: unaires.c:542

References vect_lexicographic_unsafe_compare_generic().

Referenced by vect_lexicographic_compare().

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

◆ vect_lexicographic_unsafe_compare2()

int vect_lexicographic_unsafe_compare2 ( Pvecteur  v1,
Pvecteur  v2,
int(*)(Pvecteur *, Pvecteur *)  compare 
)
Parameters
v11
v22

Definition at line 474 of file unaires.c.

476 {
477  int cmp = 0;
478 
479  cmp = vect_lexicographic_unsafe_compare_generic(v1, v2, compare, false);
480 
481  return cmp;
482 }

References vect_lexicographic_unsafe_compare_generic().

Referenced by vect_lexicographic_compare2().

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

◆ vect_lexicographic_unsafe_compare_generic()

int vect_lexicographic_unsafe_compare_generic ( Pvecteur  ,
Pvecteur  ,
int(*)(Pvecteur *, Pvecteur *)  ,
bool   
)

◆ vect_make()

Pvecteur vect_make ( Pvecteur  v,
Variable  var,
Value  val,
  ... 
)

Pvecteur vect_make(v, [var, val,]* 0, val) Pvecteur v; // may be NULL, use assigne anyway Variable var; Value val;.

Builds a vector from the list of arguments, by successive additions. ends when a 0 Variable (that is TCST!) is encountered.

Because of the var val order, this function cannot be called directly with a va_list, but (va_list, 0) should be used, since the val argument is expected, read and used anyway.

CAUTION: the initial vector is modified by the process!

Parameters
varar
valal

Definition at line 165 of file alloc.c.

166 {
167  va_list the_args;
168 
169  // handle fist argument
170  vect_add_elem(&v, var, val);
171 
172  // get others
173  va_start(the_args, val);
174 
175  while (var != (Variable) 0)
176  {
177  var = va_arg(the_args, Variable);
178  val = va_arg(the_args, Value);
179  vect_add_elem(&v, var, val);
180  }
181 
182  va_end (the_args);
183  return v;
184 }

References vect_add_elem().

Referenced by add_type_information(), align_check(), buffer_acces(), call_rwt(), compute_entity_to_declaration_constraints(), compute_x_and_y_bounds(), convex_in_effect_loop_range_fix(), fortran_data_to_prec_for_variables(), fortran_user_function_call_to_transformer(), fusion(), fusion_buffer(), generate_system_for_equal_variables(), generate_work_sharing_system(), Hierarchical_tiling(), hpfc_compute_align_constraints(), hpfc_compute_distribute_constraints(), hpfc_compute_entity_to_new_declaration(), hpfc_compute_unicity_constraints(), interlaced_basic_workchunk_regions_p(), loop_basic_workchunk_to_workchunk(), make_loop_indice_equation(), processor_loop(), sc_image_computation(), sc_minmax_of_variables(), small_positive_slope_reduce_coefficients_with_bounding_box(), Tiling2_buffer(), Tiling_buffer_allocation(), transformer_derivative_constraints(), transformer_derivative_fix_point(), and transformer_list_generic_transitive_closure().

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

◆ vect_make_1D()

Pvecteur vect_make_1D ( Value  a,
Variable  x,
Value  b 
)

Generate a sparse vector a x + b TCST.

Definition at line 226 of file alloc.c.

227 {
228  Pvecteur v = vect_new(x, a);
229  vect_add_elem(&v, TCST, b);
230  return v;
231 }

References TCST, vect_add_elem(), vect_new(), and x.

Referenced by contrainte_make_1D().

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

◆ vect_make_dense()

Pvecteur vect_make_dense ( Pbase  b,
Value  val,
  ... 
)

Allocate a new vector v whose coefficient are given by the list of values ad whose dimension is given by b.

The number of constant values passed as argument is supposed to be equal to the dimension of b.

Note: 0 is a normal value. I see no way to mark the last argument.

FI: I add this function to check under gdb that a given point belongs to a constraint system. The manual verification is tedious and error prone. This is done for debugging in Linear/C3 Library the linked_regions bug.

handle first argument - the first element of a basis has rank 1

get others

Parameters
valal

Definition at line 198 of file alloc.c.

199 {
200  va_list the_args;
201  Pvecteur v = VECTEUR_NUL;
202  Variable var;
203  int dim = (int) base_dimension(b);
204  int i = 0; // current dimension
205 
206  /* handle first argument - the first element of a basis has rank 1 */
207  var = variable_of_rank(b,1);
208  vect_add_elem(&v, var, val);
209 
210  /* get others */
211  va_start (the_args, val);
212 
213  for(i=2;i<=dim;i++) // i <= dim because of the way dimensions are counted
214  {
215  var = variable_of_rank(b,i);
216  val = va_arg(the_args, Value);
217  vect_add_elem(&v, var, val);
218  }
219 
220  va_end (the_args);
221 
222  return v;
223 }
void const char const char const int
Variable variable_of_rank()

References base_dimension, int, variable_of_rank(), vect_add_elem(), and VECTEUR_NUL.

Referenced by build_sc_nredund_2pass_ofl_ctrl().

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

◆ vect_max()

Value vect_max ( Pvecteur  v)

Value vect_max(Pvecteur v): recherche du coefficient non nul maximum d'un vecteur v; aborte sur le vecteur 0 puisqu'il faudrait renvoyer plus l'infini.

max v[i] i v[i]!=0

Note: changement de semantique puisque 0 etait renvoye auparavant pour le vecteur 0

Modifications:

Definition at line 240 of file reductions.c.

242 {
243  if(v!=NULL) {
244  Value max = val_of(v);
245  for (v=v->succ; v!= NULL; v= v->succ)
246  max = value_max(val_of(v), max);
247  return max;
248  }
249  else {
250  vect_error("vect_max","ill. null vector as argument\n");
251  return VALUE_NAN;
252  }
253 }
#define value_max(v1, v2)
#define VALUE_NAN
#define max(a, b)

References max, val_of, value_max, VALUE_NAN, and vect_error().

+ Here is the call graph for this function:

◆ vect_max0()

Value vect_max0 ( Pvecteur  v)

Value vect_max0(Pvecteur v): recherche du coefficient maximum d'un vecteur v; ce coefficient est toujours au moins egal a 0 car on ne dispose pas d'une base pour verifier que TOUS les coefficients sont negatifs.

max(0,max v[i]) i

Note: on evite le probleme du vecteur de dimension 0 dont le max vaut moins l'infini

Definition at line 164 of file reductions.c.

166 {
167  Value max = VALUE_ZERO;
168 
169  for(; v!= NULL; v= v->succ)
170  max = value_max(val_of(v),max);
171 
172  return max;
173 }

References max, val_of, value_max, and VALUE_ZERO.

◆ vect_min()

Value vect_min ( Pvecteur  v)

Value vect_min(Pvecteur v): recherche du coefficient non nul minimum d'un vecteur v; aborte sur le vecteur 0 puisqu'il faudrait renvoyer plus l'infini.

min v[i] i v[i]!=0

Note: changement de semantique puisque 0 etait renvoye auparavant pour le vecteur 0

just to avoid a gcc warning

Definition at line 208 of file reductions.c.

210 {
211  if(v!=NULL) {
212  Value min = val_of(v);
213  for (v=v->succ; v!= NULL; v= v->succ)
214  min = value_min(val_of(v),min);
215 
216  return min;
217  }
218  else {
219  vect_error("vect_min","ill. null vector as argument\n");
220  return VALUE_NAN; /* just to avoid a gcc warning */
221  }
222 }
#define value_min(v1, v2)
#define min(a, b)

References min, val_of, value_min, VALUE_NAN, and vect_error().

+ Here is the call graph for this function:

◆ vect_min0()

Value vect_min0 ( Pvecteur  v)

Value vect_min0(Pvecteur v): recherche du coefficient minimum d'un vecteur v; ce coefficient est toujours au moins egal a 0 car on ne dispose pas d'une base pour verifier que TOUS les coefficients sont negatifs.

min(0,min v[i]) i

Note: on evite le probleme du vecteur de dimension 0 dont le min vaut moins l'infini

Definition at line 186 of file reductions.c.

188 {
189  Value min = VALUE_ZERO;
190 
191  for(; v!= NULL; v= v->succ)
192  min = value_min(val_of(v),min);
193 
194  return min;
195 }

References min, val_of, value_min, and VALUE_ZERO.

◆ vect_multiply()

Pvecteur vect_multiply ( Pvecteur  v,
Value  x 
)

Pvecteur vect_multiply(Pvecteur v, Value x): multiplication du vecteur v par le scalaire x, si x est different de 0.

-> -> v := x v;

Ancien nom: vect_mult() Ancien profil: void vect_mult(); ne permettait pas de renvoyer un vecteur nul en cas de multiplication par zero d'un vecteur non nul

Definition at line 123 of file scalaires.c.

126 {
127  Pvecteur coord;
128 
129  if (value_zero_p(x))
130  {
131  vect_rm(v);
132  return VECTEUR_NUL;
133  }
134  else if (value_one_p(x))
135  return v;
136  else if (value_mone_p(x))
137  vect_chg_sgn(v);
138  else
139  for(coord = v; coord!=NULL; coord=coord->succ)
140  value_product(val_of(coord), x);
141 
142  return v;
143 }
#define value_product(v, w)
void vect_rm(Pvecteur v)
void vect_rm(Pvecteur v): desallocation des couples de v;
Definition: alloc.c:78

References Svecteur::succ, val_of, value_mone_p, value_one_p, value_product, value_zero_p, vect_chg_sgn(), vect_rm(), VECTEUR_NUL, and x.

Referenced by analyze_expression(), array_indices_communication(), bounds_equal_p(), build_convex_constraints_from_vertices(), build_list_of_min(), build_sc_machine(), build_third_comb(), constraints_eliminate_constant_terms(), contrainte_parallele(), eq_in_ineq(), expression_equal_in_context_p(), find_intermediate_constraints(), find_intermediate_constraints_recursively(), full_linearization(), generic_minmax_to_transformer(), include_trans_in_sc(), include_trans_on_LC_in_ref(), integer_divide_to_transformer(), integer_minmax_to_transformer(), integer_power_to_transformer(), integer_right_shift_to_transformer(), loop_bound_evaluation_to_transformer(), make_bound_expression(), make_context_of_loop(), my_vect_var_subst(), normalize_intrinsic(), NormalizeIntrinsic(), partial_linearization(), pivoter(), prepare_reindexing(), sc_lexicographic_sort(), sc_oppose(), sc_to_tableau(), simplify_dimension(), simplify_predicate(), small_positive_slope_reduce_coefficients_with_bounding_box(), system_new_var_subst(), transformer_add_condition_information_updown(), valuer(), vect_change_base(), vect_cl_ofl_ctrl(), vect_product(), and vect_var_subst().

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

◆ vect_new()

Pvecteur vect_new ( Variable  var,
Value  coeff 
)

Pvecteur vect_new(Variable var,Value coeff): allocation d'un vecteur colineaire au vecteur de base var et de coefficient coeff (i.e.

creation d'un nouveau vecteur ne comportant qu'un seul couple (var,coeff))

  -->

coeff var

Pourrait etre remplace par un vect_chain(NULL,,)

Modifications:

  • a 0 coeff generates a null vector; Francois Irigoin, 26 March 1991

fprintf(stderr, "%10.3f MB", (sbrk(0) - etext)/(double)(1 << 20)); // not portable

xit(-1);

Parameters
varar
coeffoeff

Definition at line 110 of file alloc.c.

111 {
112  Pvecteur v;
113 
114  if(coeff!=0) {
115  v = (Pvecteur) MALLOC(sizeof(Svecteur),VECTEUR,"vect_new");
116  if (v == NULL) {
117  (void) fprintf(stderr,"vect_new: Out of memory space\n");
118  /* fprintf(stderr, "%10.3f MB",
119  (sbrk(0) - etext)/(double)(1 << 20)); // not portable */
120  abort();
121  /*exit(-1);*/
122  }
123  var_of(v) = var;
124  val_of(v) = coeff;
125  v->succ = NULL;
126  }
127  else
128  v = NULL;
129 
130  return v;
131 }

References abort, fprintf(), MALLOC, Svecteur::succ, val_of, var_of, and VECTEUR.

Referenced by add_elem_to_list_of_Pvecteur(), add_equivalence_equality(), add_loop_index_exit_value(), add_type_information(), add_x_list(), adg_dataflowgraph(), adg_dataflowgraph_with_extremities(), adg_get_predicate_of_loops(), adg_max_of_leaves(), affine_to_transformer(), ajout_dte(), align_check(), apply_farkas(), array_indices_communication(), array_scalar_access_to_bank_communication(), base_add_variable(), base_complete(), binary_to_normalized(), bitwise_xor_to_transformer(), broadcast_of_dataflow(), build_esv_list(), build_image_base(), build_sc_machine(), build_third_comb(), c_convex_effects_on_actual_parameter_forward_translation(), calculate_delay(), comp_exec_domain(), completer_base(), config_vecteur(), converti_psysmin_psysmax(), cout_nul(), create_farkas_poly(), dependence_cone_positive(), dj_system_complement(), do_solve_hardware_constraints_on_nb_proc(), do_terapix_warmup_patching(), elim_var_with_eg(), entity_list_to_base(), expression_equal_in_context_p(), expression_flt(), expression_less_than_in_context(), expression_multiply_sizeof_to_transformer(), find_implicit_equation(), find_vbase(), fonct_max(), fonct_max_all(), fonct_max_d(), fonct_min(), fonct_min_all(), fonct_min_d(), fonct_read(), generate_one_message(), generate_work_sharing_system(), generic_abs_to_transformer(), generic_equality_to_transformer(), generic_minmax_to_transformer(), hpfc_compute_distribute_constraints(), hpfc_compute_entity_to_new_declaration(), iabs_to_transformer(), include_parameters_in_sc(), integer_left_shift_to_transformer(), integer_minmax_to_transformer(), integer_multiply_to_transformer(), integer_power_to_transformer(), local_tile_constraints(), logical_binary_function_to_transformer(), logical_binary_operation_to_transformer(), logical_constant_to_transformer(), logical_unary_operation_to_transformer(), loop_basic_workchunk_to_workchunk(), loop_bound_evaluation_to_transformer(), loop_bounds_to_tile_bounds(), loop_index_domaine_to_contrainte(), loop_regions_normalize(), lvbase_add(), make_datum_movement(), make_dual(), make_load_blocks(), make_monome(), make_movement_scalar_wp65(), make_movements_loop_body_wp65(), make_store_blocks(), mat_sys_conv(), matrices_to_constraints(), matrices_to_constraints_with_sym_cst(), matrices_to_contraintes_with_sym_cst(), matrices_to_loop_sc(), matrices_to_sc(), matrix_to_system(), mk_rn(), monome_del_var(), monome_monome_div(), monome_monome_mult(), movement_computation(), my_matrices_to_constraints_with_sym_cst(), my_matrices_to_constraints_with_sym_cst_2(), my_substitute_var_with_vec(), normalize_constant(), normalize_reference(), NormalizeCall(), NormalizeConstant(), NormalizeReference(), old_prototype_factorize(), one_message_guards_and_neighbour(), one_receive_message(), pa_path_to_few_disjunct_ofl_ctrl(), plc_elim_var_with_eg(), plc_make_vvs_with_vector(), plint_degen(), polynome_constant_p(), polynome_roots(), polynome_TCST(), prepare_reindexing(), prototype_factorize(), pu_matrices_to_contraintes(), put_source_ind(), re_do_it(), reference_conversion_computation(), relation_to_transformer(), remove_variables_if_possible(), sc_base_add_variable(), sc_empty(), sc_find_equalities(), sc_image_computation(), sc_multiply_constant_terms(), sc_to_vvs(), simple_addition_to_transformer(), simple_affine_to_transformer(), simplify_float_constraint(), sort_tile_indices(), substitute_var_with_vec(), top_down_abc_dimension(), transformer_add_3d_affine_constraint(), transformer_add_condition_information_updown(), transformer_add_equality(), transformer_add_equality_with_affine_term(), transformer_add_equality_with_integer_constant(), transformer_add_identity(), transformer_add_inequality(), transformer_add_inequality_with_affine_term(), transformer_add_inequality_with_integer_constraint(), transformer_add_sign_information(), transformer_convex_hulls(), transformer_logical_inequalities_add(), translate_global_value(), valuer(), var_pivotd(), var_pivots(), var_posit(), variables_in_declaration_list(), vect_chain(), vect_make_1D(), vect_make_line(), vect_read(), vecteur_mult(), vecteur_of_zvec(), xml_Chain_Graph(), xml_LocalVariables(), and xml_Pattern_Paving().

+ Here is the call graph for this function:

◆ vect_normalize()

void vect_normalize ( Pvecteur  v)

unaires.c

unaires.c

-> -> -> -> si v == 0 alors v := 0; sinon pgcd = PGCD v[i]; i -> -> v := v / pgcd

Le pgcd est toujours positif.

Ancien nom: vect_norm()

Definition at line 59 of file unaires.c.

60 {
61  Value gcd = vect_pgcd_all(v);
62  if (value_notzero_p(gcd) && value_notone_p(gcd))
63  (void) vect_div(v, gcd);
64 }
Value vect_pgcd_all(Pvecteur v)
Value vect_pgcd(Pvecteur v): calcul du pgcd de tous les coefficients non nul d'un vecteur v.
Definition: reductions.c:108
Pvecteur vect_div(Pvecteur v, Value x)
Pvecteur vect_div(Pvecteur v, Value x): division du vecteur v par le scalaire x, si x est different d...
Definition: scalaires.c:52

References value_notone_p, value_notzero_p, vect_div(), and vect_pgcd_all().

Referenced by bounds_equal_p(), build_third_comb(), compute_x_and_y_bounds(), include_trans_on_LC_in_ref(), make_rational_exp(), my_sc_normalize(), norm_eq(), ray_dte_normalize(), sc_add_normalize_eq(), sc_add_normalize_ineq(), sc_elim_double_constraints(), sc_elim_redund(), sc_elim_redund_with_first_ofl_ctrl(), sc_gcd_normalize(), sc_normalize(), simplify_relational_expression(), system_new_var_subst(), and vect_make_line().

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

◆ vect_one_coeff_if_any()

Variable vect_one_coeff_if_any ( Pvecteur  v)

Definition at line 182 of file unaires.c.

183 {
184  for (; v; v=v->succ)
185  if (v->var && (value_one_p(v->val) || value_mone_p(v->val)))
186  return v->var;
187  return NULL;
188 }

References Svecteur::succ, Svecteur::val, value_mone_p, value_one_p, and Svecteur::var.

◆ vect_oppos()

bool vect_oppos ( Pvecteur  v1,
Pvecteur  v2 
)

bool vect_oppos(Pvecteur v1, Pvecteur v2): test de l'opposition de deux vecteurs

   ->   ->    ->

return v1 + v2 == 0 ;

Parameters
v11
v22

Definition at line 360 of file reductions.c.

362 {
363  /*
364  * Note: le test n'est pas optimal puisque v2 est parcouru et compare
365  * a v1 meme si ces coefficients ont ete deja ete compare lors du
366  * parcours de v1; mais cela evite le "marquage" des coefficients vus;
367  */
368  bool result;
369  Pvecteur pv;
370 
371  if(v1==NULL && v2==NULL)
372  result = true;
373  else if(v1==NULL || v2 == NULL)
374  result = false;
375  else {
376  result = true;
377 
378  for (pv = v1; pv != NULL && result == true; pv = pv->succ)
379  result = value_eq(val_of(pv),
380  value_uminus(vect_coeff(var_of(pv), v2)));
381 
382  for (pv = v2; pv != NULL && result == true; pv = pv->succ)
383  result = value_eq(val_of(pv),
384  value_uminus(vect_coeff(var_of(pv), v1)));
385 
386  }
387 
388  return result;
389 }

References Svecteur::succ, val_of, value_eq, value_uminus, var_of, and vect_coeff().

Referenced by contrainte_oppos(), egalite_equal(), egalite_in_liste(), and free_guards().

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

◆ vect_opposite_except()

bool vect_opposite_except ( Pvecteur  v1,
Pvecteur  v2,
Variable  var 
)

bool vect_opposite_except(Pvecteur v1, Pvecteur v2, Variable var): test a egalite des projections selon la coordonnees var de deux vecteurs -> Soit e un vecteur de base quelconque: -> -> -> -> return <v1 .

e> == - <v2 . e>; e!=var

Parameters
v11
v22
varar

Definition at line 399 of file reductions.c.

402 {
403  Pvecteur pv;
404  /*
405  * Note: le test n'est pas optimal puisque v2 est parcouru et compare
406  * a v1 meme si ces coefficients ont ete deja ete compare lors du
407  * parcours de v1; mais cela evite le "marquage" des coefficients vus;
408  */
409  bool result;
410 
411  if(v1==NULL && v2==NULL)
412  result = true;
413  else if(v1==NULL)
414  result = v2->succ==NULL && var_of(v2)==var;
415  else if(v2 == NULL)
416  result = v1->succ==NULL && var_of(v1)==var;
417  else {
418  result = true;
419 
420  for (pv = v1; pv != NULL && result == true; pv = pv->succ)
421  if (var_of(pv) != var)
422  result = value_eq(val_of(pv),
423  value_uminus(vect_coeff(var_of(pv), v2)));
424 
425  for (pv = v2; pv != NULL && result == true; pv = pv->succ)
426  if (var_of(pv) != var)
427  result = value_eq(val_of(pv),
428  value_uminus(vect_coeff(var_of(pv), v1)));
429 
430  }
431 
432  return result;
433 }

References Svecteur::succ, val_of, value_eq, value_uminus, var_of, and vect_coeff().

Referenced by find_motif(), and inequalities_opposite_p().

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

◆ vect_pgcd_all()

Value vect_pgcd_all ( Pvecteur  v)

Value vect_pgcd(Pvecteur v): calcul du pgcd de tous les coefficients non nul d'un vecteur v.

return PGCD v[i] i v[i]!=0

Renvoie 1 pour le vecteur nul (ca devrait etre +infinity)

Definition at line 108 of file reductions.c.

110 {
111  Value d = (v!=NULL ? value_abs(val_of(v)) : VALUE_ONE);
112 
113  if (v!=NULL) {
114  for (v=v->succ; v!=NULL && value_notone_p(d); v=v->succ)
115  d = pgcd(d, value_abs(val_of(v)));
116  }
117  return d;
118 }
#define pgcd(a, b)
Pour la recherche de performance, selection d'une implementation particuliere des fonctions.
#define value_abs(val)

References pgcd, val_of, value_abs, value_notone_p, and VALUE_ONE.

Referenced by analyze_expression(), calculate_delay(), gomory_trait_eq(), make_array_bounds(), make_rational_exp(), sc_find_equalities(), sommet_normalize(), and vect_normalize().

+ Here is the caller graph for this function:

◆ vect_pgcd_except()

Value vect_pgcd_except ( Pvecteur  v,
Variable  var 
)

Value vect_pgcd_except(Pvecteur v, Variable var): calcul du pgcd de tous les coefficients non nul d'un vecteur v, sauf le coefficient correspondant a la variable var.

return PGCD v[i] i!=var v[i]!=0

Renvoie 1 pour le vecteur nul (ca devrait etre +infinity)

skip var's coeff if it comes first

Parameters
varar

Definition at line 130 of file reductions.c.

133 {
134  Value d;
135 
136  /* skip var's coeff if it comes first */
137  if ((v!= NULL) && (var_of(v) == var))
138  v = v->succ;
139 
140 
141  if(v==NULL)
142  d = VALUE_ONE;
143  else {
144  d = value_abs(val_of(v));
145  for (v=v->succ; v!=NULL && value_notone_p(d); v=v->succ)
146  if (var_of(v) != var)
147  d = pgcd(d,value_abs(val_of(v)));
148  }
149 
150  return d;
151 }

References pgcd, Svecteur::succ, val_of, value_abs, value_notone_p, VALUE_ONE, and var_of.

Referenced by contrainte_normalize(), and my_contrainte_normalize().

+ Here is the caller graph for this function:

◆ vect_print()

void vect_print ( Pvecteur  v,
get_variable_name_t  variable_name 
)

void vect_print(Pvecteur v, char * (*variable_name)()): impression d'un vecteur creux v sur stdout; le nom de chaque coordonnee est donne par la fonction variable_name(); voir vect_fprint()

Parameters
variable_nameariable_name

Definition at line 312 of file io.c.

313 {
314  vect_fprint(stdout, v, variable_name);
315 }

References variable_name(), and vect_fprint().

+ Here is the call graph for this function:

◆ vect_prod_scal()

Value vect_prod_scal ( Pvecteur  v1,
Pvecteur  v2 
)

Value vect_prod_scal(v1,v2): produit scalaire de v1 et de v2.

sum v1[i] * v2[i] i

Parameters
v11
v22

Definition at line 82 of file reductions.c.

84 {
85  Value result = VALUE_ZERO;
86 
87  if(v2==NULL) return result;
88 
89  for(; v1!=NULL; v1 = v1->succ)
90  {
91  Value tmp = vect_coeff(var_of(v1),v2);
92  value_product(tmp, val_of(v1));
93  value_addto(result, tmp);
94  }
95 
96  return result;
97 }

References val_of, value_addto, value_product, VALUE_ZERO, var_of, and vect_coeff().

+ Here is the call graph for this function:

◆ vect_proport()

int vect_proport ( Pvecteur  v1,
Pvecteur  v2 
)

int vect_proport(Pvecteur v1, Pvecteur v2): test de la colinearite de deux vecteurs et de leur direction.

return 1 si les deux vecteurs sont colineaires et dans la meme direction c2 v1 == c1 v1, c1*c2 > 0 c'est le cas si v1 ou v2 vaut le vecteur nul -1 si les deux vecteurs sont colineaires et dans des directions opposees c2 v1 == c1 v1, c1*c2 < 0 0 s'ils ne sont pas colineaires

          ->    ->    ->

Note: aborte pour v1 == v2 == 0 parce qu'il est impossible de decider entre le retour de 1 et de -1

Modifications:

  • introduction des variables temporaires t1 et t2 pour ne pas effectuer le test de proprotionalite uniquement sur la fin des vecteurs v1 et v2; Francois Irigoin, 26 mars 1991
Parameters
v11
v22

Definition at line 455 of file reductions.c.

456 {
457  int prop = 1;
458 
459  if (v1==NULL && v2==NULL)
460  vect_error("vect_proport","ill. NULL v1 and v2 args\n");
461 
462  if (v1!=NULL && v2!=NULL) {
463  Value c1, c2;
464  Pvecteur t1;
465  Pvecteur t2;
466 
467  c1 = val_of(v1);
468  c2 = vect_coeff(var_of(v1),v2);
469  prop = 1;
470 
471  for (t1 = v1->succ; (t1!=NULL) && (prop); t1=t1->succ)
472  {
473  Value tmp1 = vect_coeff(var_of(t1),v2), tmp2;
474 
475  value_product(tmp1,c1);
476  tmp2 = value_mult(c2,val_of(t1));
477  prop = value_eq(tmp1,tmp2);
478  }
479 
480  for (t2 = v2; (t2!=NULL) && (prop != 0);t2=t2->succ)
481  {
482  Value tmp1 = vect_coeff(var_of(t2),v1), tmp2;
483 
484  value_product(tmp1,c2);
485  tmp2 = value_mult(c1,val_of(t2));
486  prop = value_eq(tmp1,tmp2);
487  }
488 
489  if(prop!=0) {
490  if (value_pos_p(value_mult(c1,c2)))
491  prop = 1;
492  else
493  prop = -1;
494  }
495  }
496 
497  return prop;
498 }
#define value_pos_p(val)

References Svecteur::succ, val_of, value_eq, value_mult, value_pos_p, value_product, var_of, vect_coeff(), and vect_error().

+ Here is the call graph for this function:

◆ vect_read()

Pvecteur vect_read ( Pbase b)

io.c

io.c

Pvecteur vect_read(Pbase * b): lecture interactive d'un vecteur sur stdin; la base b est modifiee de maniere a ce que chaque composante y figure bien;

La representation d'un vecteur dont la troisieme composante vaut 2, la dixieme 6 et les autres 0 peut etre: 3 2 1 10 6 0 ou x3 2 1 x10 6 0 Le 1 veut dire qu'il faut continuer les lectures, le zero, qu'il faut arreter

Ce format est malheureusement incompatible avec celui de vect_fprint()

Definition at line 65 of file io.c.

66 {
67  Pvecteur v1, v = VECTEUR_NUL;
68  // Let's assume that no variable name will be longer than 9 characters
69  char buffer[10];
70  int c; // flag de continuation
71 
72  c = 1;
73  while (c == 1) {
74  Variable var;
75  Value val;
76  // vect_chain() n'est pas utilise pour conserver l'ordre des couples
77  (void) printf ("valeur de variable :");
78  int n = scanf("%9s",buffer);
79  assert(n==1);
80  (void) printf ("valeur du coefficient de la variable :");
81  (void) scan_Value(&val);
83  var = variable_make(buffer);
84  *b = vect_add_variable(*b,var);
85  }
86  else {
87  var = base_find_variable(*b, (Variable) buffer);
88  }
89  v1 = vect_new(var, val);
90  v1->succ = v;
91  v = v1;
92  (void) printf ("'1' -->rentrer d'autres valeurs,(0-2..9)"
93  "sinon. votre choix:");
94  n = scanf("%d", &c);
95  assert(n==1);
96  }
97  return v;
98 }
Variable base_find_variable(Pbase b, Variable v)
Variable base_find_variable(Pbase b, Variable v): returns variable v if variable v is one of b's elem...
Definition: base.c:155
int scan_Value(Value *pv)
Definition: io.c:63
Variable variable_make(char *name)
Variable variable_make(char * name): defines a new variable of a given name.
Definition: variable.c:129
int printf()

References assert, base_contains_variable_p(), base_find_variable(), buffer, printf(), scan_Value(), Svecteur::succ, variable_make(), vect_add_variable(), vect_new(), and VECTEUR_NUL.

+ Here is the call graph for this function:

◆ vect_rename()

Pvecteur vect_rename ( Pvecteur  ,
Pbase  ,
char *  *)(Variable 
)

◆ vect_rename_variables()

Pvecteur vect_rename_variables ( Pvecteur  v,
bool(*)(Variable renamed_p,
Variable(*)(Variable new_variable 
)

Pvecteur vect_rename_variables(v, renamed_p, new_variable) Pvecteur v; bool (*renamed_p)(Variable); Variable (*new_variable)(Variable);.

what: driven renaming of variables in v. how: scans the vector, decides and replaces. input: Pvecteur v, decision and replacement functions. output: v is returned (the same) side effects:

  • the vector is modified in place. bugs or features:
  • was written by FC...

initial vector is kept

ar!=TCST &&

Definition at line 281 of file base.c.

285 {
286  Pvecteur i=v; /* initial vector is kept */
287  Variable var;
288 
289  for(; v!=NULL; v=v->succ)
290  {
291  var = var_of(v);
292  // FI: more flexible if TCST is not tested here, but the lack
293  // of lamdba expression may require a new function for
294  // renamed_p()
295  if (/*var!=TCST &&*/ renamed_p(var)) var_of(v)=new_variable(var);
296  }
297 
298  return(i);
299 }
static entity new_variable
entity to be replaced, the primary?
Definition: dynamic.c:860

References new_variable, Svecteur::succ, and var_of.

Referenced by sc_rename_variables(), and vect_variables_to_values().

+ Here is the caller graph for this function:

◆ vect_reversal()

Pvecteur vect_reversal ( Pvecteur  vect_in)

Pvecteur vect_reversal(Pvecteur vect_in); produces the reversal vector of the vect_in.

vect_in is not killed.
12/09/91, YY

Parameters
vect_inect_in

Definition at line 237 of file private.c.

239 {
240  Pvecteur pv;
241  Pvecteur vect_out = VECTEUR_NUL;
242 
243  for(pv=vect_in; !VECTEUR_NUL_P(pv); pv=pv->succ)
244  vect_add_elem(&vect_out, vecteur_var(pv), vecteur_val(pv));
245  return (vect_out);
246 }

References Svecteur::succ, vect_add_elem(), VECTEUR_NUL, VECTEUR_NUL_P, vecteur_val, and vecteur_var.

Referenced by adg_list_to_vect(), contrainte_reversal(), vect_add_first(), vect_gen_read(), and xml_LoopOffset().

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

◆ vect_rm()

void vect_rm ( Pvecteur  v)

void vect_rm(Pvecteur v): desallocation des couples de v;

Attention! La procedure appelante doit penser a modifier la valeur de v apres l'appel pour ne pas pointer dans le vide: vect_rm(v); v = NULL;

Il vaudrait mieux que vect_rm retourne NULL et qu'on puisse ecrire: v = vect_rm(v); ou que vect_rm prenne un Pvecteur * en argument: vect_rm(&v);

Definition at line 78 of file alloc.c.

80 {
81  Pvecteur elem = NULL;
82  Pvecteur nelem = NULL;
83 
84  for(elem = v; elem!=NULL; elem = nelem) {
85  nelem = elem->succ;
86  free((char *)elem);
87  }
88  /*
89  while (v != NULL) {
90  Pvecteur nv = v->succ;
91  free((char *) v);
92  v = nv;
93  }
94  */
95 }

References free(), and Svecteur::succ.

Referenced by add_affine_bound_conditions(), add_reference_information(), add_type_information(), affine_expression_of_loop_index_p(), affine_to_transformer(), append_eg(), bounds_equal_p(), build_and_test_dependence_context(), build_convex_constraints_from_vertices(), build_image_base(), c_convex_effects_on_actual_parameter_forward_translation(), cell_reference_sc_exact_projection_along_variable(), check_positive_dependence(), constraints_keep_invariants_only(), constraints_to_loop_bound(), contrainte_free(), contrainte_parallele(), contrainte_reversal(), contrainte_subst_ofl_ctrl(), cout_nul(), dependence_system_add_lci_and_di(), dj_system_complement(), do_group_statement_constant(), do_solve_hardware_constraints_on_volume(), do_terapix_warmup_patching(), dual(), dual_positive(), elim_var_with_eg(), eq_in_ineq(), eq_set_vect_nul(), erase_trivial_ineg(), expression_equal_in_context_p(), expression_flt(), expression_less_than_in_context(), find_eg(), find_motif(), find_pattern(), find_vbase(), free_vector_list(), FreeNormalized(), gcd_and_constant_dependence_test(), hpfc_integer_constant_expression_p(), invariant_vector_p(), is_inferior_monome(), lvbase_ote_no_ligne(), make_bound_expression(), make_vecteur_expression(), monome_monome_mult(), monome_rm(), my_substitute_var_with_vec(), my_system_remove_variables(), outliner_smart_references_computation(), pa_path_to_few_disjunct_ofl_ctrl(), Pcontrainte_to_expression_list(), plc_elim_var_with_eg(), plint(), plint_degen(), plreal(), polynome_constant_p(), polynome_TCST(), polynome_used_var(), primal(), primal_positive(), print_call_precondition(), print_loopnest_dependence_cone(), Pvecteur_to_assign_statement(), ray_dte_rm(), region_exact_projection_along_parameters(), region_exact_projection_along_variable(), remove_variables_if_possible(), sc_bounded_normalization(), sc_concatenate(), sc_elim_db_constraints(), sc_elim_double_constraints(), sc_elim_redund_with_first_ofl_ctrl(), sc_find_equalities(), sc_free1(), sc_kill_db_eg(), sc_lexicographic_sort(), sc_minmax_of_variable(), sc_minmax_of_variable_optim(), sc_proj_optim_on_di_ofl(), sc_projection_ofl_along_list_of_variables(), sc_projection_optim_along_vecteur_ofl(), sc_rm(), sc_safe_elim_db_constraints(), sc_safe_kill_db_eg(), sc_simplex_feasibility_ofl_ctrl_fixprec(), sc_substitute_dimension(), sc_supress_parallel_redund_constraints(), sc_supress_same_constraints(), sc_transform_ineg_in_eg(), shift_expression_of_loop_index_p(), simple_affine_to_transformer(), simplify_constraint_with_bounding_box(), simplify_float_constraint(), simplify_float_constraint_system(), sl_fprint_tab(), sommet_rm(), sommets_rm(), substitute_and_create(), substitute_var_with_vec(), top_down_abc_dimension(), transformer_add_integer_relation_information(), transformer_projection_with_redundancy_elimination_and_check(), translate_to_module_frame(), try_reorder_expression_call(), uniform_dependence_p(), valuer(), var_pivotd(), var_pivots(), vect_gen_free(), vect_multiply(), vect_product(), vect_subst(), xml_Chain_Graph(), xml_Compute_and_Need(), xml_GlobalVariables(), and xml_LocalVariables().

+ Here is the call graph for this function:

◆ vect_sign()

Pvecteur vect_sign ( Pvecteur  v)

Pvecteur vect_sign(Pvecteur v): application de l'operation signe au vecteur v.

-> -> v := signe(v ); -> return v ;

Definition at line 269 of file unaires.c.

271 {
272  Pvecteur coord;
273 
274  for(coord = v; coord!=NULL; coord=coord->succ)
275  val_of(coord) = int_to_value(value_sign(val_of(coord)));
276 
277  return v;
278 }
#define value_sign(v)
trian operators on values
#define int_to_value(i)
end LINEAR_VALUE_IS_INT

References int_to_value, Svecteur::succ, val_of, and value_sign.

◆ vect_size()

int vect_size ( Pvecteur  v)

reductions.c

reductions.c

INTLIBRARY int vect_size(Pvecteur v): calcul du nombre de composantes non nulles d'un vecteur

sum abs(sgn(v[i])) i

Definition at line 47 of file reductions.c.

49 {
50  int nb_elem = 0;
51 
52  for (; v != NULL; v=v->succ)
53  nb_elem++;
54 
55  return (nb_elem);
56 }

Referenced by actual_convex_union(), add_elem_to_list_of_Pvecteur(), affine_expression_of_loop_index_p(), algorithm_row_echelon_generic(), alignment_p(), args_to_transformer(), bound_generation(), build_sc_with_several_uniform_ref(), check_tiling_legality(), choose_pattern(), chose_variable_to_project_for_feasability(), constant_constraint_check(), constraint_distribution(), constraints_sort_info(), constraints_sort_with_compare(), constraints_with_sym_cst_to_matrices(), contrainte_normalize(), contrainte_parallele(), contrainte_simple_equality(), dependence_cone_positive(), do_group_statement_constant(), eligible_for_coefficient_reduction_with_bounding_box_p(), EvalNormalized(), expression_and_precondition_to_integer_interval(), expression_integer_constant_p(), find_motif(), find_pattern(), gcd_and_constant_dependence_test(), hpfc_integer_constant_expression_p(), HpfcExpressionToInt(), look_for_the_best_counter(), loop_nest_to_tile(), loop_nest_to_wp65_code(), main(), make_constraint_expression(), make_loop_indice_equation(), make_reindex(), matrices_to_loop_sc(), movement_computation(), my_constraints_with_sym_cst_to_matrices(), normalized_constant_p(), parallel_tiling(), pip_solve(), pip_solve_min_with_big(), polynome_roots(), print_call_precondition(), region_range_nul_p(), sc_append(), sc_bounded_normalization(), sc_build_triang_elim_redund(), sc_creer_base(), sc_cute_convex_hull(), sc_dup1(), sc_elim_db_constraints(), sc_elim_double_constraints(), sc_elim_redund_with_first_ofl_ctrl(), sc_empty_p(), sc_gen_read(), sc_image_computation(), sc_kill_db_eg(), sc_normalize2(), sc_projection_concat_proj_on_variables(), sc_restricted_to_variables_transitive_closure(), sc_safe_append(), sc_safe_elim_db_constraints(), sc_safe_kill_db_eg(), sc_to_tableau(), sc_triang_elim_redund(), set_dimensions_of_local_variables(), shift_expression_of_loop_index_p(), simple_indices_p(), simplify_constraint_with_bounding_box(), simplify_float_constraint(), single_var_vecteur_p(), sl_fprint_tab(), small_slope_and_first_quadrant_p(), sort_unknowns(), the_index_of_vect(), transformer_add_value_update(), transformer_add_variable_incrementation(), transformer_add_variable_update(), transformer_derivative_fix_point(), transformer_filter(), transformer_list_generic_transitive_closure(), transformer_normalize(), transformer_projection_with_redundancy_elimination_and_check(), try_reorder_expression_call(), uniform_dependence_p(), vect_const_p(), vect_lexicographic_unsafe_compare_generic(), vect_simple_definition_p(), vect_sort_in_place(), and xml_LoopOffset().

◆ vect_sort()

Pvecteur vect_sort ( Pvecteur  ,
int(*)(Pvecteur *, Pvecteur *)   
)

◆ vect_sort_in_place()

void vect_sort_in_place ( Pvecteur ,
int(*)(Pvecteur *, Pvecteur *)   
)

◆ vect_sprint_as_monome()

char* vect_sprint_as_monome ( Pvecteur  v,
Pbase  b,
get_variable_name_t  variable_name,
char *  mult_symbol 
)

char *vect_sprint_as_monome(Pvecteur v, Pbase b, char * (*variable_name)(), char *mult_symbol): Retourne dans une chaine le Pvecteur considere comme un monome sans coefficient.

(voir ci-dessus)

si la base est vide: affiche comme ca vient

si la base n'est pas vide, affiche selon l'ordre qu'elle definit

exp < 0

inutile pour les polynomes

(un peu tard:-)

Parameters
variable_nameariable_name
mult_symbolult_symbol

Definition at line 217 of file io.c.

220  {
221  Pvecteur p;
222  char t[99];
223  char *r = t;
224  char *s = NULL;
225 
226  if (VECTEUR_NUL_P(v))
227  strcpy (&t[0], "0");
228  else if (VECTEUR_NUL_P(b)) {
229  /* si la base est vide: affiche comme ca vient */
230  for (p = v; p != NULL; p = p->succ) {
231  if (value_one_p(p->val)) {
232  (void) sprintf(r, "%s", variable_name(p->var));
233  r = strchr(r, '\0');
234  }
235  else {
236  (void) sprintf(r, "%s^", variable_name(p->var));
237  r = strchr(r, '\0');
238  sprint_Value(r, p->val);
239  r = strchr(r, '\0');
240  }
241  if (p->succ != NULL) {
242  (void) sprintf(r, "%s", mult_symbol);
243  r = strchr(r, '\0');
244  }
245  }
246  }
247  else {
248  /* si la base n'est pas vide, affiche selon l'ordre
249  * qu'elle definit */
250  bool first_var = true;
251  Value exp;
252  for ( ; !VECTEUR_NUL_P(b); b = b->succ) {
253  exp = vect_coeff(b->var, v);
254  if(exp!=0) {
255 
256  if (!first_var) {
257  (void) sprintf(r, "%s", mult_symbol);
258  r = strchr(r, '\0');
259  }
260  else
261  first_var = false;
262 
263  if (value_pos_p(exp)) {
264  if (value_one_p(exp)) {
265  (void) sprintf(r, "%s", variable_name(b->var));
266  r = strchr(r, '\0');
267  }
268  else {
269  (void) sprintf(r,"%s^", variable_name(b->var));
270  r = strchr(r, '\0');
271  sprint_Value(r, exp);
272  r = strchr(r, '\0');
273  }
274  }
275  else /* exp < 0 */ {
276  /* inutile pour les polynomes */
277  first_var = false;
278 
279  (void) sprintf(r, "%s^(", variable_name(b->var));
280  r = strchr(r, '\0');
281  sprint_Value(r, exp);
282  r = strchr(r, '\0');
283  (void) sprintf(r, ")");
284  r = strchr(r, '\0');
285  }
286  }
287  }
288  }
289  s = (char*) strdup(t);
290  assert(strlen(s)<99); /* (un peu tard:-) */
291  return s;
292 }
void sprint_Value(char *s, Value v)
Definition: io.c:53
#define exp
Avoid some warnings from "gcc -Wshadow".
Definition: vasnprintf.c:207

References assert, exp, sprint_Value(), strdup(), Svecteur::succ, Svecteur::val, value_one_p, value_pos_p, Svecteur::var, variable_name(), vect_coeff(), and VECTEUR_NUL_P.

Referenced by monome_sprint(), and vect_fprint_as_monome().

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

◆ vect_subst()

Pvecteur vect_subst ( Variable  v,
Pvecteur  v1,
Pvecteur  v2 
)

Pvecteur vect_subst(Variable v, Pvecteur v1, Pvecteur v2): calcul d'un vecteur v3 tel que l'intersection des hyperplans definis par v1 et v2 soit egale a l'intersection des hyperplans definis par v1 et v3, et que v appartiennent a l'hyperplan defini par v3.

v3 est defini a une constante multiplicative pret et ses coefficients ne sont donc pas necessairement normalises, mais on s'arrange pour multiplier v2 par une constante positive ce qui est utile si v2 represente une inegalite (cf. package contrainte).

-> -> -> -> -> -> -> -> -> -> -> { U / V1 . u = 0 & v2 . u = 0 } = { u / v1 . u = 0 & v3 . u = 0 }

-> -> v3 . v = 0

Si v2 remplit la condition v2 . v = 0, on prend v3 = v2.

Il faut comme precondition a l'appel que v1 . v != 0

Le vecteur v1 est preserve. Le vecteur v2 est detruit. v3 est alloue.

Cette routine peut servir a eliminer une variable entre deux egalites ou inegalites. C'est pourquoi v2 est detruit. Il est destine a etre remplace par v3. Voir contrainte_subst().

ATTENTION: je ne comprends pas a quoi sert le vect_chg_coeff(). F.I. Les commentaires precedent sont donc partiellement (?) faux!!!

cv_v1 = coeff de v dans v1

cv_v2 = coeff de v dans v2

v2 est solution; i.e., substitution non faite: var absente

Parameters
v11
v22

Definition at line 286 of file binaires.c.

290 {
291  Pvecteur v3;
292  /* cv_v1 = coeff de v dans v1 */
293  Value cv_v1 = vect_coeff(v,v1);
294  /* cv_v2 = coeff de v dans v2 */
295  Value cv_v2 = vect_coeff(v,v2);
296 
297  if (cv_v2==VALUE_ZERO) {
298  /* v2 est solution; i.e., substitution non faite: var absente */
299  v3 = v2;
300  }
301  else {
302  if (cv_v1<VALUE_ZERO) {
303  v3 = vect_cl2(value_uminus(cv_v1),v2,cv_v2,v1);
304  vect_chg_coeff(&v3,v,value_uminus(cv_v2));
305  }
306  else {
307  v3 = vect_cl2(cv_v1,v2,value_uminus(cv_v2),v1);
308  vect_chg_coeff(&v3,v,cv_v2);
309  }
310  vect_rm(v2);
311  }
312  return(v3);
313 }
Pvecteur vect_cl2(Value x1, Pvecteur v1, Value x2, Pvecteur v2)
Definition: binaires.c:247
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 value_uminus, VALUE_ZERO, vect_chg_coeff(), vect_cl2(), vect_coeff(), and vect_rm().

+ Here is the call graph for this function:

◆ vect_substitute_dimension()

Pvecteur vect_substitute_dimension ( Pvecteur  v,
Variable  i,
Pvecteur  s 
)

Pvecteur vect_substitute_dimension(Pvecteur v, Variable i, Pvecteur s)

Vector v is updated to be equal to M v, where M is the identity matrix except for its ith column that is replaced by s. In other words, the resulting v is v + v_i s - v_i e_i = v + v_i (s - e_i), where e_i is the ith base vector.

Because the transformation is applied to a constraint system, it is better to update s once, and not a this low-level. So this compute v + v_i s.

Vector s is preserved.

Definition at line 99 of file binaires.c.

100 {
101  Value v_i = vect_coeff(i, v);
102  //vect_add_elem(s, i, VALUE_MONE);
103  v = vect_cl(v, v_i, s);
104  return v;
105 }
Pvecteur vect_cl(Pvecteur v, Value lambda, Pvecteur u)
Definition: binaires.c:181

References vect_cl(), and vect_coeff().

Referenced by contrainte_substitute_dimension().

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

◆ vect_substract()

Pvecteur vect_substract ( Pvecteur  v1,
Pvecteur  v2 
)

Pvecteur vect_substract(Pvecteur v1, Pvecteur v2): allocation d'un vecteur v dont la valeur est la difference des deux vecteurs v1 et v2.

     ->

allocate v; -> -> -> v := v1 - v2; -> return v;

Parameters
v11
v22

Definition at line 75 of file binaires.c.

77 {
78  Pvecteur v = vect_dup (v1);
79 
80  for (; v2 != NULL; v2 = v2->succ)
82 
83  return (v);
84 }

References Svecteur::succ, val_of, value_uminus, var_of, vect_add_elem(), and vect_dup().

Referenced by add_declaration_list_information(), add_loop_index_exit_value(), add_loop_skip_condition(), add_reference_information(), adg_dataflowgraph(), adg_dataflowgraph_with_extremities(), adg_get_predicate_of_loops(), adg_max_of_leaves(), affine_to_transformer(), analyze_expression(), build_contraction_matrices(), build_sc_with_several_uniform_ref(), c_convex_effects_on_actual_parameter_forward_translation(), calculate_delay(), check_range_wrt_precondition(), comp_exec_domain(), count_eq_occ(), expression_equal_in_context_p(), expression_flt(), expression_less_than_in_context(), free_guards(), gcd_and_constant_dependence_test(), include_trans_on_LC_in_ref(), loop_executed_approximation(), make_array_bounds(), make_lin_op_exp(), monome_monome_div(), my_matrices_to_constraints_with_sym_cst(), normalize_intrinsic(), NormalizeIntrinsic(), pip_solve(), pip_solve_min_with_big(), sc_elim_double_constraints(), simple_affine_to_transformer(), simplify_dimension(), simplify_predicate(), simplify_relational_expression(), subarray_shift_assignment_p(), top_down_abc_dimension(), transformer_add_integer_relation_information(), trivial_expression_p(), try_reorder_expression_call(), and uniform_dependence_p().

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

◆ vect_sum()

Value vect_sum ( Pvecteur  v)

Value vect_sum(Pvecteur v): somme des coefficients d'un vecteur (i.e.

produit scalaire avec le vecteur 1)

sum v[i] i

Definition at line 261 of file reductions.c.

262 {
263  Value sum = VALUE_ZERO;
264 
265  for (; v!=NULL; v=v->succ)
266  value_addto(sum, val_of(v));
267 
268  return sum;
269 }
t_real sum(int n1, int n2, int n3, t_real u[n1][n2][n3])
Definition: stencil.c:57

References Svecteur::succ, sum(), val_of, value_addto, and VALUE_ZERO.

Referenced by do_computation_intensity(), polynome_max_degree(), and polynomial_to_numerical().

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

◆ vect_translate()

Pvecteur vect_translate ( Pvecteur  ,
Pbase  ,
char *  *)(Variable 
)

◆ vect_variable_rename()

Pvecteur vect_variable_rename ( Pvecteur  v,
Variable  v_old,
Variable  v_new 
)

Pvecteur vect_variable_rename(Pvecteur v, Variable v_old, Variable v_new): rename the potential coordinate v_old in v as v_new.

Parameters
v_old_old
v_new_new

Definition at line 366 of file base.c.

370 {
371  Pvecteur coord;
372 
373  for(coord = v; !VECTEUR_NUL_P(coord); coord = coord->succ) {
374  Variable var = vecteur_var(coord);
375 
376  if(var==v_old)
377  vecteur_var(coord) = v_new;
378  }
379  return v;
380 }

References Svecteur::succ, VECTEUR_NUL_P, and vecteur_var.

Referenced by affine_to_transformer(), contrainte_variable_rename(), sc_variable_rename(), upwards_vect_rename(), and variables_to_new_values().

+ Here is the caller graph for this function:

Variable Documentation

◆ variable_debug_name

char*(* variable_debug_name) (Variable) ( Variable  )
extern