source: git/factory/facHensel.h @ 667ba1

spielwiese
Last change on this file since 667ba1 was d9357b, checked in by Martin Lee <martinlee84@…>, 12 years ago
chg: added coeff bounds to Hensel lifting routines added coeff bounds to henselLiftAndEarly
  • Property mode set to 100644
File size: 11.5 KB
Line 
1/*****************************************************************************\
2 * Computer Algebra System SINGULAR
3\*****************************************************************************/
4/** @file facHensel.h
5 *
6 * This file defines functions for Hensel lifting.
7 *
8 * ABSTRACT: function are used for bi- and multivariate factorization over
9 * finite fields
10 *
11 * @author Martin Lee
12 *
13 * @internal @version \$Id$
14 *
15 **/
16/*****************************************************************************/
17
18#ifndef FAC_HENSEL_H
19#define FAC_HENSEL_H
20
21// #include "config.h"
22#include "cf_assert.h"
23#include "debug.h"
24#include "timing.h"
25
26#include "canonicalform.h"
27#include "fac_util.h"
28
29#ifdef HAVE_NTL
30/// sort a list of polynomials by their degree in @a x.
31///
32void sortList (CFList& list,     ///< [in, out] list of polys, sorted list
33               const Variable& x ///< [in] some Variable
34              );
35
36/// Hensel lift from univariate to bivariate.
37///
38/// @sa henselLiftResume12(), henselLift23(), henselLiftResume(), henselLift()
39void
40henselLift12 (const CanonicalForm& F, ///< [in] compressed, bivariate poly
41              CFList& factors,        ///< [in, out] monic univariate factors of
42                                      ///< F, including leading coefficient as
43                                      ///< first element. Returns monic lifted
44                                      ///< factors without the leading
45                                      ///< coefficient
46              int l,                  ///< [in] lifting precision
47              CFArray& Pi,            ///< [in,out] stores intermediate results
48              CFList& diophant,       ///< [in,out] result of diophantine()
49              CFMatrix& M,            ///< [in,out] stores intermediate results
50              bool sort= true,        ///< [in] sort factors by degree in
51                                      ///< Variable(1)
52              const modpk& b= modpk ()///< [in] coeff bound
53             );
54
55/// resume Hensel lift from univariate to bivariate. Assumes factors are lifted
56/// to precision Variable (2)^start and lifts them to precision Variable (2)^end
57///
58/// @sa henselLift12(), henselLift23(), henselLiftResume(), henselLift()
59void
60henselLiftResume12 (const CanonicalForm& F, ///< [in] compressed, bivariate poly
61                    CFList& factors,        ///< [in,out] monic factors of F,
62                                            ///< lifted to precision start,
63                                            ///< including leading coefficient
64                                            ///< as first element. Returns monic
65                                            ///< lifted factors without the
66                                            ///< leading coefficient
67                    int start,              ///< [in] starting precision
68                    int end,                ///< [in] end precision
69                    CFArray& Pi,            ///< [in,out] stores intermediate
70                                            ///< results
71                    const CFList& diophant, ///< [in] result of diophantine
72                    CFMatrix& M,            ///< [in,out] stores intermediate
73                                            ///< results
74                    const modpk& b= modpk() ///< [in] coeff bound
75                   );
76
77/// Hensel lifting from bivariate to trivariate.
78///
79/// @return @a henselLift23 returns a list of polynomials lifted to precision
80///          Variable (3)^l[1]
81/// @sa henselLift12(), henselLiftResume12(), henselLiftResume(), henselLift()
82CFList
83henselLift23 (const CFList& eval,    ///< [in] contains compressed, bivariate
84                                     ///< as first element and trivariate one as
85                                     ///< second element
86              const CFList& factors, ///< [in] monic bivariate factors,
87                                     ///< including leading coefficient
88                                     ///< as first element.
89              int* l,          ///< [in] l[0]: precision of bivariate
90                                     ///< lifting, l[1] as above
91              CFList& diophant,      ///< [in,out] returns the result of
92                                     ///< biDiophantine()
93              CFArray& Pi,           ///< [in,out] stores intermediate results
94              CFMatrix& M            ///< [in,out] stores intermediate results
95             );
96
97/// resume Hensel lifting.
98///
99/// @sa henselLift12(), henselLiftResume12(), henselLift23(), henselLift()
100void
101henselLiftResume (
102              const CanonicalForm& F, ///< [in] compressed, multivariate poly
103              CFList& factors,        ///< [in,out] monic multivariate factors
104                                      ///< lifted to precision F.mvar()^start,
105                                      ///< including leading coefficient
106                                      ///< as first element. Returns factors
107                                      ///< lifted to precision F.mvar()^end
108              int start,              ///< [in] starting precision
109              int end,                ///< [in] end precision
110              CFArray& Pi,            ///< [in,out] stores intermediate results
111              const CFList& diophant, ///< [in] result of multiRecDiophantine()
112              CFMatrix& M,            ///< [in, out] stores intermediate results
113              const CFList& MOD       ///< [in] a list of powers of Variables
114                                      ///< of level higher than 1
115                 );
116
117/// Hensel lifting
118///
119/// @return @a henselLift returns a list of polynomials lifted to
120///          precision F.getLast().mvar()^l_new
121/// @sa henselLift12(), henselLiftResume12(), henselLift23(), henselLiftResume()
122CFList
123henselLift (const CFList& F,       ///< [in] two compressed, multivariate
124                                   ///< polys F and G
125            const CFList& factors, ///< [in] monic multivariate factors
126                                   ///< including leading coefficient
127                                   ///< as first element.
128            const CFList& MOD,     ///< [in] a list of powers of Variables
129                                   ///< of level higher than 1
130            CFList& diophant,      ///< [in,out] result of multiRecDiophantine()
131            CFArray& Pi,           ///< [in,out] stores intermediate results
132            CFMatrix& M,           ///< [in,out] stores intermediate results
133            int lOld,       ///< [in] lifting precision of F.mvar()
134            int lNew        ///< [in] lifting precision of G.mvar()
135           );
136
137/// Hensel lifting from bivariate to multivariate
138///
139/// @return @a henselLift returns a list of lifted factors
140/// @sa henselLift12(), henselLiftResume12(), henselLift23(), henselLiftResume()
141CFList
142henselLift (const CFList& eval,    ///< [in] a list of polynomials the last
143                                   ///< element is a compressed multivariate
144                                   ///< poly, last but one element equals the
145                                   ///< last elements modulo its main variable
146                                   ///< and so on. The first element is a
147                                   ///< compressed bivariate poly.
148            const CFList& factors, ///< [in] bivariate factors, including
149                                   ///< leading coefficient
150            int* l,          ///< [in] lifting bounds
151            int lLength,     ///< [in] length of l
152            bool sort= true        ///< [in] sort factors by degree in
153                                   ///< Variable(1)
154           );
155
156/// Hensel lifting from univariate to bivariate, factors need not to be monic
157void
158nonMonicHenselLift12 (const CanonicalForm& F,///< [in] a bivariate poly
159               CFList& factors,       ///< [in, out] a list of univariate polys
160                                      ///< lifted factors
161               int l,                 ///< [in] lift bound
162               CFArray& Pi,           ///< [in, out] stores intermediate results
163               CFList& diophant,      ///< [in, out] result of diophantine
164               CFMatrix& M,           ///< [in, out] stores intermediate results
165               const CFArray& LCs,    ///< [in] leading coefficients
166               bool sort              ///< [in] if true factors are sorted by
167                                      ///< their degree
168              );
169
170/// two factor Hensel lifting from bivariate to multivariate, factors need not
171/// to be monic
172///
173/// @return @a henselLift122 returns a list of lifted factors
174CFList
175nonMonicHenselLift2 (const CFList& eval,///< [in] a list of polynomials the last
176                                   ///< element is a compressed multivariate
177                                   ///< poly, last but one element equals the
178                                   ///< last elements modulo its main variable
179                                   ///< and so on. The first element is a
180                                   ///< compressed bivariate poly.
181             const CFList& factors,///< [in] bivariate factors
182             int* l,               ///< [in] lift bounds
183             int lLength,          ///< [in] length of l
184             bool sort,            ///< [in] if true factors are sorted by
185                                   ///< their degree in Variable(1)
186             const CFList& LCs1,   ///< [in] a list of evaluated LC of first
187                                   ///< factor
188             const CFList& LCs2,   ///< [in] a list of evaluated LC of second
189                                   ///< factor
190             const CFArray& Pi,    ///< [in] intermediate result
191             const CFList& diophant,///< [in] result of diophantine
192             bool& noOneToOne      ///< [in,out] check for one to one
193                                   ///< correspondence
194            );
195
196/// Hensel lifting of non monic factors, needs correct leading coefficients of
197/// factors and a one to one corresponds between bivariate and multivariate
198/// factors to succeed
199///
200/// @return @a nonMonicHenselLift returns a list of lifted factors
201/// such that prod (factors) == eval.getLast() if there is a one to one
202/// correspondence
203CFList
204nonMonicHenselLift (const CFList& eval,    ///< [in] a list of polys the last
205                                           ///< element is a compressed
206                                           ///< multivariate poly, last but one
207                                           ///< element equals the last elements
208                                           ///< modulo its main variable and so
209                                           ///< on. The first element is a
210                                           ///< compressed poly in 3 variables
211                    const CFList& factors, ///< [in] a list of bivariate factors
212                    CFList* const& LCs,    ///< [in] leading coefficients,
213                                           ///< evaluated in the same way as
214                                           ///< eval
215                    CFList& diophant,      ///< [in, out] solution of univariate
216                                           ///< diophantine equation
217                    CFArray& Pi,           ///< [in, out] buffer intermediate
218                                           ///< results
219                    int* liftBound,        ///< [in] lifting bounds
220                    int length,            ///< [in] length of lifting bounds
221                    bool& noOneToOne       ///< [in, out] check for one to one
222                                           ///< correspondence
223                   );
224#endif /* HAVE_NTL */
225#endif
226/* FAC_HENSEL_H */
227
Note: See TracBrowser for help on using the repository browser.