/** doubleValue returns current value. */ public void testDoubleValue() { AtomicDouble at = new AtomicDouble(); assertEquals(0.0d, at.doubleValue()); for (double x : VALUES) { at.set(x); assertBitEquals(x, at.doubleValue()); } }
@Override public Double getValue() { return memoryFragmentRatio.doubleValue(); } });
@Override public double getDesiredTorque() { return desiredTorque.doubleValue(); }
@Override public double getDesiredPosition() { return desiredPosition.doubleValue(); }
@Override public double getDesiredVelocity() { return desiredVelocity.doubleValue(); }
@Override public double getDesiredAcceleration() { return desiredAcceleration.doubleValue(); }
public Double getValue() { return value.doubleValue(); } }
public Double getValue() { return value.doubleValue(); } }
@Override public Double read() { return doubleVar.doubleValue(); } });
@Override public Object getResult() { if (histogramStat) { // If the operation is Histogram, the result is returned as a double array double[] array = new double[numBins]; for (int i = 0; i < numBins; i++) { array[i] = bins[i].doubleValue(); } return array; } else { // If the operation is Mode, the most present value is returned double max = 0; int indexMax = 0; for (int i = 0; i < numBins; i++) { if (bins[i].doubleValue() > max) { max = bins[i].doubleValue(); indexMax = i; } } if (max == 0) { return indexMax * 1.0d; } else { return indexMax + minBound; } } }
@Override public Object getResult() { if (histogramStat) { // If the operation is Histogram, the result is returned as a double array double[] array = new double[numBins]; for (int i = 0; i < numBins; i++) { array[i] = bins[i].doubleValue(); } return array; } else { // If the operation is Mode, the most present value is returned double max = 0; int indexMax = 0; for (int i = 0; i < numBins; i++) { if (bins[i].doubleValue() > max) { max = bins[i].doubleValue(); indexMax = i; } } if (max == 0) { return indexMax * 1.0d; } else { return indexMax + minBound; } } }
@Override public JsonElement serialize(final AtomicDouble src, final Type typeOfSrc, final JsonSerializationContext context) { return new JsonPrimitive(src.doubleValue()); } }
public EagleMetric(EagleMetric metric) { this.latestUserTimeClock = metric.latestUserTimeClock; this.name = metric.name; this.value = new AtomicDouble(metric.value.doubleValue()); this.granularity = metric.granularity; }
public EagleMetric(EagleMetric metric) { this.latestUserTimeClock = metric.latestUserTimeClock; this.name = metric.name; this.value = new AtomicDouble(metric.value.doubleValue()); this.granularity = metric.granularity; }
/** Convert the given value to {@code Double}. This function is not null-safe. * * @param number a number of {@code AtomicDouble} type. * @return the equivalent value to {@code number} of {@code Double} type. */ @Pure @Inline(value = "$2.valueOf($1.longValue())", imported = {Long.class}) public static Double toDoubleObject(AtomicDouble number) { return Double.valueOf(number.doubleValue()); }
/** Convert the given value to {@code double}. This function is not null-safe. * * @param number a number of {@code AtomicDouble} type. * @return the equivalent value to {@code number} of {@code double} type. */ @Pure @Inline(value = "$1.doubleValue()") public static double toDouble(AtomicDouble number) { return number.doubleValue(); }
public static Tree addCladewiseSplitFit(List<WeightedTreePartitions> biparts, Tree tree) { Map<Set<String>, TreeNode> labelsToClade = getChildrenMap(tree); Set<String> all = getLeafLabels(tree); Map<WeightedTreePartitions, AtomicDouble> partitionsToConflicts = new HashMap<>(labelsToClade.size()); for (Set<String> leafesInClade : labelsToClade.keySet()) { partitionsToConflicts.put(new WeightedTreePartitions(leafesInClade, all), new AtomicDouble(0)); } double numberOfChars = 0; for (WeightedTreePartitions sourcePartition : biparts) { numberOfChars += sourcePartition.weight; for (Map.Entry<WeightedTreePartitions, AtomicDouble> e : partitionsToConflicts.entrySet()) { if (e.getKey().isIncompatible(sourcePartition)) { e.getValue().addAndGet(e.getKey().weight); } } } for (Map.Entry<WeightedTreePartitions, AtomicDouble> entry : partitionsToConflicts.entrySet()) { TreeNode first = labelsToClade.remove(entry.getKey().getGroupA()); TreeNode second = labelsToClade.remove(entry.getKey().getGroupB()); String l = String.valueOf(1 - (entry.getValue().doubleValue() / numberOfChars)); if (first != null) first.setLabel(l); if (second != null) second.setLabel(l); } return tree; }
/** * doubleValue returns current value. */ public void testDoubleValue() { AtomicDouble at = new AtomicDouble(); assertEquals(0.0d, at.doubleValue()); for (double x : VALUES) { at.set(x); assertBitEquals(x, at.doubleValue()); } }
@Override public double score() { // Get estimate of normalization term INDArray buff = Nd4j.create(numDimensions); AtomicDouble sum_Q = new AtomicDouble(0.0); for (int n = 0; n < N; n++) tree.computeNonEdgeForces(n, theta, buff, sum_Q); // Loop over all edges to compute t-SNE error double C = .0; INDArray linear = Y; for (int n = 0; n < N; n++) { int begin = rows.getInt(n); int end = rows.getInt(n + 1); int ind1 = n; for (int i = begin; i < end; i++) { int ind2 = cols.getInt(i); buff.assign(linear.slice(ind1)); buff.subi(linear.slice(ind2)); double Q = pow(buff, 2).sum(Integer.MAX_VALUE).getDouble(0); Q = (1.0 / (1.0 + Q)) / sum_Q.doubleValue(); C += vals.getDouble(i) * FastMath.log(vals.getDouble(i) + Nd4j.EPS_THRESHOLD) / (Q + Nd4j.EPS_THRESHOLD); } } return C; }
Q = (1.0 / (1.0 + Q)) / sum_Q.doubleValue(); C += vals.getDouble(i) * FastMath.log(vals.getDouble(i) + Nd4j.EPS_THRESHOLD) / (Q + Nd4j.EPS_THRESHOLD);