barry: Your go-to motif accountant  0.0-1
Full enumeration of sample space and fast count of sufficient statistics for binary arrays
cell-meat.hpp
Go to the documentation of this file.
1 #ifndef BARRY_CELL_MEAT_HPP
2 #define BARRY_CELL_MEAT_HPP 1
3 
4 template <typename Cell_Type>
6  this->value = other.value;
7  this->visited = other.visited;
8  this->active = other.active;
9  return *this;
10 }
11 
12 template <typename Cell_Type>
14  this->value = std::move(other.value);
15  this->visited = std::move(other.visited);
16  this->active = std::move(other.active);
17  return *this;
18 }
19 
20 template<typename Cell_Type>
22 
23  if (this == *rhs)
24  return true;
25 
26  return this->value == rhs.value;
27 
28 }
29 
30 template<typename Cell_Type>
32 
33  return !this->operator==(rhs);
34 
35 }
36 
37 
38 /***
39  * Specializations
40  */
41 
42 template <> inline void Cell<double>::add(double x) {
43  value += x;
44  return;
45 }
46 
47 template <> inline void Cell<size_t>::add(size_t x) {
48  value += x;
49  return;
50 }
51 
52 template <> inline void Cell<int>::add(int x) {
53  value += x;
54  return;
55 }
56 
57 template <> inline void Cell<bool>::add(bool x) {
58  value = true;
59  return;
60 }
61 
62 template<> inline Cell< double >::Cell() : value(1.0), visited(false), active(true) {}
63 template<> inline Cell< size_t >::Cell() : value(1u), visited(false), active(true) {}
64 template<> inline Cell< int >::Cell() : value(1), visited(false), active(true) {}
65 template<> inline Cell< bool >::Cell() : value(true), visited(false), active(true) {}
66 
67 #endif
Data_Type & rhs
Entries in BArray. For now, it only has two members:
Definition: cell-bones.hpp:10
bool visited
Definition: cell-bones.hpp:13
bool operator!=(const Cell< Cell_Type > &rhs) const
Definition: cell-meat.hpp:31
void add(Cell_Type x)
Cell_Type value
Definition: cell-bones.hpp:12
Cell< Cell_Type > & operator=(const Cell< Cell_Type > &other)
Definition: cell-meat.hpp:5
bool active
Definition: cell-bones.hpp:14
bool operator==(const Cell< Cell_Type > &rhs) const
Definition: cell-meat.hpp:21
Data_Type &&counter_ noexcept