From 818186b480d7c05e0c58ff89da2180f5b2476434 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Thu, 26 Sep 2024 14:59:11 +0200 Subject: Added TOOLARGS and simplified gendata tool(s) --- tools/tool.h | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'tools/tool.h') diff --git a/tools/tool.h b/tools/tool.h index 757657b..1540f22 100644 --- a/tools/tool.h +++ b/tools/tool.h @@ -6,14 +6,16 @@ #include #include "../src/nissy.h" +#include "nissy_extra.h" static void log_stderr(const char *, ...); static void log_stdout(const char *, ...); static double timerun(void (*)(void), const char *); +static void getfilename(const char *, const char *, char *); static void writetable(const char *, int64_t, const char *); static int64_t generatetable(const char *, const char *, char **); static int getdata(const char *, const char *, char **, const char *); -static void gendata_run(const char *, const char *, const char *, uint64_t[static 21]); +static void gendata_run(const char *, const char *, uint64_t *); static void log_stderr(const char *str, ...) @@ -69,6 +71,17 @@ timerun(void (*run)(void), const char *name) return tdiff; } +static void +getfilename(const char *solver, const char *options, char *filename) +{ + uint8_t h, k; + + /* Only h48 supported for now */ + parse_h48_options(options, &h, &k, NULL); + + sprintf(filename, "tables/%sh%dk%d", solver, h, k); +} + static void writetable(const char *buf, int64_t size, const char *filename) { @@ -155,13 +168,12 @@ static void gendata_run( const char *solver, const char *options, - const char *filename, /* TODO: remove filename, use solver name */ uint64_t expected[static 21] ) { int64_t size; - char *buf; + char *buf, filename[1024]; - + getfilename(solver, options, filename); size = generatetable(solver, options, &buf); switch (size) { case -1: -- cgit v1.3 From 79500f46632ba50b1640d16983942b940dd7955f Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Thu, 26 Sep 2024 19:07:10 +0200 Subject: small fix --- tools/tool.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools/tool.h') diff --git a/tools/tool.h b/tools/tool.h index 1540f22..18b8ce9 100644 --- a/tools/tool.h +++ b/tools/tool.h @@ -15,7 +15,7 @@ static void getfilename(const char *, const char *, char *); static void writetable(const char *, int64_t, const char *); static int64_t generatetable(const char *, const char *, char **); static int getdata(const char *, const char *, char **, const char *); -static void gendata_run(const char *, const char *, uint64_t *); +static void gendata_run(const char *, const char *, uint64_t [static 21]); static void log_stderr(const char *str, ...) -- cgit v1.3