From 0aa37b072a74debf421e3a15597cd3972aaac35c Mon Sep 17 00:00:00 2001 From: andreasaporito Date: Wed, 10 Dec 2025 14:08:33 +0100 Subject: [PATCH 01/19] Updating README.md for executing examples --- README.md | 35 +++++++++++++++++++++++++++++++++++ test.csv | 5 +++++ 2 files changed, 40 insertions(+) create mode 100644 test.csv diff --git a/README.md b/README.md index 7ace887..1a048c4 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,41 @@ Which will put the library's header files and the application `/in ## Usage +The program can be executed with: + +``` +$ ./build/ROOT/ROOT/root_cli +``` +In order to print out helper to pass correctly the arguments `--help` can be added: + +``` +$ ./build/ROOT/ROOT/root_cli +``` +Every additional needed function must be added together with the function to find the root of. +Here's a list of examples of possible execution syntax: + +- CLI input, CLI output, Newton-Raphson method to find the root of x^2-4, starting from initial guess 1 (default tolerance and maximum iterations): + +``` +$ ./build/ROOT/ROOT/root_cli cli --wcli --function x^2-4 newton --initial 1.0 --derivative 2*x +``` + +- .dat file input called input.dat with first row not being header and " " separating different values, .dat file output called output.dat, Bisection method to find the root of x^3-1, with initial interval [-2,2], verbose output (given tolerance and maximum iterations): + +``` +$ ./build/ROOT/ROOT/root_cli --verbose --wdat output dat input --tolerance 1e-3 --max-iteration 100 bisection +``` +where input.dat is: + +``` +function = x^3-1 +method = bisection +initial = -1 +tolerance = 1e-5 +max_iterations = 100 +derivative = 2*x +``` + The installed CLI application can simply be used by: ``` diff --git a/test.csv b/test.csv new file mode 100644 index 0000000..b1bf696 --- /dev/null +++ b/test.csv @@ -0,0 +1,5 @@ +1.-3 +2.5.2.25 +2.05.0.2025 +2.00061.0.0024394 +2.3.71689e-07 From 4eb160d59c3e6f45fd328a7d52a6ae6a9884474b Mon Sep 17 00:00:00 2001 From: andreasaporito Date: Wed, 10 Dec 2025 14:09:50 +0100 Subject: [PATCH 02/19] Removed trash --- test.csv | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 test.csv diff --git a/test.csv b/test.csv deleted file mode 100644 index b1bf696..0000000 --- a/test.csv +++ /dev/null @@ -1,5 +0,0 @@ -1.-3 -2.5.2.25 -2.05.0.2025 -2.00061.0.0024394 -2.3.71689e-07 From 9cba496371bde45999d19c6c3ab7a009e72e576d Mon Sep 17 00:00:00 2001 From: andreasaporito Date: Wed, 10 Dec 2025 14:47:19 +0100 Subject: [PATCH 03/19] Write examples for execution --- README.md | 31 +++++++++++++++++++++++++++---- ROOT/ROOT/reader.cpp | 20 ++++++++++---------- 2 files changed, 37 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 1b19c8a..a1139f5 100644 --- a/README.md +++ b/README.md @@ -117,14 +117,15 @@ Here's a list of examples of possible execution syntax: - CLI input, CLI output, Newton-Raphson method to find the root of x^2-4, starting from initial guess 1 (default tolerance and maximum iterations): ``` -$ ./build/ROOT/ROOT/root_cli cli --wcli --function x^2-4 newton --initial 1.0 --derivative 2*x +$ ./build/ROOT/ROOT/root_cli --wcli cli --function "x^2-4" newton --initial 1.0 --derivative "2*x" ``` -- .dat file input called input.dat with first row not being header and " " separating different values, .dat file output called output.dat, Bisection method to find the root of x^3-1, with initial interval [-2,2], verbose output (given tolerance and maximum iterations): +- .dat input file called input.dat with first row not being header and " " separating different values, .dat file output called output.dat, Bisection method to find the root of x^3-1, with initial interval [-2,2], verbose output (given tolerance and maximum iterations): ``` -$ ./build/ROOT/ROOT/root_cli --verbose --wdat output dat input --tolerance 1e-3 --max-iteration 100 bisection +$ ./build/ROOT/ROOT/root_cli --verbose --wdat output dat input ``` + where input.dat is: ``` @@ -132,10 +133,32 @@ function = x^3-1 method = bisection initial = -1 tolerance = 1e-5 -max_iterations = 100 +max-iterations = 100 derivative = 2*x ``` +- .csv input file called input.csv with first row which is a header and "," separating different values, .csv file ouput +called output.csv, Fixed Point Method to find the root of cos(x), with +initial guess 0.5, fixed point function cos(x): + +``` +$ ./build/ROOT/ROOT/root_cli --wcsv output --ocsvsep , csv input --sep , --header +``` + +where input.csv is: + +``` +function,method,initial,tolerance,max_iterations,g-function +'cos(x)',fixed_point,0.5,1e-5,100,'cos(x)' +``` + +- CLI input, .dat output file called output.dat and moreover a GNU Plot is created from it as output.png. Chords method to solve +the equation x^3-8 starting from the two initial points 1 and 3: + +``` +$ ./build/ROOT/ROOT/root_cli --wdat output --wgnuplot output cli --function x^3-8 chords --x0 --x1 3 +``` + The installed CLI application can simply be used by: ``` diff --git a/ROOT/ROOT/reader.cpp b/ROOT/ROOT/reader.cpp index 2c92bae..c5a331b 100644 --- a/ROOT/ROOT/reader.cpp +++ b/ROOT/ROOT/reader.cpp @@ -107,10 +107,10 @@ std::unique_ptr ReaderBase::make_config_from_map( } int max_iter = 100; - auto it_max = config_map.find("max_iterations"); + auto it_max = config_map.find("max-iterations"); if (it_max != config_map.end()) { if (!parseInt(it_max->second, max_iter)) { - std::cerr << "\033[31mmake_config_from_map: invalid max_iterations: " << it_max->second << "\033[0m\n"; + std::cerr << "\033[31mmake_config_from_map: invalid max-iterations: " << it_max->second << "\033[0m\n"; std::exit(EXIT_FAILURE); } } @@ -202,14 +202,14 @@ std::unique_ptr ReaderBase::make_config_from_map( case Method::FIXED_POINT: { auto it_x0 = config_map.find("initial"); - auto it_g = config_map.find("function_g"); + auto it_g = config_map.find("g-function"); if (it_x0 == config_map.end() || it_g == config_map.end()) { - std::cerr << "\033[31mmake_config_from_map: fixed_point requires initial and function_g\033[0m\n"; + std::cerr << "\033[31mmake_config_from_map: fixed_point requires initial and g-function\033[0m\n"; std::exit(EXIT_FAILURE); } double initial = 0.0; - auto function_g = FunctionParserBase::parseFunction(it_g->second); - return std::make_unique(tolerance, max_iter, aitken, function, initial, function_g, + auto g-function = FunctionParserBase::parseFunction(it_g->second); + return std::make_unique(tolerance, max_iter, aitken, function, initial, g-function, verbose); } } // switch @@ -312,8 +312,8 @@ std::unique_ptr ReaderCSV::read(CLI::App* app, bool verbose) { } } else { // positional mapping documented here: - std::vector posnames = {"method", "tolerance", "max_iterations", "aitken", "function", - "derivative", "interval_a", "interval_b", "function_g", "initial", + std::vector posnames = {"method", "tolerance", "max-iterations", "aitken", "function", + "derivative", "interval_a", "interval_b", "function-g", "initial", "x0", "x1"}; for (size_t i = 0; i < values.size() && i < posnames.size(); ++i) { config_map[posnames[i]] = values[i]; @@ -383,7 +383,7 @@ std::unique_ptr ReaderCLI::read(CLI::App* app, bool verbose) { if (verbose) { std::cout << "ReaderCLI: read configuration\n"; std::cout << " tolerance = " << app->get_option("--tolerance")->as() << "\n"; - std::cout << " max_iterations = " << app->get_option("--max-iterations")->as() << "\n"; + std::cout << " max-iterations = " << app->get_option("--max-iterations")->as() << "\n"; std::cout << " aitken = " << (app->get_option("--aitken")->as() ? "true" : "false") << "\n"; std::cout << " function = " << app->get_option("--function")->as() << "\n"; std::cout << " verbose = " << (verbose ? "true" : "false") << "\n"; @@ -423,7 +423,7 @@ std::unique_ptr ReaderCLI::read(CLI::App* app, bool verbose) { app->get_subcommand("fixed_point")->get_option("--g-function")->as()), verbose); if (verbose) { - std::cout << " g_function = " + std::cout << " g-function = " << app->get_subcommand("fixed_point")->get_option("--g-function")->as() << "\n"; std::cout << " initial = " << app->get_subcommand("fixed_point")->get_option("--initial")->as() << "\n"; From f7a68fca3107d40a7d7cef05396b3259c43ee228 Mon Sep 17 00:00:00 2001 From: andreasaporito Date: Wed, 10 Dec 2025 14:56:12 +0100 Subject: [PATCH 04/19] Finished examples --- ROOT/ROOT/reader.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ROOT/ROOT/reader.cpp b/ROOT/ROOT/reader.cpp index c5a331b..80ff684 100644 --- a/ROOT/ROOT/reader.cpp +++ b/ROOT/ROOT/reader.cpp @@ -208,8 +208,8 @@ std::unique_ptr ReaderBase::make_config_from_map( std::exit(EXIT_FAILURE); } double initial = 0.0; - auto g-function = FunctionParserBase::parseFunction(it_g->second); - return std::make_unique(tolerance, max_iter, aitken, function, initial, g-function, + auto g_function = FunctionParserBase::parseFunction(it_g->second); + return std::make_unique(tolerance, max_iter, aitken, function, initial, g_function, verbose); } } // switch From e1cfdf374edd20ef22b0d2ce84cafb19d3b5d2d7 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 10 Dec 2025 13:58:14 +0000 Subject: [PATCH 05/19] style: pre-commit fixes --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a1139f5..78c8b3b 100644 --- a/README.md +++ b/README.md @@ -123,7 +123,7 @@ $ ./build/ROOT/ROOT/root_cli --wcli cli --function "x^2-4" newton --initial 1.0 - .dat input file called input.dat with first row not being header and " " separating different values, .dat file output called output.dat, Bisection method to find the root of x^3-1, with initial interval [-2,2], verbose output (given tolerance and maximum iterations): ``` -$ ./build/ROOT/ROOT/root_cli --verbose --wdat output dat input +$ ./build/ROOT/ROOT/root_cli --verbose --wdat output dat input ``` where input.dat is: @@ -138,7 +138,7 @@ derivative = 2*x ``` - .csv input file called input.csv with first row which is a header and "," separating different values, .csv file ouput -called output.csv, Fixed Point Method to find the root of cos(x), with +called output.csv, Fixed Point Method to find the root of cos(x), with initial guess 0.5, fixed point function cos(x): ``` From 81b7a26b08e14f07155bf56734b5e51c46a7aef5 Mon Sep 17 00:00:00 2001 From: Andrea Saporito Date: Wed, 10 Dec 2025 15:10:05 +0100 Subject: [PATCH 06/19] Update README.md with Saransh's suggestion Co-authored-by: Saransh Chopra --- README.md | 40 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 37 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 78c8b3b..acdf5ac 100644 --- a/README.md +++ b/README.md @@ -101,12 +101,46 @@ Which will put the library's header files and the application `/in ## Usage -The program can be executed with: +TLDR; +``` + +ROOT Command Line Interface + + +root_cli [OPTIONS] SUBCOMMAND + + +OPTIONS: + -h, --help Print this help message and exit + -v, --verbose Enable verbose output + --wcli, --write-to-cli + Write results to command line + --wcsv, --write-to-csv TEXT + Path for writing results to CSV file + --ocsvsep, --output-csv-sep CHAR [,] + Separator character for CSV output + --wdat, --write-to-dat TEXT + Path for writing results to DAT file + --wgnuplot, --write-to-gnuplot TEXT + Path for writing results to Gnuplot file + --ofmode, --output-file-mode CHAR:{a,o} [o] + Append or overwrite output file: 'a' for append, 'o' for + overwrite +SUBCOMMANDS: + csv Use CSV input + dat Use DAT input + cli Use CLI input ``` -$ ./build/ROOT/ROOT/root_cli + +Assuming that `root_cli` is on your `PATH`, the program can be executed with: + ``` -In order to print out helper to pass correctly the arguments `--help` can be added: +root_cli +# or use the full install/build path of the executable: /path/to/root_cli +``` + +In order to print out more information about the arguments and the subcommands: ``` $ ./build/ROOT/ROOT/root_cli From b841612d6f1d11204f0b68b306e84bc4514a75e0 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 10 Dec 2025 14:10:12 +0000 Subject: [PATCH 07/19] style: pre-commit fixes --- README.md | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index acdf5ac..a0943fd 100644 --- a/README.md +++ b/README.md @@ -104,33 +104,33 @@ Which will put the library's header files and the application `/in TLDR; ``` -ROOT Command Line Interface +ROOT Command Line Interface root_cli [OPTIONS] SUBCOMMAND OPTIONS: - -h, --help Print this help message and exit - -v, --verbose Enable verbose output - --wcli, --write-to-cli - Write results to command line - --wcsv, --write-to-csv TEXT - Path for writing results to CSV file - --ocsvsep, --output-csv-sep CHAR [,] - Separator character for CSV output - --wdat, --write-to-dat TEXT - Path for writing results to DAT file - --wgnuplot, --write-to-gnuplot TEXT - Path for writing results to Gnuplot file - --ofmode, --output-file-mode CHAR:{a,o} [o] - Append or overwrite output file: 'a' for append, 'o' for - overwrite + -h, --help Print this help message and exit + -v, --verbose Enable verbose output + --wcli, --write-to-cli + Write results to command line + --wcsv, --write-to-csv TEXT + Path for writing results to CSV file + --ocsvsep, --output-csv-sep CHAR [,] + Separator character for CSV output + --wdat, --write-to-dat TEXT + Path for writing results to DAT file + --wgnuplot, --write-to-gnuplot TEXT + Path for writing results to Gnuplot file + --ofmode, --output-file-mode CHAR:{a,o} [o] + Append or overwrite output file: 'a' for append, 'o' for + overwrite SUBCOMMANDS: - csv Use CSV input - dat Use DAT input - cli Use CLI input + csv Use CSV input + dat Use DAT input + cli Use CLI input ``` Assuming that `root_cli` is on your `PATH`, the program can be executed with: From 817d29fbb3739315f17521f28de3c2b20fdccd23 Mon Sep 17 00:00:00 2001 From: Andrea Saporito Date: Wed, 10 Dec 2025 15:13:07 +0100 Subject: [PATCH 08/19] Update README.md with Saransh's suggestion Co-authored-by: Saransh Chopra --- README.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index a0943fd..473dbeb 100644 --- a/README.md +++ b/README.md @@ -160,16 +160,16 @@ $ ./build/ROOT/ROOT/root_cli --wcli cli --function "x^2-4" newton --initial 1.0 $ ./build/ROOT/ROOT/root_cli --verbose --wdat output dat input ``` -where input.dat is: - -``` -function = x^3-1 -method = bisection -initial = -1 -tolerance = 1e-5 -max-iterations = 100 -derivative = 2*x -``` + where input.dat is: + + ``` + function = x^3-1 + method = bisection + initial = -1 + tolerance = 1e-5 + max-iterations = 100 + derivative = 2*x + ``` - .csv input file called input.csv with first row which is a header and "," separating different values, .csv file ouput called output.csv, Fixed Point Method to find the root of cos(x), with From 897a256e688d46b78995ae9ecee40729690b60ed Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 10 Dec 2025 14:13:13 +0000 Subject: [PATCH 09/19] style: pre-commit fixes --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 473dbeb..2f77c84 100644 --- a/README.md +++ b/README.md @@ -161,7 +161,7 @@ $ ./build/ROOT/ROOT/root_cli --verbose --wdat output dat input ``` where input.dat is: - + ``` function = x^3-1 method = bisection From a74653acb3bced0f726ab312964c60df2738e80a Mon Sep 17 00:00:00 2001 From: Andrea Saporito Date: Wed, 10 Dec 2025 15:13:53 +0100 Subject: [PATCH 10/19] Update README.md with Saransh's suggestion Co-authored-by: Saransh Chopra --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 2f77c84..a97d3f2 100644 --- a/README.md +++ b/README.md @@ -179,12 +179,12 @@ initial guess 0.5, fixed point function cos(x): $ ./build/ROOT/ROOT/root_cli --wcsv output --ocsvsep , csv input --sep , --header ``` -where input.csv is: - -``` -function,method,initial,tolerance,max_iterations,g-function -'cos(x)',fixed_point,0.5,1e-5,100,'cos(x)' -``` + where input.csv is: + + ``` + function,method,initial,tolerance,max_iterations,g-function + 'cos(x)',fixed_point,0.5,1e-5,100,'cos(x)' + ``` - CLI input, .dat output file called output.dat and moreover a GNU Plot is created from it as output.png. Chords method to solve the equation x^3-8 starting from the two initial points 1 and 3: From 33fdea0b7a919ffa62c670882f79a31f3a404ccc Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 10 Dec 2025 14:14:00 +0000 Subject: [PATCH 11/19] style: pre-commit fixes --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a97d3f2..b9daeae 100644 --- a/README.md +++ b/README.md @@ -180,7 +180,7 @@ $ ./build/ROOT/ROOT/root_cli --wcsv output --ocsvsep , csv input --sep , --heade ``` where input.csv is: - + ``` function,method,initial,tolerance,max_iterations,g-function 'cos(x)',fixed_point,0.5,1e-5,100,'cos(x)' From 9eb6289b510c98099bc034a2d87c5e68096ba662 Mon Sep 17 00:00:00 2001 From: Andrea Saporito Date: Wed, 10 Dec 2025 15:14:16 +0100 Subject: [PATCH 12/19] Update README.md with Saransh's suggestion Co-authored-by: Saransh Chopra --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b9daeae..435ea71 100644 --- a/README.md +++ b/README.md @@ -189,9 +189,9 @@ $ ./build/ROOT/ROOT/root_cli --wcsv output --ocsvsep , csv input --sep , --heade - CLI input, .dat output file called output.dat and moreover a GNU Plot is created from it as output.png. Chords method to solve the equation x^3-8 starting from the two initial points 1 and 3: -``` -$ ./build/ROOT/ROOT/root_cli --wdat output --wgnuplot output cli --function x^3-8 chords --x0 --x1 3 -``` + ``` + root_cli --wdat output --wgnuplot output cli --function x^3-8 chords --x0 --x1 3 + ``` The installed CLI application can simply be used by: From 8d39712827e97e8971f9096228dc034e7ef0ebf5 Mon Sep 17 00:00:00 2001 From: Andrea Saporito Date: Wed, 10 Dec 2025 15:18:10 +0100 Subject: [PATCH 13/19] Update README.md with Saransh's suggestion Co-authored-by: Saransh Chopra --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 435ea71..527d865 100644 --- a/README.md +++ b/README.md @@ -175,9 +175,9 @@ $ ./build/ROOT/ROOT/root_cli --verbose --wdat output dat input called output.csv, Fixed Point Method to find the root of cos(x), with initial guess 0.5, fixed point function cos(x): -``` -$ ./build/ROOT/ROOT/root_cli --wcsv output --ocsvsep , csv input --sep , --header -``` + ``` + root_cli --wcsv output --ocsvsep , csv input --sep , --header + ``` where input.csv is: From 566fb4c74d8f1aab8b05da56ccf4c9f600c3a753 Mon Sep 17 00:00:00 2001 From: Andrea Saporito Date: Wed, 10 Dec 2025 15:18:18 +0100 Subject: [PATCH 14/19] Update README.md with Saransh's suggestion Co-authored-by: Saransh Chopra --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 527d865..e12ed48 100644 --- a/README.md +++ b/README.md @@ -156,9 +156,9 @@ $ ./build/ROOT/ROOT/root_cli --wcli cli --function "x^2-4" newton --initial 1.0 - .dat input file called input.dat with first row not being header and " " separating different values, .dat file output called output.dat, Bisection method to find the root of x^3-1, with initial interval [-2,2], verbose output (given tolerance and maximum iterations): -``` -$ ./build/ROOT/ROOT/root_cli --verbose --wdat output dat input -``` + ``` + root_cli --verbose --wdat output dat input + ``` where input.dat is: From d649e9ef35a5e8e60a39c231bd411bd77ac154c0 Mon Sep 17 00:00:00 2001 From: Andrea Saporito Date: Wed, 10 Dec 2025 15:18:31 +0100 Subject: [PATCH 15/19] Update README.md with Saransh's suggestion Co-authored-by: Saransh Chopra --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index e12ed48..59ba6c4 100644 --- a/README.md +++ b/README.md @@ -103,7 +103,6 @@ Which will put the library's header files and the application `/in TLDR; ``` - ROOT Command Line Interface From 0df2276b946c42850451d5bc22e12518541097ab Mon Sep 17 00:00:00 2001 From: Andrea Saporito Date: Wed, 10 Dec 2025 15:18:41 +0100 Subject: [PATCH 16/19] Update README.md with Saransh's suggestion Co-authored-by: Saransh Chopra --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 59ba6c4..a6ce21a 100644 --- a/README.md +++ b/README.md @@ -170,7 +170,7 @@ $ ./build/ROOT/ROOT/root_cli --wcli cli --function "x^2-4" newton --initial 1.0 derivative = 2*x ``` -- .csv input file called input.csv with first row which is a header and "," separating different values, .csv file ouput +- CSV input file called input.csv with first row which is a header and "," separating different values, .csv file ouput called output.csv, Fixed Point Method to find the root of cos(x), with initial guess 0.5, fixed point function cos(x): From 2e01f0ee0b7d87f07d3360bac31c32038d695570 Mon Sep 17 00:00:00 2001 From: Andrea Saporito Date: Wed, 10 Dec 2025 15:18:53 +0100 Subject: [PATCH 17/19] Update README.md with Saransh's suggestion Co-authored-by: Saransh Chopra --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a6ce21a..751c467 100644 --- a/README.md +++ b/README.md @@ -153,7 +153,7 @@ Here's a list of examples of possible execution syntax: $ ./build/ROOT/ROOT/root_cli --wcli cli --function "x^2-4" newton --initial 1.0 --derivative "2*x" ``` -- .dat input file called input.dat with first row not being header and " " separating different values, .dat file output called output.dat, Bisection method to find the root of x^3-1, with initial interval [-2,2], verbose output (given tolerance and maximum iterations): +- DAT input file called input.dat with first row not being header and " " separating different values, .dat file output called output.dat, Bisection method to find the root of x^3-1, with initial interval [-2,2], verbose output (given tolerance and maximum iterations): ``` root_cli --verbose --wdat output dat input From 8f190fe8d2c981846e9acf87828067245bfebc1b Mon Sep 17 00:00:00 2001 From: Andrea Saporito Date: Wed, 10 Dec 2025 15:19:03 +0100 Subject: [PATCH 18/19] Update README.md with Saransh's suggestion Co-authored-by: Saransh Chopra --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 751c467..e2ac3cc 100644 --- a/README.md +++ b/README.md @@ -149,9 +149,9 @@ Here's a list of examples of possible execution syntax: - CLI input, CLI output, Newton-Raphson method to find the root of x^2-4, starting from initial guess 1 (default tolerance and maximum iterations): -``` -$ ./build/ROOT/ROOT/root_cli --wcli cli --function "x^2-4" newton --initial 1.0 --derivative "2*x" -``` + ``` + root_cli --wcli cli --function "x^2-4" newton --initial 1.0 --derivative "2*x" + ``` - DAT input file called input.dat with first row not being header and " " separating different values, .dat file output called output.dat, Bisection method to find the root of x^3-1, with initial interval [-2,2], verbose output (given tolerance and maximum iterations): From 313284b8e508d6b7dc4abb0aa8ee5b7917953f30 Mon Sep 17 00:00:00 2001 From: Andrea Saporito Date: Wed, 10 Dec 2025 15:19:13 +0100 Subject: [PATCH 19/19] Update README.md with Saransh's suggestion Co-authored-by: Saransh Chopra --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e2ac3cc..a67a289 100644 --- a/README.md +++ b/README.md @@ -142,8 +142,9 @@ root_cli In order to print out more information about the arguments and the subcommands: ``` -$ ./build/ROOT/ROOT/root_cli +root_cli ``` + Every additional needed function must be added together with the function to find the root of. Here's a list of examples of possible execution syntax: