Skip to content

Commit

Permalink
Increase value of epsilon in nontrivially_less_than to avoid intermin…
Browse files Browse the repository at this point in the history
…able loop (#32)

* Avoid near-infinite loop in SPI
* Precision 4 works; let's conservatively go to 8.
* Update metatext

- CID still seems to encounter issue.
  • Loading branch information
ms609 authored Aug 16, 2020
1 parent 4527591 commit ce5ffa4
Show file tree
Hide file tree
Showing 3 changed files with 261 additions and 4 deletions.
8 changes: 5 additions & 3 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# TreeDist 1.1.1.9001 (development)

- Improve floating-point arithmetic in `TreeDistance()` functions to avoid
multi-hour runtimes in corner cases.

- Improve floating-point arithmetic in `TreeDistance()` functions.

- Reduce precision of LAPJV so rounding errors do not result in interminable run
times.

- Fix rounding error in NNI 'Li' upper estimate, and improve NNI performance.

# TreeDist 1.1.1.9000
Expand Down
2 changes: 1 addition & 1 deletion src/lap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ List lapjv (NumericMatrix x, NumericVector maxX) {
}

bool nontrivially_less_than(cost a, cost b) {
return a + ((a > ROUND_PRECISION) ? 2 : 0) < b;
return a + ((a > ROUND_PRECISION) ? 8 : 0) < b;
}

/* This function is the jv shortest augmenting path algorithm to solve the
Expand Down
Loading

0 comments on commit ce5ffa4

Please sign in to comment.