After a lot of work with fwdpp::ts, the only reasons a mutation vector is passed to tree sequence functions is to access the pos or neutral fields of a mutation. Since these fields represent the minimal API requirements for a mutation, they should be added as fields to fwdpp::ts::mutation_record.
This change would simplify the API but break serialization. The latter point would be solved with a mock struct mimicking the current mutation_record and setting the new fields to "NULL" values upon deserialization.
An additional plus is that locality of reference would improve for several operations on mutation tables, but the performance improvement may not be noticeable as these ops are already quite fast.
We can handle the change in serialization format semi-gracefully by only populating the key field and setting derived_state=1. After deserializing, other fields can be filled in by user code.
After a lot of work with
fwdpp::ts
, the only reasons a mutation vector is passed to tree sequence functions is to access thepos
orneutral
fields of a mutation. Since these fields represent the minimal API requirements for a mutation, they should be added as fields tofwdpp::ts::mutation_record
.This change would simplify the API but break serialization. The latter point would be solved with a mock struct mimicking the current
mutation_record
and setting the new fields to "NULL" values upon deserialization.An additional plus is that locality of reference would improve for several operations on mutation tables, but the performance improvement may not be noticeable as these ops are already quite fast.