Loading pom.xml +1 −1 Original line number Diff line number Diff line Loading @@ -4,7 +4,7 @@ <groupId>messif</groupId> <artifactId>messif</artifactId> <version>2.3.5-DEVEL</version> <version>2.3.6-DEVEL</version> <packaging>jar</packaging> <url>http://disa.fi.muni.cz/trac/messif/</url> Loading src/main/java/messif/operations/GetCandidateSetOperation.java +12 −0 Original line number Diff line number Diff line Loading @@ -120,6 +120,18 @@ public class GetCandidateSetOperation extends AbstractOperation { } } public boolean addLocators(Iterator<String> it, int limit) { try { int i = 0; while (it.hasNext() && i ++ < limit) { candidateSetLocators.add(it.next()); } return true; } catch (IllegalStateException ex) { return false; } } // ************************ Overrides ******************************** // @Override Loading src/main/java/messif/operations/query/JoinQueryOperation.java +0 −12 Original line number Diff line number Diff line Loading @@ -88,18 +88,6 @@ public class JoinQueryOperation extends QueryOperation<RankedJoinObject> { this(mu, Integer.MAX_VALUE, skipSymmetricPairs, answerType); } /** * Creates a new instance of JoinQueryOperation for a given distance threshold and maximal number of pairs to return. * Objects in qualifying pairs added to answer are updated to {@link AnswerType#NODATA_OBJECTS no-data objects}. * @param mu the distance threshold * @param k the number of nearest pairs to retrieve * @param skipSymmetricPairs flag whether symmetric pairs should be avoided in the answer */ @AbstractOperation.OperationConstructor({"Distance threshold", "Number of nearest pairs", "Skip symmetric pairs"}) public JoinQueryOperation(float mu, int k, boolean skipSymmetricPairs) { this(mu, k, skipSymmetricPairs, AnswerType.NODATA_OBJECTS); } /** * Creates a new instance of JoinQueryOperation for a given distance threshold and maximal number of objects to return. * @param mu the distance threshold Loading src/main/java/messif/operations/query/PrintAllObjectsOperation.java +1 −1 Original line number Diff line number Diff line Loading @@ -89,7 +89,7 @@ public class PrintAllObjectsOperation extends AbstractOperation { */ @AbstractOperation.OperationConstructor({"t/f print just IDs"}) public PrintAllObjectsOperation(boolean printJustIDs) throws IOException { this(printJustIDs, File.createTempFile("all-objects-", (printJustIDs ? ".data" : ".ids"), new File(".")).getPath()); this(printJustIDs, File.createTempFile("all-objects-", (printJustIDs ? ".ids" : ".data"), new File(".")).getPath()); } /** Loading src/main/java/messif/pivotselection/KMeansPivotChooser.java +7 −1 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package messif.pivotselection; import java.util.ArrayList; import java.util.Collections; import java.util.List; import messif.objects.LocalAbstractObject; import messif.objects.PrecompDistPerforatedArrayFilter; Loading Loading @@ -45,6 +46,8 @@ public class KMeansPivotChooser extends AbstractPivotChooser { /** List of initial pivots */ protected AbstractObjectList<LocalAbstractObject> initialPivots; protected List<AbstractObjectList<LocalAbstractObject>> actualClusters; /** * Creates a new instance of KMeansPivotChooser with empty initial list of pivots. */ Loading @@ -60,6 +63,10 @@ public class KMeansPivotChooser extends AbstractPivotChooser { this.initialPivots = initialPivots; } public List<AbstractObjectList<LocalAbstractObject>> getClusters() { return actualClusters; } /** * This method only uses the preselected pivots as initial pivots for k-means and rewrites the pivots completely */ Loading Loading @@ -88,7 +95,6 @@ public class KMeansPivotChooser extends AbstractPivotChooser { boolean continueKMeans = true; // one step of the k-means algorithm List<AbstractObjectList<LocalAbstractObject>> actualClusters; int nIterations = 0; while (continueKMeans && (nIterations++ < MAX_ITERATIONS)) { System.err.println("Running "+nIterations+"th iteration"); Loading Loading
pom.xml +1 −1 Original line number Diff line number Diff line Loading @@ -4,7 +4,7 @@ <groupId>messif</groupId> <artifactId>messif</artifactId> <version>2.3.5-DEVEL</version> <version>2.3.6-DEVEL</version> <packaging>jar</packaging> <url>http://disa.fi.muni.cz/trac/messif/</url> Loading
src/main/java/messif/operations/GetCandidateSetOperation.java +12 −0 Original line number Diff line number Diff line Loading @@ -120,6 +120,18 @@ public class GetCandidateSetOperation extends AbstractOperation { } } public boolean addLocators(Iterator<String> it, int limit) { try { int i = 0; while (it.hasNext() && i ++ < limit) { candidateSetLocators.add(it.next()); } return true; } catch (IllegalStateException ex) { return false; } } // ************************ Overrides ******************************** // @Override Loading
src/main/java/messif/operations/query/JoinQueryOperation.java +0 −12 Original line number Diff line number Diff line Loading @@ -88,18 +88,6 @@ public class JoinQueryOperation extends QueryOperation<RankedJoinObject> { this(mu, Integer.MAX_VALUE, skipSymmetricPairs, answerType); } /** * Creates a new instance of JoinQueryOperation for a given distance threshold and maximal number of pairs to return. * Objects in qualifying pairs added to answer are updated to {@link AnswerType#NODATA_OBJECTS no-data objects}. * @param mu the distance threshold * @param k the number of nearest pairs to retrieve * @param skipSymmetricPairs flag whether symmetric pairs should be avoided in the answer */ @AbstractOperation.OperationConstructor({"Distance threshold", "Number of nearest pairs", "Skip symmetric pairs"}) public JoinQueryOperation(float mu, int k, boolean skipSymmetricPairs) { this(mu, k, skipSymmetricPairs, AnswerType.NODATA_OBJECTS); } /** * Creates a new instance of JoinQueryOperation for a given distance threshold and maximal number of objects to return. * @param mu the distance threshold Loading
src/main/java/messif/operations/query/PrintAllObjectsOperation.java +1 −1 Original line number Diff line number Diff line Loading @@ -89,7 +89,7 @@ public class PrintAllObjectsOperation extends AbstractOperation { */ @AbstractOperation.OperationConstructor({"t/f print just IDs"}) public PrintAllObjectsOperation(boolean printJustIDs) throws IOException { this(printJustIDs, File.createTempFile("all-objects-", (printJustIDs ? ".data" : ".ids"), new File(".")).getPath()); this(printJustIDs, File.createTempFile("all-objects-", (printJustIDs ? ".ids" : ".data"), new File(".")).getPath()); } /** Loading
src/main/java/messif/pivotselection/KMeansPivotChooser.java +7 −1 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package messif.pivotselection; import java.util.ArrayList; import java.util.Collections; import java.util.List; import messif.objects.LocalAbstractObject; import messif.objects.PrecompDistPerforatedArrayFilter; Loading Loading @@ -45,6 +46,8 @@ public class KMeansPivotChooser extends AbstractPivotChooser { /** List of initial pivots */ protected AbstractObjectList<LocalAbstractObject> initialPivots; protected List<AbstractObjectList<LocalAbstractObject>> actualClusters; /** * Creates a new instance of KMeansPivotChooser with empty initial list of pivots. */ Loading @@ -60,6 +63,10 @@ public class KMeansPivotChooser extends AbstractPivotChooser { this.initialPivots = initialPivots; } public List<AbstractObjectList<LocalAbstractObject>> getClusters() { return actualClusters; } /** * This method only uses the preselected pivots as initial pivots for k-means and rewrites the pivots completely */ Loading Loading @@ -88,7 +95,6 @@ public class KMeansPivotChooser extends AbstractPivotChooser { boolean continueKMeans = true; // one step of the k-means algorithm List<AbstractObjectList<LocalAbstractObject>> actualClusters; int nIterations = 0; while (continueKMeans && (nIterations++ < MAX_ITERATIONS)) { System.err.println("Running "+nIterations+"th iteration"); Loading