source: git/factory/cfModGcd.h @ 91695f

spielwiese
Last change on this file since 91695f was 91695f, checked in by Martin Lee <martinlee84@…>, 10 years ago
more docu in cfModGcd.h
  • Property mode set to 100644
File size: 3.9 KB
Line 
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
23CanonicalForm modGCDFq (const CanonicalForm& F, const CanonicalForm& G,
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
39CanonicalForm
40modGCDFp (const CanonicalForm& F, const CanonicalForm& G, bool& top_level,
41          CFList& l);
42
43CanonicalForm
44modGCDFp (const CanonicalForm& F, const CanonicalForm& G,
45          CanonicalForm& coF, CanonicalForm& coG,
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
60CanonicalForm modGCDFp (const CanonicalForm& A, const CanonicalForm& B,
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
68CanonicalForm
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{
78  ASSERT (CFFactory::gettype() == GaloisFieldDomain,
79          "GF as base field expected");
80  CFList list;
81  bool top_level= true;
82  return modGCDGF (A, B, list, top_level);
83}
84
85CanonicalForm sparseGCDFp (const CanonicalForm& F, const CanonicalForm& G,
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{
94  ASSERT (CFFactory::gettype() == FiniteFieldDomain,
95          "Fp as base field expected");
96  CFList list;
97  bool topLevel= true;
98  return sparseGCDFp (A, B, topLevel, list);
99}
100
101
102CanonicalForm
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
120CFArray
121getMonoms (const CanonicalForm& F ///<[in] some poly
122          );
123
124bool
125terminationTest (const CanonicalForm& F, const CanonicalForm& G,
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
Note: See TracBrowser for help on using the repository browser.