You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by lu...@apache.org on 2015/04/08 17:13:07 UTC

[math] Fixed wrong handling of a corner case.

Repository: commons-math
Updated Branches:
  refs/heads/MATH_3_X 502335307 -> b4d2c75d3


Fixed wrong handling of a corner case.

The problem occurs in very difficult to reproduce cases, as it is really
a corner case. When the vanishing cut-subhyperplane occurs during a
Difference operation, the fixed node still has a null cut-subhyperplane.
This was not proerply handled.

JIRA: MATH-1162

Project: http://git-wip-us.apache.org/repos/asf/commons-math/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-math/commit/b4d2c75d
Tree: http://git-wip-us.apache.org/repos/asf/commons-math/tree/b4d2c75d
Diff: http://git-wip-us.apache.org/repos/asf/commons-math/diff/b4d2c75d

Branch: refs/heads/MATH_3_X
Commit: b4d2c75d394d1b178264a3e1e6721b4f77fa1eac
Parents: 5023353
Author: Luc Maisonobe <lu...@apache.org>
Authored: Wed Apr 8 17:12:32 2015 +0200
Committer: Luc Maisonobe <lu...@apache.org>
Committed: Wed Apr 8 17:12:32 2015 +0200

----------------------------------------------------------------------
 .../org/apache/commons/math3/geometry/partitioning/BSPTree.java   | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-math/blob/b4d2c75d/src/main/java/org/apache/commons/math3/geometry/partitioning/BSPTree.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math3/geometry/partitioning/BSPTree.java b/src/main/java/org/apache/commons/math3/geometry/partitioning/BSPTree.java
index 26ae45f..5395218 100644
--- a/src/main/java/org/apache/commons/math3/geometry/partitioning/BSPTree.java
+++ b/src/main/java/org/apache/commons/math3/geometry/partitioning/BSPTree.java
@@ -707,6 +707,9 @@ public class BSPTree<S extends Space> {
                     plus      = fixed.plus;
                     minus     = fixed.minus;
                     attribute = fixed.attribute;
+                    if (cut == null) {
+                        break;
+                    }
                 }
 
             }