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


Java IntList.getInt方法代码示例

本文整理汇总了Java中it.unimi.dsi.fastutil.ints.IntList.getInt方法的典型用法代码示例。如果您正苦于以下问题:Java IntList.getInt方法的具体用法?Java IntList.getInt怎么用?Java IntList.getInt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在it.unimi.dsi.fastutil.ints.IntList的用法示例。


在下文中一共展示了IntList.getInt方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: checkNoProvoking

import it.unimi.dsi.fastutil.ints.IntList; //导入方法依赖的package包/类
private static boolean checkNoProvoking(IntList indices, int faceSize, int pos) {
	int usedId=indices.getInt(pos);
	for(int i=0;i<indices.size();i+=faceSize) {
		if(indices.getInt(i)==usedId)return false;
	}
	return true;
}
 
开发者ID:LapisSea,项目名称:OpenGL-Bullet-engine,代码行数:8,代码来源:ModelUtil.java

示例2: uncompress

import it.unimi.dsi.fastutil.ints.IntList; //导入方法依赖的package包/类
public static float[] uncompress(float[] dest, FloatList data, IntList indices, int partSize){
	int counter=0;
	for(int i=0;i<indices.size();i++){
		int pos=indices.getInt(i)*partSize;
		
		for(int j=0;j<partSize;j++){
			dest[counter++]=data.getFloat(pos+j);
		}
	}
	
	return dest;
}
 
开发者ID:LapisSea,项目名称:OpenGL-Bullet-engine,代码行数:13,代码来源:ModelUtil.java

示例3: increaseMeasure

import it.unimi.dsi.fastutil.ints.IntList; //导入方法依赖的package包/类
private void increaseMeasure(final IntList measureList, final int level) {
  if (measureList.size() > level - 1) {
    final int prev = measureList.getInt(level - 1);
    measureList.set(level - 1, prev + 1);
  } else {
    final int skippedLevels = level - measureList.size() - 1;
    // add 0 for no application of the pruning rule in the skipped levels
    for (int i = 0; i < skippedLevels; i++) {
      measureList.add(0);
    }
    // add 1 for one application of the pruning rule in the new level
    measureList.add(1);
  }
}
 
开发者ID:HPI-Information-Systems,项目名称:metanome-algorithms,代码行数:15,代码来源:Statistics.java

示例4: sum

import it.unimi.dsi.fastutil.ints.IntList; //导入方法依赖的package包/类
private int sum(IntList list) {
	int result = 0;
	int size = list.size();
	for (int i = 0; i < size; ++i) {
		result += list.getInt(i);
	}
	return result;
}
 
开发者ID:gpanther,项目名称:itdays-2016-cpu-workshop,代码行数:9,代码来源:_01_b_ListSum.java

示例5: evaluate

import it.unimi.dsi.fastutil.ints.IntList; //导入方法依赖的package包/类
public double evaluate(DoubleList preds, PredictiveModel boostModel,
                       LearningData validData, IntList subset) {
    double objVal = 0.0;
    int idx = 0;
    validData.startNewIteration();
    List<LearningInstance> instances;
    while ((instances = validData.getLearningInstance()).size() > 0) {
        List<StochasticOracle> oracles = new ArrayList<>(instances.size());
        for (LearningInstance ins : instances) {
            double modelOutput = 0.0;
            if (preds != null) {
                int subidx = idx;
                if (subset != null) {
                    subidx = subset.getInt(idx);
                }
                modelOutput += (preds.getDouble(subidx));
                idx++;
            }
            modelOutput += boostModel.predict(ins)[0];
            oracles.add(new StochasticOracle(modelOutput, ins.getLabel(), ins.getWeight()));
        }
        oracles = objectiveFunction.wrapOracle(oracles);
        for (StochasticOracle oracle : oracles) {
            objVal += oracle.getObjectiveValue();
        }
    }
    return objVal;
}
 
开发者ID:grouplens,项目名称:samantha,代码行数:29,代码来源:GradientBoostingMachine.java

示例6: generateNextOrdering

import it.unimi.dsi.fastutil.ints.IntList; //导入方法依赖的package包/类
private IntList generateNextOrdering(List<DifferenceSet> next, IntList currentOrdering, int attribute) {

        IntList result = new IntArrayList();

        Int2IntMap counting = new Int2IntArrayMap();
        boolean seen = false;
        for (int i = 0; i < currentOrdering.size(); i++) {

            if (!seen) {
                if (currentOrdering.getInt(i) != attribute) {
                    continue;
                } else {
                    seen = true;
                }
            } else {

                counting.put(currentOrdering.getInt(i), 0);
                for (DifferenceSet ds : next) {

                    if (ds.getAttributes().get(currentOrdering.getInt(i))) {
                        counting.put(currentOrdering.getInt(i), counting.get(currentOrdering.getInt(i)) + 1);
                    }
                }
            }
        }

        // TODO: Comperator und TreeMap --> Tommy
        while (true) {

            if (counting.size() == 0) {
                break;
            }

            int biggestAttribute = -1;
            int numberOfOcc = 0;
            for (int attr : counting.keySet()) {

                if (biggestAttribute < 0) {
                    biggestAttribute = attr;
                    numberOfOcc = counting.get(attr);
                    continue;
                }

                int tempOcc = counting.get(attr);
                if (tempOcc > numberOfOcc) {
                    numberOfOcc = tempOcc;
                    biggestAttribute = attr;
                } else if (tempOcc == numberOfOcc) {
                    if (biggestAttribute > attr) {
                        biggestAttribute = attr;
                    }
                }
            }

            if (numberOfOcc == 0) {
                break;
            }

            result.add(biggestAttribute);
            counting.remove(biggestAttribute);
        }

        return result;
    }
 
开发者ID:HPI-Information-Systems,项目名称:metanome-algorithms,代码行数:65,代码来源:FindCoversGenerator.java


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