Examples of writeGamma()


Examples of ivory.core.compression.BitOutputStream.writeGamma()

      try {
        ByteArrayOutputStream b = new ByteArrayOutputStream();
        BitOutputStream t = new BitOutputStream(b);
        for (int i = 0; i < tf; i++) {
          if (i == 0) {
            t.writeGamma(positions[0]);
          } else {
            int pgap = positions[i] - positions[i - 1];
            if (positions[i] <= 0 || pgap == 0) {
              throw new RuntimeException("Error: invalid term positions " + toString());
            }
View Full Code Here

Examples of ivory.core.compression.BitOutputStream.writeGamma()

            int pgap = positions[i] - positions[i - 1];
            if (positions[i] <= 0 || pgap == 0) {
              throw new RuntimeException("Error: invalid term positions " + toString());
            }

            t.writeGamma(pgap);
          }
        }

        int bitOffset = t.getBitOffset();
        int byteOffset = (int) t.getByteOffset();
View Full Code Here

Examples of ivory.core.compression.BitOutputStream.writeGamma()

   */
  public static byte[] serializePositions(int[] positions) throws IOException {
    ByteArrayOutputStream b = new ByteArrayOutputStream();
    BitOutputStream t = new BitOutputStream(b);

    t.writeGamma(positions.length);

    for (int i = 0; i < positions.length; i++) {
      if (i == 0) {
        t.writeGamma(positions[0] + 1);
      } else {
View Full Code Here

Examples of ivory.core.compression.BitOutputStream.writeGamma()

    t.writeGamma(positions.length);

    for (int i = 0; i < positions.length; i++) {
      if (i == 0) {
        t.writeGamma(positions[0] + 1);
      } else {
        int pgap = positions[i] - positions[i - 1];
        t.writeGamma(pgap);
      }
    }
View Full Code Here

Examples of ivory.core.compression.BitOutputStream.writeGamma()

    for (int i = 0; i < positions.length; i++) {
      if (i == 0) {
        t.writeGamma(positions[0] + 1);
      } else {
        int pgap = positions[i] - positions[i - 1];
        t.writeGamma(pgap);
      }
    }

    t.padAndFlush();
    t.close();
View Full Code Here

Examples of ivory.core.compression.BitOutputStream.writeGamma()

   */
  public static byte[] serializePositions(int[] positions) throws IOException {
    ByteArrayOutputStream b = new ByteArrayOutputStream();
    BitOutputStream t = new BitOutputStream(b);

    t.writeGamma(positions.length);

    for (int i = 0; i < positions.length; i++) {
      if (i == 0) {
        t.writeGamma(positions[0] + 1);
      } else {
View Full Code Here

Examples of ivory.core.compression.BitOutputStream.writeGamma()

    t.writeGamma(positions.length);

    for (int i = 0; i < positions.length; i++) {
      if (i == 0) {
        t.writeGamma(positions[0] + 1);
      } else {
        int pgap = positions[i] - positions[i - 1];
        t.writeGamma(pgap);
      }
    }
View Full Code Here

Examples of ivory.core.compression.BitOutputStream.writeGamma()

    for (int i = 0; i < positions.length; i++) {
      if (i == 0) {
        t.writeGamma(positions[0] + 1);
      } else {
        int pgap = positions[i] - positions[i - 1];
        t.writeGamma(pgap);
      }
    }

    t.padAndFlush();
    t.close();
View Full Code Here

Examples of org.terrier.compression.MemorySBOS.writeGamma()

            //obtain the compressed memory posting list
            final MemorySBOS Docs = p.getDocs();
            //some obscure problem when reading from memory rather than disk.
            //by padding the posting list with some non zero bytes the problem
            //is solved. Thanks to Roicho for working this one out.
            Docs.writeGamma(1);
            Docs.writeGamma(1);
            Docs.pad();
         
            //use a PostingInRun to decompress the postings stored in memory
            final PostingInRun pir = getPostingReader();
View Full Code Here

Examples of org.terrier.compression.MemorySBOS.writeGamma()

            final MemorySBOS Docs = p.getDocs();
            //some obscure problem when reading from memory rather than disk.
            //by padding the posting list with some non zero bytes the problem
            //is solved. Thanks to Roicho for working this one out.
            Docs.writeGamma(1);
            Docs.writeGamma(1);
            Docs.pad();
         
            //use a PostingInRun to decompress the postings stored in memory
            final PostingInRun pir = getPostingReader();
            pir.setDf(p.getDocF());
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.