private static Schema buildSegment(String segmentDirName, String segmentName, HllConfig hllConfig) throws Exception { int numRows = (int) MathUtils.factorial(NUM_DIMENSIONS) * 100; Schema schema = new Schema();
/** * Returns true if both arguments are equal or within the range of allowed * error (inclusive). * * @param x first value * @param y second value * @param eps the amount of absolute error to allow. * @return {@code true} if the values are equal or within range of each other. * @since 2.2 */ public static boolean equals(float x, float y, float eps) { return equals(x, y, 1) || FastMath.abs(y - x) <= eps; }
/** * Evaluates the continued fraction at the value x. * @param x the evaluation point. * @return the value of the continued fraction evaluated at x. * @throws MathException if the algorithm fails to converge. */ public double evaluate(double x) throws MathException { return evaluate(x, DEFAULT_EPSILON, Integer.MAX_VALUE); }
/** * Returns true if both arguments are NaN or are equal or within the range * of allowed error (inclusive). * * @param x first value * @param y second value * @param eps the amount of absolute error to allow. * @return {@code true} if the values are equal or within range of each other, * or both are NaN. * @since 2.2 */ public static boolean equalsIncludingNaN(double x, double y, double eps) { return equalsIncludingNaN(x, y) || (FastMath.abs(y - x) <= eps); }
/** * Copy constructor. Creates a new ResizableDoubleArray that is a deep, * fresh copy of the original. Needs to acquire synchronization lock * on original. Original may not be null; otherwise a NullPointerException * is thrown. * * @param original array to copy * @since 2.0 */ public ResizableDoubleArray(ResizableDoubleArray original) { copy(original, this); }
/** {@inheritDoc} */ @Override public RealVector mapSqrtToSelf() { for (int i = 0; i < data.length; i++) { data[i] = FastMath.sqrt(data[i]); } return this; }
/** {@inheritDoc} */ @Override public RealVector mapExpToSelf() { for (int i = 0; i < data.length; i++) { data[i] = FastMath.exp(data[i]); } return this; }
/** {@inheritDoc} */ @Override public RealVector mapSinhToSelf() { for (int i = 0; i < data.length; i++) { data[i] = FastMath.sinh(data[i]); } return this; }
/** {@inheritDoc} */ @Override public RealVector mapRintToSelf() { for (int i = 0; i < data.length; i++) { data[i] = FastMath.rint(data[i]); } return this; }
/** {@inheritDoc} */ @Override public double value(double d) { return FastMath.asin(d); } };
/** {@inheritDoc} */ @Override public double value(double d) { return FastMath.cbrt(d); } };
/** {@inheritDoc} */ @Override public double value(double d) { return FastMath.cos(d); } };
/** * Create an iterator over this counter. * * @return the iterator. */ public Iterator iterator() { return new Iterator(); }
private void testSimpleCore(int numDimensions, int numMetrics, int numSkipMaterializationDimensions) throws Exception { int ROWS = (int) MathUtils.factorial(numDimensions); Schema schema = new Schema(); List<String> dimensionsSplitOrder = new ArrayList<>();
/** * Computes t test statistic for 1-sample t-test. * * @param m sample mean * @param mu constant to test against * @param v sample variance * @param n sample n * @return t test statistic */ protected double t(double m, double mu, double v, double n) { return (m - mu) / FastMath.sqrt(v / n); }