当前位置: 首页>>代码示例>>Java>>正文


Java TObjectIntIterator.hasNext方法代码示例

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

	};
}
 
开发者ID:appliedtopology,项目名称:javaplex,代码行数:26,代码来源:InducedHomologyMappingUtility.java

示例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);
		}

	};
}
 
开发者ID:appliedtopology,项目名称:javaplex,代码行数:26,代码来源:InducedHomologyMappingUtility.java

示例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);
    }
}
 
开发者ID:jatecs,项目名称:jatecs,代码行数:32,代码来源:TroveFeaturesDB.java

示例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;
}
 
开发者ID:jatecs,项目名称:jatecs,代码行数:16,代码来源:TroveFeaturesDB.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:GrModifierListStub.java

示例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;
}
 
开发者ID:appliedtopology,项目名称:javaplex,代码行数:23,代码来源:FormalSumUtility.java

示例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;
}
 
开发者ID:appliedtopology,项目名称:javaplex,代码行数:20,代码来源:FormalSumUtility.java


注:本文中的gnu.trove.TObjectIntIterator.hasNext方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。