PIPS
sg-local.h
Go to the documentation of this file.
1 /*
2 
3  $Id: sg-local.h 1641 2016-03-02 08:20:19Z coelho $
4 
5  Copyright 1989-2016 MINES ParisTech
6 
7  This file is part of Linear/C3 Library.
8 
9  Linear/C3 Library is free software: you can redistribute it and/or modify it
10  under the terms of the GNU Lesser General Public License as published by
11  the Free Software Foundation, either version 3 of the License, or
12  any later version.
13 
14  Linear/C3 Library is distributed in the hope that it will be useful, but WITHOUT ANY
15  WARRANTY; without even the implied warranty of MERCHANTABILITY or
16  FITNESS FOR A PARTICULAR PURPOSE.
17 
18  See the GNU Lesser General Public License for more details.
19 
20  You should have received a copy of the GNU Lesser General Public License
21  along with Linear/C3 Library. If not, see <http://www.gnu.org/licenses/>.
22 
23 */
24 
25 /* package sur les systemes generateur sg
26  *
27  * Francois Irigoin, Mai 1989
28  *
29  * packages a inclure: boolean.h, arithmetique.h, variable.h, vecteur.h,
30  * ray_dte.h et sommet.h
31  *
32  * package utilisateur: polyedre.h
33  */
34 
35 #ifndef TSG
36 #define TSG 101
37 #define TSGSOMS 103
38 #define TSGVECTS 104
39 
40 /* Representation d'un ensemble de sommets */
41 typedef struct ttsg_soms {
42  int nb_s;
43  struct typ_som *ssg;
45 
46 /* Representation d'un ensemble de droites */
47 typedef struct ttsg_vects {
48  int nb_v;
51 
52 /* Representation d'un systeme generateur par trois ensembles de sommets
53  * de rayons et de droites
54  *
55  * L'ensemble vide est represente par un systeme generateur n'ayant
56  * aucun element dans ces trois ensembles (soms_sg.nb_s==0 &&
57  * rays_sg.nb_v == 0 && dtes_sg.nb_v == 0)
58  *
59  * L'espace tout entier Rn est represente par n droites et un sommet.
60  * Par convention ce sommet est l'origine.
61  *
62  * La dimension de l'espace contenant le polyedre genere n'est pas
63  * accessible directement. Il faut parcourir tous les elements
64  * generateurs et chercher leurs coordonnees non nulles.
65  */
66 typedef struct type_sg {
71  } *Ptsg,Stsg;
72 
73 #define SG_UNDEFINED ((Ptsg) NULL)
74 #define SG_UNDEFINED_P(sg) ((sg)==(SG_UNDEFINED))
75 
76 /* vieilles definitions des fonctions d'impression
77  * void sg_fprint();
78  * #define print_sg(sg) sg_fprint(stdout,sg)
79  */
80 
81 /* macros d'acces aux champs */
82 
83 /* acces au premier sommet de la liste des sommets d'un systeme generateur
84  defini par un pointeur: sg_sommets(Ptsg) */
85 #define sg_sommets(sg) ((sg)->soms_sg.ssg)
86 
87 /* acces au premier rayon de la liste des rayons d'un systeme generateur
88  defini par un pointeur: sg_rayons(Ptsg) */
89 #define sg_rayons(sg) ((sg)->rays_sg.vsg)
90 
91 /* acces a la premiere droite de la liste des droites d'un systeme generateur
92  defini par un pointeur: sg_droites(Ptsg) */
93 #define sg_droites(sg) ((sg)->dtes_sg.vsg)
94 
95 /* nombre de sommets: int sg_nbre_sommets(Ptsg) */
96 #define sg_nbre_sommets(sg) ((sg)->soms_sg.nb_s)
97 
98 /* nombre de rayons: int sg_nbre_rayons(Ptsg) */
99 #define sg_nbre_rayons(sg) ((sg)->rays_sg.nb_v)
100 
101 /* nombre de droites: int sg_nbre_droites(Ptsg) */
102 #define sg_nbre_droites(sg) ((sg)->dtes_sg.nb_v)
103 
104 /* Basis used for the generating system */
105 #define sg_base(sg) ((sg)->base)
106 
107 /* Test for an empty generating system, which corresponds to an empty set */
108 #define sg_empty(sg) \
109  ((sg)->soms_sg.nb_s==0 &&(sg)-> rays_sg.nb_v == 0 && (sg)->dtes_sg.nb_v == 0)
110 
111 /* Obsolete macros of Malik Imadache
112  * #define soms_of_sg(sg) (((sg).soms_sg).ssg)
113  * #define rays_of_sg(sg) (((sg).rays_sg).vsg)
114  * #define dtes_of_sg(sg) (((sg).dtes_sg).vsg)
115  */
116 
117 #endif /* TSG */
118 
119 
120 
struct ttsg_vects Stsg_vects
struct type_sg * Ptsg
Representation d'un systeme generateur par trois ensembles de sommets de rayons et de droites.
struct ttsg_soms * Ptsg_soms
Representation d'un ensemble de sommets.
struct ttsg_soms Stsg_soms
struct ttsg_vects * Ptsg_vects
Representation d'un ensemble de droites.
struct type_sg Stsg
le type des coefficients dans les vecteurs: Value est defini dans le package arithmetique
Definition: vecteur-local.h:89
Representation d'un ensemble de sommets.
Definition: sg-local.h:41
struct typ_som * ssg
Definition: sg-local.h:43
int nb_s
Definition: sg-local.h:42
Representation d'un ensemble de droites.
Definition: sg-local.h:47
Pray_dte vsg
Definition: sg-local.h:49
int nb_v
Definition: sg-local.h:48
structure de donnees Sommet
Definition: sommet-local.h:64
Representation d'un systeme generateur par trois ensembles de sommets de rayons et de droites.
Definition: sg-local.h:66
Stsg_vects rays_sg
Definition: sg-local.h:68
Stsg_soms soms_sg
Definition: sg-local.h:67
Pbase base
Definition: sg-local.h:70
Stsg_vects dtes_sg
Definition: sg-local.h:69