Returns the mean of the {@code microAmount} of the two Money values if neither is null, else
returns null.
486158
private static Double calculateMean(Money minMoney, Money maxMoney) {
    if (minMoney == null || maxMoney == null) {
      return null;
    }
    return calculateMean(minMoney.getMicroAmount(), maxMoney.getMicroAmount());
  }
184686
public double getCount(A first, B second) {
    if (counts.containsKey(first) && counts.get(first).containsKey(second)) {
      return counts.get(first).get(second);
    }
    return 0.0;
  }
642410
public double getAndSet(double amount) {
    long v = value.getAndSet(Double.doubleToLongBits(amount));
    return Double.longBitsToDouble(v);
  }
945798
public static double variance( GrayS8 img , double mean ) {

		if( BoofConcurrency.USE_CONCURRENT ) {
			return ImplImageStatistics_MT.variance(img,mean);
		} else {
			return ImplImageStatistics.variance(img,mean);
		}
	}
146183
public Double getVariance() {
		if (counter == 0) {
			return Double.NaN;
		} else {
			final double mean = computeMean();
			final double meanSquare = mean * mean;
			final double squareMean = ((double) squareTotal) / counter;
			return squareMean - meanSquare;
		}
	}
546645
public static Predicate<MonetaryAmount> isBetween(MonetaryAmount min, MonetaryAmount max){
        return isLessThanOrEqualTo(max).and(isGreaterThanOrEqualTo(min));
    }
69752
@Nullable
    public T getValue() {
        Object data = mData;
        if (data != NOT_SET) {
            //noinspection unchecked
            return (T) data;
        }
        return null;
    }
739835
public double mean(double[] series) {
    double res = 0D;
    int count = 0;
    for (double tp : series) {
      res += tp;
      count += 1;

    }
    if (count > 0) {
      return res / ((Integer) count).doubleValue();
    }
    return Double.NaN;
  }
1263943
@Override
  public Long min11(Long arg1, Long arg2) {
    if (arg1 == null || arg2 == null) {
      return null;
    } else {
      return Math.min(arg1, arg2);
    }
  }
295301
private static function calculateMeanMicroAmount($min, $max)
    {
        if ($min === null || $max === null) {
            return null;
        }
        if ($min->getMicroAmount() === null
            || $max->getMicroAmount() === null) {
            return null;
        }

        return ($min->getMicroAmount() + $max->getMicroAmount()) / 2;
    }
187208
public T min() {
        if (sum == 0)
            return null;
        int minCount = Integer.MAX_VALUE;
        int minIndex = -1;
        for (TIntIntIterator it = indexToCount.iterator(); it.hasNext(); ) {
            it.advance();
            if (it.value() < minCount) {
                minIndex = it.key();
                minCount = it.value();
            }
        }
        return objectIndices.lookup(minIndex);
    }
299246
public <V> V getValue() {
        if (values == null || values.isEmpty()) {
            return null;
        }
        return (V)values.get(0);
    }
1142647
public double getBalance(String world, String currencyName) {
        double balance = Double.MIN_NORMAL;
        if (!Common.getInstance().getWorldGroupManager().worldGroupExist(world)) {
            world = Common.getInstance().getWorldGroupManager().getWorldGroupName(world);
        }
        Currency currency = Common.getInstance().getCurrencyManager().getCurrency(currencyName);
        if (currency != null) {
            if (!hasInfiniteMoney()) {
                balance = Common.getInstance().getStorageHandler().getStorageEngine().getBalance(this, currency, world);
            } else {
                balance = Double.MAX_VALUE;
            }
        }
        return format(balance);
    }
1191905
public static double variance( GrayU8 img , double mean ) {

		if( BoofConcurrency.USE_CONCURRENT ) {
			return ImplImageStatistics_MT.variance(img,mean);
		} else {
			return ImplImageStatistics.variance(img,mean);
		}
	}
1046028
public Optional<Double> avg() {
        if (isEmpty()) return Optional.empty();
        return Optional.of(sum() / getEventCount());
    }
1219008
public static double mean(int[] values) {
        double sum = 0d;
        for (int i : values)
            sum += i;
        return sum / values.length;
    }
690272
public T getMinimum() {
        Lock lock = this.lock.readLock();
        lock.lock();
        try {
            return this.minimum != null ? this.minimum : (T)this.math.createZeroValue();
        } finally {
            lock.unlock();
        }
    }