• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java IntBigArrays类的典型用法和代码示例

java 2次浏览

本文整理汇总了Java中it.unimi.dsi.fastutil.ints.IntBigArrays的典型用法代码示例。如果您正苦于以下问题:Java IntBigArrays类的具体用法?Java IntBigArrays怎么用?Java IntBigArrays使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

IntBigArrays类属于it.unimi.dsi.fastutil.ints包,在下文中一共展示了IntBigArrays类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: ConsecutiveItemsHugeTidList

点赞 3

import it.unimi.dsi.fastutil.ints.IntBigArrays; //导入依赖的package包/类
public ConsecutiveItemsHugeTidList(Counters counters, int highestTidList) {
	long startPos = 0;
	int top = Math.min(highestTidList, counters.getMaxFrequent() + 1);
	this.indexAndFreqs = new long[top * 2];
	for (int i = 0; i < top; i++) {
		int itemIndex = i << 1;
		int count = counters.distinctTransactionsCounts[i];
		if (count > 0) {
			this.indexAndFreqs[itemIndex] = startPos;
			startPos += count;
		} else {
			this.indexAndFreqs[itemIndex] = -1;
		}
	}
	this.tidLists = IntBigArrays.newBigArray(startPos);
}
 

开发者ID:slide-lig,
项目名称:jlcm,
代码行数:17,
代码来源:ConsecutiveItemsHugeTidList.java

示例2: Long2IntOpenHashBigMap

点赞 2

import it.unimi.dsi.fastutil.ints.IntBigArrays; //导入依赖的package包/类
/**
 * Creates a new hash big set.
 * 
 * <p>The actual table size will be the least power of two greater than
 * <code>expected</code>/<code>f</code>.
 * 
 * @param expected the expected number of elements in the set.
 * @param f the load factor.
 */
public Long2IntOpenHashBigMap( final long expected, final float f ) {
	if ( f <= 0 || f > 1 ) throw new IllegalArgumentException( "Load factor must be greater than 0 and smaller than or equal to 1" );
	if ( n < 0 ) throw new IllegalArgumentException( "The expected number of elements must be nonnegative" );
	this.f = f;
	n = bigArraySize( expected, f );
	maxFill = maxFill( n, f );
	key = LongBigArrays.newBigArray( n );
	value = IntBigArrays.newBigArray( n );
	used = BooleanBigArrays.newBigArray( n );
	initMasks();
}
 

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

示例3: clone

点赞 2

import it.unimi.dsi.fastutil.ints.IntBigArrays; //导入依赖的package包/类
@Override
public TransactionsList clone() {
	try {
		IntHugeTransactionsList o = (IntHugeTransactionsList) super.clone();
		o.indexSegmentsAndFreqs = Arrays.copyOf(this.indexSegmentsAndFreqs, this.indexSegmentsAndFreqs.length);
		o.concatenated = IntBigArrays.copy(this.concatenated);
		o.size = this.size;
		return o;
	} catch (CloneNotSupportedException e) {
		e.printStackTrace();
	}
	return null;
}
 

开发者ID:slide-lig,
项目名称:jlcm,
代码行数:14,
代码来源:IntHugeTransactionsList.java

示例4: addTransaction

点赞 2

import it.unimi.dsi.fastutil.ints.IntBigArrays; //导入依赖的package包/类
@Override
public void addTransaction(int item, int transaction) {
	int itemIndex = item << 1;
	if (itemIndex > this.indexAndFreqs.length || this.indexAndFreqs[itemIndex] == -1) {
		throw new IllegalArgumentException("item " + item + " has no tidlist");
	}
	long start = this.indexAndFreqs[itemIndex];
	long index = this.indexAndFreqs[itemIndex + 1];
	IntBigArrays.set(tidLists, start + index, transaction);
	this.indexAndFreqs[itemIndex + 1]++;
}
 

开发者ID:slide-lig,
项目名称:jlcm,
代码行数:12,
代码来源:ConsecutiveItemsHugeTidList.java

示例5: clone

点赞 2

import it.unimi.dsi.fastutil.ints.IntBigArrays; //导入依赖的package包/类
@Override
public TidList clone() {
	try {
		ConsecutiveItemsHugeTidList c = (ConsecutiveItemsHugeTidList) super.clone();
		c.indexAndFreqs = Arrays.copyOf(this.indexAndFreqs, this.indexAndFreqs.length);
		c.tidLists = IntBigArrays.copy(this.tidLists);
		return c;
	} catch (CloneNotSupportedException e) {
		e.printStackTrace();
	}
	return null;
}
 

开发者ID:slide-lig,
项目名称:jlcm,
代码行数:13,
代码来源:ConsecutiveItemsHugeTidList.java

示例6: rehash

点赞 2

import it.unimi.dsi.fastutil.ints.IntBigArrays; //导入依赖的package包/类
protected void rehash( final long newN ) {
	final boolean used[][] = this.used;
	final long key[][] = this.key;
	final int[][] value = this.value;
	final boolean newUsed[][] = BooleanBigArrays.newBigArray( newN );
	final long newKey[][] = LongBigArrays.newBigArray( newN );
	final int newValue[][] = IntBigArrays.newBigArray( newN );
	final long newMask = newN - 1;
	final int newSegmentMask = newKey[ 0 ].length - 1;
	final int newBaseMask = newKey.length - 1;

	int base = 0, displ = 0;
	long h;
	long k;

	for ( long i = size; i-- != 0; ) {

		while ( !used[ base ][ displ ] )
			base = ( base + ( ( displ = ( displ + 1 ) & segmentMask ) == 0 ? 1 : 0 ) );

		k = key[ base ][ displ ];
		h = it.unimi.dsi.fastutil.HashCommon.murmurHash3( k );

		// The starting point.
		int d = (int)( h & newSegmentMask );
		int b = (int)( ( h & newMask ) >>> BigArrays.SEGMENT_SHIFT );

		while ( newUsed[ b ][ d ] )
			b = ( b + ( ( d = ( d + 1 ) & newSegmentMask ) == 0 ? 1 : 0 ) ) & newBaseMask;

		newUsed[ b ][ d ] = true;
		newKey[ b ][ d ] = k;
		newValue[ b ][ d ] = value[ base ][ displ ];

		base = ( base + ( ( displ = ( displ + 1 ) & segmentMask ) == 0 ? 1 : 0 ) );
	}

	this.n = newN;
	this.key = newKey;
	this.value = newValue;
	this.used = newUsed;
	initMasks();
	maxFill = maxFill( n, f );
}
 

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

示例7: IntHugeTransactionsList

点赞 2

import it.unimi.dsi.fastutil.ints.IntBigArrays; //导入依赖的package包/类
public IntHugeTransactionsList(long transactionsLength, int nbTransactions) {
	this.indexSegmentsAndFreqs = new int[nbTransactions * 3];
	Arrays.fill(this.indexSegmentsAndFreqs, -1);
	this.concatenated = IntBigArrays.newBigArray(transactionsLength);
}
 

开发者ID:slide-lig,
项目名称:jlcm,
代码行数:6,
代码来源:IntHugeTransactionsList.java

示例8: next

点赞 2

import it.unimi.dsi.fastutil.ints.IntBigArrays; //导入依赖的package包/类
@Override
public int next() {
	return IntBigArrays.get(tidLists, this.i++);
}
 

开发者ID:slide-lig,
项目名称:jlcm,
代码行数:5,
代码来源:ConsecutiveItemsHugeTidList.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)