My Project
debian-1:4.1.2-p1+ds-2
factory
cf_hnf.cc
Go to the documentation of this file.
1
/* emacs edit mode for this file is -*- C++ -*- */
2
3
/**
4
*
5
* @file cf_hnf.cc
6
*
7
* HNF/LLL of NTL
8
*
9
* Header file: cf_hnf.h
10
*
11
**/
12
13
14
#include "config.h"
15
16
17
#ifdef HAVE_NTL
18
#include "
NTLconvert.h
"
19
#include "
canonicalform.h
"
20
#include "
cf_defs.h
"
21
#include "
cf_hnf.h
"
22
#include <NTL/mat_ZZ.h>
23
#include <NTL/HNF.h>
24
#include <NTL/LLL.h>
25
26
/**
27
* The input matrix A is an n x m matrix of rank m (so n >= m), and D
28
* is a multiple of the determinant of the lattice L spanned by the
29
* rows of A. W is computed as the Hermite Normal Form of A; that is,
30
* W is the unique m x m matrix whose rows span L, such that
31
*
32
* - W is lower triangular,
33
* - the diagonal entries are positive,
34
* - any entry below the diagonal is a non-negative number
35
* strictly less than the diagonal entry in its column.
36
*
37
**/
38
CFMatrix
*
cf_HNF
(
CFMatrix
&
A
)
39
{
40
mat_ZZ *AA=
convertFacCFMatrix2NTLmat_ZZ
(
A
);
41
ZZ DD=
convertFacCF2NTLZZ
(
determinant
(
A
,
A
.rows()));
42
mat_ZZ WW;
43
HNF(WW,*AA,DD);
44
delete
AA;
45
return
convertNTLmat_ZZ2FacCFMatrix
(WW);
46
}
47
48
CFMatrix
*
cf_LLL
(
CFMatrix
&
A
)
49
{
50
mat_ZZ *AA=
convertFacCFMatrix2NTLmat_ZZ
(
A
);
51
#if 0
52
LLL_RR(*AA);
53
#else
54
ZZ det2;
55
LLL(det2,*AA,0L);
56
#endif
57
CFMatrix
*r=
convertNTLmat_ZZ2FacCFMatrix
(*AA);
58
delete
AA;
59
return
r;
60
}
61
#endif
Matrix
Definition:
ftmpl_matrix.h:20
cf_HNF
CFMatrix * cf_HNF(CFMatrix &A)
The input matrix A is an n x m matrix of rank m (so n >= m), and D is a multiple of the determinant o...
Definition:
cf_hnf.cc:38
canonicalform.h
cf_defs.h
NTLconvert.h
convertFacCFMatrix2NTLmat_ZZ
mat_ZZ * convertFacCFMatrix2NTLmat_ZZ(const CFMatrix &m)
Definition:
NTLconvert.cc:1137
determinant
CanonicalForm determinant(const CFMatrix &M, int n)
Definition:
cf_linsys.cc:222
convertNTLmat_ZZ2FacCFMatrix
CFMatrix * convertNTLmat_ZZ2FacCFMatrix(const mat_ZZ &m)
Definition:
NTLconvert.cc:1152
cf_hnf.h
convertFacCF2NTLZZ
ZZ convertFacCF2NTLZZ(const CanonicalForm &f)
NAME: convertFacCF2NTLZZX.
Definition:
NTLconvert.cc:664
cf_LLL
CFMatrix * cf_LLL(CFMatrix &A)
performs LLL reduction.
Definition:
cf_hnf.cc:48
A
#define A
Definition:
sirandom.c:24
Generated on Thu Jan 9 2020 20:32:43 for My Project by
doxygen 1.8.16
for
Singular debian-1:4.1.2-p1+ds-2