cfModGcd.h
Go to the documentation of this file.
1 #ifndef CF_MOD_GCD_H
2 #define CF_MOD_GCD_H
3 // -*- c++ -*-
4 //*****************************************************************************
5 /** @file cfModGcd.h
6  *
7  * modular and sparse modular GCD algorithms over finite fields and Z.
8  *
9  * @author Martin Lee
10  * @date 22.10.2009
11  *
12  * @par Copyright:
13  * (c) by The SINGULAR Team, see LICENSE file
14  *
15 **/
16 //*****************************************************************************
17 
18 // #include "config.h"
19 #include "cf_assert.h"
20 
21 #include "cf_factory.h"
22 
24  Variable & alpha, CFList& l, bool& top_level);
25 
26 /// GCD of A and B over \f$ F_{p}(\alpha ) \f$
27 static inline
28 CanonicalForm modGCDFq (const CanonicalForm& A, ///<[in] poly over F_q
29  const CanonicalForm& B, ///<[in] poly over F_q
30  Variable & alpha ///<[in] algebraic variable
31  )
32 {
33  CFList list;
34  bool top_level= true;
35  return modGCDFq (A, B, alpha, list, top_level);
36 }
37 
38 
40 modGCDFp (const CanonicalForm& F, const CanonicalForm& G, bool& top_level,
41  CFList& l);
42 
44 modGCDFp (const CanonicalForm& F, const CanonicalForm& G,
46  bool& topLevel, CFList& l);
47 
48 ///GCD of A and B over \f$ F_{p} \f$
49 static inline
50 CanonicalForm modGCDFp (const CanonicalForm& A, ///<[in] poly over F_p
51  const CanonicalForm& B ///<[in] poly over F_p
52  )
53 {
54  CFList list;
55  bool top_level= true;
56  return modGCDFp (A, B, top_level, list);
57 }
58 
59 static inline
61  CanonicalForm& coA, CanonicalForm& coB)
62 {
63  CFList list;
64  bool top_level= true;
65  return modGCDFp (A, B, coA, coB, top_level, list);
66 }
67 
69 modGCDGF (const CanonicalForm& F, const CanonicalForm& G, CFList& l,
70  bool& top_level);
71 
72 /// GCD of A and B over GF
73 static inline
74 CanonicalForm modGCDGF (const CanonicalForm& A, ///<[in] poly over GF
75  const CanonicalForm& B ///<[in] poly over GF
76  )
77 {
79  "GF as base field expected");
80  CFList list;
81  bool top_level= true;
82  return modGCDGF (A, B, list, top_level);
83 }
84 
86  bool& topLevel, CFList& l);
87 
88 /// Zippel's sparse GCD over Fp
89 static inline
90 CanonicalForm sparseGCDFp (const CanonicalForm& A, ///<[in] poly over F_p
91  const CanonicalForm& B ///<[in] poly over F_p
92  )
93 {
95  "Fp as base field expected");
96  CFList list;
97  bool topLevel= true;
98  return sparseGCDFp (A, B, topLevel, list);
99 }
100 
101 
103 sparseGCDFq (const CanonicalForm& F, const CanonicalForm& G,
104  const Variable& alpha, CFList& l, bool& topLevel);
105 
106 /// Zippel's sparse GCD over Fq
107 static inline
108 CanonicalForm sparseGCDFq (const CanonicalForm& A, ///<[in] poly over F_q
109  const CanonicalForm& B, ///<[in] poly over F_q
110  const Variable& alpha ///<[in] algebraic variable
111  )
112 {
113  CFList list;
114  bool topLevel= true;
115  return sparseGCDFq (A, B, alpha, list, topLevel);
116 }
117 
118 /// extract monomials of F, parts in algebraic variable are considered
119 /// coefficients
120 CFArray
121 getMonoms (const CanonicalForm& F ///<[in] some poly
122  );
123 
124 bool
125 terminationTest (const CanonicalForm& F, const CanonicalForm& G,
126  const CanonicalForm& coF, const CanonicalForm& coG,
127  const CanonicalForm& cand);
128 
129 /// modular GCD over Z
130 CanonicalForm modGCDZ (const CanonicalForm & FF, ///<[in] poly over Z
131  const CanonicalForm & GG ///<[in] poly over Z
132  );
133 #endif
CFArray getMonoms(const CanonicalForm &F)
extract monomials of F, parts in algebraic variable are considered coefficients
Definition: cfModGcd.cc:1898
factory&#39;s class for variables
Definition: factory.h:115
factory&#39;s main class
Definition: canonicalform.h:75
assertions for Factory
const CanonicalForm CFMap CFMap bool topLevel
Definition: cfGcdAlgExt.cc:58
Variable alpha
Definition: facAbsBiFact.cc:52
static TreeM * G
Definition: janet.cc:38
const CanonicalForm & GG
Definition: cfModGcd.cc:4017
CanonicalForm modGCDFp(const CanonicalForm &F, const CanonicalForm &G, bool &top_level, CFList &l)
Definition: cfModGcd.cc:1197
CanonicalForm sparseGCDFq(const CanonicalForm &F, const CanonicalForm &G, const Variable &alpha, CFList &l, bool &topLevel)
Definition: cfModGcd.cc:3071
#define A
Definition: sirandom.c:23
Interface to generate InternalCF&#39;s over various domains from intrinsic types or mpz_t&#39;s.
CanonicalForm modGCDGF(const CanonicalForm &F, const CanonicalForm &G, CFList &l, bool &top_level)
Definition: cfModGcd.cc:846
CanonicalForm sparseGCDFp(const CanonicalForm &F, const CanonicalForm &G, bool &topLevel, CFList &l)
Definition: cfModGcd.cc:3503
CanonicalForm modGCDZ(const CanonicalForm &FF, const CanonicalForm &GG)
modular GCD over Z
static int gettype()
Definition: cf_factory.h:27
b *CanonicalForm B
Definition: facBivar.cc:51
CanonicalForm modGCDFq(const CanonicalForm &F, const CanonicalForm &G, Variable &alpha, CFList &l, bool &top_level)
Definition: cfModGcd.cc:453
#define GaloisFieldDomain
Definition: cf_defs.h:22
const CanonicalForm const CanonicalForm & coF
Definition: cfModGcd.cc:66
#define ASSERT(expression, message)
Definition: cf_assert.h:99
const CanonicalForm const CanonicalForm const CanonicalForm & coG
Definition: cfModGcd.cc:66
bool terminationTest(const CanonicalForm &F, const CanonicalForm &G, const CanonicalForm &coF, const CanonicalForm &coG, const CanonicalForm &cand)
int l
Definition: cfEzgcd.cc:94
const CanonicalForm const CanonicalForm const CanonicalForm const CanonicalForm & cand
Definition: cfModGcd.cc:69
#define FiniteFieldDomain
Definition: cf_defs.h:23