source: git/factory/facFqSquarefree.h @ 8cc501

fieker-DuValspielwiese
Last change on this file since 8cc501 was 24b338, checked in by Martin Lee <martinlee84@…>, 14 years ago
new squarefree factorization over finite fields git-svn-id: file:///usr/local/Singular/svn/trunk@12856 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 4.2 KB
Line 
1/*****************************************************************************\
2 * Computer Algebra System SINGULAR   
3\*****************************************************************************/
4/** @file facFqSquarefree.h
5 *
6 * This file provides functions for squarefrees factorizing over
7 * \f$ F_{p} \f$ , \f$ F_{p}(\alpha ) \f$ or GF.         
8 *
9 * @author Martin Lee
10 *
11 * @internal @version \$Id$
12 *
13 **/
14/*****************************************************************************/
15
16#ifndef FAC_FQ_SQUAREFREE_H
17#define FAC_FQ_SQUAREFREE_H
18
19#include "assert.h"
20
21
22/// squarefree factorization over a finite field
23/// @a return a list of squarefree factors with multiplicity
24CFFList
25squarefreeFactorization 
26                (const CanonicalForm & F, ///<[in] a poly
27                 const Variable & alpha   ///<[in] either an algebraic variable,
28                                          ///< i.e. we are over some F_p (alpha)
29                                          ///< or a variable of level 1, i.e.
30                                          ///< we are F_p or GF
31                );
32
33/// squarefree factorization over \f$ F_{p} \f$.
34/// If input is not monic, the leading coefficient is dropped
35///
36/// @return a list of squarefree factors with multiplicity
37inline
38CFFList FpSqrf (const CanonicalForm& F ///< [in] a poly           
39               ) 
40{
41  Variable a= 1;
42  CFFList result= squarefreeFactorization (F, a);
43  result.insert (CFFactor (Lc(F), 1));
44  return result;
45}
46
47/// squarefree factorization over \f$ F_{p}(\alpha ) \f$.
48/// If input is not monic, the leading coefficient is dropped
49///
50/// @return a list of squarefree factors with multiplicity
51inline
52CFFList FqSqrf (const CanonicalForm& F, ///< [in] a poly
53                const Variable& alpha   ///< [in] algebraic variable
54               )
55{
56  CFFList result= squarefreeFactorization (F, alpha);
57  result.insert (CFFactor (Lc(F), 1));
58  return result;
59} 
60
61/// squarefree factorization over GF.
62/// If input is not monic, the leading coefficient is dropped
63///
64/// @return a list of squarefree factors with multiplicity
65inline
66CFFList GFSqrf (const CanonicalForm& F ///< [in] a poly
67               ) 
68{
69  ASSERT (CFFactory::gettype() == GaloisFieldDomain, 
70          "GF as base field expected");
71  Variable a= 1;
72  CFFList result= squarefreeFactorization (F, a);
73  result.insert (CFFactor (Lc(F), 1));
74  return result;
75}
76
77/// squarefree factorization of @a F wrt @x
78///
79/// @return a list of factors of @a F which are squarefree wrt x
80static inline 
81CFFList
82sqrfPosDer (const CanonicalForm & F, ///< [in] some poly
83            const Variable & x,      ///< [in] a variable s.t. deriv (F, x) != 0
84            const int & k,           ///< [in] GFDegree or 1
85            const Variable & alpha,  ///< [in] algebraic variable or Variable(1)
86            CanonicalForm & c        ///< [in,out] F divided by the product of
87                                     ///< the result
88           );
89
90/// squarefree part of @a F/g, where g is the product of those squarefree
91/// factors whose multiplicity is 0 mod p, if @a F a pth power pthPower= F.
92///
93/// @return @a sqrfPart returns 1, if F is a pthPower, else it returns the
94///         squarefree part of @a F/g, where g is the product of those
95///         squarefree factors whose multiplicity is 0 mod p 
96CanonicalForm
97sqrfPart (const CanonicalForm& F,  ///< [in] a poly
98          CanonicalForm& pthPower, ///< [in,out] returns F is F is a pthPower
99          const Variable& alpha    ///< [in] algebraic variable
100         );
101
102/// pth root extraction
103///
104/// @return @a pthRoot returns a pth root of @a F
105/// @sa maxpthRoot()
106static inline
107CanonicalForm
108pthRoot (const CanonicalForm & F, ///< [in] a poly which is a pth power
109         const int & q            ///< [in] size of the field
110        );
111
112/// p^l-th root extraction, where l is maximal
113///
114/// @return @a maxpthRoot returns a p^l-th root of @a F, where @a l is maximal
115/// @sa pthRoot()
116CanonicalForm
117maxpthRoot (const CanonicalForm & F, ///< [in] a poly which is a pth power
118            const int & q,           ///< [in] size of the field
119            int& l                   ///< [in,out] @a l maximal, s.t. @a F is
120                                     ///< a p^l-th power
121           );
122
123#endif
124/* FAC_FQ_SQUAREFREE_H */
125
Note: See TracBrowser for help on using the repository browser.