Examples of OpenBitSet


Examples of org.apache.solr.util.OpenBitSet

  public int unionSize(DocSet other) {
    return this.size() + other.size() - this.intersectionSize(other);
  }

  public DocSet andNot(DocSet other) {
    OpenBitSet newbits = (OpenBitSet)(this.getBits().clone());
    newbits.andNot(other.getBits());
    return new BitDocSet(newbits);
  }
View Full Code Here

Examples of org.drools.core.util.bitmask.OpenBitSet

    public void mapNodeToCliqueFamily(OpenBitSet[] varNodeToCliques, JunctionTreeClique[] jtNodes) {
        for ( int i = 0; i < varNodeToCliques.length; i++ ) {
            GraphNode<BayesVariable> varNode = graph.getNode( i );

            // Get OpenBitSet for parents
            OpenBitSet parents = new OpenBitSet();
            int count = 0;
            for ( Edge edge : varNode.getInEdges() ) {
                parents.set( edge.getOutGraphNode().getId() );
                count++;
            }

            if ( count == 0 ) {
                // node has no parents, so simply find the smallest clique it's in.
            }

            OpenBitSet cliques = varNodeToCliques[i];
            if  ( cliques == null ) {
                throw new IllegalStateException("Node exists, that is not part of a clique. " + varNode.toString());
            }
            int bestWeight = -1;
            int clique = -1;
            // finds the smallest node, that contains all the parents
            for ( int j = cliques.nextSetBit(0); j >= 0; j = cliques.nextSetBit( j+ 1 ) ) {
                JunctionTreeClique jtNode = jtNodes[j];

                // if the node has parents, we find the small clique it's in.
                // If it has parents then is jtNode a supserset of parents, visa-vis is parents a subset of jtNode
                if ( (count == 0 || OpenBitSet.andNotCount(parents, jtNode.getBitSet()) == 0 ) && ( clique == -1 || jtNode.getBitSet().cardinality() < bestWeight ) ) {
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.