diff options
author | David Robillard <d@drobilla.net> | 2018-08-11 18:52:20 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2018-09-29 14:46:19 +0200 |
commit | 9ea2c312d7641e60f8955067b2c301151dad5403 (patch) | |
tree | 36521da9d3f5e421ee8bbc4f34cfeb6e421e6b3e | |
parent | 59a618492e083291f50ac47cf2adc88dac33b6ce (diff) | |
download | chilbert-9ea2c312d7641e60f8955067b2c301151dad5403.tar.gz chilbert-9ea2c312d7641e60f8955067b2c301151dad5403.tar.bz2 chilbert-9ea2c312d7641e60f8955067b2c301151dad5403.zip |
Rename fsb() to find_first() to match boost::dynamic_bitset
-rw-r--r-- | chilbert/Algorithm.hpp | 4 | ||||
-rw-r--r-- | chilbert/BigBitVec.hpp | 2 | ||||
-rw-r--r-- | chilbert/FixBitVec.hpp | 2 | ||||
-rw-r--r-- | test/test_fsb.cpp | 2 |
4 files changed, 5 insertions, 5 deletions
diff --git a/chilbert/Algorithm.hpp b/chilbert/Algorithm.hpp index 9d6fd52..d43a42b 100644 --- a/chilbert/Algorithm.hpp +++ b/chilbert/Algorithm.hpp @@ -79,7 +79,7 @@ update1(const I& l, const I& t, const I& w, int n, I& e, int& d) e.flip(d); //#D d == n-1 ? 0 : d+1 ); // Update direction - d += 1 + t.fsb(); + d += 1 + t.find_first(); if (d >= n) { d -= n; } @@ -103,7 +103,7 @@ update2(const I& l, const I& t, const I& w, int n, I& e, int& d) e.flip(d); //#D d == n-1 ? 0 : d+1 ); // Update direction - d += 1 + t.fsb(); + d += 1 + t.find_first(); if (d >= n) { d -= n; } diff --git a/chilbert/BigBitVec.hpp b/chilbert/BigBitVec.hpp index c395b05..1f97039 100644 --- a/chilbert/BigBitVec.hpp +++ b/chilbert/BigBitVec.hpp @@ -409,7 +409,7 @@ public: } /// Return 1 + the index of the first set bit, or 0 if there are none - int fsb() const + int find_first() const { for (int i = 0; i < m_iRacks; ++i) { const int j = ffs(m_pcRacks[i]); diff --git a/chilbert/FixBitVec.hpp b/chilbert/FixBitVec.hpp index a1a415e..2106aa5 100644 --- a/chilbert/FixBitVec.hpp +++ b/chilbert/FixBitVec.hpp @@ -194,7 +194,7 @@ public: bool none() const { return m_rack == 0; } /// Return 1 + the index of the first set bit, or 0 if there are none - int fsb() const { return chilbert::ffs(m_rack); } + int find_first() const { return chilbert::ffs(m_rack); } /// Flip all bits (one's complement) CFixBitVec& flip() diff --git a/test/test_fsb.cpp b/test/test_fsb.cpp index c55d9cb..b059394 100644 --- a/test/test_fsb.cpp +++ b/test/test_fsb.cpp @@ -32,7 +32,7 @@ test_fsb(const T& empty_field) for (int i = 0; i < empty_field.size(); ++i) { T field = empty_field; field.set(i); - assert(field.fsb() == i + 1); + assert(field.find_first() == i + 1); } return 0; |