My Project
Loading...
Searching...
No Matches
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$
27static inline
28CanonicalForm 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
40modGCDFp (const CanonicalForm& F, const CanonicalForm& G, bool& top_level,
41 CFList& l);
42
44modGCDFp (const CanonicalForm& F, const CanonicalForm& G,
46 bool& topLevel, CFList& l);
47
48///GCD of A and B over \f$ F_{p} \f$
49static inline
50CanonicalForm 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
59static inline
62{
63 CFList list;
64 bool top_level= true;
65 return modGCDFp (A, B, coA, coB, top_level, list);
66}
67
69modGCDGF (const CanonicalForm& F, const CanonicalForm& G, CFList& l,
70 bool& top_level);
71
72/// GCD of A and B over GF
73static inline
74CanonicalForm 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
89static inline
90CanonicalForm 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
103sparseGCDFq (const CanonicalForm& F, const CanonicalForm& G,
104 const Variable& alpha, CFList& l, bool& topLevel);
105
106/// Zippel's sparse GCD over Fq
107static inline
108CanonicalForm 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
121getMonoms (const CanonicalForm& F ///<[in] some poly
122 );
123
124bool
126 const CanonicalForm& coF, const CanonicalForm& coG,
127 const CanonicalForm& cand);
128
129/// modular GCD over Z
130CanonicalForm modGCDZ (const CanonicalForm & FF, ///<[in] poly over Z
131 const CanonicalForm & GG ///<[in] poly over Z
132 );
133#endif
int l
Definition: cfEzgcd.cc:100
const CanonicalForm CFMap CFMap bool topLevel
Definition: cfGcdAlgExt.cc:57
const CanonicalForm const CanonicalForm const CanonicalForm & coG
Definition: cfModGcd.cc:67
const CanonicalForm const CanonicalForm const CanonicalForm const CanonicalForm & cand
Definition: cfModGcd.cc:69
const CanonicalForm const CanonicalForm & coF
Definition: cfModGcd.cc:67
const CanonicalForm & GG
Definition: cfModGcd.cc:4076
CanonicalForm sparseGCDFq(const CanonicalForm &F, const CanonicalForm &G, const Variable &alpha, CFList &l, bool &topLevel)
Definition: cfModGcd.cc:3130
CFArray getMonoms(const CanonicalForm &F)
extract monomials of F, parts in algebraic variable are considered coefficients
Definition: cfModGcd.cc:1957
CanonicalForm modGCDFq(const CanonicalForm &F, const CanonicalForm &G, Variable &alpha, CFList &l, bool &top_level)
Definition: cfModGcd.cc:462
CanonicalForm modGCDGF(const CanonicalForm &F, const CanonicalForm &G, CFList &l, bool &top_level)
Definition: cfModGcd.cc:858
bool terminationTest(const CanonicalForm &F, const CanonicalForm &G, const CanonicalForm &coF, const CanonicalForm &coG, const CanonicalForm &cand)
CanonicalForm modGCDFp(const CanonicalForm &F, const CanonicalForm &G, bool &top_level, CFList &l)
Definition: cfModGcd.cc:1212
CanonicalForm sparseGCDFp(const CanonicalForm &F, const CanonicalForm &G, bool &topLevel, CFList &l)
Definition: cfModGcd.cc:3562
CanonicalForm modGCDZ(const CanonicalForm &FF, const CanonicalForm &GG)
modular GCD over Z
assertions for Factory
#define ASSERT(expression, message)
Definition: cf_assert.h:99
#define FiniteFieldDomain
Definition: cf_defs.h:19
#define GaloisFieldDomain
Definition: cf_defs.h:18
Interface to generate InternalCF's over various domains from intrinsic types or mpz_t's.
static int gettype()
Definition: cf_factory.h:28
factory's main class
Definition: canonicalform.h:86
factory's class for variables
Definition: variable.h:33
Variable alpha
Definition: facAbsBiFact.cc:51
b *CanonicalForm B
Definition: facBivar.cc:52
STATIC_VAR TreeM * G
Definition: janet.cc:31
#define A
Definition: sirandom.c:24