summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnur Nigmetov <a.nigmetov@gmail.com>2018-06-21 21:43:29 +0200
committerArnur Nigmetov <a.nigmetov@gmail.com>2018-06-21 21:43:29 +0200
commit657f73321f04d5d1c4cec8085ec43a73633b96af (patch)
tree0927165b2ba91a31c4f6d625d2813e1a65e328ae
parente2a2d6cb2eec5a7153d6e895a28c85c49347f644 (diff)
Bug in longest edge for negative persistence fixed
-rw-r--r--geom_bottleneck/include/basic_defs_bt.h2
-rw-r--r--geom_bottleneck/tests/data/test_008_A1
-rw-r--r--geom_bottleneck/tests/data/test_008_B1
-rw-r--r--geom_bottleneck/tests/data/test_009_A1
-rw-r--r--geom_bottleneck/tests/data/test_009_B1
-rw-r--r--geom_bottleneck/tests/data/test_list.txt2
6 files changed, 7 insertions, 1 deletions
diff --git a/geom_bottleneck/include/basic_defs_bt.h b/geom_bottleneck/include/basic_defs_bt.h
index 6124dbe..172e0f7 100644
--- a/geom_bottleneck/include/basic_defs_bt.h
+++ b/geom_bottleneck/include/basic_defs_bt.h
@@ -194,7 +194,7 @@ namespace hera {
{
if (isDiagonal())
return 0.0;
- Real pers = (y - x) / 2;
+ Real pers = fabs(y - x) / 2;
if (internal_p == get_infinity()) {
return pers;
} else if (internal_p == 1.0) {
diff --git a/geom_bottleneck/tests/data/test_008_A b/geom_bottleneck/tests/data/test_008_A
index e69de29..50b3df6 100644
--- a/geom_bottleneck/tests/data/test_008_A
+++ b/geom_bottleneck/tests/data/test_008_A
@@ -0,0 +1 @@
+0 1.1
diff --git a/geom_bottleneck/tests/data/test_008_B b/geom_bottleneck/tests/data/test_008_B
index e69de29..1935b11 100644
--- a/geom_bottleneck/tests/data/test_008_B
+++ b/geom_bottleneck/tests/data/test_008_B
@@ -0,0 +1 @@
+0 0.1
diff --git a/geom_bottleneck/tests/data/test_009_A b/geom_bottleneck/tests/data/test_009_A
index e69de29..a1b859e 100644
--- a/geom_bottleneck/tests/data/test_009_A
+++ b/geom_bottleneck/tests/data/test_009_A
@@ -0,0 +1 @@
+1.1 0
diff --git a/geom_bottleneck/tests/data/test_009_B b/geom_bottleneck/tests/data/test_009_B
index e69de29..b5befbc 100644
--- a/geom_bottleneck/tests/data/test_009_B
+++ b/geom_bottleneck/tests/data/test_009_B
@@ -0,0 +1 @@
+0.1 0
diff --git a/geom_bottleneck/tests/data/test_list.txt b/geom_bottleneck/tests/data/test_list.txt
index 1309884..24b462a 100644
--- a/geom_bottleneck/tests/data/test_list.txt
+++ b/geom_bottleneck/tests/data/test_list.txt
@@ -3,6 +3,8 @@ test_002_A test_002_B 0.01 0.2 0 0
test_003_A test_003_B 0.01 2 1 1
test_004_A test_004_B 0.01 inf -1 -1
test_005_A test_005_B 0.01 4 5 5
+test_008_A test_008_B 0.01 0.55 0 -1
+test_009_A test_009_B 0.01 0.55 0 -1
test_010_A test_010_B 0.01 1.32937
test_011_A test_011_B 0.01 1.03125
test_014_A test_014_B 0.01 0