28        if (r < c) std::swap(r, c);
 
   29        return bitvec::operator[]((r * r + r) / 2 + c);
 
   31    bool operator()(
unsigned r, 
unsigned c)
 const {
 
   32        if (r < c) std::swap(r, c);
 
   33        return bitvec::operator[]((r * r + r) / 2 + c);
 
   35    unsigned size()
 const {
 
   36        if (empty()) 
return 0;
 
   39        while ((r * r + r) / 2 <= m) r++;
 
   44    using bitvec::operator bool;
 
   47    using bitvec::operator|=;
 
   53        rowref(T &s, 
unsigned r) : self(s), row(r) {}
 
   56        rowref(
const rowref &) = 
default;
 
   57        rowref(rowref &&) = 
default;
 
   58        explicit operator bool()
 const {
 
   59            if (row < bits_per_unit) {
 
   60                if (self.getrange((row * row + row) / 2, row + 1) != 0) 
return true;
 
   62                if (self.getslice((row * row + row) / 2, row + 1)) 
return true;
 
   64            const auto size = self.size();
 
   65            for (
auto c = row + 1; c < size; ++c)
 
   66                if (self(row, c)) 
return true;
 
   70            auto rv = self.getslice((row * row + row) / 2, row + 1);
 
   71            const auto size = self.size();
 
   72            for (
auto c = row + 1; c < size; ++c)
 
   73                if (self(row, c)) rv[c] = 1;
 
   77    class nonconst_rowref : 
public rowref<SymBitMatrix> {
 
   81        void operator|=(
bitvec a)
 const {
 
   86        nonconst_bitref operator[](
unsigned col)
 const { 
return self(row, col); }
 
   88    class const_rowref : 
public rowref<const SymBitMatrix> {
 
   92        bool operator[](
unsigned col)
 const { 
return self(row, col); }
 
   96    nonconst_rowref operator[](
unsigned r) { 
return nonconst_rowref(*
this, r); }
 
   97    const_rowref operator[](
unsigned r)
 const { 
return const_rowref(*
this, r); }
 
   99    bool operator==(
const SymBitMatrix &a)
 const { 
return bitvec::operator==(a); }
 
  100    bool operator!=(
const SymBitMatrix &a)
 const { 
return bitvec::operator!=(a); }
 
  101    bool operator|=(
const SymBitMatrix &a) { 
return bitvec::operator|=(a); }