squiggle.c

Self-contained Monte Carlo estimation in C99
Log | Files | Refs | README

example.c (349B)


      1 #include "../../../squiggle.h"
      2 #include "../../../squiggle_more.h"
      3 #include <stdio.h>
      4 #include <stdlib.h>
      5 
      6 double sample_model(uint64_t* seed){
      7     return sample_to(1, 10, seed);
      8 }
      9 
     10 int main()
     11 {
     12     // set randomness seed
     13     uint64_t* seed = malloc(sizeof(uint64_t));
     14     *seed = 1000; // xorshift can't start with 0
     15 
     16     // ...
     17 
     18     free(seed);
     19 }