diff options
| author | pjungeblut <paul.jungeblut@gmail.com> | 2014-10-25 17:50:23 +0200 |
|---|---|---|
| committer | pjungeblut <paul.jungeblut@gmail.com> | 2014-10-25 17:50:23 +0200 |
| commit | 0b40aa3bb5c635f253d300e8e2885f751848bed8 (patch) | |
| tree | e2aacd149b7cd820338e7f826f0d05a2e7d8e572 | |
| parent | 04703be68216170849bfe5151319ec962d3d072b (diff) | |
adding makefile
| -rw-r--r-- | Makefile | 6 | ||||
| -rw-r--r-- | geometry/closestPair.cpp | 11 | ||||
| -rw-r--r-- | maxFlow/edmondsKarp.cpp | 7 | ||||
| -rw-r--r-- | tcr.pdf | bin | 45262 -> 45111 bytes | |||
| -rw-r--r-- | tcr.tex | 2 |
5 files changed, 16 insertions, 10 deletions
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<point> &points) { +double shortestDist(vector<point> &points) { //check that points.size() > 1 and that ALL POINTS ARE DIFFERENT set<point, bool(*)(point, point)> status(compY); sort(points.begin(), points.end()); @@ -33,5 +31,6 @@ void shortestDist(vector<point> &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 Binary files differ@@ -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} |
