source: git/factory/cf_gcd_smallp.h @ d67fcad

spielwiese
Last change on this file since d67fcad was e4fe2b, checked in by Oleksandr Motsak <motsak@…>, 13 years ago
FIX: Fixed huge BUG in cf_gmp.h CHG: starting to cleanup factory
  • 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
28CanonicalForm GCD_Fp_extension (const CanonicalForm& F, const CanonicalForm& G,
29                  Variable & alpha, CFList& l, bool& top_level);
30
31/// GCD of A and B over \f$ F_{p}(\alpha ) \f$
32static inline CanonicalForm GCD_Fp_extension (const CanonicalForm& A, const CanonicalForm& B,
33                                Variable & alpha)
34{
35  CFList list;
36  bool top_level= true;
37  return GCD_Fp_extension (A, B, alpha, list, top_level);
38}
39
40
41CanonicalForm GCD_small_p (const CanonicalForm& F, const CanonicalForm&  G,
42                           bool& top_level, CFList& l);
43
44///GCD of A and B over \f$ F_{p} \f$
45static inline CanonicalForm GCD_small_p (const CanonicalForm& A, const CanonicalForm& B)
46{
47  CFList list;
48  bool top_level= true;
49  return GCD_small_p (A, B, top_level, list);
50}
51
52CanonicalForm GCD_GF (const CanonicalForm& F, const CanonicalForm& G, CFList& l,
53        bool& top_level);
54
55/// GCD of A and B over GF
56static inline CanonicalForm GCD_GF (const CanonicalForm& A, const CanonicalForm& B)
57{
58  ASSERT (CFFactory::gettype() == GaloisFieldDomain,
59          "GF as base field expected");
60  CFList list;
61  bool top_level= true;
62  return GCD_GF (A, B, list, top_level);
63}
64
65CanonicalForm sparseGCDFp (const CanonicalForm& F, const CanonicalForm& G,
66                           bool& topLevel, CFList& l);
67
68/// Zippel's sparse GCD over Fp
69static inline
70CanonicalForm sparseGCDFp (const CanonicalForm& A, const CanonicalForm& B)
71{
72  ASSERT (CFFactory::gettype() == GaloisFieldDomain, 
73          "GF as base field expected");
74  CFList list;
75  bool topLevel= true;
76  return sparseGCDFp (A, B, topLevel, list);
77}
78
79/// Zippel's sparse GCD over Fq
80CanonicalForm
81sparseGCDFq (const CanonicalForm& F, const CanonicalForm& G,
82             const Variable& alpha, CFList& l, bool& topLevel);
83
84static inline
85CanonicalForm sparseGCDFq (const CanonicalForm& A, const CanonicalForm& B,
86                           const Variable& alpha)
87{
88  CFList list;
89  bool topLevel= true;
90  return sparseGCDFq (A, B, alpha, list, topLevel);
91}
92
93/// extended Zassenhaus GCD
94CanonicalForm
95EZGCD_P (const CanonicalForm& A, const CanonicalForm& B);
96
97CanonicalForm
98randomIrredpoly (int i, const Variable & x) ;
99#endif
Note: See TracBrowser for help on using the repository browser.