19 return r >= c ? bitvec::operator[]((r * r + r) / 2 + c) : end();
21 bool operator()(
unsigned r,
unsigned c)
const {
22 return r >= c ? bitvec::operator[]((r * r + r) / 2 + c) :
false;
24 unsigned size()
const {
25 if (empty())
return 0;
28 while ((r * r + r) / 2 <= m) r++;
33 using bitvec::operator bool;
41 rowref(T &s,
unsigned r) : self(s), row(r) {}
44 rowref(
const rowref &) =
default;
45 rowref(rowref &&) =
default;
46 explicit operator bool()
const {
47 if (row < bits_per_unit)
48 return self.getrange((row * row + row) / 2, row + 1) != 0;
50 return self.getslice((row * row + row) / 2, row + 1) ? true :
false;
52 operator bitvec()
const {
return self.getslice((row * row + row) / 2, row + 1); }
54 class nonconst_rowref :
public rowref<LTBitMatrix> {
58 void operator|=(bitvec a)
const {
64 nonconst_bitref operator[](
unsigned col)
const {
return self(row, col); }
66 class const_rowref :
public rowref<const LTBitMatrix> {
70 bool operator[](
unsigned col)
const {
return self(row, col); }
74 nonconst_rowref operator[](
unsigned r) {
return nonconst_rowref(*
this, r); }
75 const_rowref operator[](
unsigned r)
const {
return const_rowref(*
this, r); }
77 bool operator==(
const LTBitMatrix &a)
const {
return bitvec::operator==(a); }
78 bool operator!=(
const LTBitMatrix &a)
const {
return bitvec::operator!=(a); }
79 friend bool operator>>(
const char *p,
LTBitMatrix &bm);
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition applyOptionsPragmas.cpp:13