PDF function, static version.

@param x Value
@param location Location (x0)
@param shape Shape (gamma)
@return PDF value
761598
public static double quantile(double x, double location, double shape) {
    return (x == .5) ? location : (x <= .5) //
        ? x <= 0. ? x < 0. ? Double.NaN : Double.NEGATIVE_INFINITY //
            : location - shape / FastMath.tan(Math.PI * x) //
        : x >= 1. ? x > 1. ? Double.NaN : Double.POSITIVE_INFINITY //
            : location + shape / FastMath.tan(Math.PI * (1 - x));
  }
1278119
protected int getInternalDayFromLocation(float x, float y) {
        int dayStart = mEdgePadding;
        if (x < dayStart || x > mWidth - mEdgePadding) {
            return -1;
        }
        // Selection is (x - start) / (pixels/day) == (x -s) * day / pixels
        int row = (int) (y - getMonthHeaderSize()) / mRowHeight;
        int column = (int) ((x - dayStart) * mNumDays / (mWidth - dayStart - mEdgePadding));

        int day = column - findDayOffset() + 1;
        day += row * mNumDays;
        return day;
    }
43558
def _pdf(self, x, dist, cache):
        """"""
        output = evaluation.evaluate_density(dist, numpy.arccosh(x), cache=cache)
        output /= numpy.where(x != 1, numpy.sqrt(x*x-1), numpy.inf)
        return output
252498
public static double pdf(double x, double mu, double sigma) {
    if(x <= 0.) {
      return 0.;
    }
    final double xrel = (FastMath.log(x) - mu) / sigma;
    return 1 / (MathUtil.SQRTTWOPI * sigma * x) * FastMath.exp(-.5 * xrel * xrel);
  }
654382
public static double quantile(double val, double shape, double location, double scale) {
    return val < 0 || val > 1 ? Double.NaN : scale * FastMath.pow(val / (1. - val), 1. / shape) + location;
  }
509094
public static GeoShapeCondition geoShape(String field, String shape) {
        return geoShape(field, wkt(shape));
    }
489978
public int getPositionInContextNodeList(XPathContext xctxt)
  {

    // System.out.println("FuncPosition- entry");
    // If we're in a predicate, then this will return non-null.
    SubContextList iter = m_isTopLevel ? null : xctxt.getSubContextList();

    if (null != iter)
    {
      int prox = iter.getProximityPosition(xctxt);
 
      // System.out.println("FuncPosition- prox: "+prox);
      return prox;
    }

    DTMIterator cnl = xctxt.getContextNodeList();

    if (null != cnl)
    {
      int n = cnl.getCurrentNode();
      if(n == DTM.NULL)
      {
        if(cnl.getCurrentPos() == 0)
          return 0;
          
        // Then I think we're in a sort.  See sort21.xsl. So the iterator has 
        // already been spent, and is not on the node we're processing. 
        // It's highly possible that this is an issue for other context-list 
        // functions.  Shouldn't be a problem for last(), and it shouldn't be 
        // a problem for current().
        try 
        { 
          cnl = cnl.cloneWithReset(); 
        }
        catch(CloneNotSupportedException cnse)
        {
          throw new org.apache.xml.utils.WrappedRuntimeException(cnse);
        }
        int currentNode = xctxt.getContextNode();
        // System.out.println("currentNode: "+currentNode);
        while(DTM.NULL != (n = cnl.nextNode()))
        {
          if(n == currentNode)
            break;
        }
      }
      // System.out.println("n: "+n);
      // System.out.println("FuncPosition- cnl.getCurrentPos(): "+cnl.getCurrentPos());
      return cnl.getCurrentPos();
    }

    // System.out.println("FuncPosition - out of guesses: -1");
    return -1;
  }
1347227
public static boolean isPointOnShape(LatLng point,
                                         GoogleMapShape shape, boolean geodesic, double tolerance) {

        boolean onShape = false;

        switch (shape.getShapeType()) {

            case LAT_LNG:
                onShape = isPointNearPoint(point, (LatLng) shape.getShape(), tolerance);
                break;
            case MARKER_OPTIONS:
                onShape = isPointNearMarker(point, (MarkerOptions) shape.getShape(), tolerance);
                break;
            case POLYLINE_OPTIONS:
                onShape = isPointOnPolyline(point, (PolylineOptions) shape.getShape(), geodesic, tolerance);
                break;
            case POLYGON_OPTIONS:
                onShape = isPointOnPolygon(point, (PolygonOptions) shape.getShape(), geodesic, tolerance);
                break;
            case MULTI_LAT_LNG:
                onShape = isPointNearMultiLatLng(point, (MultiLatLng) shape.getShape(), tolerance);
                break;
            case MULTI_POLYLINE_OPTIONS:
                onShape = isPointOnMultiPolyline(point, (MultiPolylineOptions) shape.getShape(), geodesic, tolerance);
                break;
            case MULTI_POLYGON_OPTIONS:
                onShape = isPointOnMultiPolygon(point, (MultiPolygonOptions) shape.getShape(), geodesic, tolerance);
                break;
            case COLLECTION:
                @SuppressWarnings("unchecked")
                List<GoogleMapShape> shapeList = (List<GoogleMapShape>) shape
                        .getShape();
                for (GoogleMapShape shapeListItem : shapeList) {
                    onShape = isPointOnShape(point, shapeListItem, geodesic, tolerance);
                    if (onShape) {
                        break;
                    }
                }
                break;
            default:
                throw new GeoPackageException("Unsupported Shape Type: "
                        + shape.getShapeType());

        }

        return onShape;
    }
1150709
public static double pdf(double x, double k, double theta, double shift) {
    if(x == Double.POSITIVE_INFINITY || x == Double.NEGATIVE_INFINITY) {
      return 0.;
    }
    if(x != x) {
      return Double.NaN;
    }
    x = (x - shift) * theta;
    final double ex = FastMath.exp(x);
    return ex < Double.POSITIVE_INFINITY ? FastMath.exp(k * x - ex - GammaDistribution.logGamma(k)) * theta : 0.;
  }
432034
public static double pdf(double x, double sigma) {
    if(!(x > 0.) || x == Double.POSITIVE_INFINITY) {
      return x == x ? 0. : Double.NaN;
    }
    final double xs = x / sigma;
    final double v = FastMath.exp(-.5 * xs * xs);
    return v > 0. ? xs / sigma * v : 0.;
  }
1220831
public static double pdf(double x, double mu, double beta) {
    final double z = (x - mu) / beta;
    if(x == Double.NEGATIVE_INFINITY) {
      return 0.;
    }
    return FastMath.exp(-z - FastMath.exp(-z)) / beta;
  }
1217215
@Override
	@Pure
	protected Rectangle2d calcBounds() {
		final GeoLocationPoint p = getGeoPosition();
		if (p == null) {
			return null;
		}
		return new Rectangle2d(p.getX(), p.getY(), 0, 0);
	}
691549
public static double pdf(double val, double loc, double scale, double shape1, double shape2) {
    val = (val - loc) / scale;
    final double logc = logcdf(val, shape1, shape2);
    if(shape1 == 1.) {
      // Then val will usually become 0.
      return val >= 1 ? 0 : FastMath.exp(logc * (1. - shape2)) / scale;
    }
    if(shape1 != 0.) {
      val = shape1 * val;
      if(val >= 1) {
        return 0;
      }
      val = (1. - 1. / shape1) * FastMath.log1p(-val);
    }
    if(Double.isInfinite(val)) {
      return 0;
    }
    val = FastMath.exp(-val);
    return Double.isInfinite(val) ? 0. : val / scale * FastMath.exp(logc * (1. - shape2));
  }
1073623
public static GoogleMapShape addShapeToMap(GoogleMap map,
                                               GoogleMapShape shape) {

        GoogleMapShape addedShape = null;

        switch (shape.getShapeType()) {

            case LAT_LNG:
                addedShape = new GoogleMapShape(shape.getGeometryType(),
                        GoogleMapShapeType.MARKER, addLatLngToMap(map,
                        (LatLng) shape.getShape()));
                break;
            case MARKER_OPTIONS:
                addedShape = new GoogleMapShape(shape.getGeometryType(),
                        GoogleMapShapeType.MARKER, addMarkerOptionsToMap(map,
                        (MarkerOptions) shape.getShape()));
                break;
            case POLYLINE_OPTIONS:
                addedShape = new GoogleMapShape(shape.getGeometryType(),
                        GoogleMapShapeType.POLYLINE, addPolylineToMap(map,
                        (PolylineOptions) shape.getShape()));
                break;
            case POLYGON_OPTIONS:
                addedShape = new GoogleMapShape(shape.getGeometryType(),
                        GoogleMapShapeType.POLYGON, addPolygonToMap(map,
                        (PolygonOptions) shape.getShape()));
                break;
            case MULTI_LAT_LNG:
                addedShape = new GoogleMapShape(shape.getGeometryType(),
                        GoogleMapShapeType.MULTI_MARKER, addLatLngsToMap(map,
                        (MultiLatLng) shape.getShape()));
                break;
            case MULTI_POLYLINE_OPTIONS:
                addedShape = new GoogleMapShape(shape.getGeometryType(),
                        GoogleMapShapeType.MULTI_POLYLINE, addPolylinesToMap(map,
                        (MultiPolylineOptions) shape.getShape()));
                break;
            case MULTI_POLYGON_OPTIONS:
                addedShape = new GoogleMapShape(shape.getGeometryType(),
                        GoogleMapShapeType.MULTI_POLYGON, addPolygonsToMap(map,
                        (MultiPolygonOptions) shape.getShape()));
                break;
            case COLLECTION:
                List<GoogleMapShape> addedShapeList = new ArrayList<GoogleMapShape>();
                @SuppressWarnings("unchecked")
                List<GoogleMapShape> shapeList = (List<GoogleMapShape>) shape
                        .getShape();
                for (GoogleMapShape shapeListItem : shapeList) {
                    addedShapeList.add(addShapeToMap(map, shapeListItem));
                }
                addedShape = new GoogleMapShape(shape.getGeometryType(),
                        GoogleMapShapeType.COLLECTION, addedShapeList);
                break;
            default:
                throw new GeoPackageException("Unsupported Shape Type: "
                        + shape.getShapeType());

        }

        return addedShape;
    }
248439
public PdfChunk getChunk(int idx) {
        if (idx < 0 || idx >= line.size())
            return null;
        return (PdfChunk)line.get(idx);
    }
877699
public static Document resourceFileToXMLDocument(final String location, final String fileName) {
        if (location == null || fileName == null) return null;

        final InputStream in = ResourceUtilities.class.getResourceAsStream(location + fileName);
        if (in == null) return null;

        final DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
        final DocumentBuilder dBuilder;
        Document doc = null;
        try {
            dBuilder = dbFactory.newDocumentBuilder();
            doc = dBuilder.parse(in);
        } catch (Exception e) {
            LOG.error("Failed to parse the resource as XML.", e);
        } finally {
            try {
                in.close();
            } catch (IOException e) {
                LOG.error("Failed to close the InputStream", e);
            }
        }
        return doc;
    }
900668
def _pdf(self, x, dist, cache):
        """"""
        return evaluation.evaluate_density(
            dist, numpy.arctan(x), cache=cache)/(1+x*x)