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


Java LongBigArrayBigList.add方法代码示例

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


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

示例1: index

import it.unimi.dsi.fastutil.longs.LongBigArrayBigList; //导入方法依赖的package包/类
/**
 * Returns a list of pointers to a GZIP archive entries positions (including the end of file).
 *
 * @param in the stream from which to read the GZIP archive.
 * @param pl a progress logger.
 * @return a list of longs where the <em>i</em>-th long is the offset in the stream of the first byte of the <em>i</em>-th archive entry.
 */
public static LongBigArrayBigList index(final InputStream in, final ProgressLogger pl) throws IOException {
	final LongBigArrayBigList pointers = new LongBigArrayBigList();
	long current = 0;
	final GZIPArchiveReader gzar = new GZIPArchiveReader(in);
	GZIPArchive.ReadEntry re;
	for (;;) {
		re = gzar.skipEntry();
		if (re == null) break;
		pointers.add(current);
		current += re.compressedSkipLength;
		if (pl != null) pl.lightUpdate();
	}
	in.close();
	return pointers;
}
 
开发者ID:LAW-Unimi,项目名称:BUbiNG,代码行数:23,代码来源:GZIPIndexer.java

示例2: loadLongBigList

import it.unimi.dsi.fastutil.longs.LongBigArrayBigList; //导入方法依赖的package包/类
/** Commodity method for loading a big list of binary longs with specified endianness into a
 * {@linkplain LongBigArrays long big array}.
 * 
 * @param filename the file containing the longs.
 * @param byteOrder the endianness of the longs.
 * @return a big list of longs containing the longs in <code>file</code>. */
public static LongBigArrayBigList loadLongBigList( final CharSequence filename, final ByteOrder byteOrder ) throws IOException {
	final long length = new File( filename.toString() ).length() / ( Long.SIZE / Byte.SIZE );
	@SuppressWarnings("resource")
	final ReadableByteChannel channel = new FileInputStream( filename.toString() ).getChannel();
	final ByteBuffer byteBuffer = ByteBuffer.allocateDirect( 64 * 1024 ).order( byteOrder );
	final LongBigArrayBigList list = new LongBigArrayBigList( length );

	while ( channel.read( byteBuffer ) > 0 ) {
		byteBuffer.flip();
		while ( byteBuffer.hasRemaining() )
			list.add( byteBuffer.getLong() );
		byteBuffer.clear();
	}

	channel.close();
	return list;

}
 
开发者ID:lhelwerd,项目名称:WebGraph,代码行数:25,代码来源:EFGraph.java

示例3: StrippedPartition

import it.unimi.dsi.fastutil.longs.LongBigArrayBigList; //导入方法依赖的package包/类
/**
 * Create a StrippedPartition with only one equivalence class with the definied number of elements. <br/>
 * Tuple ids start with 0 to numberOfElements-1
 *
 * @param numberTuples
 */
public StrippedPartition(long numberTuples) {
    this.strippedPartition = new ObjectBigArrayBigList<LongBigArrayBigList>();
    this.elementCount = numberTuples;
    // StrippedPartition only contains partition with more than one elements.
    if (numberTuples > 1) {
        LongBigArrayBigList newEqClass = new LongBigArrayBigList();
        for (int i = 0; i < numberTuples; i++) {
            newEqClass.add(i);
        }
        this.strippedPartition.add(newEqClass);
    }
    this.calculateError();
}
 
开发者ID:HPI-Information-Systems,项目名称:metanome-algorithms,代码行数:20,代码来源:StrippedPartition.java

示例4: testRandom

import it.unimi.dsi.fastutil.longs.LongBigArrayBigList; //导入方法依赖的package包/类
@Test
public void testRandom() {
	// Weird skips
	final LongBigArrayBigList l = new LongBigArrayBigList();
	final XoRoShiRo128PlusRandom random = new XoRoShiRo128PlusRandom(0);
	for(long i = 10000000, c = 0; i-- != 0;) {
		c += Long.numberOfTrailingZeros(random.nextLong());
		l.add(c);
	}
	assertEquals(l, new EliasFanoMonotoneLongBigList(l));
}
 
开发者ID:vigna,项目名称:Sux4J,代码行数:12,代码来源:EliasFanoMonotoneLongBigListTest.java

示例5: execute

import it.unimi.dsi.fastutil.longs.LongBigArrayBigList; //导入方法依赖的package包/类
@Override
public void execute() throws AlgorithmExecutionException {

    level0 = new Object2ObjectOpenHashMap<OpenBitSet, CombinationHelper>();
    level1 = new Object2ObjectOpenHashMap<OpenBitSet, CombinationHelper>();
    prefix_blocks = new Object2ObjectOpenHashMap<OpenBitSet, ObjectArrayList<OpenBitSet>>();

    // Get information about table from database
    ObjectArrayList<Object2ObjectOpenHashMap<Object, LongBigArrayBigList>> partitions = loadData();
    setColumnIdentifiers();
    numberAttributes = this.columnNames.size();

    // Initialize table used for stripped partition product
    tTable = new LongBigArrayBigList(numberTuples);
    for (long i = 0; i < numberTuples; i++) {
        tTable.add(-1);
    }
    // Initialize FDTree to store fds and filter them before returning them.
    dependencies = new FDTree(numberAttributes);

    // Initialize Level 0
    CombinationHelper chLevel0 = new CombinationHelper();
    OpenBitSet rhsCandidatesLevel0 = new OpenBitSet();
    rhsCandidatesLevel0.set(1, numberAttributes + 1);
    chLevel0.setRhsCandidates(rhsCandidatesLevel0);
    StrippedPartition spLevel0 = new StrippedPartition(numberTuples);
    chLevel0.setPartition(spLevel0);
    spLevel0 = null;
    level0.put(new OpenBitSet(), chLevel0);
    chLevel0 = null;


    // Initialize Level 1
    for (int i = 1; i <= numberAttributes; i++) {
        OpenBitSet combinationLevel1 = new OpenBitSet();
        combinationLevel1.set(i);

        CombinationHelper chLevel1 = new CombinationHelper();
        OpenBitSet rhsCandidatesLevel1 = new OpenBitSet();
        rhsCandidatesLevel1.set(1, numberAttributes + 1);
        chLevel1.setRhsCandidates(rhsCandidatesLevel0);

        StrippedPartition spLevel1 = new StrippedPartition(partitions.get(i - 1));
        chLevel1.setPartition(spLevel1);

        level1.put(combinationLevel1, chLevel1);
    }
    partitions = null;

    // while loop (main part of TANE)
    int l = 1;
    while (!level1.isEmpty() && l <= numberAttributes) {
        // compute dependencies for a level
        computeDependencies(l);

        // prune the search space
        prune();

        // compute the combinations for the next level
        generateNextLevel();

        l++;
    }
    dependencies.filterGeneralizations();
    addAllDependenciesToResultReceiver();
}
 
开发者ID:HPI-Information-Systems,项目名称:metanome-algorithms,代码行数:67,代码来源:TaneAlgorithmFilterTreeEnd.java

示例6: execute

import it.unimi.dsi.fastutil.longs.LongBigArrayBigList; //导入方法依赖的package包/类
@Override
public void execute() throws AlgorithmExecutionException {

    level0 = new Object2ObjectOpenHashMap<OpenBitSet, CombinationHelper>();
    level1 = new Object2ObjectOpenHashMap<OpenBitSet, CombinationHelper>();
    prefix_blocks = new Object2ObjectOpenHashMap<OpenBitSet, ObjectArrayList<OpenBitSet>>();

    // Get information about table from database or csv file
    ObjectArrayList<Object2ObjectOpenHashMap<Object, LongBigArrayBigList>> partitions = loadData();
    setColumnIdentifiers();
    numberAttributes = this.columnNames.size();

    // Initialize table used for stripped partition product
    tTable = new LongBigArrayBigList(numberTuples);
    for (long i = 0; i < numberTuples; i++) {
        tTable.add(-1);
    }

    // Initialize Level 0
    CombinationHelper chLevel0 = new CombinationHelper();
    OpenBitSet rhsCandidatesLevel0 = new OpenBitSet();
    rhsCandidatesLevel0.set(1, numberAttributes + 1);
    chLevel0.setRhsCandidates(rhsCandidatesLevel0);
    StrippedPartition spLevel0 = new StrippedPartition(numberTuples);
    chLevel0.setPartition(spLevel0);
    spLevel0 = null;
    level0.put(new OpenBitSet(), chLevel0);
    chLevel0 = null;


    // Initialize Level 1
    for (int i = 1; i <= numberAttributes; i++) {
        OpenBitSet combinationLevel1 = new OpenBitSet();
        combinationLevel1.set(i);

        CombinationHelper chLevel1 = new CombinationHelper();
        OpenBitSet rhsCandidatesLevel1 = new OpenBitSet();
        rhsCandidatesLevel1.set(1, numberAttributes + 1);
        chLevel1.setRhsCandidates(rhsCandidatesLevel0);

        StrippedPartition spLevel1 = new StrippedPartition(partitions.get(i - 1));
        chLevel1.setPartition(spLevel1);

        level1.put(combinationLevel1, chLevel1);
    }
    partitions = null;

    // while loop (main part of TANE)
    int l = 1;
    while (!level1.isEmpty() && l <= numberAttributes) {
        // compute dependencies for a level
        computeDependencies();

        // prune the search space
        prune();

        // compute the combinations for the next level
        generateNextLevel();
        l++;
    }
}
 
开发者ID:HPI-Information-Systems,项目名称:metanome-algorithms,代码行数:62,代码来源:TaneAlgorithm.java

示例7: execute

import it.unimi.dsi.fastutil.longs.LongBigArrayBigList; //导入方法依赖的package包/类
@Override
public void execute() throws AlgorithmExecutionException {

    level0 = new Object2ObjectOpenHashMap<OpenBitSet, CombinationHelper>();
    level1 = new Object2ObjectOpenHashMap<OpenBitSet, CombinationHelper>();
    prefix_blocks = new Object2ObjectOpenHashMap<OpenBitSet, ObjectArrayList<OpenBitSet>>();

    // Get information about table from database
    ObjectArrayList<Object2ObjectOpenHashMap<Object, LongBigArrayBigList>> partitions = loadData();
    setColumnIdentifiers();
    numberAttributes = this.columnNames.size();

    // Initialize table used for stripped partition product
    tTable = new LongBigArrayBigList(numberTuples);
    for (long i = 0; i < numberTuples; i++) {
        tTable.add(-1);
    }
    // Initialize FDTree to store fds and filter them before returning them.
    dependencies = new FDTree(numberAttributes);

    // Initialize Level 0
    CombinationHelper chLevel0 = new CombinationHelper();
    OpenBitSet rhsCandidatesLevel0 = new OpenBitSet();
    rhsCandidatesLevel0.set(1, numberAttributes + 1);
    chLevel0.setRhsCandidates(rhsCandidatesLevel0);
    StrippedPartition spLevel0 = new StrippedPartition(numberTuples);
    chLevel0.setPartition(spLevel0);
    spLevel0 = null;
    level0.put(new OpenBitSet(), chLevel0);
    chLevel0 = null;


    // Initialize Level 1
    for (int i = 1; i <= numberAttributes; i++) {
        OpenBitSet combinationLevel1 = new OpenBitSet();
        combinationLevel1.set(i);

        CombinationHelper chLevel1 = new CombinationHelper();
        OpenBitSet rhsCandidatesLevel1 = new OpenBitSet();
        rhsCandidatesLevel1.set(1, numberAttributes + 1);
        chLevel1.setRhsCandidates(rhsCandidatesLevel0);

        StrippedPartition spLevel1 = new StrippedPartition(partitions.get(i - 1));
        chLevel1.setPartition(spLevel1);

        level1.put(combinationLevel1, chLevel1);
    }
    partitions = null;

    // while loop (main part of TANE)
    int l = 1;
    while (!level1.isEmpty() && l <= numberAttributes) {
        // compute dependencies for a level
        computeDependencies(l);

        // prune the search space
        prune();

        // compute the combinations for the next level
        generateNextLevel();

        l++;
    }
}
 
开发者ID:HPI-Information-Systems,项目名称:metanome-algorithms,代码行数:65,代码来源:TaneAlgorithmFilterTreeDirect.java


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