PIPS
base.c
Go to the documentation of this file.
1 /*
2 
3  $Id: base.c 1669 2019-06-26 17:24:57Z 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 vecteur - routines sur les bases
26  *
27  * Francois Irigoin
28  *
29  * The function variable_name should be inlined as much as possible to
30  * improve performances. It has to be used to be generic over the
31  * "Variable" type. For instance, variables represented by a character
32  * string cannot be decided equal by a simple pointer comparison.
33  *
34  * Modifications:
35  */
36 
37 /*LINTLIBRARY*/
38 #ifdef HAVE_CONFIG_H
39  #include "config.h"
40 #endif
41 
42 #include <stdio.h>
43 #include <string.h>
44 #include <stdlib.h>
45 
46 #include "linear_assert.h"
47 
48 #include "boolean.h"
49 #include "arithmetique.h"
50 #include "vecteur.h"
51 
52 /* Pbase vect_add_variable(Pbase b, Variable v): add variable v as a new
53  * dimension to basis b; if variable v is already in basis b, do nothing;
54  * this is not clean but convenient to avoid a test;
55  *
56  * Note that basis b contains a pointer towards variable v and not a copy
57  * of it. So some sharing is introduced.
58  *
59  * A routine to check variable equality, variable_equal(), is used.
60  */
62 Pbase b;
63 Variable v;
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 }
77 
78 /* Pbase base_add_variable(Pbase b, Variable v): add variable v as a new
79  * dimension to basis b at the end of the base list; if variable v is
80  * already in basis b, do nothing;
81  * this is not clean but convenient to avoid a test;
82  *
83  * Note that basis b contains a pointer towards variable v and not a copy
84  * of it. So some sharing is introduced.
85  *
86  * A routine to check variable equality, variable_equal(), is used.
87  */
89 Pbase b;
90 Variable var;
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 }
108 
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 }
117 
118 
119 /* Pbase base_remove_variable(b, v): remove basis vector relative to v
120  * from b; abort if v is not in b;
121  */
123 Pbase b;
124 Variable v;
125 {
127  vect_erase_var(&b, v);
128  return b;
129 }
130 
131 /* bool base_contains_variable_p(Pbase b, Variable v): returns true if
132  * variable v is one of b's elements;
133  *
134  * Based on variable_equal()
135  */
137 Pbase b;
138 Variable v;
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 }
148 
149 /* Variable base_find_variable(Pbase b, Variable v): returns variable v if
150  * variable v is one of b's elements (returns a pointer to the copy of v
151  * that's pointed to by basis b); else returns VARIABLE_UNDEFINED
152  *
153  * Based on variable_equal()
154  */
156 Pbase b;
157 Variable v;
158 {
159  for(; !VECTEUR_NUL_P(b) && !variable_equal(vecteur_var(b), v); b = b->succ)
160  ;
161 
163 }
164 
165 /* Variable base_find_variable_name(Pbase b, Variable v,
166  * char * (*variable_name)()):
167  * returns the variable (i.e. coord) in b that has the same name as v;
168  * else returns VARIABLE_UNDEFINED
169  */
171 Pbase b;
172 Variable v;
173 char * (*variable_name)(Variable);
174 {
175  char * nv;
176  char * nb;
177  bool equal;
178 
179  for(; !VECTEUR_NUL_P(b); b = b->succ) {
180  nv = variable_name(v);
181  nb = variable_name(vecteur_var(b));
182  equal = !strcmp(nv, nb);
183  if(equal)
184  break;
185  }
186 
188 }
189 
190 /* int base_find_variable_rank(Pbase b, Variable v,
191  * char * (*variable_name)()):
192  * returns variable v's rank if it is in basis b, else -1
193  */
195 Pbase b;
196 Variable v;
197 char * (*variable_name)(Variable);
198 {
199  char * nv;
200  char * nb;
201  bool equal;
202  int rank;
203 
204  for(rank=1; !VECTEUR_NUL_P(b); b = b->succ, rank++) {
205  nv = variable_name(v);
206  nb = variable_name(vecteur_var(b));
207  equal = !strcmp(nv, nb);
208  if(equal)
209  break;
210  }
211 
212  return VECTEUR_NUL_P(b)? -1 : rank;
213 }
214 
215 /* Pbase base_reversal(Pbase b_in): produces a basis b_out, having the
216  * same basis vectors as b_in, but in reverse order. Basis b_in is not
217  * touched.
218  *
219  * Example: b_in = { e1, e2, e3 } -> b_out = { e3, e2, e1}
220  */
222 Pbase b_in;
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 }
231 
232 /* Pvecteur vect_rename(Pvecteur v, Pbase b, char * (*variable_name)()):
233  * modify vector v so that its coordinates are relative to basis b;
234  * each basis vector is defined by a pointer of type Variable, but
235  * different pointers can point to the same basis vector wrt variable_name;
236  * these pointers are unified with respect to b and variable_name to let us
237  * perform eq-type comparison in the library
238  *
239  * This function is identical to vect_translate, except that if a variable
240  * var of v does not appear in b, then the assert is not executed.
241  *
242  * Bugs:
243  * - TCST and VARIABLE_UNDEFINED are equal; a dirty test is performed
244  * to screen TCST terms; on top of that, the special variable TCST is not
245  * kept in bases!
246  */
248 Pvecteur v;
249 Pbase b;
250 char * (*variable_name)(Variable);
251 {
252  Pvecteur coord;
253 
254  for(coord = v; !VECTEUR_NUL_P(coord); coord = coord->succ) {
255  Variable var;
256 
257  if(VARIABLE_DEFINED_P(vecteur_var(coord))) {
258  var = base_find_variable_name(b, vecteur_var(coord),
259  variable_name);
260  if (!VARIABLE_UNDEFINED_P(var))
261  vecteur_var(coord) = var;
262  }
263  }
264  return v;
265 }
266 
267 /* Pvecteur vect_rename_variables(v, renamed_p, new_variable)
268  * Pvecteur v;
269  * bool (*renamed_p)(Variable);
270  * Variable (*new_variable)(Variable);
271  *
272  * what: driven renaming of variables in v.
273  * how: scans the vector, decides and replaces.
274  * input: Pvecteur v, decision and replacement functions.
275  * output: v is returned (the same)
276  * side effects:
277  * - the vector is modified in place.
278  * bugs or features:
279  * - was written by FC...
280  */
282  Pvecteur v,
283  bool (*renamed_p)(Variable),
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 }
300 
301 /* Pvecteur vect_translate(Pvecteur v, Pbase b, char * (*variable_name)()):
302  * modify vector v so that its coordinates are relative to basis b;
303  * each basis vector is defined by a pointer of type Variable, but
304  * different pointers can point to the same basis vector wrt variable_name;
305  * these pointers are unified with respect to b and variable_name to let us
306  * perform eq-type comparison in the library
307  *
308  * Bugs:
309  * - TCST and VARIABLE_UNDEFINED are equal; a dirty test is performed
310  * to screen TCST terms; on top of that, the special variable TCST is not
311  * kept in bases!
312  */
314 Pvecteur v;
315 Pbase b;
316 char * (*variable_name)(Variable);
317 {
318  Pvecteur coord;
319 
320  for(coord = v; !VECTEUR_NUL_P(coord); coord = coord->succ) {
321  Variable var;
322 
323  if(VARIABLE_DEFINED_P(vecteur_var(coord))) {
324  var = base_find_variable_name(b, vecteur_var(coord),
325  variable_name);
327  vecteur_var(coord) = var;
328  }
329  }
330  return v;
331 }
332 
333 /* Pvecteur vect_in_basis_p(Pvecteur v, Pbase b):
334  * check that all coordinates in v are in b, i.e. vector v is a membre
335  * of the space generated by b
336  *
337  * Bugs:
338  * - TCST and VARIABLE_UNDEFINED are equal; a dirty test is performed
339  * to screen TCST terms; on top of that, the special variable TCST is not
340  * kept in bases!
341  */
342 bool vect_in_basis_p(v, b)
343 Pvecteur v;
344 Pbase b;
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 }
362 
363 /* Pvecteur vect_variable_rename(Pvecteur v, Variable v_old, Variable v_new):
364  * rename the potential coordinate v_old in v as v_new
365  */
367 Pvecteur v;
368 Variable v_old;
369 Variable v_new;
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 }
381 
382 /* appends b2 to b1. modifies b1. b2 is not modified.
383  */
384 void base_append(Pbase * pb1, Pbase b2)
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 }
411 
412 /* Pbase base_union(Pbase b1, Pbase b2): compute a new basis containing
413  * all elements of b1 and all elements of b2, in an unkown order
414  *
415  * b := b1 u b2;
416  * return b;
417  *
418  * Bases b1 and b2 are not modified.
419  * Basis vectors are compared for equality using variable_equal()
420  *
421  * Modifications:
422  * - Pbase b = (Pbase)vect_add((Pvecteur) b1, (Pvecteur) b2);
423  * This is the definition of b at the beginning. This ignored
424  * one case that when addition of two values is zero, vect_add will call
425  * vect_add_elem, where there is vect_erase_var. We'll miss the variable
426  * Lei Zhou. 15/07/91
427  */
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 }
471 
472 /* Return variables/dimensions present in bases b1 and b2. Order is not preserved. */
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 }
492 
493 /* this function returns the rank of the variable var in the base
494  * 0 encodes TCST, but I do not know why, TCST may be in base, sometimes
495  * -1 encodes an error
496  */
498 Pbase base;
499 Variable var;
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 }
516 
517 /* Variable variable_of_rank():
518  * this function returns the variable of rank "rank"
519  */
521 Pbase base;
522 int rank;
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 }
536 
537 /* int search_higher_rank():
538  * this fonction returns the rank of the variable of higher rank in the
539  * vecteur
540  */
542 Pvecteur vect;
543 Pbase base;
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 }
555 
556 
557 /* this function returns the variable of higher rank, after the variable var,
558  * in the vecteur pvect
559  *
560  */
562 Pvecteur pvect;
563 Pbase base;
564 Variable var;
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 }
579 
580 /* Pvecteur search_i_element():
581  * recherche du i-ieme couple (var,val) dans la Pbase b
582  */
584 Pbase b;
585 int i;
586 {
587  Pbase b1;
588  int j;
589 
590  for (b1=b, j=1; j<i; b1=b1->succ,j++);
591  return(b1);
592 }
593 
595 Pbase b;
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 }
603 
605 Pbase b;
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 }
615 
616 /* Pbase base_difference(Pbase b1, Pbase b2):
617  * allocate b;
618  * b = b1 - b2 -- with the set meaning
619  * return b;
620  */
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 }
635 
636 /* Pbase base_included_p(Pbase b1, Pbase b2):
637  * include_p = b1 is included in b2 -- with the set meaning
638  * return b;
639  */
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 }
658 
659 /* Make sure that each dimension of b1 is the same dimension in b2 */
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 }
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
#define value_one_p(val)
#define VALUE_ONE
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
void base_append(Pbase *pb1, Pbase b2)
appends b2 to b1.
Definition: base.c:384
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;.
Definition: base.c:621
Pbase make_base_from_vect(Pvecteur pv)
Definition: base.c:109
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
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: base.c:122
Pvecteur vect_rename(Pvecteur v, Pbase b, char *(*variable_name)(Variable))
Pvecteur vect_rename(Pvecteur v, Pbase b, char * (*variable_name)()): modify vector v so that its coo...
Definition: base.c:247
bool bases_strictly_equal_p(Pbase b1, Pbase b2)
Make sure that each dimension of b1 is the same dimension in b2.
Definition: base.c:660
Variable base_find_variable_name(Pbase b, Variable v, char *(*variable_name)(Variable))
Variable base_find_variable_name(Pbase b, Variable v, char * (*variable_name)()): returns the variabl...
Definition: base.c:170
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
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
Variable variable_of_rank(Pbase base, int rank)
Variable variable_of_rank(): this function returns the variable of rank "rank".
Definition: base.c:520
Pbase base_normalize(Pbase b)
Definition: base.c:594
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 base_reversal(Pbase b_in)
Pbase base_reversal(Pbase b_in): produces a basis b_out, having the same basis vectors as b_in,...
Definition: base.c:221
int base_find_variable_rank(Pbase b, Variable v, char *(*variable_name)(Variable))
int base_find_variable_rank(Pbase b, Variable v, char * (*variable_name)()): returns variable v's ran...
Definition: base.c:194
Pvecteur vect_translate(Pvecteur v, Pbase b, char *(*variable_name)(Variable))
Pvecteur vect_translate(Pvecteur v, Pbase b, char * (*variable_name)()): modify vector v so that its ...
Definition: base.c:313
Pvecteur vect_rename_variables(Pvecteur v, bool(*renamed_p)(Variable), Variable(*new_variable)(Variable))
Pvecteur vect_rename_variables(v, renamed_p, new_variable) Pvecteur v; bool (*renamed_p)(Variable); V...
Definition: base.c:281
Pbase vect_add_variable(Pbase b, Variable v)
package vecteur - routines sur les bases
Definition: base.c:61
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 coord...
Definition: base.c:366
Pvecteur search_i_element(Pbase b, int i)
Pvecteur search_i_element(): recherche du i-ieme couple (var,val) dans la Pbase b.
Definition: base.c:583
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 re...
Definition: base.c:640
Pbase base_intersection(Pbase b1, Pbase b2)
Return variables/dimensions present in bases b1 and b2.
Definition: base.c:473
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 vecteu...
Definition: base.c:541
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 eleme...
Definition: base.c:428
bool base_normalized_p(Pbase b)
Definition: base.c:604
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
Definition: base.c:561
bdt base
Current expression.
Definition: bdt_read_paf.c:100
static entity new_variable
entity to be replaced, the primary?
Definition: dynamic.c:860
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
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
bool variable_equal(Variable v1, Variable v2)
package vecteur - routines sur les variables
Definition: variable.c:62
#define abort()
Definition: misc-local.h:53
static entity rank
#define assert(ex)
Definition: newgen_assert.h:41
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
Value b1
booleen indiquant quel membre est en cours d'analyse
Definition: sc_gram.c:105
char * variable_name(Variable v)
polynome_ri.c
Definition: polynome_ri.c:73
s1
Definition: set.c:247
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
struct Svecteur * succ
Definition: vecteur-local.h:92
hidden structure to store the hashtable.
Definition: hashpointer.c:66
#define VARIABLE_DEFINED_P(v)
Definition: vecteur-local.h:66
#define TCST
VARIABLE REPRESENTANT LE TERME CONSTANT.
#define vecteur_val(v)
#define vecteur_var(v)
#define VECTEUR_NUL
DEFINITION DU VECTEUR NUL.
struct Svecteur * Pbase
#define BASE_UNDEFINED_P(b)
#define vecteur_succ(v)
#define VECTEUR_NUL_P(v)
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 VARIABLE_UNDEFINED_P(v)
Definition: vecteur-local.h:65
#define BASE_UNDEFINED
#define var_of(varval)
#define VARIABLE_UNDEFINED
Definition: vecteur-local.h:64
#define base_dimension(b)
#define BASE_NULLE
MACROS SUR LES BASES.
#define BASE_NULLE_P(b)
#define base_add_dimension(b, 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
Pbase base_copy(Pbase b)
Direct duplication.
Definition: alloc.c:300
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
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