This header defines the interface for the binary string.
More...
#include <GABinStr.hpp>
|
| GABinaryString (unsigned int s) |
|
void | copy (const GABinaryString &orig) |
| Copy the contents of the bitstream. More...
|
|
int | resize (unsigned int x) |
| Resize the bitstream to the specified number of bits. More...
|
|
int | size () const |
|
short | bit (unsigned int a) const |
|
short | bit (unsigned int a, short val) |
|
bool | equal (const GABinaryString &rhs, unsigned int lhsIdx, unsigned int rhsIdx, unsigned int l) const |
| Are two (subset) bitstreams equal? More...
|
|
void | copy (const GABinaryString &orig, unsigned int destIdx, unsigned int origIdx, unsigned int l) |
|
void | move (unsigned int destIdx, unsigned int sourceIdx, unsigned int l) |
| Copy (sub) bitstream. More...
|
|
void | set (unsigned int a, unsigned int l) |
|
void | unset (unsigned int a, unsigned int l) |
|
void | randomize (unsigned int a, unsigned int l) |
|
void | randomize () |
|
|
std::vector< GABit > | data |
| the data themselves
|
|
This header defines the interface for the binary string.
This is a crude version of a real bitstring object. We don't do real bitstring in the interest of speed and ease of coding this mess up.
- Todo:
- we can get major improvements to speed by inlining functions and getting rid of the error checking... for example, inlining genome and removing the conditional makes it go from 7.5 seconds to 3.2 seconds (bm bl cs 1024 c 0.9)
◆ copy() [1/2]
Copy the contents of the bitstream.
- Parameters
-
◆ copy() [2/2]
void GABinaryString::copy |
( |
const GABinaryString & |
orig, |
|
|
unsigned int |
destIdx, |
|
|
unsigned int |
origIdx, |
|
|
unsigned int |
l |
|
) |
| |
|
inline |
- Parameters
-
orig | Copy from here |
destIdx | Start index of destination to copy |
origIdx | Start index of source from where we copy |
l | length Length of copied bitstream |
◆ equal()
bool GABinaryString::equal |
( |
const GABinaryString & |
rhs, |
|
|
unsigned int |
lhsIdx, |
|
|
unsigned int |
rhsIdx, |
|
|
unsigned int |
l |
|
) |
| const |
|
inline |
Are two (subset) bitstreams equal?
- Parameters
-
rhs | Right hand side bitstream to compare |
lhsIdx | Start index of left hand side bitstream |
rhsIdx | Start index of right hand side bitstream |
l | length of bitstream to compare |
- Returns
- True, if equal
◆ move()
void GABinaryString::move |
( |
unsigned int |
destIdx, |
|
|
unsigned int |
sourceIdx, |
|
|
unsigned int |
l |
|
) |
| |
|
inline |
Copy (sub) bitstream.
- Todo:
- Check, if it is a bug, that it's a copy not a move
- Parameters
-
destIdx | Start index of destination |
sourceIdx | Start index of source |
l | length |
◆ resize()
int GABinaryString::resize |
( |
unsigned int |
x | ) |
|
|
inline |
Resize the bitstream to the specified number of bits.
We return the number of bits actually allocated. The new allocated space not used is set to zeros.
- Parameters
-
- Returns
- the new size
The documentation for this class was generated from the following file: