From 063bdf6ca5a0b13f1ef47635a743424aede95aba Mon Sep 17 00:00:00 2001 From: Baptiste Date: Mon, 9 Dec 2024 13:28:46 +0100 Subject: [PATCH] feat : second outfile --- .gitignore | 1 + Makefile | 10 +++++----- src/ftest.ml | 5 ++++- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index bbc178c..4a6006e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ _build/ outfile +outfile2 *~ *.exe diff --git a/Makefile b/Makefile index 88ee9eb..dc552e0 100644 --- a/Makefile +++ b/Makefile @@ -20,16 +20,16 @@ edit: demo: build @echo "\n ⚡ EXECUTING ⚡\n" - ./ftest.exe graphs/${graph} $(src) $(dst) outfile + ./ftest.exe graphs/${graph} $(src) $(dst) outfile outfile2 @echo "\n 🥁 RESULT (content of outfile) 🥁\n" @cat outfile - make dot + make dot graphdot="outfile2" + make dot graphdot="outfile" clean: find -L . -name "*~" -delete rm -f *.exe dune clean dot: - dot -Tsvg $(graphdot) > /tmp/imgdot.svg - xdg-open /tmp/imgdot.svg - + dot -Tsvg $(graphdot) > /tmp/$(graphdot).svg + xdg-open /tmp/$(graphdot).svg diff --git a/src/ftest.ml b/src/ftest.ml index 1d99a3c..f78ac98 100644 --- a/src/ftest.ml +++ b/src/ftest.ml @@ -19,7 +19,8 @@ let () = (" 🟄 infile : input file containing a graph\n" ^ " 🟄 source : identifier of the source vertex (used by the ford-fulkerson algorithm)\n" ^ " 🟄 sink : identifier of the sink vertex (ditto)\n" ^ - " 🟄 outfile : output file in which the result should be written.\n\n") ; + " 🟄 outfile : output file in which the result should be written.\n" ^ + " 🟄 outfile2 : second output file.\n\n") ; exit 0 end ; @@ -28,6 +29,7 @@ let () = let infile = Sys.argv.(1) and outfile = Sys.argv.(4) + and outfile2 = Sys.argv.(5) (* These command-line arguments are not used for the moment. *) and source = int_of_string Sys.argv.(2) @@ -36,6 +38,7 @@ let () = (* Open file *) let graph = from_file infile in + let () =export outfile2 graph in (*let () = export outfile graph in *) let graph = gmap graph (fun x -> (int_of_string x)) in