Changeset 806c18 in git for factory/facHensel.h


Ignore:
Timestamp:
Nov 15, 2010, 4:34:57 PM (13 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
7c3bca08c96331a56864c1d35b8c2e8ff2e0be89
Parents:
c840d97af622b4e4da8761738b540e21144f716b
Message:
format

git-svn-id: file:///usr/local/Singular/svn/trunk@13655 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • factory/facHensel.h

    rc840d9 r806c18  
    11/*****************************************************************************\
    2  * Computer Algebra System SINGULAR   
     2 * Computer Algebra System SINGULAR
    33\*****************************************************************************/
    44/** @file facHensel.h
    5  * 
    6  * This file defines functions for Hensel lifting and modular multiplication. 
    7  *
    8  * ABSTRACT: function are used for bi- and multivariate factorization over 
     5 *
     6 * This file defines functions for Hensel lifting and modular multiplication.
     7 *
     8 * ABSTRACT: function are used for bi- and multivariate factorization over
    99 * finite fields
    1010 *
     
    2525
    2626#include "canonicalform.h"
    27 #include "cf_iter.h"   
     27#include "cf_iter.h"
    2828#include "ftmpl_functions.h"
    2929#include "algext.h"
     
    3131CanonicalForm mul (const CanonicalForm& F, const CanonicalForm& G);
    3232CanonicalForm mulMod3 (const CanonicalForm& F, const CanonicalForm& G, const CFList& MOD);
    33 /// multiplication of univariate polys over a finite field using NTL, if we are 
     33/// multiplication of univariate polys over a finite field using NTL, if we are
    3434/// in GF factory's default multiplication is used.
    3535///
     
    3737static inline
    3838CanonicalForm
    39 mulNTL (const CanonicalForm& F, ///< [in] a univariate poly 
     39mulNTL (const CanonicalForm& F, ///< [in] a univariate poly
    4040        const CanonicalForm& G  ///< [in] a univariate poly
    4141       );
    4242
    43 /// mod of univariate polys over a finite field using NTL, if we are 
     43/// mod of univariate polys over a finite field using NTL, if we are
    4444/// in GF factory's default mod is used.
    4545///
     
    4747static inline
    4848CanonicalForm
    49 modNTL (const CanonicalForm& F, ///< [in] a univariate poly 
     49modNTL (const CanonicalForm& F, ///< [in] a univariate poly
    5050        const CanonicalForm& G  ///< [in] a univariate poly
    5151       );
    5252
    53 /// division of univariate polys over a finite field using NTL, if we are 
     53/// division of univariate polys over a finite field using NTL, if we are
    5454/// in GF factory's default division is used.
    5555///
     
    5757static inline
    5858CanonicalForm
    59 divNTL (const CanonicalForm& F, ///< [in] a univariate poly 
     59divNTL (const CanonicalForm& F, ///< [in] a univariate poly
    6060        const CanonicalForm& G  ///< [in] a univariate poly
    6161       );
    6262
    63 /*/// division with remainder of univariate polys over a finite field using NTL, 
     63/*/// division with remainder of univariate polys over a finite field using NTL,
    6464/// if we are in GF factory's default division with remainder is used.
    6565static inline
    6666void
    67 divremNTL (const CanonicalForm& F, ///< [in] a univariate poly 
     67divremNTL (const CanonicalForm& F, ///< [in] a univariate poly
    6868           const CanonicalForm& G, ///< [in] a univariate poly
    6969           CanonicalForm& Q,       ///< [in,out] dividend
     
    7171          );*/
    7272
    73 /// splits @a F into degree (F, x)/m polynomials each of degree less than @a m 
     73/// splits @a F into degree (F, x)/m polynomials each of degree less than @a m
    7474/// in @a x.
    7575///
    7676/// @return @a split returns a list of polynomials of degree less than @a m in
    77 ///         @a x. If degree (F, x) <= 0, F is returned. 
     77///         @a x. If degree (F, x) <= 0, F is returned.
    7878/// @sa divrem32(), divrem21()
    7979static inline
     
    8181              const int m,            ///< [in] some int
    8282              const Variable& x       ///< [in] some Variable
    83              );     
     83             );
    8484
    8585/// division with remainder of @a F by
    8686/// @a G wrt Variable (1) modulo @a M.
    87 /// 
     87///
    8888/// @sa divrem(), divrem21(), divrem2()
    8989static inline
    90 void divrem32 (const CanonicalForm& F, ///< [in] poly, s.t. 3*(degree (G, 1)/2)> 
     90void divrem32 (const CanonicalForm& F, ///< [in] poly, s.t. 3*(degree (G, 1)/2)>
    9191                                       ///< degree (F, 1)
    9292               const CanonicalForm& G, ///< [in] some poly
    9393               CanonicalForm& Q,       ///< [in,out] dividend
    94                CanonicalForm& R,       ///< [in,out] remainder, degree (R, 1) < 
     94               CanonicalForm& R,       ///< [in,out] remainder, degree (R, 1) <
    9595                                       ///< degree (G, 1)
    9696               const CFList& M         ///< [in] only contains powers of
     
    100100/// division with remainder of @a F by
    101101/// @a G wrt Variable (1) modulo @a M.
    102 /// 
     102///
    103103/// @sa divrem(), divrem32(), divrem2()
    104104static inline
     
    107107               const CanonicalForm& G, ///< [in] some poly
    108108               CanonicalForm& Q,       ///< [in,out] dividend
    109                CanonicalForm& R,       ///< [in,out] remainder, degree (R, 1) < 
     109               CanonicalForm& R,       ///< [in,out] remainder, degree (R, 1) <
    110110                                       ///< degree (G, 1)
    111111               const CFList& M         ///< [in] only contains powers of
     
    114114
    115115/// division with remainder of @a F by
    116 /// @a G wrt Variable (1) modulo @a M. 
    117 /// 
     116/// @a G wrt Variable (1) modulo @a M.
     117///
    118118/// @return @a Q returns the dividend, @a R returns the remainder.
    119119/// @sa divrem()
    120 void divrem2 (const CanonicalForm& F, ///< [in] bivariate, compressed polynomial 
     120void divrem2 (const CanonicalForm& F, ///< [in] bivariate, compressed polynomial
    121121              const CanonicalForm& G, ///< [in] bivariate, compressed polynomial
    122122              CanonicalForm& Q,       ///< [in,out] dividend
    123               CanonicalForm& R,       ///< [in,out] remainder, degree (R, 1) < 
     123              CanonicalForm& R,       ///< [in,out] remainder, degree (R, 1) <
    124124                                      ///< degree (G, 1)
    125125              const CanonicalForm& M  ///< [in] power of Variable (2)
     
    134134           const CanonicalForm& G, ///< [in] multivariate, compressed polynomial
    135135           CanonicalForm& Q,       ///< [in,out] dividend
    136            CanonicalForm& R,       ///< [in,out] remainder, degree (R, 1) < 
     136           CanonicalForm& R,       ///< [in,out] remainder, degree (R, 1) <
    137137                                   ///< degree (G, 1)
    138138           const CFList& MOD       ///< [in] only contains powers of
     
    144144/// @return @a mod returns @a F modulo @a M
    145145CanonicalForm mod (const CanonicalForm& F, ///< [in] compressed polynomial
    146                    const CFList& M         ///< [in] list containing only 
     146                   const CFList& M         ///< [in] list containing only
    147147                                           ///< univariate polynomials
    148148                  );
     
    151151///
    152152/// @return @a mulMod2 returns @a A * @a B mod @a M.
    153 CanonicalForm 
     153CanonicalForm
    154154mulMod2 (const CanonicalForm& A, ///< [in] bivariate, compressed polynomial
    155155         const CanonicalForm& B, ///< [in] bivariate, compressed polynomial
     
    160160///
    161161/// @return @a mulMod2 returns @a A * @a B mod @a MOD.
    162 CanonicalForm 
     162CanonicalForm
    163163mulMod (const CanonicalForm& A, ///< [in] multivariate, compressed polynomial
    164164        const CanonicalForm& B, ///< [in] multivariate, compressed polynomial
     
    170170///
    171171/// @return @a prodMod returns product of all elements in @a L modulo @a M.
    172 CanonicalForm 
    173 prodMod (const CFList& L,       ///< [in] contains only bivariate, compressed 
     172CanonicalForm
     173prodMod (const CFList& L,       ///< [in] contains only bivariate, compressed
    174174                                ///< polynomials
    175175         const CanonicalForm& M ///< [in] power of Variable (2)
     
    179179///
    180180/// @return @a prodMod returns product of all elements in @a L modulo @a M.
    181 CanonicalForm 
    182 prodMod (const CFList& L, ///< [in] contains multivariate, compressed 
     181CanonicalForm
     182prodMod (const CFList& L, ///< [in] contains multivariate, compressed
    183183                          ///< polynomials
    184184         const CFList& M  ///< [in] contains only powers of Variables
    185185        );
    186  
     186
    187187/// sort a list of polynomials by their degree in @a x.
    188188///
    189 void sortList (CFList& list,     ///< [in, out] list of polys, sorted list 
    190                const Variable& x ///< [in] some Variable 
     189void sortList (CFList& list,     ///< [in, out] list of polys, sorted list
     190               const Variable& x ///< [in] some Variable
    191191              );
    192192
    193 /// solve the univariate diophantine equation 
     193/// solve the univariate diophantine equation
    194194/// \f$ 1\equiv \sum_{i= 1}^{r} {\delta_{i} F/g_{i}} \f$.
    195 /// Where \f$ F= \prod_{i= 1}^{r} {g_{i}} \f$ and \f$ F \f$ is squarefree 
     195/// Where \f$ F= \prod_{i= 1}^{r} {g_{i}} \f$ and \f$ F \f$ is squarefree
    196196/// the \f$ \delta_{i} \f$ have degree less than the degree of \f$ g_{i} \f$.
    197197///
     
    200200/// @sa biDiophantine(), multiRecDiophantine()
    201201static inline
    202 CFList diophantine (const CanonicalForm& F, ///< [in] compressed, bivariate 
     202CFList diophantine (const CanonicalForm& F, ///< [in] compressed, bivariate
    203203                                            ///< polynomial
    204                     const CFList& factors   ///< [in] a list of factors, as 
     204                    const CFList& factors   ///< [in] a list of factors, as
    205205                                            ///< specified above, including
    206                                             ///< LC (F, Variable (1)) as first 
     206                                            ///< LC (F, Variable (1)) as first
    207207                                            ///< element
    208208                   );
    209209
    210210/// Hensel lift from univariate to bivariate.
    211 /// 
     211///
    212212/// @sa henselLiftResume12(), henselLift23(), henselLiftResume(), henselLift()
    213 void 
     213void
    214214henselLift12 (const CanonicalForm& F, ///< [in] compressed, bivariate poly
    215               CFList& factors,        ///< [in, out] monic univariate factors of 
     215              CFList& factors,        ///< [in, out] monic univariate factors of
    216216                                      ///< F, including leading coefficient as
    217                                       ///< first element. Returns monic lifted 
    218                                       ///< factors without the leading 
     217                                      ///< first element. Returns monic lifted
     218                                      ///< factors without the leading
    219219                                      ///< coefficient
    220220              int l,                  ///< [in] lifting precision
     
    224224             );
    225225
    226 /// resume Hensel lift from univariate to bivariate. Assumes factors are lifted 
     226/// resume Hensel lift from univariate to bivariate. Assumes factors are lifted
    227227/// to precision Variable (2)^start and lifts them to precision Variable (2)^end
    228 /// 
     228///
    229229/// @sa henselLift12(), henselLift23(), henselLiftResume(), henselLift()
    230 void 
     230void
    231231henselLiftResume12 (const CanonicalForm& F, ///< [in] compressed, bivariate poly
    232                     CFList& factors,        ///< [in,out] monic factors of F, 
    233                                             ///< lifted to precision start, 
    234                                             ///< including leading coefficient 
    235                                             ///< as first element. Returns monic 
    236                                             ///< lifted factors without the 
     232                    CFList& factors,        ///< [in,out] monic factors of F,
     233                                            ///< lifted to precision start,
     234                                            ///< including leading coefficient
     235                                            ///< as first element. Returns monic
     236                                            ///< lifted factors without the
    237237                                            ///< leading coefficient
    238238                    int start,              ///< [in] starting precision
     
    247247/// solves the bivariate polynomial diophantine equation
    248248/// \f$ 1\equiv \sum_{i= 1}^{r} {\delta_{i} F/g_{i}} \ mod\ y^{d} \f$,
    249 /// where \f$ F= \prod_{i= 1}^{r} {g_{i}} \ mod\ y^{d}\f$ and 
     249/// where \f$ F= \prod_{i= 1}^{r} {g_{i}} \ mod\ y^{d}\f$ and
    250250/// \f$ F \in K[x][y]\f$ is squarefree, the \f$ \delta_{i} \f$ have degree less
    251251/// than the degree of \f$ g_{i} \f$ in x.
     
    258258biDiophantine (const CanonicalForm& F, ///< [in] compressed, bivariate poly
    259259               const CFList& factors,  ///< [in] list of monic bivariate factors
    260                                        ///< including LC (F, Variable (1)) as 
     260                                       ///< including LC (F, Variable (1)) as
    261261                                       ///< first element
    262262               const int d             ///< [in] precision
     
    265265/// solve the multivariate polynomial diophantine equation
    266266/// \f$ 1\equiv \sum_{i= 1}^{r} {\delta_{i} F/g_{i}} \ mod\ <M,F.mvar()^{d}>\f$,
    267 /// where \f$ F= \prod_{i= 1}^{r} {g_{i}} \ mod\ <M,F.mvar()^{d}>\f$ and 
    268 /// \f$ F \in K[x][x_1,\ldots , x_n]\f$ is squarefree, the \f$ \delta_{i} \f$ 
    269 /// have degree less than the degree of \f$ g_{i} \f$ in x. 
    270 /// 
    271 /// @return @a multiDiophantine returns a list of polynomials \f$ \delta_{i} \f$ 
     267/// where \f$ F= \prod_{i= 1}^{r} {g_{i}} \ mod\ <M,F.mvar()^{d}>\f$ and
     268/// \f$ F \in K[x][x_1,\ldots , x_n]\f$ is squarefree, the \f$ \delta_{i} \f$
     269/// have degree less than the degree of \f$ g_{i} \f$ in x.
     270///
     271/// @return @a multiDiophantine returns a list of polynomials \f$ \delta_{i} \f$
    272272///         as specified above
    273273/// @sa diophantine(), biDiophantine()
     
    275275CFList
    276276multiRecDiophantine (
    277                const CanonicalForm& F,   ///< [in] compressed, 
     277               const CanonicalForm& F,   ///< [in] compressed,
    278278                                         ///< multivariate polynomial
    279279               const CFList& factors,    ///< [in] list of monic factors
     
    292292///          Variable (3)^l[1]
    293293/// @sa henselLift12(), henselLiftResume12(), henselLiftResume(), henselLift()
    294 CFList 
     294CFList
    295295henselLift23 (const CFList& eval,    ///< [in] contains compressed, bivariate
    296296                                     ///< as first element and trivariate one as
    297                                      ///< second element 
    298               const CFList& factors, ///< [in] monic bivariate factors, 
    299                                      ///< including leading coefficient 
     297                                     ///< second element
     298              const CFList& factors, ///< [in] monic bivariate factors,
     299                                     ///< including leading coefficient
    300300                                     ///< as first element.
    301               const int* l,          ///< [in] l[0]: precision of bivariate 
     301              const int* l,          ///< [in] l[0]: precision of bivariate
    302302                                     ///< lifting, l[1] as above
    303303              CFList& diophant,      ///< [in,out] returns the result of
     
    310310///
    311311/// @sa henselLift12(), henselLiftResume12(), henselLift23(), henselLift()
    312 void 
     312void
    313313henselLiftResume (
    314               const CanonicalForm& F, ///< [in] compressed, multivariate poly 
     314              const CanonicalForm& F, ///< [in] compressed, multivariate poly
    315315              CFList& factors,        ///< [in,out] monic multivariate factors
    316                                       ///< lifted to precision F.mvar()^start, 
    317                                       ///< including leading coefficient 
     316                                      ///< lifted to precision F.mvar()^start,
     317                                      ///< including leading coefficient
    318318                                      ///< as first element. Returns factors
    319319                                      ///< lifted to precision F.mvar()^end
    320               int start,              ///< [in] starting precision 
     320              int start,              ///< [in] starting precision
    321321              int end,                ///< [in] end precision
    322322              CFArray& Pi,            ///< [in,out] stores intermediate results
     
    329329/// Hensel lifting
    330330///
    331 /// @return @a henselLift returns a list of polynomials lifted to 
     331/// @return @a henselLift returns a list of polynomials lifted to
    332332///          precision F.getLast().mvar()^l_new
    333333/// @sa henselLift12(), henselLiftResume12(), henselLift23(), henselLiftResume()
     
    335335henselLift (const CFList& F,       ///< [in] two compressed, multivariate
    336336                                   ///< polys F and G
    337             const CFList& factors, ///< [in] monic multivariate factors                                     
    338                                    ///< including leading coefficient 
    339                                    ///< as first element. 
     337            const CFList& factors, ///< [in] monic multivariate factors
     338                                   ///< including leading coefficient
     339                                   ///< as first element.
    340340            const CFList& MOD,     ///< [in] a list of powers of Variables
    341341                                   ///< of level higher than 1
     
    343343            CFArray& Pi,           ///< [in,out] stores intermediate results
    344344            CFMatrix& M,           ///< [in,out] stores intermediate results
    345             const int lOld,       ///< [in] lifting precision of F.mvar() 
     345            const int lOld,       ///< [in] lifting precision of F.mvar()
    346346            const int lNew        ///< [in] lifting precision of G.mvar()
    347347           );
    348348
    349 /// Hensel lifting from bivariate to multivariate 
    350 ///
    351 /// @return @a henselLift returns a list of lifted factors 
    352 /// @sa henselLift12(), henselLiftResume12(), henselLift23(), henselLiftResume()         
    353 CFList
    354 henselLift (const CFList& eval,    ///< [in] a list of polynomials the last 
    355                                    ///< element is a compressed multivariate 
    356                                    ///< poly, last but one element equals the 
     349/// Hensel lifting from bivariate to multivariate
     350///
     351/// @return @a henselLift returns a list of lifted factors
     352/// @sa henselLift12(), henselLiftResume12(), henselLift23(), henselLiftResume()
     353CFList
     354henselLift (const CFList& eval,    ///< [in] a list of polynomials the last
     355                                   ///< element is a compressed multivariate
     356                                   ///< poly, last but one element equals the
    357357                                   ///< last elements modulo its main variable
    358                                    ///< and so on. The first element is a 
     358                                   ///< and so on. The first element is a
    359359                                   ///< compressed bivariate poly.
    360             const CFList& factors, ///< [in] bivariate factors, including 
     360            const CFList& factors, ///< [in] bivariate factors, including
    361361                                   ///< leading coefficient
    362362            const int* l,          ///< [in] lifting bounds
Note: See TracChangeset for help on using the changeset viewer.