summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile6
-rw-r--r--geometry/closestPair.cpp11
-rw-r--r--maxFlow/edmondsKarp.cpp7
-rw-r--r--tcr.pdfbin45262 -> 45111 bytes
-rw-r--r--tcr.tex2
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
diff --git a/tcr.pdf b/tcr.pdf
index 9f6d1b1..1996e3e 100644
--- a/tcr.pdf
+++ b/tcr.pdf
Binary files 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}