diff options
| author | MZuenni <michi.zuendorf@gmail.com> | 2022-11-30 12:43:27 +0100 |
|---|---|---|
| committer | MZuenni <michi.zuendorf@gmail.com> | 2022-11-30 12:43:27 +0100 |
| commit | 03788f48be2634c36cd19ba25b0a851685b9c877 (patch) | |
| tree | ef430668558366afe95d958d26250361f5452666 /graph | |
| parent | 99259d60cb345eae15211397f3199aa86ac2bceb (diff) | |
use all macro
Diffstat (limited to 'graph')
| -rw-r--r-- | graph/bitonicTSP.cpp | 4 | ||||
| -rw-r--r-- | graph/kruskal.cpp | 2 | ||||
| -rw-r--r-- | graph/maxWeightBipartiteMatching.cpp | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/graph/bitonicTSP.cpp b/graph/bitonicTSP.cpp index 767bc5b..3dea828 100644 --- a/graph/bitonicTSP.cpp +++ b/graph/bitonicTSP.cpp @@ -25,7 +25,7 @@ void bitonicTSP() { } } while(n = j + 1, j > 0); (lt.back() == 1 ? lt : ut).push_back(0); - reverse(lt.begin(), lt.end()); - lt.insert(lt.end(), ut.begin(), ut.end()); + reverse(all(lt)); + lt.insert(lt.end(), all(ut)); //return lt;// Enthält Knoten 0 zweimal. An erster und letzter Position. }
\ No newline at end of file diff --git a/graph/kruskal.cpp b/graph/kruskal.cpp index af5a8ff..5b0e153 100644 --- a/graph/kruskal.cpp +++ b/graph/kruskal.cpp @@ -1,4 +1,4 @@ -sort(edges.begin(), edges.end()); +sort(all(edges)); vector<edge> mst; int cost = 0; for (edge& e : edges) { diff --git a/graph/maxWeightBipartiteMatching.cpp b/graph/maxWeightBipartiteMatching.cpp index ef99232..e7e186e 100644 --- a/graph/maxWeightBipartiteMatching.cpp +++ b/graph/maxWeightBipartiteMatching.cpp @@ -54,6 +54,6 @@ double match(int l, int r) { y = prec; }} // Wert des Matchings - return accumulate(lx.begin(), lx.end(), 0.0) + - accumulate(ly.begin(), ly.end(), 0.0); + return accumulate(all(lx), 0.0) + + accumulate(all(ly), 0.0); } |
