tergm icon indicating copy to clipboard operation
tergm copied to clipboard

Dynamic allocation of logging toggles

Open AdrienLeGuillou opened this issue 5 months ago • 3 comments

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 and diffto into DiffVect.
  • DiffVect are basically growable vectors with:
    • content a heap allocated array of ints
    • 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?

AdrienLeGuillou avatar Aug 28 '24 09:08 AdrienLeGuillou