diff options
author | kurtis.heimerl <kurtis.heimerl@19bc5d8c-e614-43d4-8b26-e1612bc8e597> | 2013-05-31 21:47:25 +0000 |
---|---|---|
committer | kurtis.heimerl <kurtis.heimerl@19bc5d8c-e614-43d4-8b26-e1612bc8e597> | 2013-05-31 21:47:25 +0000 |
commit | 5a87247fdf2768a6408e0b87c210cebda85bc996 (patch) | |
tree | b538e7e42f8a7ba6c53e1b0bc22bfb359b1e0ef9 /CommonLibs/BitVector.h | |
parent | bec41039bf2ec07c04a6e8b0b586b085ab9cd74c (diff) |
syncing commonlibs with Many thanks to Michael Iedema for these patches, makes config a lot better.
git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@5655 19bc5d8c-e614-43d4-8b26-e1612bc8e597
Diffstat (limited to 'CommonLibs/BitVector.h')
-rw-r--r-- | CommonLibs/BitVector.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/CommonLibs/BitVector.h b/CommonLibs/BitVector.h index 572e6b4..e244be7 100644 --- a/CommonLibs/BitVector.h +++ b/CommonLibs/BitVector.h @@ -314,6 +314,9 @@ class BitVector : public Vector<char> { void fillFieldReversed(size_t writeIndex, uint64_t value, unsigned length); void writeField(size_t& writeIndex, uint64_t value, unsigned length); void writeFieldReversed(size_t& writeIndex, uint64_t value, unsigned length); + void write0(size_t& writeIndex) { writeField(writeIndex,0,1); } + void write1(size_t& writeIndex) { writeField(writeIndex,1,1); } + //@} /** Sum of bits. */ @@ -333,11 +336,26 @@ class BitVector : public Vector<char> { /** Make a hexdump string. */ void hex(std::ostream&) const; + std::string hexstr() const; /** Unpack from a hexdump string. * @returns true on success, false on error. */ bool unhex(const char*); + void set(BitVector other) // That's right. No ampersand. + { + clear(); + mData=other.mData; + mStart=other.mStart; + mEnd=other.mEnd; + other.mData=NULL; + } + + void settfb(int i, int j) const + { + mStart[i] = j; + } + }; @@ -412,6 +430,11 @@ class SoftVector: public Vector<float> { /** Decode soft symbols with the GSM rate-1/2 Viterbi decoder. */ void decode(ViterbiR2O4 &decoder, BitVector& target) const; + // (pat) How good is the SoftVector in the sense of the bits being solid? + // Result of 1 is perfect and 0 means all the bits were 0.5 + // If plow is non-NULL, also return the lowest energy bit. + float getEnergy(float *low=0) const; + /** Fill with "unknown" values. */ void unknown() { fill(0.5F); } |