From 5a87247fdf2768a6408e0b87c210cebda85bc996 Mon Sep 17 00:00:00 2001 From: "kurtis.heimerl" Date: Fri, 31 May 2013 21:47:25 +0000 Subject: 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 --- CommonLibs/BitVector.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'CommonLibs/BitVector.h') 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 { 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 { /** 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 { /** 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); } -- cgit v1.2.3