source: git/factory/facFqSquarefree.h @ c1b9927

fieker-DuValspielwiese
Last change on this file since c1b9927 was c1b9927, checked in by Hans Schoenemann <hannes@…>, 13 years ago
- removed some unsed variables - never put static inline routine without a body in a .h file git-svn-id: file:///usr/local/Singular/svn/trunk@14265 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 3.4 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 part of @a F/g, where g is the product of those squarefree
78/// factors whose multiplicity is 0 mod p, if @a F a pth power pthPower= F.
79///
80/// @return @a sqrfPart returns 1, if F is a pthPower, else it returns the
81///         squarefree part of @a F/g, where g is the product of those
82///         squarefree factors whose multiplicity is 0 mod p
83CanonicalForm
84sqrfPart (const CanonicalForm& F,  ///< [in] a poly
85          CanonicalForm& pthPower, ///< [in,out] returns F is F is a pthPower
86          const Variable& alpha    ///< [in] algebraic variable
87         );
88
89/// p^l-th root extraction, where l is maximal
90///
91/// @return @a maxpthRoot returns a p^l-th root of @a F, where @a l is maximal
92/// @sa pthRoot()
93CanonicalForm
94maxpthRoot (const CanonicalForm & F, ///< [in] a poly which is a pth power
95            const int & q,           ///< [in] size of the field
96            int& l                   ///< [in,out] @a l maximal, s.t. @a F is
97                                     ///< a p^l-th power
98           );
99
100#endif
101/* FAC_FQ_SQUAREFREE_H */
102
Note: See TracBrowser for help on using the repository browser.