PIPS
|
#include <stdlib.h>
#include <stdio.h>
#include "linear_assert.h"
#include "boolean.h"
#include "arithmetique.h"
#include "matrix.h"
Go to the source code of this file.
Functions | |
void | matrix_determinant (Pmatrix a, result) |
package matrix More... | |
void | matrix_sub_determinant (Pmatrix a, int i, int j, result) |
void matrix_sub_determinant(Pmatrix a,int i, int j, int result[]) calculate sub determinant of a matrix More... | |
void matrix_determinant | ( | Pmatrix | a, |
result | |||
) |
package matrix
int matrix_determinant(Pmatrix a, int * result):
calculate determinant of an (nxn) rational matrix a
The result consists of two integers, a numerator result[1] and a denominator result[0].
Algorithm: integer matrix triangularisation by Hermite normal form (because the routine is available)
Complexity: O(n**3) – up to gcd computations...
Authors: Francois Irigoin, September 1989, Yi-qing Yang, January 1990 output
cette routine est FAUSSE car la factorisation de Hermite peut s'appuyer sur des matrice unimodulaires de determinant 1 ou -1. Il faudrait donc ecrire un code de calcul de determinant de matrice unimodulaire...
Ou tout reprendre avec une triangularisation rapide et n'utilisant que des matrice de determinant +1. Voir mon code des US. Cette triangularisation donnera en derivation une routine d'inversion rapide pour matrice unimodulaire
matrix_hermite expects an integer matrix
product of diagonal elements
product of determinants of three matrixs P, H, Q
free useless matrices
reduce result
Definition at line 54 of file determinant.c.
References assert, MATRIX_DENOMINATOR, MATRIX_ELEM, matrix_free, matrix_hermite(), MATRIX_NB_LINES, matrix_new(), pgcd_slow(), value_division, value_minus, value_mult, value_notone_p, VALUE_ONE, and value_product.
Referenced by matrix_sub_determinant().
void matrix_sub_determinant(Pmatrix a,int i, int j, int result[]) calculate sub determinant of a matrix
The sub determinant indicated by (i,j) is the one obtained by deleting row i and column j from matrix of dimension n. The result passed back consists of two integers, a numerator result[1] and a denominator result[0].
Precondition: n >= i > 0 && n >= j > 0
Algorithm: put 0 in row i and in column j, and 1 in a[i,j], and then call matrix_determinant, restore a
Complexity: O(n**3) output
save column j
save row i, but for the (i,j) elements
restore row i
restore column j, with proper (i,j) element
i | The sub determinant indicated by (i,j) is the one obtained by deleting row i and column j from matrix of dimension n. The result passed back consists of two integers, a numerator result[1] and a denominator result[0]. |
Precondition: n >= i > 0 && n >= j > 0
Algorithm: put 0 in row i and in column j, and 1 in a[i,j], and then call matrix_determinant, restore a
Complexity: O(n**3) input matrix
Definition at line 149 of file determinant.c.
References matrix_determinant(), MATRIX_ELEM, matrix_free, MATRIX_NB_LINES, matrix_new(), VALUE_ONE, and VALUE_ZERO.
Referenced by matrix_triangular_inversion().