当前位置: 首页>>代码示例>>Java>>正文


Java OpenBitSet.intersect方法代码示例

本文整理汇总了Java中org.apache.lucene.util.OpenBitSet.intersect方法的典型用法代码示例。如果您正苦于以下问题:Java OpenBitSet.intersect方法的具体用法?Java OpenBitSet.intersect怎么用?Java OpenBitSet.intersect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.lucene.util.OpenBitSet的用法示例。


在下文中一共展示了OpenBitSet.intersect方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: computeDependencies

import org.apache.lucene.util.OpenBitSet; //导入方法依赖的package包/类
private void computeDependencies(int l) throws AlgorithmExecutionException {
    initializeCplusForLevel();

    // iterate through the combinations of the level
    for (OpenBitSet X : level1.keySet()) {
        // Build the intersection between X and C_plus(X)
        OpenBitSet C_plus = level1.get(X).getRhsCandidates();
        OpenBitSet intersection = (OpenBitSet) X.clone();
        intersection.intersect(C_plus);

        // clone of X for usage in the following loop
        OpenBitSet Xclone = (OpenBitSet) X.clone();

        // iterate through all elements (A) of the intersection
        for (int A = intersection.nextSetBit(0); A >= 0; A = intersection.nextSetBit(A + 1)) {
            Xclone.clear(A);

            // check if X\A -> A is valid
            StrippedPartition spXwithoutA = level0.get(Xclone).getPartition();
            StrippedPartition spX = level1.get(X).getPartition();

            if (spX.getError() == spXwithoutA.getError()) {
                // add fd to FDTree. Filter the tree at the end of the algorithm.
                dependencies.addFunctionalDependency(Xclone, A);


                // remove A from C_plus(X)
                level1.get(X).getRhsCandidates().clear(A);

                // remove all B in R\X from C_plus(X)
                OpenBitSet RwithoutX = new OpenBitSet();
                // set to R
                RwithoutX.set(1, numberAttributes + 1);
                // remove X
                RwithoutX.andNot(X);

                for (int i = RwithoutX.nextSetBit(0); i >= 0; i = RwithoutX.nextSetBit(i + 1)) {
                    level1.get(X).getRhsCandidates().clear(i);
                }

            }
            Xclone.set(A);
        }
    }
}
 
开发者ID:HPI-Information-Systems,项目名称:metanome-algorithms,代码行数:46,代码来源:TaneAlgorithmFilterTreeEnd.java

示例2: computeDependencies

import org.apache.lucene.util.OpenBitSet; //导入方法依赖的package包/类
/**
 * Computes the dependencies for the current level (level1).
 *
 * @throws AlgorithmExecutionException
 */
private void computeDependencies() throws AlgorithmExecutionException {
    initializeCplusForLevel();

    // iterate through the combinations of the level
    for (OpenBitSet X : level1.keySet()) {
        if (level1.get(X).isValid()) {
            // Build the intersection between X and C_plus(X)
            OpenBitSet C_plus = level1.get(X).getRhsCandidates();
            OpenBitSet intersection = (OpenBitSet) X.clone();
            intersection.intersect(C_plus);

            // clone of X for usage in the following loop
            OpenBitSet Xclone = (OpenBitSet) X.clone();

            // iterate through all elements (A) of the intersection
            for (int A = intersection.nextSetBit(0); A >= 0; A = intersection.nextSetBit(A + 1)) {
                Xclone.clear(A);

                // check if X\A -> A is valid
                StrippedPartition spXwithoutA = level0.get(Xclone).getPartition();
                StrippedPartition spX = level1.get(X).getPartition();

                if (spX.getError() == spXwithoutA.getError()) {
                    // found Dependency
                    OpenBitSet XwithoutA = (OpenBitSet) Xclone.clone();
                    processFunctionalDependency(XwithoutA, A);

                    // remove A from C_plus(X)
                    level1.get(X).getRhsCandidates().clear(A);

                    // remove all B in R\X from C_plus(X)
                    OpenBitSet RwithoutX = new OpenBitSet();
                    // set to R
                    RwithoutX.set(1, numberAttributes + 1);
                    // remove X
                    RwithoutX.andNot(X);

                    for (int i = RwithoutX.nextSetBit(0); i >= 0; i = RwithoutX.nextSetBit(i + 1)) {
                        level1.get(X).getRhsCandidates().clear(i);
                    }

                }
                Xclone.set(A);
            }
        }
    }
}
 
开发者ID:HPI-Information-Systems,项目名称:metanome-algorithms,代码行数:53,代码来源:TaneAlgorithm.java

示例3: computeDependencies

import org.apache.lucene.util.OpenBitSet; //导入方法依赖的package包/类
private void computeDependencies(int l) throws AlgorithmExecutionException {
    initializeCplusForLevel();

    // iterate through the combinations of the level
    for (OpenBitSet X : level1.keySet()) {
        // Build the intersection between X and C_plus(X)
        OpenBitSet C_plus = level1.get(X).getRhsCandidates();
        OpenBitSet intersection = (OpenBitSet) X.clone();
        intersection.intersect(C_plus);

        // clone of X for usage in the following loop
        OpenBitSet Xclone = (OpenBitSet) X.clone();

        // iterate through all elements (A) of the intersection
        for (int A = intersection.nextSetBit(0); A >= 0; A = intersection.nextSetBit(A + 1)) {
            Xclone.clear(A);

            // check if X\A -> A is valid
            StrippedPartition spXwithoutA = level0.get(Xclone).getPartition();
            StrippedPartition spX = level1.get(X).getPartition();

            if (spX.getError() == spXwithoutA.getError()) {
                // Add dependency to the result receiver as well as to the FDTree (dependencies),
                // which is used to check, whether a more general dependency already exists.
                OpenBitSet XwithoutA = (OpenBitSet) Xclone.clone();
                addDependencyToResultReceiver(XwithoutA, A);
                dependencies.addFunctionalDependency(Xclone, A);


                // remove A from C_plus(X)
                level1.get(X).getRhsCandidates().clear(A);

                // remove all B in R\X from C_plus(X)
                OpenBitSet RwithoutX = new OpenBitSet();
                // set to R
                RwithoutX.set(1, numberAttributes + 1);
                // remove X
                RwithoutX.andNot(X);

                for (int i = RwithoutX.nextSetBit(0); i >= 0; i = RwithoutX.nextSetBit(i + 1)) {
                    level1.get(X).getRhsCandidates().clear(i);
                }

            }
            Xclone.set(A);
        }
    }
}
 
开发者ID:HPI-Information-Systems,项目名称:metanome-algorithms,代码行数:49,代码来源:TaneAlgorithmFilterTreeDirect.java

示例4: checkIfSetIsSuperSetOf

import org.apache.lucene.util.OpenBitSet; //导入方法依赖的package包/类
private boolean checkIfSetIsSuperSetOf(OpenBitSet set, OpenBitSet set2) {
    OpenBitSet setCopy = set.clone();
    setCopy.intersect(set2);
    return setCopy.equals(set2);
}
 
开发者ID:HPI-Information-Systems,项目名称:metanome-algorithms,代码行数:6,代码来源:MAX_SET.java


注:本文中的org.apache.lucene.util.OpenBitSet.intersect方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。