tergm
tergm copied to clipboard
Dynamic allocation of logging toggles
Hi @krivit,
I made this PoC implementation of the grow-able logging vectors you suggests in #123.
Currently it does the following:
- make
difftime
,difftail
,diffhead
anddiffto
intoDiffVect
. -
DiffVect
are basically growable vectors with:-
content
a heap allocated array ofint
s -
size
the current count of elements -
capacity
available memory allocated - methods to create, free, append and convert to
SEXP
-
- I kept maxchanges for now but it's only used to stop if to many changes occurs
I implemented only what is necessary here and not all the features of a true "vector". The initial capacity of 100 for each is purely for testing purposes.
This implementation seems to work as I can run EpiModelHIV simulations with it.
Does this interest you? If so, what should I improve in this (very simple) PoC?