aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Hilbert/Algorithm.hpp26
-rw-r--r--Hilbert/BigBitVec.hpp60
-rw-r--r--Hilbert/FixBitVec.hpp16
-rw-r--r--Hilbert/GetBits.hpp2
-rw-r--r--Hilbert/GetLocation.hpp2
-rw-r--r--Hilbert/GrayCodeRank.hpp10
-rw-r--r--Hilbert/SetBits.hpp2
-rw-r--r--Hilbert/SetLocation.hpp2
8 files changed, 60 insertions, 60 deletions
diff --git a/Hilbert/Algorithm.hpp b/Hilbert/Algorithm.hpp
index b2ad5f8..bcc3b55 100644
--- a/Hilbert/Algorithm.hpp
+++ b/Hilbert/Algorithm.hpp
@@ -101,7 +101,7 @@ namespace Hilbert
{
assert( 0 <= d && d < n );
e = l;
- e.toggleBit( d ); //#D d == n-1 ? 0 : d+1 );
+ e.toggle( d ); //#D d == n-1 ? 0 : d+1 );
// Update direction
d += 1 + t.fsb();
@@ -110,7 +110,7 @@ namespace Hilbert
assert( 0 <= d && d < n );
if ( ! (w.rack() & 1) )
- e.toggleBit( d == 0 ? n-1 : d-1 ); //#D d );
+ e.toggle( d == 0 ? n-1 : d-1 ); //#D d );
return;
}
@@ -130,7 +130,7 @@ namespace Hilbert
{
assert( 0 <= d && d < n );
e = l;
- e.toggleBit( d );//#D d == n-1 ? 0 : d+1 );
+ e.toggle( d );//#D d == n-1 ? 0 : d+1 );
// Update direction
d += 1 + t.fsb();
@@ -157,10 +157,10 @@ namespace Hilbert
int ho = m*n;
// Initialize
- e.zero();
+ e.reset();
d = D0;
- l.zero();
- h.zero();
+ l.reset();
+ h.reset();
int r, b;
BBV_MODSPLIT(r,b,n-1);
@@ -238,11 +238,11 @@ namespace Hilbert
int d, i, j, ho;
// Initialize
- e.zero();
+ e.reset();
d = D0;
- l.zero();
+ l.reset();
for ( j = 0; j < n; j++ )
- p[j].zero();
+ p[j].reset();
ho = m*n;
@@ -408,11 +408,11 @@ namespace Hilbert
}
// Initialize
- e.zero();
+ e.reset();
d = D0;
- l.zero();
+ l.reset();
for ( j = 0; j < n; j++ )
- p[j].zero();
+ p[j].reset();
// Work from MSB to LSB
for ( i = m-1; i >= 0; i-- )
@@ -424,7 +424,7 @@ namespace Hilbert
// Get the Hilbert index bits
M -= b;
- r.zero(); // GetBits doesn't do this
+ r.reset(); // GetBits doesn't do this
getBits<HC,I>(hc,b,M,r);
// w = GrayCodeRankInv(r)
diff --git a/Hilbert/BigBitVec.hpp b/Hilbert/BigBitVec.hpp
index 24f84a2..8f7c485 100644
--- a/Hilbert/BigBitVec.hpp
+++ b/Hilbert/BigBitVec.hpp
@@ -118,7 +118,7 @@ public:
// Returns the current size in bits.
int
- getSize() const
+ size() const
{
return m_iRacks*FBV_BITS;
}
@@ -155,7 +155,7 @@ public:
// zero the new values
/*for ( ; i < iRacks; i++ )
- pcRacks[i].zero();*/
+ pcRacks[i].reset();*/
if ( iRacks > i )
memset( static_cast<void*>(pcRacks + i), 0,
sizeof(CFixBitVec)*(iRacks-i) );
@@ -173,12 +173,12 @@ public:
// zeros the bit-vector.
CBigBitVec &
- zero()
+ reset()
{
/*int i;
for ( i = 0; i < m_iRacks; i++ )
- m_pcRacks[i].zero();*/
+ m_pcRacks[i].reset();*/
memset( static_cast<void*>(m_pcRacks), 0,
sizeof(CFixBitVec)*m_iRacks );
@@ -193,7 +193,7 @@ public:
int iBits
)
{
- assert( iBits >= 0 && iBits <= getSize() );
+ assert( iBits >= 0 && iBits <= size() );
int r, b, i;
BBV_MODSPLIT(r,b,iBits);
@@ -204,7 +204,7 @@ public:
m_pcRacks[r].truncate(b);
for ( i = r+1; i < m_iRacks; i++ )
- m_pcRacks[i].zero();
+ m_pcRacks[i].reset();
return (*this);
}
@@ -231,7 +231,7 @@ public:
for ( i = 0; i < cBBV.m_iRacks; i++ )
m_pcRacks[i] = cBBV.m_pcRacks[i];
for ( ; i < m_iRacks; i++ )
- m_pcRacks[i].zero();*/
+ m_pcRacks[i].reset();*/
if (m_pcRacks) {
if (cBBV.m_pcRacks) {
memcpy( static_cast<void*>(m_pcRacks),
@@ -267,7 +267,7 @@ public:
m_pcRacks[0] = cFBV;
/*int i;
for ( i = 1; i < m_iRacks; i++ )
- m_pcRacks[i].zero();*/
+ m_pcRacks[i].reset();*/
memset( static_cast<void*>(m_pcRacks+1),
0, sizeof(CFixBitVec)*(m_iRacks-1) );
return (*this);
@@ -280,7 +280,7 @@ public:
m_pcRacks[0] = j;
/*int i;
for ( i = 1; i < m_iRacks; i++ )
- m_pcRacks[i].zero();*/
+ m_pcRacks[i].reset();*/
memset( static_cast<void*>(m_pcRacks+1),
0, sizeof(CFixBitVec)*(m_iRacks-1) );
return (*this);
@@ -288,42 +288,42 @@ public:
// Returns the value of the nth bit.
bool
- getBit(
+ test(
int iIndex
) const
{
- assert( iIndex >= 0 && iIndex < getSize() );
+ assert( iIndex >= 0 && iIndex < size() );
int r, b;
BBV_MODSPLIT(r,b,iIndex);
- return m_pcRacks[r].getBit(b);
+ return m_pcRacks[r].test(b);
}
// Sets the value of the nth bit.
CBigBitVec &
- setBit(
+ set(
int iIndex,
- bool bBit
+ bool bBit = true
)
{
- assert( iIndex >= 0 && iIndex < getSize() );
+ assert( iIndex >= 0 && iIndex < size() );
int r, b;
BBV_MODSPLIT(r,b,iIndex);
- m_pcRacks[r].setBit(b,bBit);
+ m_pcRacks[r].set(b,bBit);
return (*this);
}
// Toggles the value of the nth bit.
CBigBitVec &
- toggleBit(
+ toggle(
int iIndex
)
{
- assert( iIndex >= 0 && iIndex < getSize() );
+ assert( iIndex >= 0 && iIndex < size() );
int r, b;
BBV_MODSPLIT(r,b,iIndex);
- m_pcRacks[r].toggleBit(b);
+ m_pcRacks[r].toggle(b);
return (*this);
}
@@ -538,7 +538,7 @@ public:
// All racks?
if ( r >= m_iRacks )
{
- zero();
+ reset();
return (*this);
}
@@ -548,7 +548,7 @@ public:
for ( i = m_iRacks-1; i >= r; i-- )
m_pcRacks[i] = m_pcRacks[i-r];
for ( ; i >= 0; i-- )
- m_pcRacks[i].zero();
+ m_pcRacks[i].reset();
}
// Do bit shifts.
@@ -597,7 +597,7 @@ public:
// All racks?
if ( r >= m_iRacks )
{
- zero();
+ reset();
return (*this);
}
@@ -607,7 +607,7 @@ public:
for ( i = 0; i < m_iRacks-r; i++ )
m_pcRacks[i] = m_pcRacks[i+r];
for ( ; i < m_iRacks; i++ )
- m_pcRacks[i].zero();
+ m_pcRacks[i].reset();
}
// Do bit shifts.
@@ -649,7 +649,7 @@ public:
// Fill in the width, if necessary.
if ( iWidth <= 0 )
- iWidth = getSize();
+ iWidth = size();
// Modulo the number of bits.
//FBVMOD(iBits,iWidth);
@@ -694,7 +694,7 @@ public:
// Fill in the width, if necessary.
if ( iWidth <= 0 )
- iWidth = getSize();
+ iWidth = size();
// Modulo the number of bits.
//FBVMOD(iBits,iWidth);
@@ -730,11 +730,11 @@ public:
// Returns true if the rack is zero valued.
bool
- isZero() const
+ none() const
{
int i;
for ( i = 0; i < m_iRacks; i++ )
- if ( !m_pcRacks[i].isZero() ) return false;
+ if ( !m_pcRacks[i].none() ) return false;
return true;
}
@@ -835,7 +835,7 @@ public:
for ( i = m_iRacks-1; i >= 0; i-- )
{
m_pcRacks[i].grayCodeInv();
- if ( s ) m_pcRacks[i].complement();
+ if ( s ) m_pcRacks[i].flip();
s = m_pcRacks[i].rack() & 1;
}
return (*this);
@@ -844,11 +844,11 @@ public:
// Complement
CBigBitVec &
- complement()
+ flip()
{
int i;
for ( i = 0; i < m_iRacks; i++ )
- m_pcRacks[i].complement();
+ m_pcRacks[i].flip();
return (*this);
}
diff --git a/Hilbert/FixBitVec.hpp b/Hilbert/FixBitVec.hpp
index 84015cf..0efd889 100644
--- a/Hilbert/FixBitVec.hpp
+++ b/Hilbert/FixBitVec.hpp
@@ -77,7 +77,7 @@ public:
// Returns the current size in bits.
int
- getSize()
+ size()
{
return FBV_BITS;
}
@@ -94,7 +94,7 @@ public:
// Zeros the bit-vector.
CFixBitVec &
- zero()
+ reset()
{
m_uiRack = 0;
return (*this);
@@ -134,7 +134,7 @@ public:
// Returns the value of the nth bit.
bool
- getBit(
+ test(
int iIndex
) const
{
@@ -144,9 +144,9 @@ public:
// Sets the value of the nth bit.
CFixBitVec &
- setBit(
+ set(
int iIndex,
- bool bBit
+ bool bBit = true
)
{
assert( 0 <= iIndex && iIndex < FBV_BITS );
@@ -158,7 +158,7 @@ public:
// Toggles the value of the nth bit.
CFixBitVec &
- toggleBit(
+ toggle(
int iIndex
)
{
@@ -382,7 +382,7 @@ public:
// Is the bit rack zero valued?
bool
- isZero() const
+ none() const
{
return m_uiRack == 0;
}
@@ -485,7 +485,7 @@ public:
// Ones-complements the rack
CFixBitVec &
- complement()
+ flip()
{
m_uiRack = ~m_uiRack;
return (*this);
diff --git a/Hilbert/GetBits.hpp b/Hilbert/GetBits.hpp
index 119ace9..862eae3 100644
--- a/Hilbert/GetBits.hpp
+++ b/Hilbert/GetBits.hpp
@@ -39,7 +39,7 @@ namespace Hilbert
// This is terribly inefficient.
int j;
for ( j = 0; j < n; j++ )
- w.setBit(j,h.getBit(i+j));
+ w.set(j,h.test(i+j));
return;
}
diff --git a/Hilbert/GetLocation.hpp b/Hilbert/GetLocation.hpp
index 99ea7ba..c0d6781 100644
--- a/Hilbert/GetLocation.hpp
+++ b/Hilbert/GetLocation.hpp
@@ -79,7 +79,7 @@ namespace Hilbert
{
/*int j;
for ( j = n-1; j >= 0; --j )
- l.setBit(j,p[j].getBit(i));
+ l.set(j,p[j].test(i));
return;*/
int j, jo, ir;
diff --git a/Hilbert/GrayCodeRank.hpp b/Hilbert/GrayCodeRank.hpp
index 33ea9f4..1165598 100644
--- a/Hilbert/GrayCodeRank.hpp
+++ b/Hilbert/GrayCodeRank.hpp
@@ -45,7 +45,7 @@ namespace Hilbert
int i, j, hr, hcr;
FBV_UINT hm, hcm;
- hc.zero();
+ hc.reset();
hr = hcr = 0;
hm = hcm = 1;
@@ -124,7 +124,7 @@ namespace Hilbert
I &r
)
{
- r.zero();
+ r.reset();
int i, ir, jr;
FBV_UINT im, jm;
@@ -159,8 +159,8 @@ namespace Hilbert
I &gi
)
{
- g.zero();
- gi.zero();
+ g.reset();
+ gi.reset();
int i, j, ir, jr;
FBV_UINT im, jm;
@@ -220,7 +220,7 @@ namespace Hilbert
int j, jr;
FBV_UINT jm;
- mask.zero();
+ mask.reset();
b = 0;
jm = 1; jr = 0;
diff --git a/Hilbert/SetBits.hpp b/Hilbert/SetBits.hpp
index 87f19cb..1dc9857 100644
--- a/Hilbert/SetBits.hpp
+++ b/Hilbert/SetBits.hpp
@@ -40,7 +40,7 @@ namespace Hilbert
// This is terribly inefficient.
int j;
for ( j = 0; j < n; j++ )
- h.setBit(i+j,w.getBit(j));
+ h.set(i+j,w.test(j));
}
diff --git a/Hilbert/SetLocation.hpp b/Hilbert/SetLocation.hpp
index d7b5099..d3f6130 100644
--- a/Hilbert/SetLocation.hpp
+++ b/Hilbert/SetLocation.hpp
@@ -39,7 +39,7 @@ namespace Hilbert
// Easy to understand implementation
/*int j;
for ( j = 0; j < n; j++ )
- p[j].setBit(i,l.getBit(j));
+ p[j].set(i,l.test(j));
return;*/
// Much faster loop-unrolled implementation.