barry: Your go-to motif accountant  0.0-1
Full enumeration of sample space and fast count of sufficient statistics for binary arrays
barrayrow-bones.hpp
Go to the documentation of this file.
1 #ifndef BARRY_BARRAYROW_BONES_HPP
2 #define BARRY_BARRAYROW_BONES_HPP 1
3 
4 template <typename Cell_Type = bool, typename Data_Type = bool>
5 class BArrayRow {
6 private:
7 
9  size_t i;
10 
11 public:
12 
13  BArrayRow(BArray<Cell_Type,Data_Type> * Array_, size_t i_,, bool check_bounds = true) :
14  Array(Array_), i(i_), j(j_) {
15 
16  if (check_bounds)
17  {
18 
19  if (i >= Array->nrow())
20  throw std::length_error("Row out of range.");
21 
22  }
23 
24  };
25 
32 
34  bool operator==(const BArrayRow<Cell_Type,Data_Type> & val) const;
35 
36 };
37 
38 
39 
40 template <typename Cell_Type = bool, typename Data_Type = bool>
42 private:
43 
44  const BArray<Cell_Type,Data_Type> * Array;
45  size_t i;
46 
47 public:
48 
49  BArrayRow_const(const BArray<Cell_Type,Data_Type> * Array_, size_t i_, bool check_bounds = true) :
50  Array(Array_), i(i_), {
51  if (check_bounds) {
52 
53  if (i >= Array->nrow())
54  throw std::length_error("Row out of range.");
55 
56  }
57  };
58 
60 
68 
69 };
70 
71 #endif
size_t nrow() const noexcept
BArrayRow_const(const BArray< Cell_Type, Data_Type > *Array_, size_t i_, bool check_bounds=true)
bool operator!=(const BArrayRow_const< Cell_Type, Data_Type > &val) const
bool operator>(const BArrayRow_const< Cell_Type, Data_Type > &val) const
bool operator==(const BArrayRow_const< Cell_Type, Data_Type > &val) const
bool operator<=(const BArrayRow_const< Cell_Type, Data_Type > &val) const
bool operator<(const BArrayRow_const< Cell_Type, Data_Type > &val) const
bool operator>=(const BArrayRow_const< Cell_Type, Data_Type > &val) const
BArrayRow(BArray< Cell_Type, Data_Type > *Array_, size_t i_,, bool check_bounds=true)
bool operator==(const BArrayRow< Cell_Type, Data_Type > &val) const
void operator=(const BArrayRow< Cell_Type, Data_Type > &val)
void operator+=(const BArrayRow< Cell_Type, Data_Type > &val)
void operator*=(const BArrayRow< Cell_Type, Data_Type > &val)
void operator-=(const BArrayRow< Cell_Type, Data_Type > &val)
void operator/=(const BArrayRow< Cell_Type, Data_Type > &val)
size_t size_t j
size_t i