Package net.sf.cram.stats.CompressionHeaderFactory

Examples of net.sf.cram.stats.CompressionHeaderFactory.HuffmanParamsCalculator.values()


    }

    cal.calculate();

    CanonicalHuffmanIntegerCodec c = new CanonicalHuffmanIntegerCodec(
        cal.values(), cal.bitLens());
    long time6 = System.nanoTime() ;

    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    DefaultBitOutputStream bos = new DefaultBitOutputStream(baos);
   
View Full Code Here


    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    DefaultBitOutputStream bos = new DefaultBitOutputStream(baos);
   
    long time1=System.nanoTime() ;
    for (int i = 0; i < size; i++) {
      for (int b : cal.values()) {
        c.write(bos, b);
      }
    }

    bos.close();
View Full Code Here

    ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
    DefaultBitInputStream bis = new DefaultBitInputStream(bais);

    long time3=System.nanoTime() ;
    for (int i = 0; i < size; i++) {
      for (int b : cal.values()) {
        int v = c.read(bis);
        if (v != b)
          fail("Mismatch: " + v + " vs " + b);
      }
    }
View Full Code Here

          fail("Mismatch: " + v + " vs " + b);
      }
    }
    long time4=System.nanoTime() ;
   
    System.out.printf("Size: %d bytes, bits per value: %.2f, create time %dms, write time %d ms, read time %d ms.", baos.size(), 8f*baos.size()/size/cal.values().length, (time6-time5)/1000000, (time2-time1)/1000000, (time4-time3)/1000000);
  }
}
View Full Code Here

    }
    iterator.close();
    r.close();
    c.calculate();

    int[] values = c.values();
    int[] lens = c.bitLens();
    System.out.println(Arrays.toString(values));
    System.out.println(Arrays.toString(lens));

    EncodingParams params = HuffmanIntegerEncoding.toParam(values, lens);
View Full Code Here

    DefaultBitInputStream bis = new DefaultBitInputStream(bais);

    long time3 = System.nanoTime();
    int counter = 0;
    for (int i = 0; i < size; i++) {
      for (int b : cal.values()) {
        int v = helper.read(bis);
        if (v != b)
          fail("Mismatch: " + v + " vs " + b + " at " + counter);

        counter++;
View Full Code Here

    long time4 = System.nanoTime();

    System.out
        .printf("Size: %d bytes, bits per value: %.2f, create time %dms, write time %d ms, read time %d ms.",
            baos.size(), 8f * baos.size() / size
                / cal.values().length,
            (time6 - time5) / 1000000, (time2 - time1) / 1000000,
            (time4 - time3) / 1000000);
  }

}
View Full Code Here

    cal.calculate();

    // CanonicalHuffmanIntegerCodec helper = new
    // CanonicalHuffmanIntegerCodec(
    // cal.values(), cal.bitLens());
    Helper helper = new Helper(cal.values(), cal.bitLens());
    long time6 = System.nanoTime();

    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    DefaultBitOutputStream bos = new DefaultBitOutputStream(baos);
View Full Code Here

    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    DefaultBitOutputStream bos = new DefaultBitOutputStream(baos);

    long time1 = System.nanoTime();
    for (int i = 0; i < size; i++) {
      for (int b : cal.values()) {
        helper.write(bos, b);
      }
    }

    bos.close();
View Full Code Here

    DefaultBitInputStream bis = new DefaultBitInputStream(bais);

    long time3 = System.nanoTime();
    int counter = 0;
    for (int i = 0; i < size; i++) {
      for (int b : cal.values()) {
        int v = helper.read(bis);
        if (v != b)
          fail("Mismatch: " + v + " vs " + b + " at " + counter);

        counter++;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.