本文整理匯總了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.
}