@Override public void setValue(int pos, double value) { checkPos(pos); if (value == defaultValue) { // il est egal a default on supprime l'element data.removeKey(pos); } else { // sinon on l'ajoute data.put(pos, value); } }
@Override public boolean apply(int i) { double value = data.get(i); value = f.apply(value); if (value == defaultValue) { data.removeKey(i); } else { data.put(i, value); } return true; } });
/** * DOCUMENT ME! * * @param node_index DOCUMENT ME! * @param att_id DOCUMENT ME! * @param value DOCUMENT ME! * * @return DOCUMENT ME! */ public static int setNodeAttributeDoubleValue(int node_index, int att_id, double value) { // return if higher than the number of attributes if (att_id > nodeAttributeCount) return INSANE_ATTRIBUTE_ID; // make sure that the attribute type is correct if (getNodeAttIDToAttTypeMap().get(att_id) != DOUBLE_TYPE) return WRONG_ATTRIBUTE_TYPE; OpenIntDoubleHashMap double_map = (OpenIntDoubleHashMap) getNodeAttributeIDToAttributeValuesMap() .get(att_id); double_map.put(node_index, value); return 1; }
return put(key, value);
return put(key, value);
return put(key, value);
int index = indexList.get(j); int wordCount = topicWordCountArray[i].get(index); topicWordDistributionArray[i].put(index, (wordCount + globalBeta) / (sumLocalCount * globalBeta * this.globalWordNum )); double prob = topicWordDistributionArray[i].get(index); double cateProb = categoryDistribution.get(index); categoryDistribution.put(index, cateProb + prob); categoryDistribution.put(indexList.get(j), categoryDistribution.get(indexList.get(j)) / sum ); categoryDistribution.put( indexList.get(j), categoryDistribution.get(indexList.get(j)) + childCategoryDistribution.get(indexList.get(j)) categoryDistribution.put(indexList.get(j), categoryDistribution.get(indexList.get(j)) / sum );