diff options
Diffstat (limited to 'misc/examples/gauss1.c')
| -rw-r--r-- | misc/examples/gauss1.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/misc/examples/gauss1.c b/misc/examples/gauss1.c index 6b06b4e8..40d0981f 100644 --- a/misc/examples/gauss1.c +++ b/misc/examples/gauss1.c @@ -29,26 +29,26 @@ int main() stc64_normalf_t dist = stc64_normalf_new(Mean, StdDev); // Create and init histogram vec and map with defered destructors: - c_AUTO (cvec_ii, histvec) - c_AUTO (cmap_ii, histmap) + c_auto (cvec_ii, histvec) + c_auto (cmap_ii, histmap) { - c_FORRANGE (N) { + c_forrange (N) { int index = (int)round( stc64_normalf(&rng, &dist) ); cmap_ii_insert(&histmap, index, 0).ref->second += 1; } // Transfer map to vec and sort it by map keys. - c_FOREACH (i, cmap_ii, histmap) + c_foreach (i, cmap_ii, histmap) cvec_ii_push(&histvec, (cmap_ii_value){i.ref->first, i.ref->second}); cvec_ii_sort(&histvec); // Print the gaussian bar chart - c_FOREACH (i, cvec_ii, histvec) { + c_foreach (i, cvec_ii, histvec) { int n = (int)(i.ref->second * StdDev * Scale * 2.5 / (double)N); if (n > 0) { printf("%4d ", i.ref->first); - c_FORRANGE (n) printf("*"); + c_forrange (n) printf("*"); puts(""); } } |
