From 159c42498365913f6ed400e13c77798d041a7d43 Mon Sep 17 00:00:00 2001 From: Paul Duncan Date: Mon, 4 Feb 2019 15:33:35 -0500 Subject: add rand-{path,erand48}, minor fixes --- main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index 8e94e87..5629cd5 100644 --- a/main.c +++ b/main.c @@ -264,7 +264,7 @@ save_on_best( UNUSED(cb_data); // convert rank to channel brightness - const uint8_t ch = 0x66 + (0xff - 0x66) * (1.0 * rank) / (MAX_BEST - 1); + const uint8_t ch = 0x33 + (0xff - 0x33) * (1.0 * rank + 1) / (MAX_BEST); const uint32_t color = (ch & 0xff) << 16; // const uint32_t color = 0xff0000; // D("rank = %zu, score = %0.3f, size = %zu, color = %06x", rank, score, set->num_rows, color); @@ -324,9 +324,11 @@ int main(int argc, char *argv[]) { // init context ctx_t ctx; memset(&ctx, 0, sizeof(ctx_t)); - km_rand_init_libc(&(ctx.rs)); ctx.init_type = km_init_get_type(init_type_name); + // init ctx rng + km_rand_init_erand48(&(ctx.rs), rand()); + // init data set km_set_t set; if (!km_load_path(data_path, &LOAD_CBS, &set)) { -- cgit v1.2.3