feat : second outfile

This commit is contained in:
Baptiste 2024-12-09 13:28:46 +01:00
parent 640b12765f
commit 063bdf6ca5
3 changed files with 10 additions and 6 deletions

1
.gitignore vendored
View file

@ -1,4 +1,5 @@
_build/
outfile
outfile2
*~
*.exe

View file

@ -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

View file

@ -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