source: git/factory/facHensel.h @ 81d96c

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