diff --git a/elki-core-distance/src/main/java/elki/distance/minkowski/SparseLPNormDistance.java b/elki-core-distance/src/main/java/elki/distance/minkowski/SparseLPNormDistance.java index de9d0e0edb..bedb55ff9e 100644 --- a/elki-core-distance/src/main/java/elki/distance/minkowski/SparseLPNormDistance.java +++ b/elki-core-distance/src/main/java/elki/distance/minkowski/SparseLPNormDistance.java @@ -23,11 +23,11 @@ import elki.data.SparseNumberVector; import elki.data.type.SimpleTypeInformation; import elki.distance.Norm; -import elki.distance.PrimitiveDistance; import elki.utilities.optionhandling.Parameterizer; import elki.utilities.optionhandling.constraints.CommonConstraints; import elki.utilities.optionhandling.parameterization.Parameterization; import elki.utilities.optionhandling.parameters.DoubleParameter; + import net.jafama.FastMath; /** @@ -116,7 +116,7 @@ public SimpleTypeInformation getInputTypeRestriction @Override public boolean isMetric() { - return (p >= 1.); + return p >= 1.; } /** @@ -139,16 +139,10 @@ public void configure(Parameterization config) { @Override public SparseLPNormDistance make() { - if(p == 2.) { - return SparseEuclideanDistance.STATIC; - } - if(p == 1.) { - return SparseManhattanDistance.STATIC; - } - if(p == Double.POSITIVE_INFINITY) { - return SparseMaximumDistance.STATIC; - } - return new SparseLPNormDistance(p); + return p == 2. ? SparseEuclideanDistance.STATIC : // + p == 1. ? SparseManhattanDistance.STATIC : // + p == Double.POSITIVE_INFINITY ? SparseMaximumDistance.STATIC : // + new SparseLPNormDistance(p); } } } diff --git a/elki-core-math/src/main/java/elki/math/statistics/dependence/MutualInformationEquiwidthDependence.java b/elki-core-math/src/main/java/elki/math/statistics/dependence/MutualInformationEquiwidthDependence.java index b32114efa8..dfdcaf7268 100644 --- a/elki-core-math/src/main/java/elki/math/statistics/dependence/MutualInformationEquiwidthDependence.java +++ b/elki-core-math/src/main/java/elki/math/statistics/dependence/MutualInformationEquiwidthDependence.java @@ -23,8 +23,6 @@ import elki.utilities.datastructures.arraylike.NumberArrayAdapter; import elki.utilities.optionhandling.Parameterizer; -import net.jafama.FastMath; - /** * Mutual Information (MI) dependence measure by dividing each attribute into * equal-width bins. MI can be seen as Kullback–Leibler divergence of the joint diff --git a/elki-index-mtree/src/main/java/elki/index/tree/metrical/mtreevariants/mktrees/AbstractMkTree.java b/elki-index-mtree/src/main/java/elki/index/tree/metrical/mtreevariants/mktrees/AbstractMkTree.java index aad972aa1e..f370d49be0 100644 --- a/elki-index-mtree/src/main/java/elki/index/tree/metrical/mtreevariants/mktrees/AbstractMkTree.java +++ b/elki-index-mtree/src/main/java/elki/index/tree/metrical/mtreevariants/mktrees/AbstractMkTree.java @@ -20,9 +20,6 @@ */ package elki.index.tree.metrical.mtreevariants.mktrees; -import java.util.HashMap; -import java.util.Map; - import elki.database.datastore.DataStore; import elki.database.datastore.DataStoreFactory; import elki.database.datastore.DataStoreUtil; diff --git a/elki-index-rtree/src/main/java/elki/index/tree/spatial/rstarvariants/rdknn/RdKNNTreeFactory.java b/elki-index-rtree/src/main/java/elki/index/tree/spatial/rstarvariants/rdknn/RdKNNTreeFactory.java index fa59075059..b071fab254 100644 --- a/elki-index-rtree/src/main/java/elki/index/tree/spatial/rstarvariants/rdknn/RdKNNTreeFactory.java +++ b/elki-index-rtree/src/main/java/elki/index/tree/spatial/rstarvariants/rdknn/RdKNNTreeFactory.java @@ -27,7 +27,6 @@ import elki.index.tree.spatial.rstarvariants.AbstractRStarTreeFactory; import elki.persistent.PageFile; import elki.persistent.PageFileFactory; -import elki.utilities.ClassGenericsUtil; import elki.utilities.optionhandling.OptionID; import elki.utilities.optionhandling.constraints.CommonConstraints; import elki.utilities.optionhandling.parameterization.Parameterization; diff --git a/elki-index-rtree/src/test/java/elki/index/tree/spatial/rstarvariants/rstar/RStarTreeTest.java b/elki-index-rtree/src/test/java/elki/index/tree/spatial/rstarvariants/rstar/RStarTreeTest.java index c270695042..a0fa8d419d 100644 --- a/elki-index-rtree/src/test/java/elki/index/tree/spatial/rstarvariants/rstar/RStarTreeTest.java +++ b/elki-index-rtree/src/test/java/elki/index/tree/spatial/rstarvariants/rstar/RStarTreeTest.java @@ -70,7 +70,7 @@ public void testRStarTree() { */ @Test public void testRStarTreeFast() { - RStarTreeFactory factory = new ELKIBuilder<>(RStarTreeFactory.class) // + RStarTreeFactory factory = new ELKIBuilder>(RStarTreeFactory.class) // .with(AbstractPageFileFactory.Par.PAGE_SIZE_ID, 300) // .with(AbstractRStarTreeFactory.Par.INSERTION_STRATEGY_ID, ApproximativeLeastOverlapInsertionStrategy.class) // .with(ApproximativeLeastOverlapInsertionStrategy.Par.INSERTION_CANDIDATES_ID, 1) // diff --git a/elki-index-various/src/main/java/elki/index/vafile/VAFile.java b/elki-index-various/src/main/java/elki/index/vafile/VAFile.java index 1003a76ef8..8e6745a563 100644 --- a/elki-index-various/src/main/java/elki/index/vafile/VAFile.java +++ b/elki-index-various/src/main/java/elki/index/vafile/VAFile.java @@ -46,14 +46,12 @@ import elki.utilities.datastructures.heap.DoubleMaxHeap; import elki.utilities.documentation.Reference; import elki.utilities.documentation.Title; -import elki.utilities.optionhandling.Parameterizer; import elki.utilities.optionhandling.OptionID; +import elki.utilities.optionhandling.Parameterizer; import elki.utilities.optionhandling.constraints.CommonConstraints; import elki.utilities.optionhandling.parameterization.Parameterization; import elki.utilities.optionhandling.parameters.IntParameter; -import net.jafama.FastMath; - /** * Vector-approximation file (VAFile) *

diff --git a/elki/src/main/java/elki/result/textwriter/TextWriter.java b/elki/src/main/java/elki/result/textwriter/TextWriter.java index ee9606ed5a..d5d9d49d53 100644 --- a/elki/src/main/java/elki/result/textwriter/TextWriter.java +++ b/elki/src/main/java/elki/result/textwriter/TextWriter.java @@ -20,7 +20,6 @@ */ package elki.result.textwriter; -import java.io.FileNotFoundException; import java.io.IOException; import java.io.PrintStream; import java.util.*;