source: git/factory/cf_gcd_smallp.h @ 6caa2a6

spielwiese
Last change on this file since 6caa2a6 was f71453, checked in by Martin Lee <martinlee84@…>, 12 years ago
fix: compilation errors with --enable-assertions
  • Property mode set to 100644
File size: 3.0 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 * @internal
20 * @version \$Id$
21 *
22**/
23//*****************************************************************************
24
25// #include "config.h"
26#include "cf_assert.h"
27
28#include "cf_factory.h"
29
30CanonicalForm GCD_Fp_extension (const CanonicalForm& F, const CanonicalForm& G,
31                  Variable & alpha, CFList& l, bool& top_level);
32
33/// GCD of A and B over \f$ F_{p}(\alpha ) \f$
34static inline CanonicalForm GCD_Fp_extension (const CanonicalForm& A, const CanonicalForm& B,
35                                Variable & alpha)
36{
37  CFList list;
38  bool top_level= true;
39  return GCD_Fp_extension (A, B, alpha, list, top_level);
40}
41
42
43CanonicalForm GCD_small_p (const CanonicalForm& F, const CanonicalForm&  G,
44                           bool& top_level, 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
54CanonicalForm GCD_GF (const CanonicalForm& F, const CanonicalForm& G, CFList& l,
55        bool& top_level);
56
57/// GCD of A and B over GF
58static inline CanonicalForm GCD_GF (const CanonicalForm& A, const CanonicalForm& B)
59{
60  ASSERT (CFFactory::gettype() == GaloisFieldDomain,
61          "GF as base field expected");
62  CFList list;
63  bool top_level= true;
64  return GCD_GF (A, B, list, top_level);
65}
66
67CanonicalForm sparseGCDFp (const CanonicalForm& F, const CanonicalForm& G,
68                           bool& topLevel, CFList& l);
69
70/// Zippel's sparse GCD over Fp
71static inline
72CanonicalForm sparseGCDFp (const CanonicalForm& A, const CanonicalForm& B)
73{
74  ASSERT (CFFactory::gettype() == GaloisFieldDomain, 
75          "GF as base field expected");
76  CFList list;
77  bool topLevel= true;
78  return sparseGCDFp (A, B, topLevel, list);
79}
80
81/// Zippel's sparse GCD over Fq
82CanonicalForm
83sparseGCDFq (const CanonicalForm& F, const CanonicalForm& G,
84             const Variable& alpha, CFList& l, bool& topLevel);
85
86static inline
87CanonicalForm sparseGCDFq (const CanonicalForm& A, const CanonicalForm& B,
88                           const Variable& alpha)
89{
90  CFList list;
91  bool topLevel= true;
92  return sparseGCDFq (A, B, alpha, list, topLevel);
93}
94
95/// extended Zassenhaus GCD
96CanonicalForm
97EZGCD_P (const CanonicalForm& A, const CanonicalForm& B);
98
99CanonicalForm
100randomIrredpoly (int i, const Variable & x) ;
101
102CFArray
103getMonoms (const CanonicalForm& F);
104#endif
Note: See TracBrowser for help on using the repository browser.