comparison base/ResizeableBitset.h @ 550:107d3f3705c9

* Auto-close write-mode matrix files when all columns written
author Chris Cannam
date Thu, 05 Feb 2009 14:17:11 +0000
parents 1469caaa8e67
children 682101331278
comparison
equal deleted inserted replaced
549:388afa99d537 550:107d3f3705c9
69 69
70 void copy(size_t source, size_t dest) { 70 void copy(size_t source, size_t dest) {
71 get(source) ? set(dest) : reset(dest); 71 get(source) ? set(dest) : reset(dest);
72 } 72 }
73 73
74 bool isAllOff() const {
75 for (size_t i = 0; i < m_bits->size(); ++i) {
76 if ((*m_bits)[i]) return false;
77 }
78 return true;
79 }
80
81 bool isAllOn() const {
82 for (size_t i = 0; i + 1 < m_bits->size(); ++i) {
83 if ((*m_bits)[i] != 0xff) return false;
84 }
85 for (size_t i = (m_size / 8) * 8; i < m_size; ++i) {
86 if (!get(i)) return false;
87 }
88 return true;
89 }
90
74 size_t size() const { 91 size_t size() const {
75 return m_size; 92 return m_size;
76 } 93 }
77 94
78 private: 95 private: