@@ -0,0 +1,2717 @@
+package de.lmu.ifi.dbs.elki.math;%0A%0Aimport de.lmu.ifi.dbs.elki.utilities.exceptions.AbortException;%0A%0A/*%0A This file is part of ELKI:%0A Environment for Developing KDD-Applications Supported by Index-Structures%0A%0A Copyright (C) 2011%0A Ludwig-Maximilians-Universit%C3%A4t M%C3%BCnchen%0A Lehr- und Forschungseinheit f%C3%BCr Datenbanksysteme%0A ELKI Development Team%0A%0A This program is free software: you can redistribute it and/or modify%0A it under the terms of the GNU Affero General Public License as published by%0A the Free Software Foundation, either version 3 of the License, or%0A (at your option) any later version.%0A%0A This program is distributed in the hope that it will be useful,%0A but WITHOUT ANY WARRANTY; without even the implied warranty of%0A MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the%0A GNU Affero General Public License for more details.%0A%0A You should have received a copy of the GNU Affero General Public License%0A along with this program.  If not, see %3Chttp://www.gnu.org/licenses/%3E.%0A */%0A/**%0A * Class collecting mean, variance, minimum and maximum statistics.%0A * %0A * @author Erich Schubert%0A */%0Apublic class MeanVarianceMinMax extends MeanVariance %7B%0A  /**%0A   * Minimum value%0A   */%0A  double min = Double.POSITIVE_INFINITY;%0A%0A  /**%0A   * Maximum value%0A   */%0A  double max = Double.NEGATIVE_INFINITY;%0A%0A  /**%0A   * Constructor.%0A   */%0A  public MeanVarianceMinMax() %7B%0A    super();%0A  %7D%0A%0A  /**%0A   * Constructor cloning existing statistics.%0A   * %0A   * @param other Existing statistics%0A   */%0A  public MeanVarianceMinMax(MeanVarianceMinMax other) %7B%0A    super(other);%0A    this.min = other.min;%0A    this.max = other.max;%0A  %7D%0A%0A  @Override%0A  public void put(double val) %7B%0A    super.put(val);%0A    min = Math.min(min, val);%0A    max = Math.max(max, val);%0A  %7D%0A%0A  @Override%0A  public void put(double val, double weight) %7B%0A    super.put(val, weight);%0A    min = Math.min(min, val);%0A    max = Math.max(max, val);%0A  %7D%0A%0A  @Override%0A  public void put(Mean other) %7B%0A    if(other instanceof MeanVarianceMinMax) %7B%0A      super.put(other);%0A      min = Math.min(min, ((MeanVarianceMinMax) other).min);%0A      max = Math.max(max, ((MeanVarianceMinMax) other).max);%0A    %7D%0A    else %7B%0A      throw new AbortException(%22Cannot aggregate into a minmax statistic: %22 + other.getClass());%0A    %7D%0A  %7D%0A%0A  /**%0A   * Get the current minimum.%0A   * %0A   * @return current minimum.%0A   */%0A  public double getMin() %7B%0A    return this.min;%0A  %7D%0A%0A  /**%0A   * Get the current maximum.%0A   * %0A   * @return current maximum.%0A   */%0A  public double getMax() %7B%0A    return this.max;%0A  %7D%0A%0A  /**%0A   * Return the difference between minimum and maximum.%0A   * %0A   * @return Difference of current Minimum and Maximum.%0A   */%0A  public double getDiff() %7B%0A    return this.getMax() - this.getMin();%0A  %7D%0A%7D

Add a MeanVarianceMinMax statistics class.