Package org.fastlsh.util

Examples of org.fastlsh.util.BitSet


      }
   
    @Test
    public void stuff()
    {
        BitSet b1 = new BitSet(64);
        b1.set(0);         
        BitSet b2 = new BitSet(64);
        b2.set(1);       
        BitSet b3 = new BitSet(64);
        b3.set(2);       
        BitSet b4 = new BitSet(64);
        b4.set(0);         
        b4.set(63);         
        long l1 = b1.bits[0];
        long l2 = b2.bits[0];
        long l3 = b3.bits[0];
        long l4 = b4.bits[0];
View Full Code Here


     * @param input the input vector whose signature is desired
     * @return the LSH signature for the input vector
     */
    public BitSet makeSignature(VectorWithId input)
    {
        BitSet retval = new BitSet(hashes.length);
        for(int i = 0, max = hashes.length; i < max; i++)
        {
            retval.set(i, hashes[i].hash(input));
        }
        return retval;
    }
View Full Code Here

    }

    @Test
    public void duffTest()
    {
        BitSet b1 = new BitSet(64);
        b1.set(0);         
        BitSet b2 = new BitSet(64);
        b2.set(1);       
        BitSet b3 = new BitSet(64);
        b3.set(2);       
        BitSet b4 = new BitSet(64);
        b4.set(3);
        BitSet b5 = new BitSet(64);
        b5.set(0);         
        b5.set(63);         

        ArrayList<Signature> al = new ArrayList<Signature>();
        al.add(new Signature(1,b1));
        al.add(new Signature(2,b2));
        al.add(new Signature(4,b4));
View Full Code Here

   
    @Test
    public void sortSmall()
    {
        BitSet b1 = new BitSet(4);
        b1.set(3)
        b1.set(2)
        b1.set(1)
        b1.set(0)
       
        BitSet b2 = new BitSet(4);
        BitSet b3 = new BitSet(4);
        b3.set(2);
       
        BitSet b4 = new BitSet(4);
        b4.set(2);
        b4.set(3);

        ArrayList<Signature> al = new ArrayList<Signature>();
        al.add(new Signature(1,b1));
        al.add(new Signature(2,b2));
        al.add(new Signature(4,b4));
View Full Code Here

    }

    @Test
    public void sortBigger()
    {
        BitSet b11 = new BitSet(356);
        b11.set(3)
        b11.set(2)
        b11.set(1)
        b11.set(0)
        b11.set(200)

        BitSet b1 = new BitSet(356);
        b1.set(3)
        b1.set(2)
        b1.set(1)
        b1.set(0)
       
        BitSet b2 = new BitSet(356);
        BitSet b3 = new BitSet(356);
        b3.set(2);
       
        BitSet b4 = new BitSet(356);
        b4.set(2);
        b4.set(3);

        ArrayList<Signature> al = new ArrayList<Signature>();
        al.add(new Signature(11,b11));
        al.add(new Signature(1,b1));
        al.add(new Signature(2,b2));
View Full Code Here

        int curId = 1;
       
        Random rand = new Random();
        do
        {
            BitSet bs = new BitSet(cardinality);
            for(int i = 0; i < cardinality; i++)
            {
                if(rand.nextBoolean()) bs.set(i);
            }
            bitsetList.add(new Signature(curId, bs));
            curId++;
        }
        while(curId <= numBitSets);
View Full Code Here

TOP

Related Classes of org.fastlsh.util.BitSet

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.