List of usage examples for java.lang Double MIN_VALUE
double MIN_VALUE
To view the source code for java.lang Double MIN_VALUE.
Click Source Link
From source file:org.jlinda.core.coregistration.estimation.utils.JamaUtils.java
/** * Gets the maximum value in a matrix.//w ww . j a va2s.c o m * * @param m the matrix * @return the maximum value in m. */ public static double getMax(Matrix m) { int numRows = m.getRowDimension(); int numCols = m.getColumnDimension(); // compute the max of the matrix double maxValue = Double.MIN_VALUE; for (int i = 0; i < numRows; i++) { for (int j = 0; j < numCols; j++) { maxValue = Math.max(maxValue, m.get(i, j)); } } return maxValue; }
From source file:org.lmn.fc.frameworks.starbase.plugins.observatory.ui.tabs.charts.ChartUIHelper.java
/*********************************************************************************************** * Calculate and update the Domain Offset Crosshair and draw the crosshair on the XYPlot. * Return the value set on the XYPlot, or Double.MIN_VALUE on failure. * * @param chartui/*from w w w . j a v a 2s . c o m*/ * @param valueminimum * @param valuemaximum * @param offset * @param debug * * @return double */ public static double updateDomainCrosshairForOffsetControl(final ChartUIComponentPlugin chartui, final int valueminimum, final int valuemaximum, final double offset, final boolean debug) { final String SOURCE = "ChartHelper.updateDomainCrosshairForOffsetControl() "; double dblDomainCrosshairXYPlot; dblDomainCrosshairXYPlot = Double.MIN_VALUE; if (chartui != null) { if ((chartui.getChartPanel() != null) && (chartui.getChartPanel().getChart() != null) && (chartui.getChartPanel().getChart().getPlot() != null)) { final XYPlot plot; final ValueAxis domainAxis; final Range range; final double dblPositionFraction; // Save the supplied new value chartui.setDomainCrosshair(offset); plot = (XYPlot) chartui.getChartPanel().getChart().getPlot(); domainAxis = plot.getDomainAxis(); range = domainAxis.getRange(); if (offset >= 0) { //dblPositionFraction = (offset - (double)valueminimum) / (double)(valuemaximum - valueminimum); dblPositionFraction = (offset * 2.0) / (double) (valuemaximum - valueminimum); } else { dblPositionFraction = 0.0; } dblDomainCrosshairXYPlot = domainAxis.getLowerBound() + (dblPositionFraction * range.getLength()); // Update the XYPlot plot.setDomainCrosshairValue(dblDomainCrosshairXYPlot); FrameworkSingletons.LOGGER.debug(debug, SOURCE + "Domain Crosshair updated [value.knob=" + offset + "] [value.xyplot=" + dblDomainCrosshairXYPlot + "] [domain.lowerbound=" + domainAxis.getLowerBound() + "] [domain.upperbound=" + domainAxis.getUpperBound() + "] [value.fraction=" + dblPositionFraction + "] [value.minimum=" + valueminimum + "] [value.maximum=" + valuemaximum + "]"); } else { FrameworkSingletons.LOGGER.debug(debug, SOURCE + "There is no Chart, so cannot update Domain Crosshair on XYPlot"); // Save a default value chartui.setDomainCrosshair(valueminimum); dblDomainCrosshairXYPlot = Double.MIN_VALUE; } } return (dblDomainCrosshairXYPlot); }
From source file:de.qaware.chronix.converter.common.DoubleList.java
/** * @return maximum of the values of the list */// w w w.ja v a2 s . c om public double max() { if (size <= 0) { return Double.NaN; } double max = Double.MIN_VALUE; for (int i = 0; i < size; i++) { max = doubles[i] > max ? doubles[i] : max; } return max; }
From source file:org.jlinda.core.coregistration.estimation.utils.JamaUtils.java
/** * Gets the maximum value in a matrix, in the absolute sense. * * @param m the matrix/*w w w . j a va2s .c o m*/ * @return the maximum value in m. */ public static double getAbsMax(Matrix m) { int numRows = m.getRowDimension(); int numCols = m.getColumnDimension(); // compute the max of the matrix double maxValue = Double.MIN_VALUE; for (int i = 0; i < numRows; i++) { for (int j = 0; j < numCols; j++) { maxValue = Math.max(maxValue, Math.abs(m.get(i, j))); } } return maxValue; }
From source file:gov.nih.nci.ispy.ui.graphing.chart.plot.ISPYPrincipalComponentAnalysisPlot.java
/** * Get the range of values for a given clinical factor * @param dataPoints// w ww .ja v a 2s . c o m * @param factor * @return */ private DataRange getDataRange(Collection<PrincipalComponentAnalysisDataPoint> dataPoints, PCAcomponent component) { double maxValue = Double.MIN_VALUE; double minValue = Double.MAX_VALUE; double value; for (PrincipalComponentAnalysisDataPoint dataPoint : dataPoints) { value = dataPoint.getComponentValue(component); if (value < minValue) { minValue = value; } if (value > maxValue) { maxValue = value; } } DataRange range = new DataRange(minValue, maxValue); return range; }
From source file:org.odk.collect.android.activities.GeoShapeOsmMapActivity.java
private void zoomToBounds() { map.getController().setZoom(4);// ww w .j a va 2 s. c o m map.invalidate(); Handler handler = new Handler(); handler.postDelayed(new Runnable() { public void run() { double minLat = Double.MAX_VALUE; double maxLat = Double.MIN_VALUE; double minLong = Double.MAX_VALUE; double maxLong = Double.MIN_VALUE; Integer size = mapMarkers.size(); for (int i = 0; i < size; i++) { GeoPoint tempMarker = mapMarkers.get(i).getPosition(); if (tempMarker.getLatitude() < minLat) { minLat = tempMarker.getLatitude(); } if (tempMarker.getLatitude() > maxLat) { maxLat = tempMarker.getLatitude(); } if (tempMarker.getLongitude() < minLong) { minLong = tempMarker.getLongitude(); } if (tempMarker.getLongitude() > maxLong) { maxLong = tempMarker.getLongitude(); } } BoundingBox boundingBox = new BoundingBox(maxLat, maxLong, minLat, minLong); map.zoomToBoundingBox(boundingBox, false); map.invalidate(); } }, 100); map.invalidate(); }
From source file:com.medlog.webservice.vo.DiaryAnalysisSummaryVO.java
/** * Retrieve current diary value by KEY/* w w w .ja v a 2 s . c o m*/ * * @param key ref {@linkplain #CORR_STR} * @return */ private double getValFromKey(String key) { key = sanitizeKey(key); if (DEBUG) { System.out.println("com.medlog.webservice.vo.DiaryAnalysisSummaryVO.getIDXFromName(KEY)" + key); } switch (key) { case "anger": return getCurrentDiary().anger; case "disgust": return getCurrentDiary().disgust; // break; case "fear": return getCurrentDiary().fear; // break; case "joy": return getCurrentDiary().joy; case "sadness": return getCurrentDiary().sadness; // break; case "analytical": return getCurrentDiary().analytical; // break; case "confident": return getCurrentDiary().confident; // break; case "tentative": return getCurrentDiary().tentative; // break; case "agreeableness_big5": case "agreeableness": return getCurrentDiary().agreeablenessBig5; // break; case "conscientiousness_big5": case "conscientiousness": return getCurrentDiary().conscientiousnessBig5; // break; case "emotional_range_big5": case "emotionalrange": return getCurrentDiary().emotionalRangeBig5; // break; case "extraversion_big5": case "extraversion": return getCurrentDiary().extraversionBig5; // break; case "openness_big5": case "openness": return getCurrentDiary().opennessBig5; // break; case "mood": return (int) getCurrentDiary().getMood(); // break; default: return Double.MIN_VALUE; } }
From source file:dk.netarkivet.harvester.harvesting.monitor.StartedJobHistoryChartGen.java
/** * Find the maximum of the values given. If this maximum is less than * {@link Double#MIN_VALUE} then {@link Double#MIN_VALUE} is returned. * @param values an array of doubles/* ww w. java2 s .c o m*/ * @return the maximum of the values given */ private double getMaxValue(double[] values) { double max = Double.MIN_VALUE; for (double v : values) { max = Math.max(v, max); } return max; }
From source file:gov.nih.nci.caintegrator.ui.graphing.chart.plot.PrincipalComponentAnalysisPlot.java
/** * Get the range of values for a given clinical factor * @param dataPoints/*from ww w .j a v a2s .c om*/ * @param factor * @return */ protected DataRange getDataRange(Collection<PrincipalComponentAnalysisDataPoint> dataPoints, PCAcomponent component) { double maxValue = Double.MIN_VALUE; double minValue = Double.MAX_VALUE; double value; for (PrincipalComponentAnalysisDataPoint dataPoint : dataPoints) { value = dataPoint.getComponentValue(component); if (value < minValue) { minValue = value; } if (value > maxValue) { maxValue = value; } } DataRange range = new DataRange(minValue, maxValue); return range; }