From de49120e1bc311e45d4bb124271140dc2f4dc5c1 Mon Sep 17 00:00:00 2001 From: jiri Date: Sat, 3 Nov 2018 18:17:13 +0000 Subject: [PATCH] *** empty log message *** --- bitvector.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bitvector.h b/bitvector.h index 70cf352..bbc6e54 100644 --- a/bitvector.h +++ b/bitvector.h @@ -50,10 +50,10 @@ public: void resize(const unsigned int n) {NRVec::resize((n+blockbits-1)/blockbits); modulo=n%blockbits;}; unsigned int size() const {return (nn*blockbits)-blockbits+(modulo?modulo:blockbits);}; //arguments must be unsigned to keep the resulting assembly code simple and efficient - const bool operator[](const unsigned int i) const {return (v[i/blockbits] >>(i%blockbits))&1;}; - void set(const unsigned int i) {v[i/blockbits] |= (1<<(i%blockbits));}; - void reset(const unsigned int i) {v[i/blockbits] &= ~(1<<(i%blockbits));}; - const bool get(const unsigned int i) {return (v[i/blockbits] >>(i%blockbits))&1;}; + const bool operator[](const unsigned int i) const {return (v[i/blockbits] >>(i%blockbits))&1UL;}; + void set(const unsigned int i) {v[i/blockbits] |= (1UL<<(i%blockbits));}; + void reset(const unsigned int i) {v[i/blockbits] &= ~(1UL<<(i%blockbits));}; + const bool get(const unsigned int i) {return (v[i/blockbits] >>(i%blockbits))&1UL;}; const bool assign(const unsigned int i, const bool r) {if(r) set(i); else reset(i); return r;}; void clear() {copyonwrite(true); memset(v,0,nn*sizeof(bitvector_block));}; void fill() {memset(v,0xff,nn*sizeof(bitvector_block));};