[SCM] polybori: Polynomials over Boolean Rings branch, upstream-hg, updated. b4a5cffaa908c53e1d958a42110f8c4dad853aa3
Alexander Dreyer
adreyer at gmx.de
Fri Mar 23 08:01:41 UTC 2012
The following commit has been merged in the upstream-hg branch:
commit 8a6191f3bd683804c56d255419f7bea96487d981
Author: Alexander Dreyer <adreyer at gmx.de>
Date: Tue Feb 28 14:21:39 2012 +0100
CHA: using enums instead of static constants
diff --git a/groebner/include/polybori/groebner/BitMask.h b/groebner/include/polybori/groebner/BitMask.h
index 17fba84..16997b7 100644
--- a/groebner/include/polybori/groebner/BitMask.h
+++ b/groebner/include/polybori/groebner/BitMask.h
@@ -32,8 +32,7 @@ class BitMask;
template <>
class BitMask<0> {
public:
- static const unsigned nbits = 0;
- static const unsigned long mask = 0;
+ enum { nbits = 0, mask = 0 };
unsigned long low(const unsigned long& value) const { return 0; }
const unsigned long& high(const unsigned long& value) const { return value; }
@@ -45,8 +44,7 @@ public:
template <unsigned NBits>
class BitMask {
public:
- static const unsigned nbits = NBits;
- static const unsigned long mask = (BitMask<nbits-1>::mask << 1) + 1;
+ enum { nbits = NBits, mask = (BitMask<nbits-1>::mask << 1) + 1};
unsigned long low(const unsigned long& value) const {
return value & mask;
@@ -65,8 +63,8 @@ public:
template <>
class BitMask<sizeof(unsigned long)*8> {
public:
- static const unsigned nbits = sizeof(unsigned long)*8;
- static const unsigned long mask = (BitMask<nbits-1>::mask << 1) + 1;
+ enum { nbits = sizeof(unsigned long)*8,
+ mask = (BitMask<nbits-1>::mask << 1) + 1};
const unsigned long& low(const unsigned long& value) const { return value; }
unsigned long high(const unsigned long& value) const { return 0; }
diff --git a/groebner/include/polybori/groebner/NBitsUsed.h b/groebner/include/polybori/groebner/NBitsUsed.h
index 3ec9dc7..b0a1e7f 100644
--- a/groebner/include/polybori/groebner/NBitsUsed.h
+++ b/groebner/include/polybori/groebner/NBitsUsed.h
@@ -30,13 +30,13 @@ BEGIN_NAMESPACE_PBORIGB
template<unsigned long NValue>
class NBitsUsed {
public:
- static const unsigned value = NBitsUsed<(NValue >> 1)>::value + 1;
+ enum { value = NBitsUsed<(NValue >> 1)>::value + 1};
};
template<>
class NBitsUsed<0> {
public:
- static const unsigned value = 0;
+ enum { value = 0};
};
--
polybori: Polynomials over Boolean Rings
More information about the debian-science-commits
mailing list