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:reittienEtsinta.tiedostonKasittely.GeoJsonLukija.java
public GeoJsonLukija() { this.pisteita = 0; this.latmax = Double.MIN_VALUE; this.lonmax = Double.MIN_VALUE; this.latmin = Double.MAX_VALUE; this.lonmin = Double.MAX_VALUE; }
From source file:com.cidre.algorithms.CidreMath.java
public static double[][] min(List<double[][]> stack) { double[][] minImage = stack.get(0); double[][] currentImage; double min = Double.MAX_VALUE; double max = Double.MIN_VALUE; for (int i = 1; i < stack.size(); i++) { currentImage = stack.get(i);/* w w w . j av a 2 s .c o m*/ for (int x = 0; x < currentImage.length; x++) { for (int y = 0; y < currentImage[x].length; y++) { if (currentImage[x][y] < minImage[x][y]) { minImage[x][y] = currentImage[x][y]; if (currentImage[x][y] < min) { min = currentImage[x][y]; } if (currentImage[x][y] > max) { max = currentImage[x][y]; } } else { if (minImage[x][y] < min) { min = minImage[x][y]; } if (minImage[x][y] > max) { max = minImage[x][y]; } } } } } log.info("Min: {}, Max: {}", min, max); return minImage; }
From source file:net.zypr.api.vo.GeoPositionVO.java
public GeoPositionVO(JSONObject jsonObject) { try {// w w w . j a v a 2 s. c om setLatitude(Double.parseDouble(jsonObject.get("lat").toString())); } catch (Exception exception) { _latitude = Double.MIN_VALUE; } try { setLongitude(Double.parseDouble(jsonObject.get("lng").toString())); } catch (Exception exception) { _longitude = Double.MIN_VALUE; } try { setAltitude(Double.parseDouble(jsonObject.get("alt").toString())); } catch (Exception exception) { this._altitude = Double.MIN_VALUE; } }
From source file:Main.java
/** * Returns the floating-point value adjacent to <code>d</code> in * the direction of negative infinity. This method is * semantically equivalent to <code>nextAfter(d, * Double.NEGATIVE_INFINITY)</code>; however, a * <code>nextDown</code> implementation may run faster than its * equivalent <code>nextAfter</code> call. * * <p>Special Cases:/*from w ww. j av a 2 s. c o m*/ * <ul> * <li> If the argument is NaN, the result is NaN. * * <li> If the argument is negative infinity, the result is * negative infinity. * * <li> If the argument is zero, the result is * <code>-Double.MIN_VALUE</code> * * </ul> * * @param d starting floating-point value * @return The adjacent floating-point value closer to negative * infinity. * @author Joseph D. Darcy */ public static double nextDown(double d) { if (isNaN(d) || d == Double.NEGATIVE_INFINITY) return d; else { if (d == 0.0) return -Double.MIN_VALUE; else return Double.longBitsToDouble(Double.doubleToRawLongBits(d) + ((d > 0.0d) ? -1L : +1L)); } }
From source file:change_point_detection.CusumElement.java
public CusumElement() { this.preChangeDist = null; this.postChangeDist = null; this.preChangeMean = Double.MIN_VALUE; this.cusumScore = Double.MIN_VALUE; }
From source file:sadl.scaling.Normalizer.java
@Override public void setFeatureCount(int featureCount) { mins = new double[featureCount]; maxs = new double[featureCount]; for (int i = 0; i < featureCount; i++) { mins[i] = Double.MAX_VALUE; maxs[i] = Double.MIN_VALUE; }// w w w . j a v a2 s . c om }
From source file:lirmm.inria.fr.math.OpenLongToDoubleHashMapTest.java
@Before public void setUp() throws Exception { javaMap.put(Long.valueOf(50), 100.0); javaMap.put(Long.valueOf(75), 75.0); javaMap.put(Long.valueOf(25), 500.0); javaMap.put(Long.MAX_VALUE, Double.MAX_VALUE); javaMap.put(Long.valueOf(0), -1.0); javaMap.put(Long.valueOf(1), 0.0); javaMap.put(Long.valueOf(33), -0.1); javaMap.put(Long.valueOf(23234234), -242343.0); javaMap.put(Long.valueOf(23321), Double.MIN_VALUE); javaMap.put(Long.valueOf(-4444), 332.0); javaMap.put(Long.valueOf(-1), -2323.0); javaMap.put(Long.MIN_VALUE, 44.0); javaMap.put(Long.valueOf("7263934625316938832"), 224.0); /* Add a few more to cause the table to rehash */ javaMap.putAll(generate());/*from w w w . ja va 2 s .c om*/ }
From source file:org.apache.lucene.spatial.base.shape.MultiShape.java
public MultiShape(Collection<Shape> geoms, SpatialContext ctx) { this.geoms = geoms; double minX = Double.MAX_VALUE; double minY = Double.MAX_VALUE; double maxX = Double.MIN_VALUE; double maxY = Double.MIN_VALUE; for (Shape geom : geoms) { Rectangle r = geom.getBoundingBox(); minX = Math.min(minX, r.getMinX()); minY = Math.min(minY, r.getMinY()); maxX = Math.max(maxX, r.getMaxX()); maxY = Math.max(maxY, r.getMaxY()); }/*from w w w. ja v a2 s. c o m*/ this.bbox = ctx.makeRect(minX, maxX, minY, maxY); }
From source file:comp.web.core.DataUtil.java
public List<Product> getProds(String cat, String prod, String from, String to) { logger.log(Level.FINER, "get prods with filter {0} {1} {2} {3}", new Object[] { cat, prod, from, to }); if (StringUtils.isBlank(cat) && StringUtils.isBlank(prod) && StringUtils.isBlank(from) && StringUtils.isBlank(to)) { return Collections.emptyList(); }/*from w ww . j ava2s . co m*/ String cat1 = StringUtils.stripToEmpty(cat) + "%"; String prod1 = StringUtils.stripToEmpty(prod) + "%"; double from1 = StringUtils.isNumeric(from) ? Double.parseDouble(from) : Double.MIN_VALUE; double to1 = StringUtils.isNumeric(to) ? Double.parseDouble(to) : Double.MAX_VALUE; EntityManager em = createEM(); // EntityTransaction tx = em.getTransaction(); // tx.begin(); List<Product> products = em.createNamedQuery("priceList", Product.class).setParameter("cat", cat1) .setParameter("prod", prod1).setParameter("from", from1).setParameter("to", to1).getResultList(); // tx.commit(); em.close(); logger.log(Level.FINER, "get prods result size {0}", products.size()); return products; }
From source file:endrov.nucAutoJH.FitGaussian.java
private static double[] fitGaussian2D_(EvPixels p, double sigmaInit, final double midxInit, final double midyInit) { //sigma00, sigma01, sigma11, mu_x, mu_y, c p = p.getReadOnly(EvPixelsType.DOUBLE); final double[] arrPixels = p.getArrayDouble(); final int w = p.getWidth(); final int h = p.getHeight(); int extent = (int) Math.round(3 * sigmaInit); extent = Math.max(extent, 2); final int sx = Math.max(0, (int) (midxInit - extent)); final int ex = Math.min(w, (int) (midxInit + extent + 1)); //+1 to the right? final int sy = Math.max(0, (int) (midyInit - extent)); final int ey = Math.min(h, (int) (midyInit + extent + 1)); double minIntensity = Double.MAX_VALUE; double maxIntensity = Double.MIN_VALUE; for (int y = sy; y < ey; y++) { int base = y * w; double dy2 = y - midyInit; dy2 = dy2 * dy2;//from w w w . j a v a 2 s . com for (int x = sx; x < ex; x++) { double dx2 = x - midxInit; dx2 = dx2 * dx2; double t = arrPixels[base + x]; //if(dx2+dy2<=extent*extent) { if (t < minIntensity) minIntensity = t; if (t > maxIntensity) maxIntensity = t; } } } //double[] weights=new double[]{1}; double[] startPoint = new double[] { sigmaInit, 0, sigmaInit, midxInit, midyInit, minIntensity, maxIntensity - minIntensity }; //double[] output=new double[startPoint.length]; try { MultivariateRealFunction func = new MultivariateRealFunction() { // opt.optimize( public double value(double[] arg) throws FunctionEvaluationException, IllegalArgumentException { double sigma00 = arg[0]; double sigma01 = arg[1]; double sigma11 = arg[2]; double mu0 = arg[3]; double mu1 = arg[4]; double C = arg[5]; double D = arg[6]; double sumError = 0; Matrix2d sigma = new Matrix2d(sigma00, sigma01, sigma01, sigma11); Matrix2d sigmaInv = new Matrix2d(); sigma.invert(sigmaInv); double sigmaDet = sigma.determinant(); double front = 1.0 / (2 * Math.PI * Math.sqrt(sigmaDet)); //System.out.println("front: "+front); //System.out.println("sigma inv "+sigmaInv); if (mu0 < sx || mu0 > ex) sumError += 1000000; if (mu1 < sy || mu1 > ey) sumError += 1000000; if (sigma00 < 1) sumError += 1000000; //if(sigma01<0) sumError+=1000000; if (sigma11 < 1) sumError += 1000000; if (D <= 0) sumError += 1000000; for (int y = sy; y < ey; y++) { int base = y * w; double dy2 = y - midyInit; dy2 = dy2 * dy2; for (int x = sx; x < ex; x++) { double dx2 = x - midxInit; dx2 = dx2 * dx2; double thisReal = arrPixels[base + x]; // if(dx2+dy2<=extent*extent) { // DoubleMatrix2D sigma=new DenseDoubleMatrix2D(new double[][]{{sigma00,sigma01},{sigma01,sigma11}}); //double sigmaDet=sigma00*sigma11-sigma01*sigma01; double dx0 = x - mu0; double dx1 = y - mu1; //http://en.wikipedia.org/wiki/Multivariate_normal_distribution Vector2d vX = new Vector2d(dx0, dx1); Vector2d op = new Vector2d(vX); sigmaInv.transform(op); double upper = -0.5 * op.dot(vX); double exp = Math.exp(upper); //System.out.println("front "+front+" "+exp+" C "+C+" thisreal"+thisReal+" upper "+upper); if (upper > -0.4) exp = 1; else exp = Math.max(0, 1 + upper + 0.4); /* if(exp<0.7) exp=0; else exp=1; */ double thisExpected = D * front * exp + C; double diff = thisExpected - thisReal; sumError += diff * diff; } } } //System.out.println(sigma00+"\t"+sigma01+"\t"+sigma11+"\tC"+C+"\tmu "+mu0+","+mu1+"\terr "+sumError); return sumError; // return new double[]{sumError}; } }; NelderMead opt = new NelderMead(); //LevenbergMarquardtOptimizer opt=new LevenbergMarquardtOptimizer(); opt.setMaxIterations(10000); RealPointValuePair pair = opt.optimize(func, GoalType.MINIMIZE, startPoint); int numit = opt.getIterations(); System.out.println("#it " + numit); System.out.println("err " + func.value(pair.getPointRef())); return pair.getPointRef(); // for(int i=0;i<startPoint.length;i++) // System.out.println("i: "+i+" "+output[i]); //, output, weights, startPoint); } /* catch (MaxIterationsExceededException e) { System.out.println("max it reached"); }*/ catch (Exception e) { e.printStackTrace(); } //Maybe this is a bad point? System.out.println("max it reached"); return startPoint; // return output; }