

package com.davidbracewell.apollo.hash.signature;

import com.davidbracewell.apollo.linear.NDArray;
import com.davidbracewell.apollo.stat.measure.Measure;

import java.io.Serializable;

/**
 * <p>A signature function converts a high dimensional vector into a low dimensional signature vector that allows for
 * quick nearest neighbor matches.</p>
 *
 * @author David B. Bracewell
 */
public interface SignatureFunction extends Serializable {

   /**
    * Converts the given vector into a signature
    *
    * @param vector the vector
    * @return the signature
    */
   int[] signature(NDArray vector);

   /**
    * Does this signature function produce real or binary based signatures.
    *
    * @return True if creates binary (boolean) based signatures, False otherwise
    */
   boolean isBinary();

   /**
    * Gets the dimensions of vectors it can handle.
    *
    * @return the dimension
    */
   int getDimension();

   /**
    * Gets the signature size.
    *
    * @return the signature size
    */
   int getSignatureSize();

   /**
    * Gets the measure that is associated with this signature function.
    *
    * @return the measure
    */
   Measure getMeasure();


}//END OF HashingFunction
