本文整理汇总了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;
}
示例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;
}
示例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();
}
示例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));
}
示例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();
}
示例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++;
}
}
示例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