ELIFE-ASU / Inform

A cross platform C library for information analysis of dynamical systems

Home Page:https://elife-asu.github.io/Inform

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add accumulation functionality for distributions

dglmoore opened this issue · comments

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);
}