forked from personal/squiggle.c
add parallelism to sampling
This commit is contained in:
parent
58a329bcc3
commit
b22eb34835
|
@ -308,7 +308,7 @@ Overall, I'd describe the error handling capabilities of this library as pretty
|
|||
|
||||
## To do list
|
||||
|
||||
- [ ] Write better confidence interval code that:
|
||||
- [x] Write better confidence interval code that:
|
||||
- Gets number of samples as an input
|
||||
- Gets either a sampler function or a list of samples
|
||||
- is O(n), not O(nlog(n))
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -115,9 +115,10 @@ ci array_get_90_ci(double xs[], int n)
|
|||
ci sampler_get_ci(ci interval, double (*sampler)(uint64_t*), int n, uint64_t* seed)
|
||||
{
|
||||
double* xs = malloc(n * sizeof(double));
|
||||
for (int i = 0; i < n; i++) {
|
||||
/*for (int i = 0; i < n; i++) {
|
||||
xs[i] = sampler(seed);
|
||||
}
|
||||
}*/
|
||||
sampler_parallel(sampler, xs, 16, n);
|
||||
ci result = array_get_ci(interval, xs, n);
|
||||
free(xs);
|
||||
return result;
|
||||
|
|
Loading…
Reference in New Issue
Block a user