17template <
size_t NDEME>
22 const static size_t ndeme = NDEME;
76 for (
size_t i = 0; i <
ndeme; i++)
86 for (
size_t i = 0; i <
ndeme; i++)
92 for (
size_t i = 0; i <
ndeme; i++) {
93 o = (
I._inven[i] >> o);
100 for (
size_t i = 0; i <
ndeme; i++) {
101 o = (o >>
I._inven[i]);
119 return inven(i).size();
166 q = q &&
_inven[i].empty();
176 while (draw-- > 0) k++;
191 while (m <
n && k <
N) {
Balls function as pointers.
name_t deme(void) const
view deme
bool is(color_t c) const
is a given ball of the given color?
size_t ndeme(void) const
number of demes
inventory_t & operator=(const genealogy_t &G)
copy an inventory from a genealogy
const pocket_t & inven(const name_t i) const
access the i-th deme
inventory_t(void)=default
basic constructor for inventory class
void clean(void)
memory cleanup
pocket_t * random_balls(name_t i, int n=1) const
choose a random set of n balls from deme i
size_t size(name_t i) const
size of deme
inventory_t(const inventory_t &)=default
copy constructor
inventory_t(raw_t *o)
constructor from serialized binary form
pocket_t & inven(const name_t i)
access the i-th deme
inventory_t(const genealogy_t &G)
constructs an inventory from a genealogy
size_t bytesize(void) const
size of serialized binary form
inventory_t(inventory_t &&)=delete
move constructor
~inventory_t(void)
destructor
ball_t * random_ball(name_t i) const
choose one random ball from deme i
static const size_t ndeme
void clear(void)
memory cleanup
friend raw_t * operator>>(const inventory_t &I, raw_t *o)
binary serialization
bool empty(void) const
are all demes empty?
const pocket_t & operator[](const name_t i) const
return the i-th deme
Encodes a genealogical node.
A pocket is a set of balls.
static int random_integer(int n)
std::set< ball_t *, ball_order >::const_iterator ball_it