barry: Your go-to motif accountant  0.0-1
Full enumeration of sample space and fast count of sufficient statistics for binary arrays
cell-bones.hpp
Go to the documentation of this file.
1 #ifndef BARRY_CELL_BONES_HPP
2 #define BARRY_CELL_BONES_HPP 1
3 
10 template <class Cell_Type > class Cell {
11 public:
12  Cell_Type value;
13  bool visited;
14  bool active;
15  Cell();
16  Cell(Cell_Type value_, bool visited_ = false, bool active_ = true) :
17  value(value_), visited(visited_), active(active_) {};
18  ~Cell() {};
19 
20  // This is an explicit declaration since in other cases it seems
21  // to try to use the move operator, which I do not intent to use.
22  Cell(const Cell<Cell_Type>& arg) :
23  value(arg.value), visited(arg.visited), active(arg.active) {};
24 
25  // Copy by assignment
27 
28  // Move constructor
30  value(std::move(arg.value)),
31  visited(std::move(arg.visited)),
32  active(std::move(arg.active)) {} ;
33 
34  // Move assign operator
36 
37  void add(Cell_Type x);
38 
39  // Casting operator (implicit and explicit)
40  // int x = Cell<int>(1); // returns 1
41  operator Cell_Type() const {return this->value;};
42 
43  bool operator==(const Cell<Cell_Type>& rhs ) const;
44  bool operator!=(const Cell<Cell_Type>& rhs ) const;
45 
46 };
47 
48 #endif
Data_Type & rhs
Entries in BArray. For now, it only has two members:
Definition: cell-bones.hpp:10
~Cell()
Definition: cell-bones.hpp:18
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(const Cell< Cell_Type > &arg)
Definition: cell-bones.hpp:22
Cell(Cell_Type value_, bool visited_=false, bool active_=true)
Definition: cell-bones.hpp:16
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
Cell(Cell< Cell_Type > &&arg) noexcept
Definition: cell-bones.hpp:29
Data_Type &&counter_ noexcept