PIPS
matrice.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include "linear_assert.h"
#include "boolean.h"
#include "arithmetique.h"
#include "matrice.h"
+ Include dependency graph for matrice.c:

Go to the source code of this file.

Functions

void matrice_transpose (matrice a, matrice a_t, int n, int m)
 package matrice More...
 
void matrice_multiply (matrice a, matrice b, matrice c, int p, int q, int r)
 void matrice_multiply(matrice a, matrice b, matrice c, int p, int q, int r): multiply rational matrix a by rational matrix b and store result in matrix c More...
 
void matrice_normalize (matrice a, int n, int m)
 void matrice_normalize(matrice a, int n, int m) More...
 
void matrice_normalizec (matrice MAT, int n, int m)
 void matrice_normalizec(matrice MAT, int n, int m): Normalisation des coefficients de la matrice MAT, i.e. More...
 
void matrice_swap_columns (matrice matrix, int n, int m, int c1, int c2)
 void matrice_swap_columns(matrice matrix, int n, int m, int c1, int c2): exchange columns c1,c2 of an (nxm) rational matrix More...
 
void matrice_swap_rows (matrice a, int n, int m, int r1, int r2)
 void matrice_swap_rows(matrice a, int n, int m, int r1, int r2): exchange rows r1 and r2 of an (nxm) rational matrix a More...
 
void matrice_assign (matrice A, matrice B, int n, int m)
 void matrice_assign(matrice A, matrice B, int n, int m) Copie de la matrice A dans la matrice B More...
 
bool matrice_egalite (matrice A, matrice B, int n, int m)
 bool matrice_egalite(matrice A, matrice B, int n, int m) test de l'egalite de deux matrices A et B; elles doivent avoir ete normalisees au prealable pour que le test soit mathematiquement exact More...
 
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 More...
 
bool matrice_nulle_p (matrice Z, int n, int m)
 bool matrice_nulle_p(matrice Z, int n, int m): test de nullite de la matrice Z More...
 
bool matrice_diagonale_p (matrice Z, int n, int m)
 bool matrice_diagonale_p(matrice Z, int n, int m): test de nullite de la matrice Z More...
 
bool matrice_triangulaire_p (matrice Z, int n, int m, bool inferieure)
 bool matrice_triangulaire_p(matrice Z, int n, int m, bool inferieure): test de triangularite de la matrice Z More...
 
bool matrice_triangulaire_unimodulaire_p (matrice Z, int n, bool inferieure)
 bool matrice_triangulaire_unimodulaire_p(matrice Z, int n, bool inferieure) test de la triangulaire et unimodulaire de la matrice Z. More...
 
void matrice_substract (matrice a, matrice b, matrice c, int n, int m)
 void matrice_substract(matrice a, matrice b, matrice c, int n, int m): substract rational matrix c from rational matrix b and store result in matrix a More...
 
void matrice_soustraction_colonne (matrice MAT, int n, int m __attribute__((unused)), int c1, int c2, Value x)
 void matrice_soustraction_colonne(matrice MAT,int n,int m,int c1,int c2,int x): Soustrait x fois la colonne c2 de la colonne c1 Precondition: n > 0; m > 0; 0 < c1, c2 < m; Effet: c1[0..n-1] = c1[0..n-1] - x*c2[0..n-1]. More...
 
void matrice_soustraction_ligne (matrice MAT, int n, int m, int r1, int r2, Value x)
 void matrice_soustraction_ligne(matrice MAT,int n,int m,int r1,int r2,int x): Soustrait x fois la ligne r2 de la ligne r1 Precondition: n > 0; m > 0; 0 < r1, r2 < n; Effet: r1[0..m-1] = r1[0..m-1] - x*r2[0..m-1] More...
 

Function Documentation

◆ matrice_assign()

void matrice_assign ( matrice  A,
matrice  B,
int  n,
int  m 
)

void matrice_assign(matrice A, matrice B, int n, int m) Copie de la matrice A dans la matrice B

Les parametres de la fonction :

int A[] : matrice !int B[] : matrice int n : nombre de lignes de la matrice int m : nombre de colonnes de la matrice

Ancien nom: mat_dup

Definition at line 264 of file matrice.c.

267 {
268  int i, size=n*m;
269  for (i = 0 ;i<=size;i++)
270  B[i] = A[i];
271 }
#define B(A)
Definition: iabrev.h:61
Definition: pip__tab.h:25

References B.

Referenced by matrice_hermite(), and matrice_smith().

+ Here is the caller graph for this function:

◆ matrice_diagonale_p()

bool matrice_diagonale_p ( matrice  Z,
int  n,
int  m 
)

bool matrice_diagonale_p(matrice Z, int n, int m): test de nullite de la matrice Z

QQ i dans [1..n] QQ j dans [1..n] Z(i,j) == 0 && i != j || i == j

Les parametres de la fonction :

int Z[] : matrice int n : nombre de lignes de la matrice int m : nombre de colonnes de la matrice

Definition at line 362 of file matrice.c.

365 {
366  int i,j;
367 
368  for (i=1;i<=n;i++)
369  for (j=1;j<=m;j++)
370  if(i!=j && value_notzero_p(ACCESS(Z,n,i,j)))
371  return(false);
372  return(true);
373 }
#define value_notzero_p(val)
#define ACCESS(matrix, column, i, j)
Macros d'acces aux elements d'une matrice.
Definition: matrice-local.h:86

References ACCESS, and value_notzero_p.

Referenced by matrice_diagonale_inversion().

+ Here is the caller graph for this function:

◆ matrice_egalite()

bool matrice_egalite ( matrice  A,
matrice  B,
int  n,
int  m 
)

bool matrice_egalite(matrice A, matrice B, int n, int m) test de l'egalite de deux matrices A et B; elles doivent avoir ete normalisees au prealable pour que le test soit mathematiquement exact

Les parametres de la fonction :

int A[] : matrice int B[] : matrice int n : nombre de lignes de la matrice int m : nombre de colonnes de la matrice

Definition at line 285 of file matrice.c.

288 {
289  int i;
290  for (i = 0 ;i<= n*m;i++)
291  if(value_ne(B[i],A[i]))
292  return(false);
293  return(true);
294 }
#define value_ne(v1, v2)

References B, and value_ne.

◆ matrice_multiply()

void matrice_multiply ( matrice  a,
matrice  b,
matrice  c,
int  p,
int  q,
int  r 
)

void matrice_multiply(matrice a, matrice b, matrice c, int p, int q, int r): multiply rational matrix a by rational matrix b and store result in matrix c

 a is a (pxq) matrix, b a (qxr) and c a (pxr)

 c := a x b ;

Algorithm used is directly from definition, and space has to be provided for output matrix c by caller. Matrix c is not necessarily normalized: its denominator may divide all its elements (see matrice_normalize()).

Precondition: p > 0; q > 0; r > 0; c != a; c != b; – aliasing between c and a or b – is not supported input

validate dimensions

simplified aliasing test

set denominator

use ordinary school book algorithm

Parameters
b
 a is a (pxq) matrix, b a (qxr) and c a (pxr)

 c := a x b ;
Algorithm used is directly from definition, and space has to be provided for output matrix c by caller. Matrix c is not necessarily normalized: its denominator may divide all its elements (see matrice_normalize()).

Precondition: p > 0; q > 0; r > 0; c != a; c != b; – aliasing between c and a or b – is not supported input

Parameters
c
 a is a (pxq) matrix, b a (qxr) and c a (pxr)

 c := a x b ;
Algorithm used is directly from definition, and space has to be provided for output matrix c by caller. Matrix c is not necessarily normalized: its denominator may divide all its elements (see matrice_normalize()).

Precondition: p > 0; q > 0; r > 0; c != a; c != b; – aliasing between c and a or b – is not supported input

Parameters
p
 a is a (pxq) matrix, b a (qxr) and c a (pxr)

 c := a x b ;
Algorithm used is directly from definition, and space has to be provided for output matrix c by caller. Matrix c is not necessarily normalized: its denominator may divide all its elements (see matrice_normalize()).

Precondition: p > 0; q > 0; r > 0; c != a; c != b; – aliasing between c and a or b – is not supported output

Parameters
q
 a is a (pxq) matrix, b a (qxr) and c a (pxr)

 c := a x b ;
Algorithm used is directly from definition, and space has to be provided for output matrix c by caller. Matrix c is not necessarily normalized: its denominator may divide all its elements (see matrice_normalize()).

Precondition: p > 0; q > 0; r > 0; c != a; c != b; – aliasing between c and a or b – is not supported input

Parameters
r
 a is a (pxq) matrix, b a (qxr) and c a (pxr)

 c := a x b ;
Algorithm used is directly from definition, and space has to be provided for output matrix c by caller. Matrix c is not necessarily normalized: its denominator may divide all its elements (see matrice_normalize()).

Precondition: p > 0; q > 0; r > 0; c != a; c != b; – aliasing between c and a or b – is not supported input

Definition at line 82 of file matrice.c.

89 {
90  int loop1,loop2,loop3;
91  register Value i,va,vb;
92 
93  /* validate dimensions */
94  assert(p > 0 && q > 0 && r > 0);
95  /* simplified aliasing test */
96  assert(c != a && c != b);
97 
98  /* set denominator */
100 
101  /* use ordinary school book algorithm */
102  for(loop1=1; loop1<=p; loop1++)
103  for(loop2=1; loop2<=r; loop2++) {
104  i = VALUE_ZERO;
105  for(loop3=1; loop3<=q; loop3++)
106  {
107  va = ACCESS(a,p,loop1,loop3);
108  vb = ACCESS(b,q,loop3,loop2);
109  value_addto(i,value_mult(va,vb));
110  }
111  ACCESS(c,p,loop1,loop2) = i;
112  }
113 }
#define VALUE_ZERO
int Value
#define value_addto(ref, val)
#define value_mult(v, w)
whether the default is protected or not this define makes no sense any more...
loop loop1
tiling_sequence.c
#define DENOMINATOR(matrix)
int DENOMINATEUR(matrix): acces au denominateur global d'une matrice matrix La combinaison *(&()) est...
Definition: matrice-local.h:93
#define assert(ex)
Definition: newgen_assert.h:41

References ACCESS, assert, DENOMINATOR, loop1, value_addto, value_mult, and VALUE_ZERO.

Referenced by hyperplane(), matrice_general_inversion(), matrice_unimodulaire_inversion(), sc_image_computation(), and unimodular().

+ Here is the caller graph for this function:

◆ matrice_normalize()

void matrice_normalize ( matrice  a,
int  n,
int  m 
)

void matrice_normalize(matrice a, int n, int m)

 A rational matrix is stored as an integer one with one extra
 integer, the denominator for all the elements. To normalise the
 matrix in this sense means to reduce this denominator to the 
 smallest positive number possible. All elements are also reduced
 to their smallest possible value.

Precondition: DENOMINATOR(a)!=0 output

we must find the GCD of all elements of matrix

factor out

ensure denominator is positive

FI: this code is useless because pgcd()always return a positive integer, even if a is the null matrix; its denominator CANNOT be 0

Parameters
n
 A rational matrix is stored as an integer one with one extra
 integer, the denominator for all the elements. To normalise the
 matrix in this sense means to reduce this denominator to the 
 smallest positive number possible. All elements are also reduced
 to their smallest possible value.
Precondition: DENOMINATOR(a)!=0 input
m
 A rational matrix is stored as an integer one with one extra
 integer, the denominator for all the elements. To normalise the
 matrix in this sense means to reduce this denominator to the 
 smallest positive number possible. All elements are also reduced
 to their smallest possible value.
Precondition: DENOMINATOR(a)!=0 input

Definition at line 125 of file matrice.c.

129 {
130  int loop1,loop2;
131  Value factor;
132 
134 
135  /* we must find the GCD of all elements of matrix */
136  factor = DENOMINATOR(a);
137 
138  for(loop1=1; loop1<=n; loop1++)
139  for(loop2=1; loop2<=m; loop2++)
140  factor = pgcd(factor,ACCESS(a,n,loop1,loop2));
141 
142  /* factor out */
143  if (value_notone_p(factor)) {
144  for(loop1=1; loop1<=n; loop1++)
145  for(loop2=1; loop2<=m; loop2++)
146  value_division(ACCESS(a,n,loop1,loop2),factor);
147  value_division(DENOMINATOR(a),factor);
148  }
149 
150  /* ensure denominator is positive */
151  /* FI: this code is useless because pgcd()always return a positive integer,
152  even if a is the null matrix; its denominator CANNOT be 0 */
154  /*
155  if(DENOMINATOR(a) < 0) {
156  DENOMINATOR(a) = DENOMINATOR(a)*-1;
157  for(loop1=1; loop1<=n; loop1++)
158  for(loop2=1; loop2<=m; loop2++)
159  value_oppose(ACCESS(a,n,loop1,loop2));
160  }*/
161 }
#define value_pos_p(val)
#define pgcd(a, b)
Pour la recherche de performance, selection d'une implementation particuliere des fonctions.
#define value_notone_p(val)
#define value_division(ref, val)

References ACCESS, assert, DENOMINATOR, loop1, pgcd, value_division, value_notone_p, value_notzero_p, and value_pos_p.

Referenced by average_probability_matrix(), make_tile_constraints(), and tile_membership().

+ Here is the caller graph for this function:

◆ matrice_normalizec()

void matrice_normalizec ( matrice  MAT,
int  n,
int  m 
)

void matrice_normalizec(matrice MAT, int n, int m): Normalisation des coefficients de la matrice MAT, i.e.

division des coefficients de la matrice MAT et de son denominateur par leur pgcd

La matrice est modifiee.

Les parametres de la fonction :

!int MAT[] : matrice de dimension (n,m) int n : nombre de lignes de la matrice int m : nombre de colonnes de la matrice

FI What an awful test! It should be an assert()

Parameters
MATAT

Definition at line 175 of file matrice.c.

178 {
179  int i;
180  Value a;
181 
182  /* FI What an awful test! It should be an assert() */
183  if (n && m) {
184  a = MAT[0];
185  for (i = 1;(i<=n*m) && value_gt(a,VALUE_ONE);i++)
186  a = pgcd(a,MAT[i]);
187 
188  if (value_gt(a,VALUE_ONE)) {
189  for (i = 0;i<=n*m;i++)
190  value_division(MAT[i],a);
191  }
192  }
193 }
#define value_gt(v1, v2)
#define VALUE_ONE

References pgcd, value_division, value_gt, and VALUE_ONE.

◆ matrice_nulle()

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

Post-condition:

QQ i dans [1..n] QQ j dans [1..n] Z(i,j) == 0

Les parametres de la fonction :

!int Z[] : matrice int n : nombre de lignes de la matrice int m : nombre de colonnes de la matrice

Definition at line 311 of file matrice.c.

314 {
315  int i,j;
316 
317  for (i=1;i<=n;i++)
318  for (j=1;j<=m;j++)
319  ACCESS(Z,n,i,j)=VALUE_ZERO;
320  DENOMINATOR(Z) = VALUE_ONE;
321 }

References ACCESS, DENOMINATOR, VALUE_ONE, and VALUE_ZERO.

Referenced by average_probability_matrix(), base_G_h1_unnull(), broadcast_conditions(), build_transfer_matrix(), contraintes_with_sym_cst_to_matrices(), loop_nest_to_tile(), loop_sc_to_matrices(), make_primal(), mat_perm_col(), mat_perm_lig(), matrice_diagonale_inversion(), matrice_hermite(), matrice_triangulaire_inversion(), partial_broadcast_coefficients(), pu_contraintes_to_matrices(), sc_image_computation(), sc_to_matrices(), sys_matrice_index(), and system_inversion_restrict().

+ Here is the caller graph for this function:

◆ matrice_nulle_p()

bool matrice_nulle_p ( matrice  Z,
int  n,
int  m 
)

bool matrice_nulle_p(matrice Z, int n, int m): test de nullite de la matrice Z

QQ i dans [1..n] QQ j dans [1..n] Z(i,j) == 0

Les parametres de la fonction :

int Z[] : matrice int n : nombre de lignes de la matrice int m : nombre de colonnes de la matrice

Definition at line 336 of file matrice.c.

339 {
340  int i,j;
341 
342  for (i=1;i<=n;i++)
343  for (j=1;j<=m;j++)
344  if(value_notzero_p(ACCESS(Z,n,i,j)))
345  return(false);
346  return(true);
347 }

References ACCESS, and value_notzero_p.

◆ matrice_soustraction_colonne()

void matrice_soustraction_colonne ( matrice  MAT,
int  n,
int m   __attribute__(unused),
int  c1,
int  c2,
Value  x 
)

void matrice_soustraction_colonne(matrice MAT,int n,int m,int c1,int c2,int x): Soustrait x fois la colonne c2 de la colonne c1 Precondition: n > 0; m > 0; 0 < c1, c2 < m; Effet: c1[0..n-1] = c1[0..n-1] - x*c2[0..n-1].

Les parametres de la fonction :

int MAT[] : matrice int n : nombre de lignes de la matrice int m : nombre de colonnes de la matrice int c1 : numero du colonne int c2 : numero du colonne int x :

Definition at line 523 of file matrice.c.

529 {
530  int i;
531  register Value p;
532  for (i=1; i<=n; i++)
533  {
534  p = ACCESS(MAT,n,i,c2);
535  value_product(p,x);
536  value_substract(ACCESS(MAT,n,i,c1),p);
537  }
538 }
#define value_product(v, w)
#define value_substract(ref, val)
static char * x
Definition: split_file.c:159

References ACCESS, value_product, value_substract, and x.

Referenced by matrice_hermite(), matrice_smith(), and matrice_unimodulaire_triangulaire_inversion().

+ Here is the caller graph for this function:

◆ matrice_soustraction_ligne()

void matrice_soustraction_ligne ( matrice  MAT,
int  n,
int  m,
int  r1,
int  r2,
Value  x 
)

void matrice_soustraction_ligne(matrice MAT,int n,int m,int r1,int r2,int x): Soustrait x fois la ligne r2 de la ligne r1 Precondition: n > 0; m > 0; 0 < r1, r2 < n; Effet: r1[0..m-1] = r1[0..m-1] - x*r2[0..m-1]

Les parametres de la fonction :

int MAT[] : matrice int n : nombre de lignes de la matrice int m : nombre de colonnes de la matrice int r1 : numero du ligne int r2 : numero du ligne int x :

Parameters
MATAT
r11
r22

Definition at line 554 of file matrice.c.

559 {
560  int i;
561  register Value p;
562  for (i=1; i<=m; i++)
563  {
564  p = ACCESS(MAT,n,r2,i);
565  value_product(p,x);
566  value_substract(ACCESS(MAT,n,r1,i),p);
567  }
568 }

References ACCESS, value_product, value_substract, and x.

Referenced by matrice_smith().

+ Here is the caller graph for this function:

◆ matrice_substract()

void matrice_substract ( matrice  a,
matrice  b,
matrice  c,
int  n,
int  m 
)

void matrice_substract(matrice a, matrice b, matrice c, int n, int m): substract rational matrix c from rational matrix b and store result in matrix a

 a is a (nxm) matrix, b a (nxm) and c a (nxm)

 a = b - c ;

Algorithm used is directly from definition, and space has to be provided for output matrix a by caller. Matrix a is not necessarily normalized: its denominator may divide all its elements (see matrice_normalize()).

Precondition: n > 0; m > 0; Note: aliasing between a and b or c is supported input

denominators of b, c

ppcm of b,c

precondition

Parameters
b
 a is a (nxm) matrix, b a (nxm) and c a (nxm)

 a = b - c ;
Algorithm used is directly from definition, and space has to be provided for output matrix a by caller. Matrix a is not necessarily normalized: its denominator may divide all its elements (see matrice_normalize()).

Precondition: n > 0; m > 0; Note: aliasing between a and b or c is supported output

Parameters
n
 a is a (nxm) matrix, b a (nxm) and c a (nxm)

 a = b - c ;
Algorithm used is directly from definition, and space has to be provided for output matrix a by caller. Matrix a is not necessarily normalized: its denominator may divide all its elements (see matrice_normalize()).

Precondition: n > 0; m > 0; Note: aliasing between a and b or c is supported input

Definition at line 468 of file matrice.c.

472 {
473  register Value d1,d2; /* denominators of b, c */
474  register Value lcm; /* ppcm of b,c */
475  int i,j;
476 
477  /* precondition */
478  assert(n>0 && m>0);
481 
482  d1 = DENOMINATOR(b);
483  d2 = DENOMINATOR(c);
484  if (d1 == d2){
485  for (i=1; i<=n; i++)
486  for (j=1; j<=m; j++)
487  ACCESS(a,n,i,j) = value_minus(ACCESS(b,n,i,j),
488  ACCESS(c,n,i,j));
489  DENOMINATOR(a) = d1;
490  }
491  else{
492  register Value v1,v2;
493  lcm = ppcm(d1,d2);
494  DENOMINATOR(a) = lcm;
495  d1 = value_div(lcm,d1);
496  d2 = value_div(lcm,d2);
497  for (i=1; i<=n; i++)
498  for (j=1; j<=m; j++)
499  {
500  v1 = ACCESS(b,n,i,j);
501  value_product(v1, d1);
502  v2 = ACCESS(c,n,i,j);
503  value_product(v2, d2);
504  ACCESS(a,n,i,j) = value_minus(v1,v2);
505  }
506  }
507 }
#define value_minus(v1, v2)
#define value_div(v1, v2)
Value ppcm(Value, Value)
ppcm.c
Definition: ppcm.c:42

References ACCESS, assert, DENOMINATOR, ppcm(), value_div, value_minus, value_pos_p, and value_product.

Referenced by unstructured_to_complexity().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ matrice_swap_columns()

void matrice_swap_columns ( matrice  matrix,
int  n,
int  m,
int  c1,
int  c2 
)

void matrice_swap_columns(matrice matrix, int n, int m, int c1, int c2): exchange columns c1,c2 of an (nxm) rational matrix

 Precondition:      n > 0; m > 0; 0 < c1 <= m; 0 < c2 <= m; 

column numbers

validation step

Parameters
matrixatrix
n
 Precondition:      n > 0; m > 0; 0 < c1 <= m; 0 < c2 <= m; 
input and output matrix
m
 Precondition:      n > 0; m > 0; 0 < c1 <= m; 0 < c2 <= m; 
number of rows
c1
 Precondition:      n > 0; m > 0; 0 < c1 <= m; 0 < c2 <= m; 
number of columns
c22

Definition at line 200 of file matrice.c.

205 {
206  int loop1;
207  register Value temp;
208 
209  /* validation step */
210  /*
211  * if ((n < 1) || (m < 1)) return(-208);
212  * if ((c1 > m) || (c2 > m)) return(-209);
213  */
214  assert(n > 0 && m > 0);
215  assert(0 < c1 && c1 <= m);
216  assert(0 < c2 && c2 <= m);
217 
218  for(loop1=1; loop1<=n; loop1++) {
219  temp = ACCESS(matrix,n,loop1,c1);
220  ACCESS(matrix,n,loop1,c1) = ACCESS(matrix,n,loop1,c2);
221  ACCESS(matrix,n,loop1,c2) = temp;
222  }
223 }

References ACCESS, assert, and loop1.

Referenced by matrice_hermite(), and matrice_smith().

+ Here is the caller graph for this function:

◆ matrice_swap_rows()

void matrice_swap_rows ( matrice  a,
int  n,
int  m,
int  r1,
int  r2 
)

void matrice_swap_rows(matrice a, int n, int m, int r1, int r2): exchange rows r1 and r2 of an (nxm) rational matrix a

Precondition: n > 0; m > 0; 1 <= r1 <= n; 1 <= r2 <= n row numbers

validation

Parameters
nPrecondition: n > 0; m > 0; 1 <= r1 <= n; 1 <= r2 <= n input and output matrix
mPrecondition: n > 0; m > 0; 1 <= r1 <= n; 1 <= r2 <= n number of columns
r1Precondition: n > 0; m > 0; 1 <= r1 <= n; 1 <= r2 <= n number of rows
r22

Definition at line 230 of file matrice.c.

235 {
236  int loop1;
237  register Value temp;
238 
239  /* validation */
240  assert(n > 0);
241  assert(m > 0);
242  assert(0 < r1 && r1 <= n);
243  assert(0 < r2 && r2 <= n);
244 
245  for(loop1=1; loop1<=m; loop1++) {
246  temp = ACCESS(a,n,r1,loop1);
247  ACCESS(a,n,r1,loop1) = ACCESS(a,n,r2,loop1);
248  ACCESS(a,n,r2,loop1) = temp;
249  }
250 }

References ACCESS, assert, and loop1.

Referenced by matrice_hermite(), matrice_smith(), and scanning_base_hyperplane().

+ Here is the caller graph for this function:

◆ matrice_transpose()

void matrice_transpose ( matrice  a,
matrice  a_t,
int  n,
int  m 
)

package matrice

matrice.c

void matrice_transpose(matrice a, matrice a_t, int n, int m): transpose an (nxm) rational matrix a into a (mxn) rational matrix a_t

    t

a_t := a ;

verification step

copy from a to a_t

Parameters
a_t_t

Definition at line 48 of file matrice.c.

53 {
54  int loop1,loop2;
55 
56  /* verification step */
57  assert(n >= 0 && m >= 0);
58 
59  /* copy from a to a_t */
60  DENOMINATOR(a_t) = DENOMINATOR(a);
61  for(loop1=1; loop1<=n; loop1++)
62  for(loop2=1; loop2<=m; loop2++)
63  ACCESS(a_t,m,loop2,loop1) = ACCESS(a,n,loop1,loop2);
64 }

References ACCESS, assert, DENOMINATOR, and loop1.

Referenced by base_G_h1_unnull(), broadcast_conditions(), make_primal(), partial_broadcast_coefficients(), and system_inversion_restrict().

+ Here is the caller graph for this function:

◆ matrice_triangulaire_p()

bool matrice_triangulaire_p ( matrice  Z,
int  n,
int  m,
bool  inferieure 
)

bool matrice_triangulaire_p(matrice Z, int n, int m, bool inferieure): test de triangularite de la matrice Z

si inferieure == true QQ i dans [1..n] QQ j dans [i+1..m] Z(i,j) == 0

si inferieure == false (triangulaire superieure) QQ i dans [1..n] QQ j dans [1..i-1] Z(i,j) == 0

Les parametres de la fonction :

int Z[] : matrice int n : nombre de lignes de la matrice int m : nombre de colonnes de la matrice

Parameters
inferieurenferieure

Definition at line 394 of file matrice.c.

398 {
399  int i,j;
400 
401  for (i=1; i <= n; i++)
402  if(inferieure) {
403  for (j=i+1; j <= m; j++)
404  if(value_notzero_p(ACCESS(Z,n,i,j)))
405  return(false);
406  }
407  else
408  for (j=1; j <= i-1; j++)
409  if(value_notzero_p(ACCESS(Z,n,i,j)))
410  return(false);
411  return(true);
412 }

References ACCESS, and value_notzero_p.

Referenced by matrice_triangulaire_inversion(), and matrice_triangulaire_unimodulaire_p().

+ Here is the caller graph for this function:

◆ matrice_triangulaire_unimodulaire_p()

bool matrice_triangulaire_unimodulaire_p ( matrice  Z,
int  n,
bool  inferieure 
)

bool matrice_triangulaire_unimodulaire_p(matrice Z, int n, bool inferieure) test de la triangulaire et unimodulaire de la matrice Z.

si inferieure == true QQ i dans [1..n] QQ j dans [i+1..n] Z(i,j) == 0 i dans [1..n] Z(i,i) == 1

si inferieure == false (triangulaire superieure) QQ i dans [1..n] QQ j dans [1..i-1] Z(i,j) == 0 i dans [1..n] Z(i,i) == 1

les parametres de la fonction : matrice Z : la matrice entre int n : la dimension de la martice caree

Parameters
inferieurenferieure

Definition at line 434 of file matrice.c.

438 {
439  bool triangulaire;
440  int i;
441  triangulaire = matrice_triangulaire_p(Z,n,n,inferieure);
442  if (triangulaire == false)
443  return(false);
444  else{
445  for(i=1; i<=n; i++)
446  if (value_notone_p(ACCESS(Z,n,i,i)))
447  return(false);
448  return(true);
449  }
450 }
bool matrice_triangulaire_p(matrice Z, int n, int m, bool inferieure)
bool matrice_triangulaire_p(matrice Z, int n, int m, bool inferieure): test de triangularite de la ma...
Definition: matrice.c:394

References ACCESS, matrice_triangulaire_p(), and value_notone_p.

Referenced by matrice_unimodulaire_inversion(), and matrice_unimodulaire_triangulaire_inversion().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: