PIPS
sys_matrice_conv.c
Go to the documentation of this file.
1 /*
2 
3  $Id: sys_matrice_conv.c 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 sparse_sc: conversion de systemes representes par des matrices
26  * pleines en systemes representes par des contraintes
27  * creuses
28  *
29  * Corinne Ancourt
30  */
31 /*
32 Matrice's format: A[0]=denominator.stock column to column
33 */
34 #ifdef HAVE_CONFIG_H
35  #include "config.h"
36 #endif
37 
38 #include <stdio.h>
39 
40 #include "boolean.h"
41 #include "arithmetique.h"
42 #include "vecteur.h"
43 #include "contrainte.h"
44 #include "sc.h"
45 #include "matrix.h"
46 #include "matrice.h"
47 
48 
49 /* void sys_matrice_index(Psysteme sc, Pbase base_index,
50  * matrice A, int n, int m)
51  * create the matrix A [m,n] made with the coefficients of the index variables
52  */
53 void sys_matrice_index(sc, base_index, A, n, m)
54 Psysteme sc;
55 Pbase base_index;
56 matrice A;
57 int n;
58 int m;
59 
60 {
61  Pcontrainte pc;
62  Pvecteur pv;
63  int i, j;
64 
65  matrice_nulle(A, m, n);
66  for (pc = sc->inegalites, i=1; pc != NULL; pc = pc->succ, i++)
67  for(pv = base_index, j=1; pv != NULL; pv = pv->succ, j++)
68  ACCESS(A,m,i,j) = vect_coeff(pv->var, pc->vecteur);
69 }
70 
71 
72 ␌
73 
74 /* void matrice_index_sys(Psysteme sc, Pbase base_index,
75  * matrice AG, int n, int m)
76  * replace the coefficients of the index variables in sc
77  * by their new coefficients in the matrix AG[m,n].
78  * Modif: taken into account the order of system of constraints.
79  */
80 void matrice_index_sys(sc,base_index,AG,n,m)
81 Psysteme sc;
82 Pbase base_index;
83 matrice AG;
84 int n;
85 int m;
86 {
87  Pcontrainte pc;
88  Pbase pb;
89  Pvecteur pv;
90  int i,j;
91  Value deno;
92 
93  deno = DENOMINATOR(AG);
94  for (pc = sc->inegalites, i=1; i<=m; pc = pc->succ, i++)
95  for (pb = base_index, j=1; j<=n; pb = pb->succ, j++)
96 
97  /* vect_chg_coeff(&pc->vecteur, pb->var, ACCESS(AG,m,m-i+1,j));*/
98  /* Obsolete code:
99  * this old code was implemented assumming the order of system of constraints
100  * had changed because of _dup version. Thanks to _copy version, it's now straight.
101  * However, there'll be an incompatiblity if exist some calls of this function
102  * (which is already obsolete since it uses matrice instead of matrix) outside hyperplane.c.
103  * changed by DN.
104  */
105  vect_chg_coeff(&pc->vecteur, pb->var, ACCESS(AG,m,i,j));
106 
107  if (value_gt(deno,VALUE_ONE))
108  for (pc = sc->inegalites, i=1; i<=m; pc = pc->succ, i++)
109  for (pv = pc->vecteur; pv != NULL; pv = pv->succ)
110  if (base_find_variable(base_index,pv->var)==VARIABLE_UNDEFINED)
111  value_product(pv->val,deno);
112 }
113 
114 
115 
116 
117 
118 
119 
120 
121 /* Creation de la matrice A correspondant au systeme lineaire et de la matrice
122  * correspondant a la partie constante B
123  * Le systeme est suppose ne pas contenir de constantes symboliques.
124  *
125  * Les parametres de la fonction :
126  *
127  * Psysteme ps : systeme lineaire
128  *!int A[] : matrice
129  *!int B[] : matrice
130  * int n : nombre de lignes de la matrice
131  * int m : nombre de colonnes de la matrice
132  */
133 
134 void sc_to_matrices(ps,base_index,A,B,n,m)
135 Psysteme ps;
136 Pbase base_index;
137 matrice A, B;
138 int n,m;
139 {
140  int i,j;
141  Pcontrainte eq;
142  Pvecteur pv;
143  matrice_nulle(B,n,1);
144  matrice_nulle(A,n,m);
145 
146  for (eq = ps->inegalites,i=1;
148  eq=eq->succ,i++) {
149  for(pv = base_index, j=1; pv != NULL; pv = pv->succ, j++){
150  ACCESS(A,n,i,j) = vect_coeff(vecteur_var(pv),eq->vecteur);
151  }
152  ACCESS(B,n,i,1) = vect_coeff(0,eq->vecteur);
153  }
154 }
155 
156 
157 
158 /*
159  * Creation d'un systeme lineaire a partir de deux matrices. La matrice B
160  * correspond aux termes constants de chacune des inequations appartenant
161  * au systeme. La matrice A correspond a la partie lineaire des expressions
162  * des inequations le composant.
163  * Le systeme est suppose ne pas contenir de constantes symboliques.
164  *
165  * L'ensemble des variables du nouveau systeme est initialise avec une base
166  * d'indices que l'on donne en argument. Cette base peut etre vide (NULL).
167  *
168  * Des nouvelles variables sont creees si necessaire si il n'y a pas assez
169  * de variables dans la base fournie.
170  *
171  * La matrice A correspond a la partie non constante du systeme lineaire.
172  * La matrice B correspond a la partie constante.
173  * Le syteme lineaire s'ecrit A.x <= B.
174  *
175  * Les parametres de la fonction :
176  *
177  *!Psysteme ps : systeme lineaire
178  * int A[] : matrice de dimension (n,m)
179  * int B[] : matrice de dimension (n,1)
180  * int n : nombre de lignes de la matrice
181  * int m : nombre de colonnes de la matrice A
182  */
183 
184 
185 void matrices_to_sc(ps,base_index,A,B,n,m)
186 Psysteme ps;
187 Pbase base_index;
188 matrice A,B;
189 int n,m;
190 {
191  Pvecteur vect,pv=NULL;
192  Pcontrainte cp,pc= NULL;
193  Pbase b;
194  int i,j;
195  Value cst,coeff,dena,denb;
196  bool trouve ;
197 
198  /* create the variables */
199 
200  ps->base = base_reversal(vect_dup(base_index));
201 
202  for (b = ps->base;!VECTEUR_UNDEFINED_P(b);b=b->succ,ps->dimension ++) ;
203 
204  /* ajout des variables supplementaires utiles */
205 
206  if (VECTEUR_NUL_P(ps->base)) {
207  Variable var = creat_new_var(ps);
208  ps->base = vect_new(var,VALUE_ONE);
209  }
210 
211  for (b = ps->base,i =2; i<= m; i++,b=b->succ)
212  if (VECTEUR_NUL_P(b->succ)) {
213  Variable var = creat_new_var(ps);
214  b->succ = vect_new(var,VALUE_ONE);
215  }
216 
217 
218  dena = DENOMINATOR(A);
219  denb = DENOMINATOR(B);
220 
221  for (i=1;i<=n; i++)
222  { trouve = false;
223  cp = contrainte_new();
224 
225  /* build the constant terme if it exists */
226  cst = ACCESS(B,n,i,1);
227  if (value_notzero_p(cst)) {
228  pv = vect_new(TCST, value_mult(dena,cst));
229  trouve = true;
230  }
231 
232  for (vect = ps->base,j=1;j<=m;vect=vect->succ,j++) {
233  coeff = ACCESS(A,n,i,j);
234  if (value_notzero_p(coeff)) {
235  if (trouve)
236  vect_chg_coeff(&pv, vecteur_var(vect),
237  value_mult(denb,coeff));
238  else { /* build a new vecteur if there is not constant term */
239  pv = vect_new(vecteur_var(vect),
240  value_mult(denb,coeff));
241  trouve = true;
242  }
243  }
244  }
245  cp->vecteur = pv;
246  cp->succ = pc;
247  pc = cp;
248  }
249 
250  ps->inegalites = pc;
251  ps->nb_ineq = n;
252  ps->egalites = NULL;
253  ps->nb_eq = 0;
254 
255 
256 }
257 
258 
259 
260 
261 
262 /* Creation de la matrice A correspondant au systeme lineaire et de la matrice
263  * correspondant a la partie constante B
264  * Le systeme peut contenir des constantes symboliques. Dans ce cas, la base
265  * index_base ne doit contenir que les variables etant des indices de boucles
266  * et la base const_base les constantes symboliques. La matrice B
267  * represente toutes les contraintes sur les constantes.
268  *
269  * Les parametres de la fonction :
270  *
271  * Psysteme ps : systeme lineaire
272  *!int A[] : matrice
273  *!int B[] : matrice
274  * int n : nombre de lignes de la matrice
275  * int m : nombre de colonnes de la matrice
276  */
277 
278 void loop_sc_to_matrices(ps,index_base,const_base,A,B,n,m1,m2)
279 Psysteme ps;
280 Pbase index_base,const_base;
281 matrice A;
282 matrice B;
283 int n,m1,m2;
284 {
285 
286  int i,j;
287  Pcontrainte eq;
288  Pvecteur pv;
289 
290  matrice_nulle(B,n,m2);
291  matrice_nulle(A,n,m1);
292 
293  for (eq = ps->inegalites,i=1;
295  eq=eq->succ,i++) {
296  for(pv = index_base, j=1; pv != NULL; pv = pv->succ, j++){
297  ACCESS(A,n,i,j) = vect_coeff(vecteur_var(pv),eq->vecteur);
298  }
299  for(pv = const_base, j=1; pv != NULL; pv = pv->succ, j++){
300  ACCESS(B,n,i,j) = vect_coeff(vecteur_var(pv),eq->vecteur);
301  }
302  ACCESS(B,n,i,m2) = vect_coeff(TCST,eq->vecteur);
303  }
304 
305 }
306 
307 
308 /*
309  * Creation d'un systeme lineaire a partir de deux matrices. La matrice B
310  * correspond aux termes constants de chacune des inequations appartenant
311  * au systeme. La matrice A correspond a la partie lineaire des expressions
312  * des inequations le composant.
313  *
314  * Le systeme peut contenir des constantes symboliques. Dans ce cas, la
315  * matrice B represente toutes les contraintes sur les constantes.
316  * La base index_base ne contiendra que les variables etant des indices de
317  * boucles et la base const_base les constantes symboliques.
318  *
319  * L'ensemble des variables du nouveau systeme est initialise avec une base
320  * d'indices que l'on donne en argument. Cette base peut etre vide (NULL).
321  *
322  * Des nouvelles variables sont creees si necessaire si il n'y a pas assez
323  * de variables dans la base fournie.
324  *
325  * La matrice A correspond a la partie non constante du systeme lineaire.
326  * La matrice B correspond a la partie constante.
327  * Le syteme lineaire s'ecrit A.x <= B.
328  *
329  * Les parametres de la fonction :
330  *
331  *!Psysteme ps : systeme lineaire
332  * int A[] : matrice de dimension (n,m)
333  * int B[] : matrice de dimension (n,m2)
334  * int n : nombre de lignes de la matrice
335  * int m : nombre de colonnes de la matrice A
336  */
337 
338 void matrices_to_loop_sc(ps,index_base,const_base,A,B,n,m1,m2)
339 Psysteme ps;
340 Pbase index_base,const_base;
341 matrice A,B;
342 int n,m1,m2;
343 {
344  Pvecteur vect,pv=NULL;
345  Pcontrainte cp,pc= NULL;
346  Pbase b;
347  int i,j;
348  Value cst,coeff,dena,denb;
349  bool trouve ;
350 
351  /* create the variables */
352 
353  if (index_base != BASE_NULLE)
354  ps->base = base_reversal(vect_dup(index_base));
355  else ps->base = VECTEUR_UNDEFINED;
356 
357  ps->dimension = vect_size(ps->base);
358 
359  /* ajout des variables supplementaires utiles */
360 
361  if (VECTEUR_NUL_P(ps->base)) {
362  Variable var = creat_new_var(ps);
363  ps->base = vect_new(var,VALUE_ONE);
364  ps->dimension++;
365  }
366 
367  for (b = ps->base,i =2; i<= m1; i++,b=b->succ)
368  if (VECTEUR_NUL_P(b->succ)) {
369  Variable var = creat_new_var(ps);
370  b->succ = vect_new(var,VALUE_ONE);
371  ps->dimension++;
372  }
373 
374  ps->base = vect_add(vect_dup(const_base),vect_dup(ps->base));
375 
376  ps->dimension += vect_size(const_base);
377 
378  for (b = ps->base,i =2; i<= m1+m2-1; i++,b=b->succ)
379  if (VECTEUR_NUL_P(b->succ)) {
380  Variable var = creat_new_var(ps);
381  b->succ = vect_new(var,VALUE_ONE);
382  ps->dimension++;
383  }
384 
385  dena = DENOMINATOR(A);
386  denb = DENOMINATOR(B);
387 
388  for (i=1;i<=n; i++)
389  { trouve = false;
390  cp = contrainte_new();
391 
392  /* build the constant terme if it exists */
393  cst = ACCESS(B,n,i,m2);
394 
395  if (value_notzero_p(cst)) {
396  pv = vect_new(TCST, value_mult(dena,cst));
397  trouve = true;
398  }
399 
400 
401  for (vect = ps->base,j=1;j<=m1;vect=vect->succ,j++) {
402  coeff = ACCESS(A,n,i,j);
403  if (value_notzero_p(coeff)) {
404  if (trouve)
405  vect_chg_coeff(&pv, vecteur_var(vect),
406  value_mult(denb,coeff));
407  else {
408  /* build a new vecteur if there is not constant term */
409  pv = vect_new(vecteur_var(vect), value_mult(denb,coeff));
410  trouve = true;
411  }
412  }
413  }
414 
415  for (j=1;j<=m2-1;vect=vect->succ,j++) {
416  coeff = ACCESS(B,n,i,j);
417  if (value_notzero_p(coeff)) {
418  if (trouve)
419  vect_chg_coeff(&pv, vecteur_var(vect),
420  value_mult(denb,coeff));
421  else {
422  /* build a new vecteur if there is not constant term */
423  pv = vect_new(vecteur_var(vect), value_mult(denb,coeff));
424  trouve = true;
425  }
426  }
427  }
428  cp->vecteur = pv;
429  cp->succ = pc;
430  pc = cp;
431  }
432 
433  ps->inegalites = pc;
434  ps->nb_ineq = n;
435  ps->egalites = NULL;
436  ps->nb_eq = 0;
437 
438 
439 }
440 
441 
442 
443 
444 
445 
446 /* ======================================================================= */
447 /*
448  * void constraints_to_matrices(Pcontrainte pc, Pbase b,
449  * matrix A B):
450  * constructs the matrices "A" and "B" corresponding to the linear
451  * constraints "pc", so: A.b + B = 0 <=> pc(b) = 0.
452  *
453  * The base "b" gives the variables of the linear system.
454  *
455  * The matrices "A" and "B" are supposed to have been already allocated in
456  * memory, respectively of dimension (n, m) and (n, 1).
457  *
458  * "n" must be the exact number of constraints in "pc".
459  * "m" must be the exact number of variables in "b".
460  */
462 Pcontrainte pc;
463 Pbase b;
464 Pmatrix A, B;
465 {
466  int i,j;
467  Pvecteur pv;
468  Pcontrainte eq;
469  int n=0;
470 
471  for (eq = pc; !CONTRAINTE_UNDEFINED_P(eq); eq=eq->succ,n++);
472 
473  matrix_nulle(B);
474  matrix_nulle(A);
475 
476  for(eq = pc,i=1; !CONTRAINTE_UNDEFINED_P(eq); eq=eq->succ,i++) {
477  for(pv = b, j=1; pv != NULL; pv = pv->succ, j++){
479  }
480  MATRIX_ELEM(B,i,1) = vect_coeff(0,eq->vecteur);
481  }
482 }
483 
484 
485 /* ======================================================================= */
486 /*
487  * void matrices_to_constraints(Pcontrainte *pc, Pbase b,
488  * matrix A B):
489  * constructs the constraints "pc" corresponding to the matrices "A" and "B"
490  * so: pc(b) = 0 <=> A.b + B = 0
491  *
492  * The base "b" gives the variables of the linear system.
493  * The matrices "A" and "B" are respectively of dimension (n, m) and (n, 1).
494  *
495  * "n" will be the exact number of constraints in "pc".
496  * "m" must be the exact number of variables in "b".
497  *
498  * Note: the formal parameter pc is a "Pcontrainte *". Instead, the resulting
499  * Pcontrainte could have been returned as the result of this function.
500  */
502 Pcontrainte *pc;
503 Pbase b;
504 Pmatrix A, B;
505 {
506  Pcontrainte newpc = NULL;
507  int i, j;
508  Value cst, coeff, dena, denb;
509  int n = MATRIX_NB_LINES(A);
510  int m = MATRIX_NB_COLUMNS(A);
511 
512  dena = MATRIX_DENOMINATOR(A);
513  denb = MATRIX_DENOMINATOR(B);
514 
515  for (i=n;i>=1; i--) {
516  Pvecteur vect, pv;
517  Pcontrainte cp;
518  bool found = false;
519 
520  cp = contrainte_new();
521 
522  /* build the constant terme if it is not null */
523  cst = MATRIX_ELEM(B,i,1);
524  if (value_notzero_p(cst)) {
525  pv = vect_new(TCST, value_mult(dena,cst));
526  found = true;
527  }
528 
529  for (vect = b,j=1;j<=m;vect=vect->succ,j++) {
530  coeff = MATRIX_ELEM(A,i,j);
531  if (value_notzero_p(coeff)) {
532  if (found)
533  vect_chg_coeff(&pv, vecteur_var(vect),
534  value_mult(denb,coeff));
535  else {
536  /* build a new vecteur if there is a null constant term */
537  pv = vect_new(vecteur_var(vect),
538  value_mult(denb,coeff));
539  found = true;
540  }
541  }
542  }
543  /* the constraints are in reverse order */
544  cp->vecteur = pv;
545  cp->succ = newpc;
546  newpc = cp;
547  }
548  *pc = newpc;
549 }
550 
551 /* ======================================================================= */
552 /*
553  * void constraints_with_sym_cst_to_matrices(Pcontrainte pc,
554  * Pbase index_base const_base, matrice A B, int n m1 m2):
555  *
556  * constructs the matrices "A" and "B" corresponding to the linear
557  * constraints "pc", so: A.ib + B1.cb + B2 = 0 <=> pc(ib, cb) = 0:
558  *
559  * B = ( B1 | B2 ), B2 of dimension (n,1).
560  *
561  * The basis "ib" gives the variables of the linear system.
562  * The basis "cb" gives the symbolic constants of the linear system.
563  *
564  * The matrices "A" and "B" are supposed to have been already allocated in
565  * memory, respectively of dimension (n, m1) and (n, m2).
566  *
567  * "n" must be the exact number of constraints in "pc".
568  * "m1" must be the exact number of variables in "ib".
569  * "m2" must be equal to the number of symbolic constants (in "cb") PLUS
570  * ONE (the actual constant).
571  */
572 void constraints_with_sym_cst_to_matrices(pc,index_base,const_base,A,B)
573 Pcontrainte pc;
574 Pbase index_base,const_base;
575 Pmatrix A, B;
576 {
577  int i,j;
578  Pcontrainte eq;
579  Pvecteur pv;
580  int n = 0;
581  int m2 = vect_size(const_base);
582  for (eq = pc; !CONTRAINTE_UNDEFINED_P(eq); eq=eq->succ,n++);
583  matrix_nulle(B);
584  matrix_nulle(A);
585 
586  for (eq = pc,i=1; !CONTRAINTE_UNDEFINED_P(eq); eq=eq->succ,i++) {
587  for(pv = index_base, j=1; pv != NULL; pv = pv->succ, j++){
589  }
590  for(pv = const_base, j=1; pv != NULL; pv = pv->succ, j++){
592  }
594  }
595 }
596 
597 
598 /* ======================================================================= */
599 /*
600  * void matrices_to_constraints_with_sym_cst(Pcontrainte *pc,
601  * Pbase index_base const_base, matrice A B,int n m1 m2):
602  *
603  * constructs the constraints "pc" corresponding to the matrices "A" and "B"
604  * so: A.ib + B1.cb + B2 = 0 <=> pc(ib, cb) = 0, with:
605  *
606  * B = ( B1 | B2 ), B2 of dimension (n,1).
607  *
608  * The basis "ib" gives the variables of the linear system.
609  * The basis "cb" gives the symbolic constants of the linear system.
610  *
611  * The matrices "A" and "B" are respectively of dimension (n, m1) and (n, m2).
612  *
613  * "n" will be the exact number of constraints in "pc".
614  * "m1" must be the exact number of variables in "ib".
615  * "m2" must be equal to the number of symbolic constants (in "cb") PLUS
616  * ONE (the actual constant).
617  *
618  * Note: the formal parameter pc is a "Pcontrainte *". Instead, the resulting
619  * Pcontrainte could have been returned as the result of this function.
620  */
621 void matrices_to_constraints_with_sym_cst(pc,index_base,const_base,A,B)
622 Pcontrainte *pc;
623 Pbase index_base,const_base;
624 Pmatrix A, B;
625 {
626  Pvecteur vect,pv=NULL;
627  Pcontrainte cp,newpc= NULL;
628  int i,j;
629  Value cst,coeff,dena,denb;
630  bool found ;
631  int n = MATRIX_NB_LINES(A);
632  int m1 = MATRIX_NB_COLUMNS(A);
633  int m2 = MATRIX_NB_COLUMNS(B);
634  dena = MATRIX_DENOMINATOR(A);
635  denb = MATRIX_DENOMINATOR(B);
636 
637  for (i=n;i>=1; i--) {
638  found = false;
639  cp = contrainte_new();
640 
641  /* build the constant terme if it exists */
642  cst = MATRIX_ELEM(B,i,m2);
643  if (value_notzero_p(cst)) {
644  pv = vect_new(TCST, value_mult(dena,cst));
645  found = true;
646  }
647 
648  vect = base_union(index_base, const_base);
649  for (j=1;j<=m1;vect=vect->succ,j++) {
650  coeff = MATRIX_ELEM(A,i,j);
651  if (value_notzero_p(coeff)) {
652  if (found)
653  vect_chg_coeff(&pv, vecteur_var(vect),
654  value_mult(denb,coeff));
655  else {
656  /* build a new vecteur if there is not constant term */
657  pv = vect_new(vecteur_var(vect),
658  value_mult(denb,coeff));
659  found = true;
660  }
661  }
662  }
663 
664  for (j=1;j<=m2-1;vect=vect->succ,j++) {
665  coeff = MATRIX_ELEM(B,i,j);
666  if (value_notzero_p(coeff)) {
667  if (found)
668  vect_chg_coeff(&pv, vecteur_var(vect),
669  value_mult(denb,coeff));
670  else {
671  /* build a new vecteur if there is not constant term */
672  pv = vect_new(vecteur_var(vect),
673  value_mult(denb,coeff));
674  found = true;
675  }
676  }
677  }
678  cp->vecteur = pv;
679  cp->succ = newpc;
680  newpc = cp;
681  }
682  *pc = newpc;
683 }
684 
685 
686 
#define value_gt(v1, v2)
#define value_notzero_p(val)
int Value
#define value_product(v, w)
#define VALUE_ONE
#define value_mult(v, w)
whether the default is protected or not this define makes no sense any more...
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
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
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
#define A(i, j)
comp_matrice.c
Definition: comp_matrice.c:63
#define CONTRAINTE_UNDEFINED_P(c)
Pcontrainte contrainte_new(void)
package contrainte - allocations et desallocations
Definition: alloc.c:47
#define B(A)
Definition: iabrev.h:61
int vect_size(Pvecteur v)
package vecteur - reductions
Definition: reductions.c:47
#define DENOMINATOR(matrix)
int DENOMINATEUR(matrix): acces au denominateur global d'une matrice matrix La combinaison *(&()) est...
Definition: matrice-local.h:93
#define ACCESS(matrix, column, i, j)
Macros d'acces aux elements d'une matrice.
Definition: matrice-local.h:86
Value * matrice
package matrice
Definition: matrice-local.h:71
void matrice_nulle(matrice Z, int n, int m)
void matrice_nulle(matrice Z, int n, int m): Initialisation de la matrice Z a la valeur matrice nulle
Definition: matrice.c:311
#define MATRIX_NB_LINES(matrix)
Definition: matrix-local.h:87
#define MATRIX_NB_COLUMNS(matrix)
Definition: matrix-local.h:88
#define MATRIX_DENOMINATOR(matrix)
int MATRIX_DENONIMATOR(matrix): acces au denominateur global d'une matrice matrix
Definition: matrix-local.h:86
#define MATRIX_ELEM(matrix, i, j)
Macros d'acces aux elements d'une matrice.
Definition: matrix-local.h:80
void matrix_nulle(Pmatrix Z)
void matrix_nulle(Pmatrix Z): Initialisation de la matrice Z a la valeur matrice nulle
Definition: matrix.c:293
Pcontrainte eq
element du vecteur colonne du systeme donne par l'analyse
Definition: sc_gram.c:108
Pvecteur cp
pointeur sur l'egalite ou l'inegalite courante
Definition: sc_read.c:87
Variable creat_new_var(Psysteme ps)
char * noms_var(int i): cette fonction convertit un numero de variable en chaine de caracteres
Definition: sc_var.c:102
Definition: pip__tab.h:25
package matrice
Definition: matrix-local.h:63
Pvecteur vecteur
struct Scontrainte * succ
le type des coefficients dans les vecteurs: Value est defini dans le package arithmetique
Definition: vecteur-local.h:89
Value val
Definition: vecteur-local.h:91
Variable var
Definition: vecteur-local.h:90
struct Svecteur * succ
Definition: vecteur-local.h:92
void matrice_index_sys(Psysteme sc, Pbase base_index, matrice AG, int n, int m)
void matrice_index_sys(Psysteme sc, Pbase base_index, matrice AG, int n, int m) replace the coefficie...
void loop_sc_to_matrices(Psysteme ps, Pbase index_base, Pbase const_base, matrice A, matrice B, int n, int m1, int m2)
Creation de la matrice A correspondant au systeme lineaire et de la matrice correspondant a la partie...
void matrices_to_constraints(Pcontrainte *pc, Pbase b, Pmatrix A, Pmatrix B)
=======================================================================
void matrices_to_loop_sc(Psysteme ps, Pbase index_base, Pbase const_base, matrice A, matrice B, int n, int m1, int m2)
void constraints_to_matrices(Pcontrainte pc, Pbase b, Pmatrix A, Pmatrix B)
=======================================================================
void sc_to_matrices(Psysteme ps, Pbase base_index, matrice A, matrice B, int n, int m)
Creation de la matrice A correspondant au systeme lineaire et de la matrice correspondant a la partie...
void matrices_to_constraints_with_sym_cst(Pcontrainte *pc, Pbase index_base, Pbase const_base, Pmatrix A, Pmatrix B)
=======================================================================
void matrices_to_sc(Psysteme ps, Pbase base_index, matrice A, matrice B, int n, int m)
void sys_matrice_index(Psysteme sc, Pbase base_index, matrice A, int n, int m)
package sparse_sc: conversion de systemes representes par des matrices pleines en systemes represente...
void constraints_with_sym_cst_to_matrices(Pcontrainte pc, Pbase index_base, Pbase const_base, Pmatrix A, Pmatrix B)
=======================================================================
#define TCST
VARIABLE REPRESENTANT LE TERME CONSTANT.
#define vecteur_var(v)
#define VECTEUR_UNDEFINED
#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
Definition: vecteur-local.h:64
#define BASE_NULLE
MACROS SUR LES BASES.
#define VECTEUR_UNDEFINED_P(v)
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
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
Pvecteur vect_add(Pvecteur v1, Pvecteur v2)
package vecteur - operations binaires
Definition: binaires.c:53
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
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