ELIFE-ASU / Inform

A cross platform C library for information analysis of dynamical systems
https://elife-asu.github.io/Inform
MIT License
23 stars 3 forks source link

Add accumulation functionality for distributions #30

Closed dglmoore closed 7 years ago

dglmoore commented 7 years ago

The inform_dist API could stand to have a few additional functions.

Proposed API

// Accumulate observations from an array of events and return the number of observations made.
EXPORT size_t inform_dist_accumulate(inform_dist *dist, size_t *events, size_t n);

Example Usage

inform_dist *dist = inform_dist_alloc(2);
size_t events[5] = {0,1,1,0,1,0};
size_t n = inform_dist_accumulate(dist, events, 5);
if (n != 5)
{
    fprintf(stderr, "invalid event at index %ld\n", n);
}