Skip to content

Commit

Permalink
unused imports, minor cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
kno10 committed Feb 22, 2024
1 parent 262b4ef commit c9fe872
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand Down Expand Up @@ -116,7 +116,7 @@ public SimpleTypeInformation<? super SparseNumberVector> getInputTypeRestriction

@Override
public boolean isMetric() {
return (p >= 1.);
return p >= 1.;
}

/**
Expand All @@ -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);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public void testRStarTree() {
*/
@Test
public void testRStarTreeFast() {
RStarTreeFactory<NumberVector> factory = new ELKIBuilder<>(RStarTreeFactory.class) //
RStarTreeFactory<NumberVector> factory = new ELKIBuilder<RStarTreeFactory<NumberVector>>(RStarTreeFactory.class) //
.with(AbstractPageFileFactory.Par.PAGE_SIZE_ID, 300) //
.with(AbstractRStarTreeFactory.Par.INSERTION_STRATEGY_ID, ApproximativeLeastOverlapInsertionStrategy.class) //
.with(ApproximativeLeastOverlapInsertionStrategy.Par.INSERTION_CANDIDATES_ID, 1) //
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
* <p>
Expand Down
1 change: 0 additions & 1 deletion elki/src/main/java/elki/result/textwriter/TextWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
*/
package elki.result.textwriter;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.PrintStream;
import java.util.*;
Expand Down

0 comments on commit c9fe872

Please sign in to comment.