Commit a112933b authored by David Novak's avatar David Novak
Browse files

* because M-Index (MIndex.java) does not use the "max_number_of_objects"...

 * because M-Index (MIndex.java) does not use the "max_number_of_objects" parameter, the PPPCodes.java is to return the max. number objects - in the future probably given by the StringToInt ID converter
 * ApproxNavProcessorPPPCodes now implements just NavProc<AbstractOperation> so that the "GetCandSetProcessor.getOperation" can return the GetCandOperation (not the included KNNOper)
parent 93973458
Loading
Loading
Loading
Loading
+2 −12
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@

    <groupId>mindex</groupId>
    <artifactId>ppp-codes</artifactId>
    <version>1.2.5-DEVEL</version>
    <version>1.2.8-DEVEL</version>
    <packaging>jar</packaging>

    <name>ppp-codes</name>
@@ -101,20 +101,10 @@
            <version>1.3</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>net.sf.trove4j</groupId>
            <artifactId>trove4j</artifactId>
            <version>3.0.3</version>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>mindex</artifactId>
            <version>(2.8.0,)</version>
        </dependency>
        <dependency>
            <groupId>messif</groupId>
            <artifactId>messif</artifactId>
            <version>(2.1.2,)</version>
            <version>([2.8.0,)</version>
        </dependency>
    </dependencies>
    <description>PPP-Codes index and search algorithm for approximate metric-based search. 
+15 −2
Original line number Diff line number Diff line
@@ -57,7 +57,11 @@ public class PPPCodeIndex extends MetricIndex {
    
    //************************************   Getters ************************//
    
    /** Returns a serializer for PPP Codes */
    /**
     * Returns a serializer for PPP Codes
     *
     * @return
     */
    public final PPPCodeReadWriter getPPPCodeReadWriter() {
        if (pppCodeSerializer == null) {
            pppCodeSerializer = new PPPCodeReadWriter(this);
@@ -90,6 +94,15 @@ public class PPPCodeIndex extends MetricIndex {
        return false;
    }

    /**
     * TODO: read this either from config and/or from the LocatorID convertor
     * @return 
     */
    public long getMaxObjectNumber() {        
        return Integer.MAX_VALUE;
//        return configuration.getLongProperty(MIndexProperty.MAX_OBJECT_NUMBER);
    }
    
        
    // **************************************    Initialization   ************************************* //

+1 −1
Original line number Diff line number Diff line
@@ -58,7 +58,7 @@ public class PPPCodeAlgorithm extends MultipleOverlaysAlgorithm {
    protected List<PPPCodeSingleAlgorithm> algorithms;

    /** Translator of string locators to unique integer IDs and back again. */
    protected LocatorStringIntConvertor locatorConvertor;
    protected final LocatorStringIntConvertor locatorConvertor;
    
    /**
     * Creates a new multi-algorithm overlay for the given collection of algorithms.
+4 −0
Original line number Diff line number Diff line
@@ -43,4 +43,8 @@ public interface LocatorStringIntConvertor extends Serializable {
     */
    public String getStringLocator(int id);
    
    /**
     * Returns the maximal number 
     */
    
}
+2 −2
Original line number Diff line number Diff line
@@ -19,10 +19,10 @@ package pppcodes.index;
import java.nio.BufferOverflowException;
import java.nio.BufferUnderflowException;
import java.util.Arrays;
import mindex.MetricIndex;
import mindex.MetricIndexes;
import mindex.distance.PartialQueryPPPDistanceCalculator;
import mindex.distance.QueryPPPDistanceCalculator;
import pppcodes.PPPCodeIndex;

/**
 * This class is meant to be created one for each PPP-Code M-Index and it
@@ -73,7 +73,7 @@ public class PPPCodeReadWriter {
     * Creates the writer given an M-Index configuration.
     * @param mIndex configuration of one M-Index overlay
     */
    public PPPCodeReadWriter(MetricIndex mIndex) {
    public PPPCodeReadWriter(PPPCodeIndex mIndex) {
        this(mIndex.getNumberOfPivots(), mIndex.getMaxLevel(), mIndex.getMaxObjectNumber());
    }

Loading