diff options
author | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2022-09-16 17:34:29 +0200 |
---|---|---|
committer | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2022-09-16 17:34:29 +0200 |
commit | 4ad4d55fb0e64dee1b4b399f0e0ca505cff8f0fa (patch) | |
tree | 6cdb76dba2626a8bd07b9f51517aab83100f6367 | |
parent | 2d833ad2bf32632a2230ce1ebe28dc8207898ad7 (diff) | |
download | code-4ad4d55fb0e64dee1b4b399f0e0ca505cff8f0fa.tar.gz code-4ad4d55fb0e64dee1b4b399f0e0ca505cff8f0fa.tar.bz2 code-4ad4d55fb0e64dee1b4b399f0e0ca505cff8f0fa.zip |
Added getopt interface.
-rw-r--r-- | rbmp.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
@@ -112,11 +112,29 @@ public: } }; -int main() { +int main(int argc, char* argv[]) { unsigned n = 100; unsigned maxSteps = 1e8; double beliefThreshold = 1; + int opt; + + while ((opt = getopt(argc, argv, "n:m:t:")) != -1) { + switch (opt) { + case 'n': + n = atoi(optarg); + break; + case 'm': + maxSteps = (unsigned)atof(optarg); + break; + case 't': + beliefThreshold = atof(optarg); + break; + default: + exit(1); + } + } + Rng r; Graph G(n, r); |