PIPS
vecteur-local.h File Reference
#include "arithmetique.h"
+ Include dependency graph for vecteur-local.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 */
 package sur les vecteurs creux et les bases 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
 

Macro Definition Documentation

◆ base_add_dimension

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

Definition at line 140 of file vecteur-local.h.

◆ base_dimension

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

Definition at line 139 of file vecteur-local.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 at line 142 of file vecteur-local.h.

◆ BASE_NULLE

#define BASE_NULLE   VECTEUR_NUL

MACROS SUR LES BASES.

Definition at line 135 of file vecteur-local.h.

◆ BASE_NULLE_P

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

Definition at line 136 of file vecteur-local.h.

◆ base_rm

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

Definition at line 141 of file vecteur-local.h.

◆ BASE_UNDEFINED

#define BASE_UNDEFINED   ((Pbase) 0)

Definition at line 137 of file vecteur-local.h.

◆ BASE_UNDEFINED_P

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

Definition at line 138 of file vecteur-local.h.

◆ FWD_OFL_CTRL

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

Definition at line 184 of file vecteur-local.h.

◆ NO_OFL_CTRL

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

Definition at line 185 of file vecteur-local.h.

◆ NONEXPLIN

#define NONEXPLIN   ((PlinX)-1)

Definition at line 120 of file vecteur-local.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 183 of file vecteur-local.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 119 of file vecteur-local.h.

◆ print_vect

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

MACROS SUR LES VECTEURS.

Definition at line 123 of file vecteur-local.h.

◆ TCST

#define TCST   ((Variable) 0)

VARIABLE REPRESENTANT LE TERME CONSTANT.

Definition at line 131 of file vecteur-local.h.

◆ term_cst

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

Definition at line 132 of file vecteur-local.h.

◆ val_of

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

Definition at line 125 of file vecteur-local.h.

◆ var_of

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

Definition at line 124 of file vecteur-local.h.

◆ VARIABLE_DEFINED_P

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

Definition at line 66 of file vecteur-local.h.

◆ VARIABLE_UNDEFINED

#define VARIABLE_UNDEFINED   ((Variable) 0)

Definition at line 64 of file vecteur-local.h.

◆ VARIABLE_UNDEFINED_P

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

Definition at line 65 of file vecteur-local.h.

◆ VECTEUR

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

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 51 of file vecteur-local.h.

◆ VECTEUR_NUL

#define VECTEUR_NUL   ((Pvecteur) 0)

DEFINITION DU VECTEUR NUL.

Definition at line 110 of file vecteur-local.h.

◆ VECTEUR_NUL_P

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

Definition at line 111 of file vecteur-local.h.

◆ vecteur_succ

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

Definition at line 128 of file vecteur-local.h.

◆ VECTEUR_UNDEFINED

#define VECTEUR_UNDEFINED   ((Pvecteur) 0)

Definition at line 112 of file vecteur-local.h.

◆ VECTEUR_UNDEFINED_P

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

Definition at line 113 of file vecteur-local.h.

◆ vecteur_val

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

Definition at line 127 of file vecteur-local.h.

◆ vecteur_var

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

Definition at line 126 of file vecteur-local.h.

Typedef Documentation

◆ get_variable_name_t

typedef char*(* get_variable_name_t) (Variable)

Definition at line 62 of file vecteur-local.h.

◆ linear_hashtable_pt

Definition at line 190 of file vecteur-local.h.

◆ Pbase

typedef struct Svecteur * Pbase

Definition at line 107 of file vecteur-local.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 62 of file vecteur-local.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 60 of file vecteur-local.h.