PIPS
smith.c
Go to the documentation of this file.
1 /*
2 
3  $Id: smith.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,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or 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 #include <stdio.h>
25 #include <stdlib.h>
26 
27 #include "arithmetique.h"
28 #include "matrix.h"
29 
30 int main(void)
31 {
32  int m, n;
33  Pmatrix A, P, D, Q;
34  matrix_fscan(stdin, &A, &m, &n);
35  P = matrix_new(m, m);
36  D = matrix_new(m, n);
37  Q = matrix_new(n, n);
38  // compute Smith normal form: D = P.A.Q
39  matrix_smith(A, P, D, Q);
40  fprintf(stdout, "# A =\n");
41  matrix_fprint(stdout, A);
42  fprintf(stdout, "# P =\n");
43  matrix_fprint(stdout, P);
44  fprintf(stdout, "# D =\n");
45  matrix_fprint(stdout, D);
46  fprintf(stdout, "# Q =\n");
47  matrix_fprint(stdout, Q);
48  return 0;
49 }
int main(void)
Definition: smith.c:30
#define A(i, j)
comp_matrice.c
Definition: comp_matrice.c:63
#define D(A)
Definition: iabrev.h:56
Pmatrix matrix_new(int m, int n)
package matrix
Definition: alloc.c:41
void matrix_smith(Pmatrix MAT, Pmatrix P, Pmatrix D, Pmatrix Q)
void matrix_smith(matrice MAT, matrix P, matrix D, matrix Q): Calcul de la forme reduite de Smith D d...
Definition: smith.c:68
void matrix_fprint(FILE *, Pmatrix)
matrix_io.c
Definition: matrix_io.c:44
void matrix_fscan(FILE *, Pmatrix *, int *, int *)
void matrix_fscan(FILE * f, matrice * a, int * n, int * m): read an (nxm) rational matrix in an ASCII...
Definition: matrix_io.c:93
#define Q
Definition: pip__type.h:39
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
Definition: pip__tab.h:25
package matrice
Definition: matrix-local.h:63