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