All Downloads are FREE. Search and download functionalities are using the official Maven repository.

info.debatty.spark.knngraphs.builder.LSHSuperBitSparseIntegerVector Maven / Gradle / Ivy

There is a newer version: 0.15
Show newest version
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package info.debatty.spark.knngraphs.builder;

import info.debatty.java.graphs.SimilarityInterface;
import info.debatty.java.utils.SparseIntegerVector;

/**
 *
 * @author tibo
 */
public class LSHSuperBitSparseIntegerVector extends LSHSuperBit {

    public LSHSuperBitSparseIntegerVector() {
        super();
        this.similarity = new SimilarityInterface() {

            public double similarity(SparseIntegerVector value1, SparseIntegerVector value2) {
                return value1.cosineSimilarity(value2);
            }
        };
    }
    
    @Override
    int[] hash(SparseIntegerVector node_value) {
        return lsh.hash(node_value);
    }
    
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy