source: git/factory/cf_gcd_smallp.h @ 72bfc8

jengelh-datetimespielwiese
Last change on this file since 72bfc8 was 72bfc8, checked in by Martin Lee <martinlee84@…>, 11 years ago
chg: deleted @internal
  • Property mode set to 100644
File size: 3.6 KB
Line 
1#ifndef CF_GCD_SMALL_H
2#define CF_GCD_SMALL_H
3// -*- c++ -*-
4//*****************************************************************************
5/** @file cf_gcd_smallp.h
6 *
7 * @author Martin Lee
8 * @date   22.10.2009
9 *
10 * This file defines the functions GCD_Fp_extension which computes the GCD of
11 * two polynomials over \f$ F_{p}(\alpha ) \f$ , GCD_small_p which computes the
12 * GCD of two polynomials over  \f$ F_{p} \f$ , and GCD_GF which computes the
13 * GCD of two polynomials over GF. Algorithms are based on "On the Genericity of
14 * the Modular Polynomial GCD Algorithm" by E. Kaltofen & M. Monagan
15 *
16 * @par Copyright:
17 *   (c) by The SINGULAR Team, see LICENSE file
18 *
19**/
20//*****************************************************************************
21
22// #include "config.h"
23#include "cf_assert.h"
24
25#include "cf_factory.h"
26
27CanonicalForm GCD_Fp_extension (const CanonicalForm& F, const CanonicalForm& G,
28                  Variable & alpha, CFList& l, bool& top_level);
29
30/// GCD of A and B over \f$ F_{p}(\alpha ) \f$
31static inline CanonicalForm GCD_Fp_extension (const CanonicalForm& A, const CanonicalForm& B,
32                                Variable & alpha)
33{
34  CFList list;
35  bool top_level= true;
36  return GCD_Fp_extension (A, B, alpha, list, top_level);
37}
38
39
40CanonicalForm GCD_small_p (const CanonicalForm& F, const CanonicalForm&  G,
41                           bool& top_level, CFList& l);
42
43CanonicalForm GCD_small_p (const CanonicalForm& F, const CanonicalForm&  G, CanonicalForm& coF, CanonicalForm& coG,
44                           bool& topLevel, CFList& l);
45
46///GCD of A and B over \f$ F_{p} \f$
47static inline CanonicalForm GCD_small_p (const CanonicalForm& A, const CanonicalForm& B)
48{
49  CFList list;
50  bool top_level= true;
51  return GCD_small_p (A, B, top_level, list);
52}
53
54static inline CanonicalForm GCD_small_p (const CanonicalForm& A, const CanonicalForm& B, CanonicalForm& coA, CanonicalForm& coB)
55{
56  CFList list;
57  bool top_level= true;
58  return GCD_small_p (A, B, coA, coB, top_level, list);
59}
60
61CanonicalForm GCD_GF (const CanonicalForm& F, const CanonicalForm& G, CFList& l,
62        bool& top_level);
63
64/// GCD of A and B over GF
65static inline CanonicalForm GCD_GF (const CanonicalForm& A, const CanonicalForm& B)
66{
67  ASSERT (CFFactory::gettype() == GaloisFieldDomain,
68          "GF as base field expected");
69  CFList list;
70  bool top_level= true;
71  return GCD_GF (A, B, list, top_level);
72}
73
74CanonicalForm sparseGCDFp (const CanonicalForm& F, const CanonicalForm& G,
75                           bool& topLevel, CFList& l);
76
77/// Zippel's sparse GCD over Fp
78static inline
79CanonicalForm sparseGCDFp (const CanonicalForm& A, const CanonicalForm& B)
80{
81  ASSERT (CFFactory::gettype() == GaloisFieldDomain, 
82          "GF as base field expected");
83  CFList list;
84  bool topLevel= true;
85  return sparseGCDFp (A, B, topLevel, list);
86}
87
88/// Zippel's sparse GCD over Fq
89CanonicalForm
90sparseGCDFq (const CanonicalForm& F, const CanonicalForm& G,
91             const Variable& alpha, CFList& l, bool& topLevel);
92
93static inline
94CanonicalForm sparseGCDFq (const CanonicalForm& A, const CanonicalForm& B,
95                           const Variable& alpha)
96{
97  CFList list;
98  bool topLevel= true;
99  return sparseGCDFq (A, B, alpha, list, topLevel);
100}
101
102/// extended Zassenhaus GCD
103CanonicalForm
104EZGCD_P (const CanonicalForm& A, const CanonicalForm& B);
105
106CanonicalForm
107randomIrredpoly (int i, const Variable & x) ;
108
109CFArray
110getMonoms (const CanonicalForm& F);
111
112bool
113terminationTest (const CanonicalForm& F, const CanonicalForm& G,
114                 const CanonicalForm& coF, const CanonicalForm& coG,
115                 const CanonicalForm& cand);
116#endif
Note: See TracBrowser for help on using the repository browser.