IndirectBlock(int nrows, long iblock_size) { this.nrows = nrows; this.size = iblock_size; if (nrows < 0) { double n = SpecialMathFunction.log2(iblock_size) - SpecialMathFunction.log2(startingBlockSize * tableWidth) + 1; nrows = (int) n; } int maxrows_directBlocks = (int) (SpecialMathFunction.log2(maxDirectBlockSize) - SpecialMathFunction.log2(startingBlockSize)) + 2; if (nrows < maxrows_directBlocks) { directRows = nrows; indirectRows = 0; } else { directRows = maxrows_directBlocks; indirectRows = (nrows - maxrows_directBlocks); } if (debugFractalHeap) debugOut.println(" readIndirectBlock directChildren" + directRows + " indirectChildren= " + indirectRows); }
/** * @param a double value * @return The area under the Gaussian probability density * function, integrated from minus infinity to x: * @throws ArithmeticException */ static public double normal(double a) throws ArithmeticException { double x, y, z; x = a * SQRTH; z = Math.abs(x); if (z < SQRTH) { y = 0.5 + 0.5 * erf(x); } else { y = 0.5 * erfc(z); if (x > 0) { y = 1.0 - y; } } return y; }
/** * @param x double value * @return The Error function * <p/> * <FONT size=2> * Converted to Java from<BR> * Cephes Math Library Release 2.2: July, 1992<BR> * Copyright 1984, 1987, 1989, 1992 by Stephen L. Moshier<BR> * Direct inquiries to 30 Frost Street, Cambridge, MA 02140<BR> * @throws ArithmeticException */ static public double erf(double x) throws ArithmeticException { double y, z; double T[] = {9.60497373987051638749E0, 9.00260197203842689217E1, 2.23200534594684319226E3, 7.00332514112805075473E3, 5.55923013010394962768E4}; double U[] = { //1.00000000000000000000E0, 3.35617141647503099647E1, 5.21357949780152679795E2, 4.59432382970980127987E3, 2.26290000613890934246E4, 4.92673942608635921086E4 }; if (Math.abs(x) > 1.0) { return (1.0 - erfc(x)); } z = x * x; y = x * polevl(z, T, 4) / p1evl(z, U, 5); return y; }
toY = 0.0; } else { toX = scale * SpecialMathFunction.atanh(b) + falseEasting; toY = scale * (Math.atan2(Math.tan(lat), Math.cos(dlon)) - lat0) + falseNorthing;
t = pseries(aa, bb, xx); return t; t = pseries(a, b, x); if (t <= MACHEP) { t = 1.0 - MACHEP; w = incbcf(a, b, x); } else { w = incbd(a, b, x) / xc; t /= a; t *= w; t *= gamma(a + b) / (gamma(a) * gamma(b)); if (flag) { if (t <= MACHEP) { y += t + lgamma(a + b) - lgamma(a) - lgamma(b); y += Math.log(w / a); if (y < MINLOG) {
toY = 0.0; } else { toX = scale * SpecialMathFunction.atanh(b) + falseEasting; toY = scale * (Math.atan2(Math.tan(lat), Math.cos(dlon)) - lat0) + falseNorthing;
toY = 0.0; } else { toX = scale * SpecialMathFunction.atanh(b) + falseEasting; toY = scale * (Math.atan2(Math.tan(lat), Math.cos(dlon)) - lat0) + falseNorthing;
IndirectBlock(int nrows, long iblock_size) { this.nrows = nrows; this.size = iblock_size; if (nrows < 0) { double n = SpecialMathFunction.log2(iblock_size) - SpecialMathFunction.log2(startingBlockSize * tableWidth) + 1; nrows = (int) n; } int maxrows_directBlocks = (int) (SpecialMathFunction.log2(maxDirectBlockSize) - SpecialMathFunction.log2(startingBlockSize)) + 2; if (nrows < maxrows_directBlocks) { directRows = nrows; indirectRows = 0; } else { directRows = maxrows_directBlocks; indirectRows = (nrows - maxrows_directBlocks); } if (debugFractalHeap) debugOut.println(" readIndirectBlock directChildren" + directRows + " indirectChildren= " + indirectRows); }
toY = 0.0; } else { toX = scale * SpecialMathFunction.atanh(b) + falseEasting; toY = scale * (Math.atan2(Math.tan(lat), Math.cos(dlon)) - lat0) + falseNorthing;
IndirectBlock(int nrows, long iblock_size) { this.nrows = nrows; this.size = iblock_size; if (nrows < 0) { double n = SpecialMathFunction.log2(iblock_size) - SpecialMathFunction.log2(startingBlockSize * tableWidth) + 1; nrows = (int) n; } int maxrows_directBlocks = (int) (SpecialMathFunction.log2(maxDirectBlockSize) - SpecialMathFunction.log2(startingBlockSize)) + 2; if (nrows < maxrows_directBlocks) { directRows = nrows; indirectRows = 0; } else { directRows = maxrows_directBlocks; indirectRows = (nrows - maxrows_directBlocks); } if (debugFractalHeap) debugOut.println(" readIndirectBlock directChildren" + directRows + " indirectChildren= " + indirectRows); }
/** * Convert projection coordinates to a LatLonPoint * Note: a new object is not created on each call for the return value. * * @param world convert from these projection coordinates * @param result the object to write to * * @return LatLonPoint convert to these lat/lon coordinates */ public LatLonPoint projToLatLon(ProjectionPoint world, LatLonPointImpl result) { double toLat, toLon; double fromX = world.getX(); double fromY = world.getY(); double x = (fromX - falseEasting) / scale; double d = (fromY - falseNorthing) / scale + lat0; toLon = Math.toDegrees(lon0 + Math.atan2(SpecialMathFunction.sinh(x), Math.cos(d))); toLat = Math.toDegrees(Math.asin(Math.sin(d) / SpecialMathFunction.cosh(x))); result.setLatitude(toLat); result.setLongitude(toLon); return result; }
toY = 0.0; } else { toX = scale * SpecialMathFunction.atanh(b) + falseEasting; toY = scale * (Math.atan2(Math.tan(lat), Math.cos(dlon)) - lat0) + falseNorthing;
toY = 0.0; } else { toX = scale * SpecialMathFunction.atanh(b) + falseEasting; toY = scale * (Math.atan2(Math.tan(lat), Math.cos(dlon)) - lat0) + falseNorthing;
toY = 0.0; } else { toX = scale * SpecialMathFunction.atanh(b) + falseEasting; toY = scale
toY = 0.0; } else { toX = scale * SpecialMathFunction.atanh(b) + falseEasting; toY = scale