|
phylopomp
Phylodynamics for POMPs
|
Implementation of the inventory process. More...
#include <inventory.h>

Public Member Functions | |
| inventory_t (void)=default | |
| basic constructor for inventory class | |
| inventory_t (raw_t *o) | |
| constructor from serialized binary form | |
| inventory_t (const inventory_t &)=default | |
| copy constructor | |
| inventory_t (inventory_t &&)=delete | |
| move constructor | |
| inventory_t (const genealogy_t &G) | |
| constructs an inventory from a genealogy | |
| inventory_t & | operator= (const genealogy_t &G) |
| copy an inventory from a genealogy | |
| inventory_t & | operator= (const inventory_t &)=default |
| copy assignment operator | |
| inventory_t & | operator= (inventory_t &&)=delete |
| move assignment operator | |
| ~inventory_t (void) | |
| destructor | |
| size_t | bytesize (void) const |
| size of serialized binary form | |
| size_t | size (void) const |
| size_t | size (name_t i) const |
| size of deme | |
| const pocket_t & | operator[] (const name_t i) const |
return the i-th deme | |
| pocket_t & | operator[] (const name_t i) |
return the i-th deme | |
| void | insert (ball_t *b) |
| void | erase (ball_t *b) |
| bool | empty (void) const |
| are all demes empty? | |
| ball_t * | random_ball (name_t i) const |
choose one random ball from deme i | |
| pocket_t * | random_balls (name_t i, int n=1) const |
choose a random set of n balls from deme i | |
Private Member Functions | |
| void | clean (void) |
| memory cleanup | |
| void | clear (void) |
| memory cleanup | |
| const pocket_t & | inven (const name_t i) const |
access the i-th deme | |
| pocket_t & | inven (const name_t i) |
access the i-th deme | |
Private Attributes | |
| pocket_t | _inven [ndeme] |
Static Private Attributes | |
| static const size_t | ndeme = NDEME |
Friends | |
| raw_t * | operator>> (const inventory_t &I, raw_t *o) |
| binary serialization | |
| raw_t * | operator>> (raw_t *o, inventory_t &I) |
| binary deserialization | |
Implementation of the inventory process.
An inventory consists of an array of demes. Each deme is a set of black balls.
Definition at line 18 of file inventory.h.
|
default |
basic constructor for inventory class

|
inline |
|
default |
copy constructor

|
delete |
move constructor

|
inline |
constructs an inventory from a genealogy
Definition at line 39 of file inventory.h.

|
inline |
|
inline |
size of serialized binary form
Definition at line 84 of file inventory.h.


|
inlineprivate |
memory cleanup
Definition at line 71 of file inventory.h.


|
inlineprivate |
|
inline |
|
inline |
remove a black ball from its deme. this checks the color of the ball. if it is not black, nothing is done.
Definition at line 156 of file inventory.h.

|
inline |
add a black ball to a deme. this checks the color of the ball. if it is not black, nothing is done.
Definition at line 148 of file inventory.h.


|
inlineprivate |
|
inlineprivate |
|
inline |
|
default |
copy assignment operator

|
delete |
move assignment operator

|
inline |
return the i-th deme
Definition at line 126 of file inventory.h.

|
inline |
return the i-th deme
Definition at line 122 of file inventory.h.

|
inline |
choose one random ball from deme i
Definition at line 171 of file inventory.h.


|
inline |
choose a random set of n balls from deme i
Definition at line 180 of file inventory.h.

|
inline |
|
inline |
Total number of balls in an inventory. i.e., the sum of the sizes of all demes
Definition at line 110 of file inventory.h.


|
friend |
|
friend |
|
private |
Definition at line 23 of file inventory.h.
|
staticprivate |
Definition at line 22 of file inventory.h.