Examples of writeGamma()


Examples of it.unimi.dsi.io.InputBitStream.writeGamma()

        }
      }
     
      if ( indexingIsVirtual ) {
        final OutputBitStream sizes = new OutputBitStream( batchBasename( batch, basename, batchDir ) + DiskBasedIndex.SIZES_EXTENSION );
        for ( int i = 0; i < currSize.length; i++ ) sizes.writeGamma( currSize[ i ] );
        sizes.close();
      }

      globCounts.close();
      frequencies.close();
View Full Code Here

Examples of it.unimi.dsi.io.OutputBitStream.writeGamma()

          }
        }
      }
           
      totalFrequency = combine( numUsedIndices );
      frequencies.writeGamma( totalFrequency );
      numPointers += totalFrequency;

      /* A trick to get a correct prediction. */
      if ( writeGlobCounts ) pl.count += totalGlobCount - 1;
      pl.update();
View Full Code Here

Examples of it.unimi.dsi.io.OutputBitStream.writeGamma()

          break;
        case SHIFTED_GAMMA:
          bitCount = out.writeShiftedGamma( pointer - lastDocument - 1 );
          break;
        case GAMMA:
          bitCount = out.writeGamma( pointer - lastDocument - 1 );
          break;
        case DELTA:
          bitCount = out.writeDelta( pointer - lastDocument - 1 );
          break;
        case GOLOMB:
View Full Code Here

Examples of it.unimi.dsi.io.OutputBitStream.writeGamma()

    final int end = offset + len;
    final OutputBitStream positions = this.positions;
   
    switch( positionCoding ) {
      case GAMMA:
        if ( COOKIES ) bitCount += positions.writeGamma( Integer.MAX_VALUE );
        for( i = offset; i < end; i++ ) {
          bitCount += positions.writeGamma( occ[ i ] - prev - 1 );
          prev = occ[ i ];
        }
        break;
View Full Code Here

Examples of it.unimi.dsi.io.OutputBitStream.writeGamma()

   
    switch( positionCoding ) {
      case GAMMA:
        if ( COOKIES ) bitCount += positions.writeGamma( Integer.MAX_VALUE );
        for( i = offset; i < end; i++ ) {
          bitCount += positions.writeGamma( occ[ i ] - prev - 1 );
          prev = occ[ i ];
        }
        break;
      case DELTA:
        if ( COOKIES bitCount += positions.writeDelta( Integer.MAX_VALUE );
View Full Code Here

Examples of it.unimi.dsi.io.OutputBitStream.writeGamma()


          final OutputBitStream permutedSizes = new OutputBitStream( batchBasename( batch, basename, batchDir ) + DiskBasedIndex.SIZES_EXTENSION );
          for ( int i = 0, d = 0; i < documentCount; i++ ) {
            while ( d++ < document[ i ] )
              permutedSizes.writeGamma( 0 );
            permutedSizes.writeGamma( size[ i ] );
          }
          permutedSizes.close();
        }
      }
View Full Code Here

Examples of it.unimi.dsi.io.OutputBitStream.writeGamma()

          final OutputBitStream permutedSizes = new OutputBitStream( batchBasename( batch, basename, batchDir ) + DiskBasedIndex.SIZES_EXTENSION );
          for ( int i = 0, d = 0; i < documentCount; i++ ) {
            while ( d++ < document[ i ] )
              permutedSizes.writeGamma( 0 );
            permutedSizes.writeGamma( size[ i ] );
          }
          permutedSizes.close();
        }
      }
     
View Full Code Here

Examples of it.unimi.dsi.io.OutputBitStream.writeGamma()

        }
      }
     
      if ( indexingIsVirtual ) {
        final OutputBitStream sizes = new OutputBitStream( batchBasename( batch, basename, batchDir ) + DiskBasedIndex.SIZES_EXTENSION );
        for ( int i = 0; i < currSize.length; i++ ) sizes.writeGamma( currSize[ i ] );
        sizes.close();
      }

      globCounts.close();
      frequencies.close();
View Full Code Here

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

  public void write(DataOutput out) throws IOException {
    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
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.