Examples of SparseBitVector


Examples of de.jungblut.math.sparse.SparseBitVector

  private void traverse(HuffmanTreeNode node, BitSet currentBits,
      int currentIndex, Map<VALUE, SparseBitVector> map) {

    if (node.isLeaf()) {
      // set the bits and insert
      SparseBitVector bitVector = new SparseBitVector(getCardinality());
      for (int i = currentBits.nextSetBit(0); i >= 0; i = currentBits
          .nextSetBit(i + 1)) {
        bitVector.set(i, 1d);
      }
      map.put(node.value, bitVector);
    }

    if (node.left != null) {
View Full Code Here

Examples of de.jungblut.math.sparse.SparseBitVector

        .decode(generateVector(new int[] { 1, 0, 0, 0 })).intValue());

  }

  public SparseBitVector generateVector(int[] array) {
    SparseBitVector vec = new SparseBitVector(array.length);

    for (int i = 0; i < array.length; i++) {
      if (array[i] != 0) {
        vec.set(i, 1d);
      }
    }

    return vec;
  }
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.