summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaron Kent-Dobias <jaron@kent-dobias.com>2022-09-14 10:52:19 +0200
committerJaron Kent-Dobias <jaron@kent-dobias.com>2022-09-14 10:52:19 +0200
commit2f7c87acb04bd9dd3f14a55bb3ba7f1621c25f7c (patch)
tree1b930e36ada63a7513072a594038b41534be6357
parenta9eafe47d598b80cd9fd6f0c7d1f56e58ecdc626 (diff)
downloadcode-2f7c87acb04bd9dd3f14a55bb3ba7f1621c25f7c.tar.gz
code-2f7c87acb04bd9dd3f14a55bb3ba7f1621c25f7c.tar.bz2
code-2f7c87acb04bd9dd3f14a55bb3ba7f1621c25f7c.zip
Small simplification.
-rw-r--r--rbmp.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/rbmp.cpp b/rbmp.cpp
index 88bf18b..2b73e59 100644
--- a/rbmp.cpp
+++ b/rbmp.cpp
@@ -1,4 +1,3 @@
-
#include <iostream>
#include <cmath>
#include <functional>
@@ -96,13 +95,12 @@ public:
void propagateBeliefs() {
for (Edge& e : edges) {
for (HalfEdge& h : e.halfedges) {
- double Xt = std::numeric_limits<double>::infinity();
+ h.X = std::numeric_limits<double>::infinity();
for (const HalfEdge& hn : h.getHead().neighbors) {
if (h.getTail().index != hn.getHead().index) {
- Xt = std::min(hn.edge.weight - hn.oldX, Xt);
+ h.X = std::min(hn.edge.weight - hn.oldX, h.X);
}
}
- h.X = Xt;
}
}
@@ -136,4 +134,3 @@ int main() {
return 0;
}
-