public double put( int key, double value ) { synchronized( mutex ) { return m.put( key, value ); } } public double remove( int key ) {
distances.put(v.getIndex(), dx * dx + dy * dy);
/** * Inserts a key/value pair into the map. * * @param key an <code>Object</code> value * @param value an <code>Object</code> value * @return the previous value associated with <tt>key</tt>, * or Double(0) if none was found. */ public Double put( Integer key, Double value ) { int k; double v; if ( key == null ) { k = _map.getNoEntryKey(); } else { k = unwrapKey( key ); } if ( value == null ) { v = _map.getNoEntryValue(); } else { v = unwrapValue( value ); } double retval = _map.put( k, v ); if ( retval == _map.getNoEntryValue() ) { return null; } return wrapValue( retval ); }
@Override public double put( int key, double value ) { synchronized( mutex ) { return m.put( key, value ); } } @Override
public double put( int key, double value ) { synchronized( mutex ) { return m.put( key, value ); } } public double remove( int key ) {
public double put( int key, double value ) { synchronized( mutex ) { return m.put( key, value ); } } public double remove( int key ) {
public double put( int key, double value ) { synchronized( mutex ) { return m.put( key, value ); } } public double remove( int key ) {
@Override @Deprecated public Double put(DBIDRef id, Double value) { return Double.valueOf(map.put(DBIDUtil.asInteger(id), value.doubleValue())); }
@Override public Array<Double> fill(Double value, int start, int end) { final double fillValue = value == null ? defaultValue : value; if (fillValue == defaultValue) { this.values.clear(); } else { for (int i=start; i<end; ++i) { this.values.put(i, fillValue); } } return this; }
@Override public double put(DBIDRef id, double value) { return map.put(DBIDUtil.asInteger(id), value); }
@Override public double putDouble(DBIDRef id, double value) { return map.put(DBIDUtil.asInteger(id), value); }
@Override public final Double setValue(int index, Double value) { this.checkBounds(index, length); final Double oldValue = getValue(index); if (value == null || Double.compare(value, defaultValue) == 0) { this.values.remove(index); return oldValue; } else { this.values.put(index, value); return oldValue; } }
@Override public final double setDouble(int index, double value) { this.checkBounds(index, length); final double oldValue = getDouble(index); if (value == defaultValue) { this.values.remove(index); return oldValue; } else { this.values.put(index, value); return oldValue; } }
private double getGenerality(int wpId) throws DaoException { if (generality.containsKey(wpId)) { return generality.get(wpId); } int numInLinks = lld.getCount(new DaoFilter().setLanguages(language).setDestIds(wpId)); double g = 0.5 + Math.log(1 + Math.min(MAX_INLINKS, numInLinks)) / Math.log(1 + MAX_INLINKS); generality.put(numInLinks, numInLinks); return numInLinks; }
private void handleSliderInput(int sliderIndex, int data) { double value = SliderboardTools.toSliderPercent(data); List<SliderboardListener> listeners = sliderListeners.get(sliderIndex); double previousValue = sliderValues.containsKey(sliderIndex) ? sliderValues.get(sliderIndex) : -1.0; if (listeners != null && previousValue != value) { listeners.forEach(listener -> listener.sliderMoved(value)); } sliderValues.put(sliderIndex, value); }
public synchronized double cumulativeProbability(final int x) { if (!cacheCumulativeProbability.containsKey(x) && x >= getSupportLowerBound() && x <= getSupportUpperBound()) { cacheCumulativeProbability.put(x, super.cumulativeProbability(x)); } return cacheCumulativeProbability.get(x); } private Double cacheNumericalMean;
public synchronized double probability(final int x) { if (!cacheProbability.containsKey(x) && x >= getSupportLowerBound() && x <= getSupportUpperBound()) { cacheProbability.put(x, super.probability(x)); } return cacheProbability.get(x); } private TIntDoubleMap cacheCumulativeProbability = new TIntDoubleHashMap();
@Override protected void prepareProcessInstance(V featureVector) { for(int it = featureVector.iter(); featureVector.iterValid(it); it = featureVector.iterAdvance(it)) { if(featureVector.iterDoubleValue(it) >= 0.) { final int dim = featureVector.iterDim(it); idf.put(dim, idf.get(dim) + 1); } } objcnt += 1; }