From 0b40aa3bb5c635f253d300e8e2885f751848bed8 Mon Sep 17 00:00:00 2001 From: pjungeblut Date: Sat, 25 Oct 2014 17:50:23 +0200 Subject: adding makefile --- Makefile | 6 ++++++ geometry/closestPair.cpp | 11 +++++------ maxFlow/edmondsKarp.cpp | 7 ++++--- tcr.pdf | Bin 45262 -> 45111 bytes tcr.tex | 2 +- 5 files changed, 16 insertions(+), 10 deletions(-) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..c3c7848 --- /dev/null +++ b/Makefile @@ -0,0 +1,6 @@ +all: + pdflatex tcr.tex + pdflatex tcr.tex + make clean +clean: + rm -f *~ .*~ *.aux *.log *.backup *.out *.backup *.bbl *.blg *.brf *.idx *.ilg *.ind *.toc *.fls \ No newline at end of file diff --git a/geometry/closestPair.cpp b/geometry/closestPair.cpp index 10c9291..92b4551 100644 --- a/geometry/closestPair.cpp +++ b/geometry/closestPair.cpp @@ -1,15 +1,13 @@ double squaredDist(point a, point b) { - return (a.first - b.first) * (a.first - b.first) + (a.second - b.second) * (a.second - b.second); + return (a.first-b.first) * (a.first-b.first) + (a.second-b.second) * (a.second-b.second); } bool compY(point a, point b) { - if (a.second == b.second) { - return a.first < b.first; - } + if (a.second == b.second) return a.first < b.first; return a.second < b.second; } -void shortestDist(vector &points) { +double shortestDist(vector &points) { //check that points.size() > 1 and that ALL POINTS ARE DIFFERENT set status(compY); sort(points.begin(), points.end()); @@ -33,5 +31,6 @@ void shortestDist(vector &points) { } status.insert(*(right++)); } - } // closest distance in sqrtOpt + } + return sqrtOpt; } diff --git a/maxFlow/edmondsKarp.cpp b/maxFlow/edmondsKarp.cpp index a2be9a6..ccfb1d2 100644 --- a/maxFlow/edmondsKarp.cpp +++ b/maxFlow/edmondsKarp.cpp @@ -10,7 +10,7 @@ void augment(int v, int minEdge) { res[p[v]][v] -= f; res[v][p[v]] += f; }} -int main() { //first inititalize res, adjList, s and t +nt maxFlow() { //first inititalize res, adjList, s and t int mf = 0; while (true) { f = 0; @@ -29,5 +29,6 @@ int main() { //first inititalize res, adjList, s and t augment(t, INF); //add found path to max flow if (f == 0) break; mf += f; -}} -//max flow in mf} \ No newline at end of file + } + return maxFlow; +} \ No newline at end of file diff --git a/tcr.pdf b/tcr.pdf index 9f6d1b1..1996e3e 100644 Binary files a/tcr.pdf and b/tcr.pdf differ diff --git a/tcr.tex b/tcr.tex index 254a422..cdb37b1 100644 --- a/tcr.tex +++ b/tcr.tex @@ -36,7 +36,7 @@ commentstyle=\color{darkgreen} } -\usepackage[top=2cm, bottom=2cm, left=3cm, right=2cm]{geometry} +\usepackage[top=2cm, bottom=2cm, left=2cm, right=1cm]{geometry} \begin{document} -- cgit v1.2.3