PIPS
|
#include "arithmetique.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 Svecteur * | Pvecteur |
typedef struct Svecteur | Sbase |
STRUCTURE D'UNE BASE. More... | |
typedef struct Svecteur * | Pbase |
typedef struct linear_hashtable_st * | linear_hashtable_pt |
#define base_add_dimension | ( | b, | |
v | |||
) | vect_chg_coeff((Pvecteur *)(b),(v),VALUE_ONE) |
Definition at line 140 of file vecteur-local.h.
Definition at line 139 of file vecteur-local.h.
#define BASE_FOREACH | ( | v, | |
b | |||
) |
Definition at line 142 of file vecteur-local.h.
#define BASE_NULLE VECTEUR_NUL |
MACROS SUR LES BASES.
Definition at line 135 of file vecteur-local.h.
#define BASE_NULLE_P | ( | b | ) | ((b)==VECTEUR_NUL) |
Definition at line 136 of file vecteur-local.h.
#define base_rm | ( | b | ) | (vect_rm((Pvecteur)(b)), (b)=BASE_NULLE) |
Definition at line 141 of file vecteur-local.h.
#define BASE_UNDEFINED ((Pbase) 0) |
Definition at line 137 of file vecteur-local.h.
#define BASE_UNDEFINED_P | ( | b | ) | ((b)==BASE_UNDEFINED) |
Definition at line 138 of file vecteur-local.h.
#define FWD_OFL_CTRL 1 /**overflows are treated by the calling procedure */ |
Definition at line 184 of file vecteur-local.h.
#define NO_OFL_CTRL 0 /**overflows are not trapped at all (dangerous !) */ |
Definition at line 185 of file vecteur-local.h.
#define NONEXPLIN ((PlinX)-1) |
Definition at line 120 of file vecteur-local.h.
#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.
#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.
#define print_vect | ( | s | ) | vect_fprint(stdout,(s)) |
MACROS SUR LES VECTEURS.
Definition at line 123 of file vecteur-local.h.
#define TCST ((Variable) 0) |
VARIABLE REPRESENTANT LE TERME CONSTANT.
Definition at line 131 of file vecteur-local.h.
#define term_cst | ( | varval | ) | ((varval)->var == TCST) |
Definition at line 132 of file vecteur-local.h.
#define val_of | ( | varval | ) | ((varval)->val) |
Definition at line 125 of file vecteur-local.h.
#define var_of | ( | varval | ) | ((varval)->var) |
Definition at line 124 of file vecteur-local.h.
#define VARIABLE_DEFINED_P | ( | v | ) | ((v)!=VARIABLE_UNDEFINED) |
Definition at line 66 of file vecteur-local.h.
#define VARIABLE_UNDEFINED ((Variable) 0) |
Definition at line 64 of file vecteur-local.h.
#define VARIABLE_UNDEFINED_P | ( | v | ) | ((v)==VARIABLE_UNDEFINED) |
Definition at line 65 of file vecteur-local.h.
#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:
trop creux a mon avis. il faudrait une liste de petits tableaux ? FC.
Definition at line 51 of file vecteur-local.h.
#define VECTEUR_NUL ((Pvecteur) 0) |
DEFINITION DU VECTEUR NUL.
Definition at line 110 of file vecteur-local.h.
#define VECTEUR_NUL_P | ( | v | ) | ((v)==VECTEUR_NUL) |
Definition at line 111 of file vecteur-local.h.
#define vecteur_succ | ( | v | ) | ((v)->succ) |
Definition at line 128 of file vecteur-local.h.
#define VECTEUR_UNDEFINED ((Pvecteur) 0) |
Definition at line 112 of file vecteur-local.h.
#define VECTEUR_UNDEFINED_P | ( | v | ) | ((v)==VECTEUR_UNDEFINED) |
Definition at line 113 of file vecteur-local.h.
#define vecteur_val | ( | v | ) | ((v)->val) |
Definition at line 127 of file vecteur-local.h.
#define vecteur_var | ( | v | ) | ((v)->var) |
Definition at line 126 of file vecteur-local.h.
typedef char*(* get_variable_name_t) (Variable) |
Definition at line 62 of file vecteur-local.h.
typedef struct linear_hashtable_st* linear_hashtable_pt |
Definition at line 190 of file vecteur-local.h.
Definition at line 107 of file vecteur-local.h.
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.
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.
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.