phylopomp
Phylodynamics for POMPs
Loading...
Searching...
No Matches
curtail.cc File Reference
#include "genealogy.h"
#include "generics.h"
#include "internal.h"
Include dependency graph for curtail.cc:

Go to the source code of this file.

Functions

SEXP curtail (SEXP State, SEXP Time, SEXP Troot)
 curtail the given genealogy
 

Function Documentation

◆ curtail()

SEXP curtail ( SEXP State,
SEXP Time,
SEXP Troot )

curtail the given genealogy

Definition at line 88 of file curtail.cc.

88 {
89 genealogy_t A = State;
90 double t, t0;
91 t = *REAL(AS_NUMERIC(Time));
92 t0 = *REAL(AS_NUMERIC(Troot));
93 if (ISNA(t)) t = A.time();
94 if (ISNA(t0)) t0 = A.timezero();
95 A.curtail(t,t0);
96 SEXP out;
97 PROTECT(out = serial(A));
98 SET_ATTR(out,install("class"),mkString("gpgen"));
99 UNPROTECT(1);
100 return out;
101 }
Encodes a genealogy.
Definition genealogy.h:19
slate_t & timezero(void)
view/set zero time.
Definition genealogy.h:153
slate_t & time(void)
view/set current time.
Definition genealogy.h:145
void curtail(slate_t tnew, slate_t troot)
Definition curtail.cc:11
SEXP serial(const TYPE &X)
binary serialization
Definition generics.h:33
Here is the call graph for this function:
Here is the caller graph for this function: