Closed ajrominger closed 1 year ago
the approach currently is that all objects living in R should be 1 indexed and all objects living in Cpp or Python are 0 indexed
currently indSpecies, which contains indices for species should start at 1 while in R and start at 0 while in Cpp. We subtract one in C++ right after indSpecies enters C++ (in roleDataCpp constructor) and add 1 in runRole immediately after the model is run
the edges in the phylo also need to be indexed starting at 1 in R and starting at 0 in Cpp, so we also decrement in C++ in the roleDataCpp constructor and increment the edges by 1 in runRole immediately after the model is run
we may want to do this for tipNames, which contains species indices as strings of the form "t1","t2", etc. but I haven't bothered because tipNames is currently not used at all within Cpp.
all sounds good! as discussed, let's leave tipNames as they are for now. i'm leaving this issue open in case we need to deal with tipNames in the near future
We should just dedicate time to going over indexing once and for all! a few questions:
roleModel
objects are initialized species IDs are indexed starting at 1, is that what we want?