10 boost::dynamic_bitset<>
append(
const boost::dynamic_bitset<> &bs1,
const boost::dynamic_bitset<> &bs2) {
11 boost::dynamic_bitset<>
result(bs1.size() + bs2.size());
12 unsigned size1 = bs1.size();
13 for (
unsigned i = 0;
i < size1; ++
i) {
16 for (
unsigned i = 0;
i < bs2.size(); ++
i) {
23 boost::dynamic_bitset<>
ushortToBitset(
const unsigned int numberOfBits,
unsigned short *
buf) {
24 boost::dynamic_bitset<>
result(numberOfBits);
25 for (
unsigned i = 0;
i <
result.size(); ++
i) {
33 for (
unsigned i = 0;
i <
bs.size(); ++
i) {
34 result[
i / 8] = (
bs[
i + 7] << 7) + (
bs[
i + 6] << 6) + (
bs[
i + 5] << 5) + (
bs[
i + 4] << 4) + (
bs[
i + 3] << 3) +
35 (
bs[
i + 2] << 2) + (
bs[
i + 1] << 1) +
bs[
i];
41 constexpr
unsigned int nShorts = 30000;
42 unsigned char words[nShorts * 2];
44 unsigned short *
buf = (
unsigned short *)words;
45 for (
int unsigned i = 0;
i <
bs.size() / 16 &&
i + 3 < nShorts; ++
i) {
boost::dynamic_bitset append(const boost::dynamic_bitset<> &bs1, const boost::dynamic_bitset<> &bs2)
this method takes two bitsets bs1 and bs2 and returns result of bs2 appended to the end of bs1 ...
void printWords(const boost::dynamic_bitset<> &bs)
void bitsetToChar(const boost::dynamic_bitset<> &bs, unsigned char *result)
this method takes bitset obj and returns char * array
this file contains additional dynamic_bitset methods
boost::dynamic_bitset ushortToBitset(const unsigned int numberOfBits, unsigned short *buf)
this method takes numberOfBits bits from unsigned short * array and returns them in the bitset obj...