[7bf145] | 1 | /*****************************************************************************\ |
---|
[806c18] | 2 | * Computer Algebra System SINGULAR |
---|
[7bf145] | 3 | \*****************************************************************************/ |
---|
| 4 | /** @file ExtensionInfo.h |
---|
[806c18] | 5 | * |
---|
[7bf145] | 6 | * This file provides a class to store information about finite fields and |
---|
[806c18] | 7 | * extensions thereof. |
---|
| 8 | * |
---|
[7bf145] | 9 | * |
---|
| 10 | * @author Martin Lee |
---|
| 11 | * |
---|
| 12 | **/ |
---|
| 13 | /*****************************************************************************/ |
---|
| 14 | |
---|
| 15 | #ifndef EXTENSION_INFO_H |
---|
| 16 | #define EXTENSION_INFO_H |
---|
| 17 | |
---|
[e4fe2b] | 18 | // #include "config.h" |
---|
[7bf145] | 19 | |
---|
| 20 | #include "canonicalform.h" |
---|
| 21 | |
---|
| 22 | /** @class ExtensionInfo ExtensionInfo.h "factory/ExtensionInfo.h" |
---|
[806c18] | 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), |
---|
[7bf145] | 27 | * @a m_gamma= @a m_delta= 1, @a m_GFDegree= 0, @a m_GFName= 'Z'. If we pass |
---|
[806c18] | 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, |
---|
[7bf145] | 46 | * @a m_GFDegree= getGFDegree(), @a m_GFName= gf_name. |
---|
| 47 | * |
---|
[806c18] | 48 | * @sa facFqBivar.h, facFqFactorize.h |
---|
[7bf145] | 49 | */ |
---|
| 50 | class ExtensionInfo |
---|
| 51 | { |
---|
| 52 | private: |
---|
[806c18] | 53 | /// an algebraic variable or Variable (1) |
---|
[7bf145] | 54 | Variable m_alpha; |
---|
| 55 | /// an algebraic variable or Variable (1) |
---|
[806c18] | 56 | Variable m_beta; |
---|
[7bf145] | 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 |
---|
[806c18] | 69 | ExtensionInfo (const bool extension ///< [in] some bool |
---|
[7bf145] | 70 | ); |
---|
[806c18] | 71 | /// Construct an @a ExtensionInfo |
---|
| 72 | ExtensionInfo (const Variable& alpha, ///< [in] some algebraic variable |
---|
[7bf145] | 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 |
---|
[806c18] | 85 | /// between \f$ F_p (\alpha) \subset F_p (\beta) \f$ |
---|
[7bf145] | 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. |
---|
[806c18] | 94 | /// Else initial field is \f$ F_p \f$ |
---|
[7bf145] | 95 | ExtensionInfo (const Variable& alpha, ///< [in] some algebraic variable |
---|
| 96 | const bool extension ///< [in] some bool |
---|
| 97 | ); |
---|
[806c18] | 98 | |
---|
[7c3bca] | 99 | ExtensionInfo (const Variable& alpha ///< [in] some algebraic variable |
---|
| 100 | ); |
---|
[806c18] | 101 | |
---|
[7bf145] | 102 | /// GF as initial field |
---|
[806c18] | 103 | ExtensionInfo (const int nGFDegree, ///< [in] GF degree of initial field |
---|
| 104 | const char cGFName, ///< [in] name of GF variable |
---|
[7bf145] | 105 | const bool extension ///< [in] some bool |
---|
[806c18] | 106 | ); |
---|
[7bf145] | 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 | |
---|