add more instructions to readme
This commit is contained in:
parent
236600e387
commit
d0f94713e4
2 changed files with 27 additions and 19 deletions
13
Makefile
13
Makefile
|
@ -15,15 +15,6 @@ build:
|
||||||
format:
|
format:
|
||||||
ocp-indent --inplace src/*
|
ocp-indent --inplace src/*
|
||||||
|
|
||||||
edit:
|
|
||||||
codium . -n
|
|
||||||
|
|
||||||
demo: build
|
|
||||||
@echo $(EXECUTING)
|
|
||||||
./ftest.native graphs/graph1 1 2 test/outfile
|
|
||||||
@echo $(RESULT)
|
|
||||||
@cat test/outfile
|
|
||||||
|
|
||||||
test: build
|
test: build
|
||||||
@echo $(EXECUTING)
|
@echo $(EXECUTING)
|
||||||
./ftest.native graphs/graph1 1 2 test/outfile
|
./ftest.native graphs/graph1 1 2 test/outfile
|
||||||
|
@ -38,7 +29,7 @@ test: build
|
||||||
@dot -Tsvg test/graph_res > test/graph_res.svg
|
@dot -Tsvg test/graph_res > test/graph_res.svg
|
||||||
@echo ""
|
@echo ""
|
||||||
|
|
||||||
run: build
|
demo: build
|
||||||
@echo $(EXECUTING)
|
@echo $(EXECUTING)
|
||||||
./ftest.native graphs/test2 0 5 run/solution
|
./ftest.native graphs/test2 0 5 run/solution
|
||||||
@echo $(BUILDING_SVG)
|
@echo $(BUILDING_SVG)
|
||||||
|
@ -55,7 +46,7 @@ build_circulation:
|
||||||
@echo $(COMPILING)
|
@echo $(COMPILING)
|
||||||
ocamlbuild circulationtest.native
|
ocamlbuild circulationtest.native
|
||||||
|
|
||||||
run_circulation: build_circulation
|
demo_circulation: build_circulation
|
||||||
@echo $(EXECUTING)
|
@echo $(EXECUTING)
|
||||||
./circulationtest.native circulation_input_graphs/test1 run/circulation_solution
|
./circulationtest.native circulation_input_graphs/test1 run/circulation_solution
|
||||||
@echo $(BUILDING_SVG)
|
@echo $(BUILDING_SVG)
|
||||||
|
|
33
README.md
33
README.md
|
@ -1,21 +1,38 @@
|
||||||
Base project for Ocaml project on Ford-Fulkerson. This project contains some simple configuration files to facilitate editing Ocaml in VSCode.
|
# BE OCAML 4IR
|
||||||
|
|
||||||
To use, you should install the *OCaml* extension in VSCode. Other extensions might work as well but make sure there is only one installed.
|
## Group
|
||||||
Then open VSCode in the root directory of this repository (command line: `code path/to/ocaml-maxflow-project`).
|
* SIMARD Yohan
|
||||||
|
* VERGNET Arnaud
|
||||||
|
|
||||||
Features :
|
## Description
|
||||||
|
|
||||||
|
Ocaml project on Ford-Fulkerson. This project contains some simple configuration files to facilitate editing Ocaml in VSCode.
|
||||||
|
|
||||||
|
This project can compile 2 executables:
|
||||||
|
- `ftest.native`, the base FF algorithm implementation
|
||||||
|
- `circulationtest.native`, a circulation-demand problem solved by the use of the FF algorithm. The problem can be found on [Wikipedia](https://en.wikipedia.org/wiki/Maximum_flow_problem#Circulation%E2%80%93demand_problem).
|
||||||
|
|
||||||
|
## Use in VSCode
|
||||||
|
|
||||||
|
To use in VSCode, you should install the `OCaml` extension in VSCode. Other extensions might work as well but make sure there is only one installed.
|
||||||
|
Then open VSCode in the root directory of this repository.
|
||||||
|
|
||||||
|
### Features :
|
||||||
- full compilation as VSCode build task (Ctrl+Shift+b)
|
- full compilation as VSCode build task (Ctrl+Shift+b)
|
||||||
- highlights of compilation errors as you type
|
- highlights of compilation errors as you type
|
||||||
- code completion
|
- code completion
|
||||||
- automatic indentation on file save
|
- automatic indentation on file save
|
||||||
|
|
||||||
|
## Build and Run
|
||||||
|
|
||||||
A makefile provides some useful commands:
|
A makefile provides some useful commands:
|
||||||
- `make build` to compile. This creates an ftest.native executable
|
- `make build` to compile the base ff algorithm. This creates an ftest.native executable
|
||||||
- `make demo` to run the `ftest` program with some arguments
|
- `make test` to run the `ftest` program with some arguments and generate svg files for each tests. You must first uncomment the tests in the `ftest` file. This uses graphs in the `graphs` folder and outputs in the `test` folder.
|
||||||
|
- `make demo` to run the `ftest` program with some arguments and generate the final svg file. This uses graphs in the `graphs` folder and outputs in the `run` folder.
|
||||||
|
- `make build_circulation` to compile the circulation-demand problem resolution. This creates a circulationtest.native executable
|
||||||
|
- `make demo_circulation` to run the `circulationtest` program with some arguments and generate the final svg file. This uses graphs in the `circulation_input_graphs` folder and outputs in the `run` folder.
|
||||||
- `make format` to indent the entire project
|
- `make format` to indent the entire project
|
||||||
- `make edit` to open the project in VSCode
|
|
||||||
- `make clean` to remove build artifacts
|
- `make clean` to remove build artifacts
|
||||||
|
|
||||||
In case of trouble with the VSCode extension (e.g. the project does not build, there are strange mistakes), a common workaround is to (1) close vscode, (2) `make clean`, (3) `make build` and (4) reopen vscode (`make edit`).
|
In case of trouble with the VSCode extension (e.g. the project does not build, there are strange mistakes), a common workaround is to (1) close vscode, (2) `make clean`, (3) `make build` and (4) reopen vscode.
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue