28 return r >= c ? bitvec::operator[]((r * r + r) / 2 + c) : end();
30 bool operator()(
unsigned r,
unsigned c)
const {
31 return r >= c ? bitvec::operator[]((r * r + r) / 2 + c) :
false;
33 unsigned size()
const {
34 if (empty())
return 0;
37 while ((r * r + r) / 2 <= m) r++;
42 using bitvec::operator bool;
50 rowref(T &s,
unsigned r) : self(s), row(r) {}
53 rowref(
const rowref &) =
default;
54 rowref(rowref &&) =
default;
55 explicit operator bool()
const {
56 if (row < bits_per_unit)
57 return self.getrange((row * row + row) / 2, row + 1) != 0;
59 return self.getslice((row * row + row) / 2, row + 1) ? true :
false;
61 operator bitvec()
const {
return self.getslice((row * row + row) / 2, row + 1); }
63 class nonconst_rowref :
public rowref<LTBitMatrix> {
67 void operator|=(
bitvec a)
const {
73 nonconst_bitref operator[](
unsigned col)
const {
return self(row, col); }
75 class const_rowref :
public rowref<const LTBitMatrix> {
79 bool operator[](
unsigned col)
const {
return self(row, col); }
83 nonconst_rowref operator[](
unsigned r) {
return nonconst_rowref(*
this, r); }
84 const_rowref operator[](
unsigned r)
const {
return const_rowref(*
this, r); }
86 bool operator==(
const LTBitMatrix &a)
const {
return bitvec::operator==(a); }
87 bool operator!=(
const LTBitMatrix &a)
const {
return bitvec::operator!=(a); }
88 friend bool operator>>(
const char *p,
LTBitMatrix &bm);
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition applyOptionsPragmas.cpp:24