You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by kw...@apache.org on 2018/02/13 15:32:06 UTC
lucene-solr:branch_6x: LUCENE-8171: Check only for exactly zero
magnitude vector, and otherwise let the iterative code try to converge.
Repository: lucene-solr
Updated Branches:
refs/heads/branch_6x ee968109f -> 9d222fc7c
LUCENE-8171: Check only for exactly zero magnitude vector, and otherwise let the iterative code try to converge.
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/9d222fc7
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/9d222fc7
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/9d222fc7
Branch: refs/heads/branch_6x
Commit: 9d222fc7c7e33f8deb192227d703f00edd8e38ce
Parents: ee96810
Author: Karl Wright <Da...@gmail.com>
Authored: Tue Feb 13 10:31:13 2018 -0500
Committer: Karl Wright <Da...@gmail.com>
Committed: Tue Feb 13 10:31:59 2018 -0500
----------------------------------------------------------------------
.../src/java/org/apache/lucene/spatial3d/geom/Vector.java | 5 ++---
.../test/org/apache/lucene/spatial3d/geom/RandomPlaneTest.java | 1 -
2 files changed, 2 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9d222fc7/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/Vector.java
----------------------------------------------------------------------
diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/Vector.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/Vector.java
index 5209df8..62b3f5e 100755
--- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/Vector.java
+++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/Vector.java
@@ -106,10 +106,9 @@ public class Vector {
final double thisZ = AX * BY - AY * BX;
final double magnitude = magnitude(thisX, thisY, thisZ);
- if (magnitude < MINIMUM_RESOLUTION) {
+ if (magnitude == 0.0) {
throw new IllegalArgumentException("Degenerate/parallel vector constructed");
}
-
final double inverseMagnitude = 1.0/magnitude;
double normalizeX = thisX * inverseMagnitude;
@@ -215,7 +214,7 @@ public class Vector {
final double thisZ = A.x * B.y - A.y * B.x;
final double magnitude = magnitude(thisX, thisY, thisZ);
- if (magnitude < MINIMUM_RESOLUTION) {
+ if (magnitude == 0.0) {
return true;
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9d222fc7/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/RandomPlaneTest.java
----------------------------------------------------------------------
diff --git a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/RandomPlaneTest.java b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/RandomPlaneTest.java
index 8c94c9c..d7828bd 100644
--- a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/RandomPlaneTest.java
+++ b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/RandomPlaneTest.java
@@ -52,7 +52,6 @@ public class RandomPlaneTest extends RandomGeo3dShapeGenerator {
}
}
- @Ignore
@Test
@Repeat(iterations = 10)
public void testPlaneThreePointsAccuracy() {