Example usage for java.lang Double MAX_VALUE

List of usage examples for java.lang Double MAX_VALUE

Introduction

In this page you can find the example usage for java.lang Double MAX_VALUE.

Prototype

double MAX_VALUE

To view the source code for java.lang Double MAX_VALUE.

Click Source Link

Document

A constant holding the largest positive finite value of type double , (2-2-52)·21023.

Usage

From source file:com.github.lynxdb.server.core.aggregators.Min.java

@Override
public TimeSerie aggregate(List<TimeSerie> _series) {
    return doInterpolate(_series, new Reducer() {
        double min;

        @Override/*from  w  ww .  j a va2s .co m*/
        public void update(Entry _entry) {
            if (_entry.getValue() < min) {
                min = _entry.getValue();
            }
        }

        @Override
        public double result() {
            return min;
        }

        @Override
        public void reset() {
            min = Double.MAX_VALUE;
        }
    });
}

From source file:com.github.lynxdb.server.core.aggregators.Max.java

@Override
public TimeSerie aggregate(List<TimeSerie> _series) {
    return doInterpolate(_series, new Reducer() {
        double max;

        @Override//from w ww.  ja  v a2s . c  om
        public void update(Entry _entry) {
            if (_entry.getValue() > max) {
                max = _entry.getValue();
            }
        }

        @Override
        public double result() {
            return max;
        }

        @Override
        public void reset() {
            max = -Double.MAX_VALUE;
        }
    });
}

From source file:com.github.lynxdb.server.core.aggregators.MimMin.java

@Override
public TimeSerie aggregate(List<TimeSerie> _series) {
    return doDefaultIfMissing(_series, new Reducer() {
        double min;

        @Override/*w w  w .j av a2s  .  c  om*/
        public void update(Entry _entry) {
            if (_entry.getValue() < min) {
                min = _entry.getValue();
            }
        }

        @Override
        public double result() {
            return min;
        }

        @Override
        public void reset() {
            min = Double.MAX_VALUE;
        }
    }, Double.MAX_VALUE);
}

From source file:ch.aonyx.broker.ib.api.util.InputStreamUtils.java

public static final double readDoubleMax(final InputStream inputStream) {
    final String string = readString(inputStream);
    return string == null ? Double.MAX_VALUE : Double.parseDouble(string);
}

From source file:com.github.lynxdb.server.core.aggregators.MimMax.java

@Override
public TimeSerie aggregate(List<TimeSerie> _series) {
    return doDefaultIfMissing(_series, new Aggregator.Reducer() {
        double max;

        @Override/*from   w  ww. j a  v  a  2  s  .  c om*/
        public void update(Entry _entry) {
            if (_entry.getValue() > max) {
                max = _entry.getValue();
            }
        }

        @Override
        public double result() {
            return max;
        }

        @Override
        public void reset() {
            max = -Double.MAX_VALUE;
        }
    }, -Double.MAX_VALUE);
}

From source file:classif.PrototyperEUC.java

@Override
public double classifyInstance(Instance sample) throws Exception {
    // transform instance to sequence
    MonoDoubleItemSet[] sequence = new MonoDoubleItemSet[sample.numAttributes() - 1];
    int shift = (sample.classIndex() == 0) ? 1 : 0;
    for (int t = 0; t < sequence.length; t++) {
        sequence[t] = new MonoDoubleItemSet(sample.value(t + shift));
    }/*ww  w.ja va  2  s  . c  o m*/
    Sequence seq = new Sequence(sequence);

    double minD = Double.MAX_VALUE;
    String classValue = null;
    for (ClassedSequence s : prototypes) {
        double tmpD = seq.distanceEuc(s.sequence);
        if (tmpD < minD) {
            minD = tmpD;
            classValue = s.classValue;
        }
    }
    // System.out.println(prototypes.size());
    //      System.out.println(classValue);
    return sample.classAttribute().indexOfValue(classValue);
}

From source file:edu.iu.daal_kmeans.regroupallgather.CenCalcTask.java

@Override
public Object run(double[] points) throws Exception {
    for (int i = 0; i < points.length;) {
        i++;/*from   www . j  a v  a  2 s .  c om*/
        double minDistance = Double.MAX_VALUE;
        int minCenParID = 0;
        int minOffset = 0;
        for (int j = 0; j < centroids.length; j++) {
            for (int k = 0; k < local[j].length;) {
                int pStart = i;
                k++;
                double distance = 0.0;
                for (int l = 1; l < cenVecSize; l++) {
                    double diff = (points[pStart++] - centroids[j][k++]);
                    distance += diff * diff;
                }
                if (distance < minDistance) {
                    minDistance = distance;
                    minCenParID = j;
                    minOffset = k - cenVecSize;
                }
            }
        }
        // Count + 1
        local[minCenParID][minOffset++]++;
        // Add the point
        for (int j = 1; j < cenVecSize; j++) {
            local[minCenParID][minOffset++] += points[i++];
        }
    }
    return null;
}

From source file:org.spantus.exp.segment.exec.DrawSegmentAnalysis.java

public void draw() {
    List<ComparisionResult> results = graphGenerator.compare();
    Map<String, Double> totals = new LinkedHashMap<String, Double>();
    Double min = Double.MAX_VALUE;
    for (ComparisionResult comparisionResult : results) {
        draw(comparisionResult);// ww  w. j  a  v  a 2s.c  om
        totals.put(comparisionResult.getName(), comparisionResult.getTotalResult());
        min = Math.min(min, Math.abs(comparisionResult.getTotalResult()));
    }
    log.debug("Min: " + min + "; Totals: " + totals);
}

From source file:com.devoteam.srit.xmlloader.core.report.derived.StatFlow.java

public StatFlow(long timestamp, long zeroTimestamp, StatKey id, StatCounter counter,
        CounterReportTemplate template) throws ParsingException {
    super(timestamp, zeroTimestamp, counter);
    super.id = id;
    super.template = template;
    this.counter.graphDataset
            .divide((double) this.counter.graphDataset.graphParameters.graphPeriod / (double) 1000);

    this.min = Double.MAX_VALUE;
    this.max = Double.MIN_VALUE;

    double[] array = this.counter.graphDataset.getGraphArray();

    for (int i = 0; i < array.length; i++) {
        double value = array[i];

        if (value < this.min) {
            this.min = value;
        }/*from w  ww .  ja va2 s .co  m*/
        if (value > this.max) {
            this.max = value;
        }
    }
    init();
}

From source file:bide.hpd.TraceDistribution.java

public static double[] HPDInterval(double proportion, double[] x, int[] indices) {

    double minRange = Double.MAX_VALUE;
    int hpdIndex = 0;

    final int diff = (int) Math.round(proportion * x.length);
    for (int i = 0; i <= (x.length - diff); i++) {
        final double minValue = x[indices[i]];
        final double maxValue = x[indices[i + diff - 1]];
        final double range = Math.abs(maxValue - minValue);
        if (range < minRange) {
            minRange = range;/*from   ww  w  .  j a  va 2 s  .c  om*/
            hpdIndex = i;
        }
    }

    return new double[] { x[indices[hpdIndex]], x[indices[hpdIndex + diff - 1]] };
}