Main Page | Class List | File List | Class Members | File Members

NormalForms.c File Reference

#include <stdlib.h>
#include <polylib/polylib.h>

Go to the source code of this file.

Functions

void moins_l (Value *a, int i, int n, int p)
void moins_c (Value *a, int i, int n, int p)
void echange_l (Value *a, int i, int j, int n, int p)
void echange_c (Value *a, int i, int j, int n, int p)
void ligne (Value *a, int i, int j, Value x, int n, int p)
void colonne (Value *a, int i, int j, Value x, int n, int p)
int petit_l (Value *a, int n, int p, int q)
int petit_c (Value *a, int n, int p, int q)
void identite (Value *a, int n, int p)
void transpose (Value *a, int n, int q)
int encore (Value *a, int n, int p, int q, Value val)
void smith (Value *a, Value *b, Value *c, Value *b_inverse, Value *c_inverse, int n, int p, int q)
void hermite (Value *a, Value *b, Value *d, int n, int p, int q)
ValueConvertPolMattoDarMat (Matrix *A)
 Convert PolmattoDarmat : This function converts the matrix of a Polylib to a int * as necessary for the functions in Darte's implementation.

MatrixConvertDarMattoPolMat (Value *A, int NbRows, int NbCols)
 Convert DarmattoPolmat This function converts the matrix from Darte representation to a matrix in PolyLib.

void Smith (Matrix *A, Matrix **U, Matrix **V, Matrix **Product)
 Smith : This function takes a Matrix A of dim n * l as its input and returns the three matrices U, V and Product such that A = U * Product * V, where U is an unimodular matrix of dimension n * n and V is an unimodular matrix of dimension l * l.

void Hermite (Matrix *A, Matrix **H, Matrix **U)
 Hermite : This function takes a Matrix as its input and finds its HNF ( Left form ).


Function Documentation

void colonne Value a,
int  i,
int  j,
Value  x,
int  n,
int  p
[static]
 

Definition at line 133 of file NormalForms.c.

References Value, value_addto, value_clear, value_init, and value_multiply.

Referenced by hermite(), and smith().

Matrix* ConvertDarMattoPolMat Value A,
int  NbRows,
int  NbCols
[static]
 

Convert DarmattoPolmat This function converts the matrix from Darte representation to a matrix in PolyLib.

Input : The matrix (a pointer to it), number of Rows, number of columns Output : The matrix of the PolyLib

Definition at line 595 of file NormalForms.c.

References Matrix, Matrix_Alloc(), matrix::p, Value, and value_assign.

Referenced by Hermite(), and Smith().

Value* ConvertPolMattoDarMat Matrix A  )  [static]
 

Convert PolmattoDarmat : This function converts the matrix of a Polylib to a int * as necessary for the functions in Darte's implementation.

Input : A Polylib Matrix ( a pointer to it ); Output : An int * with the matrix copied into it

Definition at line 571 of file NormalForms.c.

References Matrix, matrix::NbColumns, matrix::NbRows, matrix::p, Value, value_assign, and value_init.

Referenced by Hermite(), and Smith().

void echange_c Value a,
int  i,
int  j,
int  n,
int  p
[static]
 

Definition at line 76 of file NormalForms.c.

References s, Value, value_assign, value_clear, and value_init.

Referenced by hermite(), and smith().

void echange_l Value a,
int  i,
int  j,
int  n,
int  p
[static]
 

Definition at line 50 of file NormalForms.c.

References s, Value, value_assign, value_clear, and value_init.

Referenced by hermite(), and smith().

int encore Value a,
int  n,
int  p,
int  q,
Value  val
[static]
 

Definition at line 320 of file NormalForms.c.

References Value, value_absolute, value_clear, value_init, value_modulus, value_notzero_p, and value_zero_p.

Referenced by smith().

void Hermite Matrix A,
Matrix **  H,
Matrix **  U
 

Hermite : This function takes a Matrix as its input and finds its HNF ( Left form ).

Input : A Matrix A (The Matrix A is not necessarily a Polylib matrix. It is just a matrix as far as Hermite is concerned. It does not even check if the matrix is a Polylib matrix or not) Output : The Hnf matrix H and the Unimodular matrix U such that A = H * U.

We use Alan Darte's implementation of Hermite to compute the HNF. Alan Darte's implementation computes the Upper Triangular HNF. So We work on the fact that if A = H * U then A (transpose) = U(transpose) * H (transpose) There are a set of interface functions written in Interface.c which convert a matrix from Polylib representationt to that of Alan Darte's and vice versa.

This Function Does the Following Step 1 : Given the matrix A it finds its Transpose. Step 2 : Finds the HNF (Right Form) using Alan Darte's Algorithm. Step 3 : The H1 and U1 obtained in Step2 are both Transposed to get the actual H and U such that A = HU.

Definition at line 695 of file NormalForms.c.

References ConvertDarMattoPolMat(), ConvertPolMattoDarMat(), hermite(), identite(), Matrix, Matrix_Copy(), Matrix_Free(), matrix::NbColumns, matrix::NbRows, Transpose(), transpose(), Value, value_clear, and value_init.

void hermite Value a,
Value b,
Value d,
int  n,
int  p,
int  q
[static]
 

Definition at line 483 of file NormalForms.c.

References colonne(), echange_c(), echange_l(), ligne(), moins_c(), moins_l(), petit_c(), Value, value_assign, value_clear, value_decrement, value_division, value_init, value_modulus, value_neg_p, value_notzero_p, and value_oppose.

Referenced by Hermite(), left_hermite(), and right_hermite().

void identite Value a,
int  n,
int  p
[static]
 

Definition at line 263 of file NormalForms.c.

References Value, and value_set_si.

Referenced by Hermite(), and Smith().

void ligne Value a,
int  i,
int  j,
Value  x,
int  n,
int  p
[static]
 

Definition at line 104 of file NormalForms.c.

References Value, value_addto, value_clear, value_init, and value_multiply.

Referenced by hermite(), and smith().

void moins_c Value a,
int  i,
int  n,
int  p
[static]
 

Definition at line 31 of file NormalForms.c.

References Value, and value_oppose.

Referenced by hermite(), and smith().

void moins_l Value a,
int  i,
int  n,
int  p
[static]
 

Definition at line 12 of file NormalForms.c.

References Value, and value_oppose.

Referenced by hermite(), and smith().

int petit_c Value a,
int  n,
int  p,
int  q
[static]
 

Definition at line 216 of file NormalForms.c.

References Value, value_absolute, value_assign, value_clear, value_ge, value_init, and value_notzero_p.

Referenced by hermite(), and smith().

int petit_l Value a,
int  n,
int  p,
int  q
[static]
 

Definition at line 164 of file NormalForms.c.

References Value, value_absolute, value_assign, value_clear, value_ge, value_init, and value_notzero_p.

Referenced by smith().

void Smith Matrix A,
Matrix **  U,
Matrix **  V,
Matrix **  Product
 

Smith : This function takes a Matrix A of dim n * l as its input and returns the three matrices U, V and Product such that A = U * Product * V, where U is an unimodular matrix of dimension n * n and V is an unimodular matrix of dimension l * l.

Product is a diagonal matrix of dimension n * l.

We use Alan Darte's implementation of Smith for computing the Smith Normal Form

Definition at line 619 of file NormalForms.c.

References ConvertDarMattoPolMat(), ConvertPolMattoDarMat(), identite(), Matrix, Matrix_Alloc(), Matrix_Free(), Matrix_Inverse(), matrix::NbColumns, matrix::NbRows, smith(), Value, value_clear, and value_init.

void smith Value a,
Value b,
Value c,
Value b_inverse,
Value c_inverse,
int  n,
int  p,
int  q
[static]
 

Definition at line 374 of file NormalForms.c.

References colonne(), echange_c(), echange_l(), encore(), ligne(), moins_c(), moins_l(), petit_c(), petit_l(), Value, value_assign, value_clear, value_decrement, value_division, value_init, value_modulus, value_neg_p, value_notzero_p, value_oppose, and value_set_si.

Referenced by Smith().

void transpose Value a,
int  n,
int  q
[static]
 

Definition at line 288 of file NormalForms.c.

References Value, value_assign, value_clear, and value_init.

Referenced by Hermite().


Generated on Mon Sep 12 14:48:30 2005 for polylib by doxygen 1.3.5