9(
double *tout,
int *anc,
int *lin,
10 int *sat,
int *type,
int *
deme,
11 int *index,
int *child)
const {
14 for (k = 0,
n = 0, i = begin(); i != end(); i++,
n++) {
31 child[
n] = NA_INTEGER;
35 for (m = 0, j = begin(); j != i; j++, m++) {
45 for (k = 0,
n = 0, i = begin(); i != end(); i++,
n++) {
48 for (m =
n+1; j != end(); m++, j++) {
61 SEXP t0, tout, anc, lin, sat, type,
deme, index, child, ns, nr, nn;
64 PROTECT(t0 = NEW_NUMERIC(1));
65 PROTECT(tout = NEW_NUMERIC(
n+1));
66 PROTECT(type = NEW_INTEGER(
n));
67 PROTECT(
deme = NEW_INTEGER(
n));
68 PROTECT(lin = NEW_INTEGER(
n));
69 PROTECT(sat = NEW_INTEGER(
n));
70 PROTECT(index = NEW_INTEGER(
n));
71 PROTECT(child = NEW_INTEGER(
n));
72 PROTECT(anc = NEW_INTEGER(
n));
73 PROTECT(ns = NEW_INTEGER(1));
74 PROTECT(nr = NEW_INTEGER(1));
75 PROTECT(nn = NEW_INTEGER(1));
76 PROTECT(out = NEW_LIST(12));
77 PROTECT(outn = NEW_CHARACTER(12));
91 gendat(REAL(tout),INTEGER(anc),INTEGER(lin),INTEGER(sat),
92 INTEGER(type),INTEGER(
deme),INTEGER(index),INTEGER(child));
95 *INTEGER(nr) =
nroot();
107 if (*LOGICAL(Obscure)) A.
obscure();
name_t deme(void) const
view deme
size_t nsample(void) const
number of samples
genealogy_t & prune(void)
prune the tree (drop all black balls)
SEXP gendat(void) const
genealogy information in list format
void gendat(double *tout, int *anc, int *lin, int *sat, int *type, int *deme, int *index, int *child) const
genealogy information in list format
slate_t & timezero(void)
view/set zero time.
slate_t & time(void)
view/set current time.
size_t nroot(void) const
number of roots
genealogy_t & obscure(void)
erase all deme information
Encodes a genealogical node.
node_t * parent(void) const
name_t lineage(void) const
view lineage
name_t deme(void) const
view deme
int nchildren(void) const
number of descendants
size_t length(void) const
Number of nodes in the sequence.
void trace_lineages(void)
ball_t * ball(const color_t c) const
retrieve the first ball of the specified color.
bool holds(ball_t *b) const
does this node hold the given ball?
SEXP gendat(SEXP State, SEXP Obscure)
data-frame format
static int set_list_elem(SEXP list, SEXP names, SEXP element, const char *name, int pos)
std::list< node_t * >::const_iterator node_it