本文整理汇总了Java中it.unimi.dsi.fastutil.booleans.BooleanArrays类的典型用法代码示例。如果您正苦于以下问题:Java BooleanArrays类的具体用法?Java BooleanArrays怎么用?Java BooleanArrays使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BooleanArrays类属于it.unimi.dsi.fastutil.booleans包,在下文中一共展示了BooleanArrays类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import it.unimi.dsi.fastutil.booleans.BooleanArrays; //导入依赖的package包/类
/** Initialises the approximator, providing a new seed to the underlying {@link HyperLogLogCounterArray}.
*
* <p>This method must be call before a series of {@linkplain #iterate() iterations}.
* @param seed passed to {@link #clear(long)}.
*/
public void init( final long seed ) {
ensureOpen();
info( "Clearing all registers..." );
clear( seed );
// We load the counter i with node i.
for( int i = numNodes; i-- != 0; ) add( i, i );
iteration = -1;
completed = systolic = local = preLocal = false;
if ( ! external ) for( long[] a: resultBits ) LongArrays.fill( a, 0 );
if ( sumOfDistances != null ) Arrays.fill( sumOfDistances, 0 );
if ( sumOfInverseDistances != null ) Arrays.fill( sumOfInverseDistances, 0 );
for ( int i = 0; i < discountFunction.length; i++ ) Arrays.fill( discountedCentrality[ i ], 0 );
// The initial value (the iteration for this value does not actually happen).
neighbourhoodFunction.add( last = numNodes );
BooleanArrays.fill( modifiedCounter, true ); // Initially, all counters are modified.
if ( pl != null ) {
pl.displayFreeMemory = true;
pl.itemsName = "iterates";
pl.start( "Iterating..." );
}
}
示例2: clear
import it.unimi.dsi.fastutil.booleans.BooleanArrays; //导入依赖的package包/类
public void clear() {
if ( size == 0 ) return;
size = 0;
BooleanArrays.fill( used, false );
// We null all object entries so that the garbage collector can do its work.
}