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 2017/09/26 07:20:50 UTC
[1/2] lucene-solr:master: LUCENE-7970: Handle the case where we
generate only a pair of identical planes,
as might happen when the center is near a pole.
Repository: lucene-solr
Updated Branches:
refs/heads/master 7752c0525 -> ec5704e4a
LUCENE-7970: Handle the case where we generate only a pair of identical planes, as might happen when the center is near a pole.
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/49583ed1
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/49583ed1
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/49583ed1
Branch: refs/heads/master
Commit: 49583ed13da97cd11c8b9d1b3a88079175a6c69d
Parents: f8f1956
Author: Karl Wright <Da...@gmail.com>
Authored: Tue Sep 26 03:20:32 2017 -0400
Committer: Karl Wright <Da...@gmail.com>
Committed: Tue Sep 26 03:20:32 2017 -0400
----------------------------------------------------------------------
.../lucene/spatial3d/geom/GeoExactCircle.java | 30 +++++++++++++-------
1 file changed, 20 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/49583ed1/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoExactCircle.java
----------------------------------------------------------------------
diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoExactCircle.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoExactCircle.java
index b6ae081..03eb5ce 100644
--- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoExactCircle.java
+++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoExactCircle.java
@@ -119,8 +119,9 @@ class GeoExactCircle extends GeoBaseCircle {
this.notableEdgePoints = null;
} else {
this.circlePlanes = new ArrayList<>();
- this.notableEdgePoints = new ArrayList<>();
- this.eitherBounds = new HashMap<>();
+ // If it turns out that there's only one circle plane, this array will be populated but unused
+ final List<GeoPoint[]> notableEdgePoints = new ArrayList<>();
+
// We construct approximation planes until we have a low enough error estimate
final List<ApproximationSlice> slices = new ArrayList<>(100);
// Construct four cardinal points, and then we'll build the first two planes
@@ -154,9 +155,11 @@ class GeoExactCircle extends GeoBaseCircle {
final GeoPoint interpPoint2 = planetModel.surfacePointOnBearing(center, cutoffAngle, interpPoint2Bearing);
// Is this point on the plane? (that is, is the approximation good enough?)
if (Math.abs(thisSlice.plane.evaluate(interpPoint1)) < actualAccuracy && Math.abs(thisSlice.plane.evaluate(interpPoint2)) < actualAccuracy) {
- // Good enough; add it to the list of planes
- circlePlanes.add(thisSlice.plane);
- notableEdgePoints.add(new GeoPoint[]{thisSlice.endPoint1, thisSlice.endPoint2});
+ // Good enough; add it to the list of planes, unless it was identical to the previous plane
+ if (circlePlanes.size() == 0 || !circlePlanes.get(circlePlanes.size()-1).isNumericallyIdentical(thisSlice.plane)) {
+ circlePlanes.add(thisSlice.plane);
+ notableEdgePoints.add(new GeoPoint[]{thisSlice.endPoint1, thisSlice.endPoint2});
+ }
} else {
// Split the plane into two, and add it back to the end
slices.add(new ApproximationSlice(center,
@@ -173,11 +176,18 @@ class GeoExactCircle extends GeoBaseCircle {
//System.out.println("Number of planes needed: "+circlePlanes.size());
// Compute bounds
- for (int i = 0; i < circlePlanes.size(); i++) {
- final SidedPlane thisPlane = circlePlanes.get(i);
- final SidedPlane previousPlane = (i == 0)?circlePlanes.get(circlePlanes.size()-1):circlePlanes.get(i-1);
- final SidedPlane nextPlane = (i == circlePlanes.size()-1)?circlePlanes.get(0):circlePlanes.get(i+1);
- eitherBounds.put(thisPlane, new EitherBound(previousPlane, nextPlane));
+ if (circlePlanes.size() == 1) {
+ this.eitherBounds = null;
+ this.notableEdgePoints = null;
+ } else {
+ this.notableEdgePoints = notableEdgePoints;
+ this.eitherBounds = new HashMap<>(circlePlanes.size());
+ for (int i = 0; i < circlePlanes.size(); i++) {
+ final SidedPlane thisPlane = circlePlanes.get(i);
+ final SidedPlane previousPlane = (i == 0)?circlePlanes.get(circlePlanes.size()-1):circlePlanes.get(i-1);
+ final SidedPlane nextPlane = (i == circlePlanes.size()-1)?circlePlanes.get(0):circlePlanes.get(i+1);
+ eitherBounds.put(thisPlane, new EitherBound(previousPlane, nextPlane));
+ }
}
}
}
[2/2] lucene-solr:master: Merge branch 'master' of
https://git-wip-us.apache.org/repos/asf/lucene-solr
Posted by kw...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/lucene-solr
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/ec5704e4
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/ec5704e4
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/ec5704e4
Branch: refs/heads/master
Commit: ec5704e4af47b971eba8b6870bb007e14e1089de
Parents: 49583ed 7752c05
Author: Karl Wright <Da...@gmail.com>
Authored: Tue Sep 26 03:20:41 2017 -0400
Committer: Karl Wright <Da...@gmail.com>
Committed: Tue Sep 26 03:20:41 2017 -0400
----------------------------------------------------------------------
.../maven/lucene/spatial3d/pom.xml.template | 13 +
lucene/CHANGES.txt | 3 +
.../directory/DirectoryTaxonomyWriter.java | 2 +-
lucene/ivy-versions.properties | 2 +-
.../morfologik-ukrainian-search-3.7.6.jar.sha1 | 1 -
.../morfologik-ukrainian-search-3.9.0.jar.sha1 | 1 +
solr/CHANGES.txt | 3 +
.../org/apache/solr/core/CoreContainer.java | 42 +-
.../org/apache/solr/handler/StreamHandler.java | 6 +-
.../src/basic-authentication-plugin.adoc | 4 +-
.../src/collapse-and-expand-results.adoc | 20 +-
solr/solr-ref-guide/src/enabling-ssl.adoc | 18 +-
solr/solr-ref-guide/src/faceting.adoc | 4 +-
.../src/implicit-requesthandlers.adoc | 19 +-
.../src/major-changes-in-solr-7.adoc | 4 +-
.../src/making-and-restoring-backups.adoc | 5 +-
solr/solr-ref-guide/src/managed-resources.adoc | 2 +-
solr/solr-ref-guide/src/managing-solr.adoc | 2 +-
.../src/mbean-request-handler.adoc | 13 +-
.../src/meta-docs/asciidoc-syntax.adoc | 10 +-
.../src/near-real-time-searching.adoc | 8 +-
.../src/performance-statistics-reference.adoc | 2 +-
solr/solr-ref-guide/src/query-re-ranking.adoc | 2 +-
solr/solr-ref-guide/src/response-writers.adoc | 28 +-
.../src/rule-based-authorization-plugin.adoc | 21 +-
.../src/running-solr-on-hdfs.adoc | 3 +-
...rcloud-query-routing-and-read-tolerance.adoc | 3 +-
.../src/statistical-programming.adoc | 190 ++-
.../src/stream-decorator-reference.adoc | 1216 ++++++++++++++++++
solr/solr-ref-guide/src/stream-decorators.adoc | 1216 ------------------
.../src/stream-evaluator-reference.adoc | 966 ++++++++++++++
solr/solr-ref-guide/src/stream-evaluators.adoc | 1030 ---------------
.../src/stream-source-reference.adoc | 539 ++++++++
solr/solr-ref-guide/src/stream-sources.adoc | 540 --------
.../src/streaming-expressions.adoc | 8 +-
.../src/the-query-elevation-component.adoc | 24 +-
.../solr-ref-guide/src/the-stats-component.adoc | 8 +-
.../src/the-term-vector-component.adoc | 3 +-
.../solr-ref-guide/src/the-terms-component.adoc | 18 +-
solr/solr-ref-guide/src/working-with-dates.adoc | 12 +-
.../client/solrj/io/eval/MeanEvaluator.java | 57 +
.../io/eval/WeibullDistributionEvaluator.java | 48 +
.../solrj/io/stream/StreamExpressionTest.java | 47 +
43 files changed, 3165 insertions(+), 2998 deletions(-)
----------------------------------------------------------------------