1 | /*****************************************************************************\ |
---|
2 | * Computer Algebra System SINGULAR |
---|
3 | \*****************************************************************************/ |
---|
4 | /** @file ExtensionInfo.h |
---|
5 | * |
---|
6 | * This file provides a class to store information about finite fields and |
---|
7 | * extensions thereof. |
---|
8 | * |
---|
9 | * |
---|
10 | * @author Martin Lee |
---|
11 | * |
---|
12 | **/ |
---|
13 | /*****************************************************************************/ |
---|
14 | |
---|
15 | #ifndef EXTENSION_INFO_H |
---|
16 | #define EXTENSION_INFO_H |
---|
17 | |
---|
18 | // #include "config.h" |
---|
19 | |
---|
20 | #include "canonicalform.h" |
---|
21 | |
---|
22 | /** @class ExtensionInfo ExtensionInfo.h "factory/ExtensionInfo.h" |
---|
23 | * ExtensionInfo contains information about extension. |
---|
24 | * If @a m_extension is true we are in an extension of some initial field. |
---|
25 | * If the initial field is \f$ F_p \f$ and we pass to \f$ F_p (\alpha) \f$ |
---|
26 | * then @a m_alpha is an algebraic variable, @a m_beta= Variable(1), |
---|
27 | * @a m_gamma= @a m_delta= 1, @a m_GFDegree= 0, @a m_GFName= 'Z'. If we pass |
---|
28 | * to some GF (p^k) then @a m_alpha= Variable (1), @a m_beta= Variable(1), |
---|
29 | * @a m_gamma= @a m_delta= 1, @a m_GFDegree= 1, @a m_GFName= 'Z'. |
---|
30 | * @n If the initial field is \f$ F_p (\epsilon) \f$, then @a m_beta= |
---|
31 | * \f$ \epsilon \f$, @a m_alpha an algebraic variable defining an extension of |
---|
32 | * \f$ F_p (\epsilon) \f$, @a m_gamma is a primitive element of |
---|
33 | * \f$ F_p (\alpha) \f$, @a m_delta is a primitive element of |
---|
34 | * \f$ F_p (\beta) \f$, @a m_GFDegree= 0, @a m_GFName= 'Z'. |
---|
35 | * @n If the initial field is GF(p^k), then @a m_alpha= Variable (1), |
---|
36 | * @a m_beta= Variable (1), @a m_gamma= 1, @a m_delta= 1, @a m_GFDegree()= k, |
---|
37 | * @a m_GFName= gf_name of the initial field. |
---|
38 | * @n If @a m_extension is false and the current field is \f$ F_p \f$ then |
---|
39 | * @a m_alpha= Variable (1), @a m_beta= Variable (1), @a m_gamma= 1, |
---|
40 | * @a m_delta= 1, @a m_GFDegree= 1, @a m_GFName= 'Z'. |
---|
41 | * @n If the current field is \f$ F_p (\alpha) \f$ then |
---|
42 | * @a m_alpha is some algebraic variable, @a m_beta= Variable (1), |
---|
43 | * @a m_gamma= 1, @a m_delta= 1, @a m_GFDegree= 0, @a m_GFName= 'Z'. |
---|
44 | * @n If the current field is GF then @a m_alpha= Variable (1), |
---|
45 | * @a m_beta= Variable (1), @a m_gamma= 1, @a m_delta= 1, |
---|
46 | * @a m_GFDegree= getGFDegree(), @a m_GFName= gf_name. |
---|
47 | * |
---|
48 | * @sa facFqBivar.h, facFqFactorize.h |
---|
49 | */ |
---|
50 | class ExtensionInfo |
---|
51 | { |
---|
52 | private: |
---|
53 | /// an algebraic variable or Variable (1) |
---|
54 | Variable m_alpha; |
---|
55 | /// an algebraic variable or Variable (1) |
---|
56 | Variable m_beta; |
---|
57 | /// a primitive element of \f$ F_p (\alpha) \f$ or 1 |
---|
58 | CanonicalForm m_gamma; |
---|
59 | /// a primitive element of \f$ F_p (\beta) \f$ or 1 |
---|
60 | CanonicalForm m_delta; |
---|
61 | /// GF degree or 1 |
---|
62 | int m_GFDegree; |
---|
63 | /// name of GF variable |
---|
64 | char m_GFName; |
---|
65 | /// indicates if we are in an extension of some initial field |
---|
66 | bool m_extension; |
---|
67 | public: |
---|
68 | /// \f$ F_p \f$ as initial field, if @a extension is true we are in some GF |
---|
69 | ExtensionInfo (const bool extension ///< [in] some bool |
---|
70 | ); |
---|
71 | /// Construct an @a ExtensionInfo |
---|
72 | ExtensionInfo (const Variable& alpha, ///< [in] some algebraic variable |
---|
73 | const Variable& beta, ///< [in] some algebraic variable |
---|
74 | const CanonicalForm& gamma, ///< [in] some primitive element |
---|
75 | ///< of \f$ F_p (\alpha) \f$ |
---|
76 | const CanonicalForm& delta, ///< [in] some primitive element |
---|
77 | ///< of \f$ F_p (\beta) \f$ |
---|
78 | const int nGFDegree, ///< [in] GFDegree of initial field |
---|
79 | const char cGFName, ///< [in] name of GF variable of |
---|
80 | ///< initial field |
---|
81 | const bool extension ///< [in] some bool |
---|
82 | ); |
---|
83 | /// \f$ F_p (\beta) \f$ as initial field and switch to an extension given by |
---|
84 | /// @a alpha, needs primitive elements @a gamma and @a delta for maps |
---|
85 | /// between \f$ F_p (\alpha) \subset F_p (\beta) \f$ |
---|
86 | ExtensionInfo (const Variable& alpha, ///< [in] some algebraic variable |
---|
87 | const Variable& beta, ///< [in] some algebraic variable |
---|
88 | const CanonicalForm& gamma, ///< [in] some primitive element |
---|
89 | ///< of \f$ F_p (\alpha) \f$ |
---|
90 | const CanonicalForm& delta ///< [in] some primitive element |
---|
91 | ///< of \f$ F_p (\beta) \f$ |
---|
92 | ); |
---|
93 | /// \f$ F_p (\alpha) \f$ as initial field, if @a extension is false. |
---|
94 | /// Else initial field is \f$ F_p \f$ |
---|
95 | ExtensionInfo (const Variable& alpha, ///< [in] some algebraic variable |
---|
96 | const bool extension ///< [in] some bool |
---|
97 | ); |
---|
98 | |
---|
99 | ExtensionInfo (const Variable& alpha ///< [in] some algebraic variable |
---|
100 | ); |
---|
101 | |
---|
102 | /// GF as initial field |
---|
103 | ExtensionInfo (const int nGFDegree, ///< [in] GF degree of initial field |
---|
104 | const char cGFName, ///< [in] name of GF variable |
---|
105 | const bool extension ///< [in] some bool |
---|
106 | ); |
---|
107 | |
---|
108 | /// getter |
---|
109 | /// |
---|
110 | /// @return @a getAlpha() returns @a m_alpha |
---|
111 | Variable getAlpha () const |
---|
112 | { |
---|
113 | return m_alpha; |
---|
114 | } |
---|
115 | /// getter |
---|
116 | /// |
---|
117 | /// @return @a getBeta() returns @a m_beta |
---|
118 | Variable getBeta () const |
---|
119 | { |
---|
120 | return m_beta; |
---|
121 | } |
---|
122 | /// getter |
---|
123 | /// |
---|
124 | /// @return @a getGamma() returns @a m_gamma |
---|
125 | CanonicalForm getGamma() const |
---|
126 | { |
---|
127 | return m_gamma; |
---|
128 | } |
---|
129 | /// getter |
---|
130 | /// |
---|
131 | /// @return @a getDelta() returns @a m_delta |
---|
132 | CanonicalForm getDelta() const |
---|
133 | { |
---|
134 | return m_delta; |
---|
135 | } |
---|
136 | /// getter |
---|
137 | /// |
---|
138 | /// @return @a getGFDegree() returns @a m_GFDegree |
---|
139 | int getGFDegree() const |
---|
140 | { |
---|
141 | return m_GFDegree; |
---|
142 | } |
---|
143 | /// getter |
---|
144 | /// |
---|
145 | /// @return @a getGFName() returns @a m_GFName |
---|
146 | char getGFName() const |
---|
147 | { |
---|
148 | return m_GFName; |
---|
149 | } |
---|
150 | /// getter |
---|
151 | /// |
---|
152 | /// @return @a isInextension() returns @a m_extension |
---|
153 | bool isInExtension() const |
---|
154 | { |
---|
155 | return m_extension; |
---|
156 | } |
---|
157 | }; |
---|
158 | |
---|
159 | #endif |
---|
160 | /* EXTENSION_INFO_H */ |
---|
161 | |
---|