本文整理汇总了Java中gnu.trove.TObjectIntIterator.hasNext方法的典型用法代码示例。如果您正苦于以下问题:Java TObjectIntIterator.hasNext方法的具体用法?Java TObjectIntIterator.hasNext怎么用?Java TObjectIntIterator.hasNext使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gnu.trove.TObjectIntIterator
的用法示例。
在下文中一共展示了TObjectIntIterator.hasNext方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getFirstGradedProjectionMap
import gnu.trove.TObjectIntIterator; //导入方法依赖的package包/类
public static <U extends PrimitiveBasisElement, V extends ObjectObjectPair<U, U>> ObjectObjectFunction<IntSparseFormalSum<V>, IntSparseFormalSum<U>> getFirstGradedProjectionMap(final IntAlgebraicFreeModule<U> chainModule, final IntAlgebraicFreeModule<V> dummy) {
return new ObjectObjectFunction<IntSparseFormalSum<V>, IntSparseFormalSum<U>>() {
public IntSparseFormalSum<U> evaluate(IntSparseFormalSum<V> chain) {
if (chain.isEmpty()) {
return chainModule.createNewSum();
}
int dimension = 0;
{
TObjectIntIterator<V> iterator = chain.iterator();
if (iterator.hasNext()) {
iterator.advance();
dimension = iterator.key().getFirst().getDimension() + iterator.key().getSecond().getDimension();
}
}
return SimplexStreamUtility.filterByDimension(SimplexStreamUtility.projectFirst(chain, chainModule), dimension);
}
};
}
示例2: getSecondGradedProjectionMap
import gnu.trove.TObjectIntIterator; //导入方法依赖的package包/类
public static <U extends PrimitiveBasisElement, V extends ObjectObjectPair<U, U>> ObjectObjectFunction<IntSparseFormalSum<V>, IntSparseFormalSum<U>> getSecondGradedProjectionMap(final IntAlgebraicFreeModule<U> chainModule, final IntAlgebraicFreeModule<V> dummy) {
return new ObjectObjectFunction<IntSparseFormalSum<V>, IntSparseFormalSum<U>>() {
public IntSparseFormalSum<U> evaluate(IntSparseFormalSum<V> chain) {
if (chain.isEmpty()) {
return chainModule.createNewSum();
}
int dimension = 0;
{
TObjectIntIterator<V> iterator = chain.iterator();
if (iterator.hasNext()) {
iterator.advance();
dimension = iterator.key().getFirst().getDimension() + iterator.key().getSecond().getDimension();
}
}
return SimplexStreamUtility.filterByDimension(SimplexStreamUtility.projectSecond(chain, chainModule), dimension);
}
};
}
示例3: removeFeatures
import gnu.trove.TObjectIntIterator; //导入方法依赖的package包/类
public void removeFeatures(IIntIterator removedFeatures) {
int shift = 0;
int lastGoodFeature = 0;
int totalFeatures = _featuresMap.size();
TIntIntHashMap featuresRemap = new TIntIntHashMap();
while (removedFeatures.hasNext()) {
int removedFeature = removedFeatures.next();
while (lastGoodFeature < removedFeature) {
featuresRemap.put(lastGoodFeature, lastGoodFeature - shift);
++lastGoodFeature;
}
lastGoodFeature = removedFeature + 1;
int removedFeaturePosition = removedFeature - shift;
_featuresMap.remove(_featuresRMap.get(removedFeaturePosition));
_featuresRMap.remove(removedFeaturePosition);
++shift;
}
while (lastGoodFeature < totalFeatures) {
featuresRemap.put(lastGoodFeature, lastGoodFeature - shift);
++lastGoodFeature;
}
TObjectIntIterator<String> mapIter = _featuresMap.iterator();
while (mapIter.hasNext()) {
mapIter.advance();
int value = mapIter.value();
int newvalue = featuresRemap.get(value);
mapIter.setValue(newvalue);
}
}
示例4: cloneDB
import gnu.trove.TObjectIntIterator; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public IFeatureDB cloneDB() {
TroveFeaturesDB featuresDB = new TroveFeaturesDB();
featuresDB._name = new String(_name);
TObjectIntIterator<String> iterator = _featuresMap.iterator();
while (iterator.hasNext()) {
iterator.advance();
featuresDB._featuresMap.put(iterator.key(), iterator.value());
}
featuresDB._featuresRMap = (Vector<String>) _featuresRMap.clone();
return featuresDB;
}
示例5: buildFlags
import gnu.trove.TObjectIntIterator; //导入方法依赖的package包/类
public static int buildFlags(GrModifierList modifierList) {
int flags = 0;
final TObjectIntIterator<String> iterator = GrModifierListImpl.NAME_TO_MODIFIER_FLAG_MAP.iterator();
while (iterator.hasNext()) {
iterator.advance();
if (modifierList.hasExplicitModifier(iterator.key())) {
flags |= iterator.value();
}
}
return flags;
}
示例6: extractActiveBasisElements
import gnu.trove.TObjectIntIterator; //导入方法依赖的package包/类
/**
* This function returns all of the basis elements in a chain which have
* non-zero coefficients. The primary use case will be to extract the set of
* simplicies in a chain.
*
* @param chain
* @return the set of active basis elements in a formal sum
*/
public static <U> List<U> extractActiveBasisElements(IntSparseFormalSum<U> chain) {
List<U> basisElements = new ArrayList<U>();
TObjectIntIterator<U> iter = chain.iterator();
while (iter.hasNext()) {
iter.advance();
U obj = iter.key();
basisElements.add(obj);
}
return basisElements;
}
示例7: extractCoefficients
import gnu.trove.TObjectIntIterator; //导入方法依赖的package包/类
/**
* This function returns the coefficients for a formal sum in the form of a
* list.
*
* @param chain
* @return the coefficients in the chain
*/
public static List<Integer> extractCoefficients(IntSparseFormalSum<?> chain) {
List<Integer> coefficients = new ArrayList<Integer>();
TObjectIntIterator<?> iter = chain.iterator();
while (iter.hasNext()) {
iter.advance();
coefficients.add(iter.value());
}
return coefficients;
}