Package ivory.lsh.data

Examples of ivory.lsh.data.Signature


        OutputCollector<IntWritable, PairOfFloatInt> output,
        Reporter reporter) throws IOException {
      Long time = System.currentTimeMillis();
      for(int i=0;i<signatures.size();i++){
        IntWritable sampleDocno = (IntWritable)signatures.get(i).getLeftElement();
        Signature fromSample = (Signature)signatures.get(i).getRightElement();
        int dist = signature.hammingDistance(fromSample, maxDist);
 
        if(dist <= maxDist){
          output.collect(new IntWritable(sampleDocno.get()), new PairOfFloatInt(-dist,docno.get()));
        }
View Full Code Here


    public void map(IntWritable docno, Signature signature,
        OutputCollector<IntWritable, PairOfFloatInt> output, Reporter reporter) throws IOException {
      for (int i = 0; i < signatures.size(); i++) {
        reporter.incrCounter(Pairs.Total, 1);
        IntWritable sampleDocno = (IntWritable) signatures.get(i).getLeftElement();
        Signature fromSample = (Signature) signatures.get(i).getRightElement();
        int dist = signature.hammingDistance(fromSample, maxDist);
        // if((sampleDocno.get()==1000009022 && docno.get()==189034) ||
        // (sampleDocno.get()==1000170828 && docno.get()==2898431)){
        // reporter.incrCounter(Pairs.DEBUG, 1);
        // sLogger.info(sampleDocno.get()+","+docno.get()+"="+dist);
View Full Code Here

    public void map(IntWritable docno, Signature signature,
        OutputCollector<IntWritable, PairOfFloatInt> output, Reporter reporter) throws IOException {
      for (int i = 0; i < signatures.size(); i++) {
        reporter.incrCounter(Pairs.Total, 1);
        IntWritable sampleDocno = (IntWritable) signatures.get(i).getLeftElement();
        Signature fromSample = (Signature) signatures.get(i).getRightElement();
        int dist = signature.hammingDistance(fromSample, maxDist);
        // if((sampleDocno.get()==1000009022 && docno.get()==189034) ||
        // (sampleDocno.get()==1000170828 && docno.get()==2898431)){
        // reporter.incrCounter(Pairs.DEBUG, 1);
        // sLogger.info(sampleDocno.get()+","+docno.get()+"="+dist);
View Full Code Here

  }

  @Test
  public void testCompare() {
    Bits b1 = new Bits("01111111111111111111111111111110");
    Signature s1 = new NBitSignature(b1);
    Bits b2 = new Bits("10000000000000000000000000000001");
    Signature s2 = new NBitSignature(b2);

    assertTrue(s1.compareTo(s2) + "", s1.compareTo(s2) < 0);
    assertTrue(s2.compareTo(s1) + "", s2.compareTo(s1) > 0);
    assertTrue(s1.compareTo(s1) + "", s1.compareTo(s1) == 0);
    assertTrue(s2.compareTo(s2) + "", s2.compareTo(s2) == 0);

  }
View Full Code Here

    public void map(IntWritable docno, Signature signature,
        OutputCollector<IntWritable, PairOfFloatInt> output, Reporter reporter) throws IOException {
      for (int i = 0; i < signatures.size(); i++) {
        reporter.incrCounter(Pairs.Total, 1);
        IntWritable sampleDocno = signatures.get(i).getLeftElement();
        Signature fromSample = signatures.get(i).getRightElement();
        int dist = signature.hammingDistance(fromSample, maxDist);
        if (dist <= maxDist) {
          output.collect(new IntWritable(sampleDocno.get()), new PairOfFloatInt(-dist, docno.get()));
          reporter.incrCounter(Pairs.Emitted, 1);
        }
View Full Code Here

TOP

Related Classes of ivory.lsh.data.Signature

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.