[642e65] | 1 | /*! |
---|
| 2 | * \file F5cData.h |
---|
| 3 | * \author Christian Eder |
---|
| 4 | * \date 07/07/2009 |
---|
| 5 | * \version 0.01 |
---|
| 6 | * \brief Declarations of the classes CPair and Rule. |
---|
| 7 | * \details This file contains the declarations of the class \c CPair, representing |
---|
| 8 | * critical pairs, and the class \c Label, representing the labels, in the F5C |
---|
| 9 | * Algorithm. All methods are inlined. |
---|
| 10 | */ |
---|
| 11 | |
---|
[030573] | 12 | #ifndef F5CDATA_HEADER |
---|
| 13 | #define F5CDATA_HEADER |
---|
| 14 | #ifdef HAVE_F5C |
---|
| 15 | |
---|
[642e65] | 16 | /*! |
---|
| 17 | * class definitions of the needed datatypes in the F5C algorithm: |
---|
| 18 | * (a) critical pairs |
---|
| 19 | * (b) labels |
---|
| 20 | */ |
---|
| 21 | class CPair; |
---|
| 22 | class Label; |
---|
[e44367] | 23 | class PolyAndShort; |
---|
[642e65] | 24 | |
---|
| 25 | /*! |
---|
| 26 | * \class CPair |
---|
| 27 | * \author Christian Eder |
---|
| 28 | * \brief This is the data structure of a critical pair in the F5C implementation. |
---|
| 29 | * \details |
---|
| 30 | */ |
---|
| 31 | class CPair { |
---|
| 32 | private: |
---|
| 33 | |
---|
| 34 | public: |
---|
| 35 | |
---|
[e44367] | 36 | }; // end CPair |
---|
[642e65] | 37 | |
---|
| 38 | |
---|
| 39 | /*! |
---|
| 40 | * \class Label |
---|
| 41 | * \author Christian Eder |
---|
| 42 | * \brief This is the data structure of a rule, i.e. a label in the F5C |
---|
| 43 | * Algorithm. |
---|
| 44 | * \details |
---|
| 45 | */ |
---|
| 46 | class Label { |
---|
| 47 | private: |
---|
[4feee0a] | 48 | int* m_pExpVec; |
---|
[e44367] | 49 | unsigned long m_nShortExpVec; |
---|
[642e65] | 50 | public: |
---|
| 51 | /*! |
---|
| 52 | * \fn Label(int* expVec); |
---|
| 53 | * \param[in] expVec The exponent vector of some monomial defining a label |
---|
| 54 | * \brief Constructor of an object of class \c Label |
---|
| 55 | */ |
---|
[4feee0a] | 56 | Label(int* expVec); |
---|
[642e65] | 57 | /*! |
---|
| 58 | * \fn ~Label(); |
---|
| 59 | * \brief Destructor of an object of class \c Label |
---|
| 60 | */ |
---|
| 61 | ~Label(); |
---|
| 62 | /*! |
---|
| 63 | * \fn static inline int getExpVec(); |
---|
| 64 | * \return The first entry of the \c integer vector at the address \c m_pExpVec |
---|
| 65 | * \brief Getter of the \c integer vector at the address \c m_pExpVec |
---|
| 66 | */ |
---|
[4feee0a] | 67 | inline int* getExpVec(); |
---|
[642e65] | 68 | /*! |
---|
| 69 | * \fn static inline long getShortExpVec(); |
---|
| 70 | * \return The short exponent vector \c m_nShortExpVec of the label |
---|
| 71 | * \brief Getter of the \code unsigned long m_nShortExpVec \endcode |
---|
| 72 | * |
---|
| 73 | */ |
---|
[e44367] | 74 | inline unsigned long getShortExpVec(); |
---|
[642e65] | 75 | /*! |
---|
| 76 | * \fn static inline unsigned long computeShortExpVec(int* expVec); |
---|
| 77 | * \param[in] expVec The exponent vector of some monomial defining a label |
---|
| 78 | * \return Short exponent vector of type \code unsigned long \endcode |
---|
| 79 | * \brief Computation of the short exponent vector of type \code unsigned |
---|
| 80 | * long \endcode of the exponent vector \c expVec |
---|
| 81 | * \note This method is originally in polys-impl.cc, in this version here it |
---|
| 82 | * is optimized for the case of working with exponent vectors and not with |
---|
| 83 | * polys as input data. |
---|
| 84 | */ |
---|
[4feee0a] | 85 | unsigned long computeShortExpVec(int* expVec); |
---|
[642e65] | 86 | /*! |
---|
| 87 | * \fn static inline unsigned long getBitFields(int e, unsigned int s, |
---|
| 88 | * unsigned int n); |
---|
| 89 | * \param[in] e Entry of the exponent vector |
---|
| 90 | * \param[in] s Integer smaller than the bitsize of \c long |
---|
| 91 | * \param[in] n Integer representing the number of bits per entry of the |
---|
| 92 | * exponent vector \c expVec |
---|
| 93 | * \return \code unsigned long \endcode the bitfield for the input data |
---|
| 94 | * \brief Computation of the bitfield of type \code unsigned long \endcode |
---|
| 95 | * for an entry \c e of the given exponent vector \c expVec at an iteration |
---|
| 96 | * step where \c s iterates over all \c integers smaller than the bitsize of |
---|
| 97 | * \c long, and \c n iterates over the number of bits per entry of the |
---|
| 98 | * exponent vector \c expVec |
---|
| 99 | * \note This method is originally in polys-impl.cc, in this version here it |
---|
| 100 | * is optimized for the case of working with exponent vectors and not with |
---|
| 101 | * polys as input data. |
---|
| 102 | */ |
---|
[4feee0a] | 103 | unsigned long getBitFields(int e, unsigned int s, unsigned int n); |
---|
[e44367] | 104 | }; // end Label |
---|
| 105 | |
---|
| 106 | /*! |
---|
| 107 | * \class PolyAndShort |
---|
| 108 | * \author Christian Eder |
---|
| 109 | * \brief This is the data structure of a polynomial together with the short |
---|
| 110 | * exponent vector of its leading monomial in F5C |
---|
| 111 | * \details |
---|
| 112 | */ |
---|
| 113 | class PolyAndShort { |
---|
| 114 | private: |
---|
| 115 | poly m_poly; |
---|
| 116 | unsigned long m_nShortExpVec; |
---|
| 117 | public: |
---|
| 118 | /*! |
---|
| 119 | * \fn PolyAndShort(poly p); |
---|
| 120 | * \param[in] p The polynomial to be stored |
---|
| 121 | * \brief Constructor of an object of class \c PolyAndShort |
---|
| 122 | * \details Constructor of an object of class \c PolyAndShort used when |
---|
| 123 | * inserting an element generating the input ideal \c I of the F5C Algorithm |
---|
| 124 | */ |
---|
| 125 | PolyAndShort(poly p); |
---|
| 126 | /*! |
---|
| 127 | * \fn ~Label(); |
---|
| 128 | * \brief Destructor of an object of class \c Label |
---|
| 129 | */ |
---|
| 130 | ~PolyAndShort(); |
---|
| 131 | /*! |
---|
| 132 | * \fn static inline int getExpVec(); |
---|
| 133 | * \return The first entry of the \c integer vector at the address \c m_pExpVec |
---|
| 134 | * \brief Getter of the \c integer vector at the address \c m_pExpVec |
---|
| 135 | */ |
---|
| 136 | inline unsigned int* getExpVec(); |
---|
| 137 | /*! |
---|
| 138 | * \fn static inline long getShortExpVec(); |
---|
| 139 | * \return The short exponent vector \c m_nShortExpVec of the label |
---|
| 140 | * \brief Getter of the \code unsigned long m_nShortExpVec \endcode |
---|
| 141 | * |
---|
| 142 | */ |
---|
[642e65] | 143 | |
---|
[e44367] | 144 | }; // end LPoly |
---|
[4feee0a] | 145 | |
---|
| 146 | |
---|
| 147 | // ---INLINE IMPLEMENTATIONS OF LABEL--- |
---|
| 148 | |
---|
| 149 | // GETTER of class Label |
---|
| 150 | int* Label::getExpVec() { |
---|
| 151 | return m_pExpVec; |
---|
| 152 | } |
---|
| 153 | |
---|
| 154 | unsigned long Label::getShortExpVec() { |
---|
| 155 | return m_nShortExpVec; |
---|
| 156 | } |
---|
| 157 | |
---|
| 158 | |
---|
| 159 | // SETTER of class Label |
---|
| 160 | |
---|
| 161 | // ---END LABEL IMPLEMENTATIONS--- |
---|
| 162 | |
---|
[030573] | 163 | #endif |
---|
[ae625f] | 164 | // HAVE_F5C |
---|
[030573] | 165 | #endif |
---|
[ae625f] | 166 | // F5CDATA_HEADER |
---|