Java Code Examples for org.apache.commons.math3.exception.util.LocalizedFormats#NUMBER_TOO_LARGE

The following examples show how to use org.apache.commons.math3.exception.util.LocalizedFormats#NUMBER_TOO_LARGE . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TriangularDistribution.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Create a triangular real distribution using the given lower limit,
 * upper limit, and mode.
 *
 * @param a Lower limit of this distribution (inclusive).
 * @param b Upper limit of this distribution (inclusive).
 * @param c Mode of this distribution.
 * @throws NumberIsTooLargeException if {@code a >= b} or if {@code c > b}
 * @throws NumberIsTooSmallException if {@code c < a}
 */
public TriangularDistribution(double a, double c, double b)
    throws NumberIsTooLargeException, NumberIsTooSmallException {
    if (a >= b) {
        throw new NumberIsTooLargeException(
                        LocalizedFormats.LOWER_BOUND_NOT_BELOW_UPPER_BOUND,
                        a, b, false);
    }
    if (c < a) {
        throw new NumberIsTooSmallException(
                LocalizedFormats.NUMBER_TOO_SMALL, c, a, true);
    }
    if (c > b) {
        throw new NumberIsTooLargeException(
                LocalizedFormats.NUMBER_TOO_LARGE, c, b, true);
    }

    this.a = a;
    this.c = c;
    this.b = b;
    solverAbsoluteAccuracy = FastMath.max(FastMath.ulp(a), FastMath.ulp(b));
}
 
Example 2
Source File: TriangularDistribution.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a triangular distribution.
 *
 * @param rng Random number generator.
 * @param a Lower limit of this distribution (inclusive).
 * @param b Upper limit of this distribution (inclusive).
 * @param c Mode of this distribution.
 * @throws NumberIsTooLargeException if {@code a >= b} or if {@code c > b}.
 * @throws NumberIsTooSmallException if {@code c < a}.
 * @since 3.1
 */
public TriangularDistribution(RandomGenerator rng,
                              double a,
                              double c,
                              double b)
    throws NumberIsTooLargeException, NumberIsTooSmallException {
    super(rng);

    if (a >= b) {
        throw new NumberIsTooLargeException(
                        LocalizedFormats.LOWER_BOUND_NOT_BELOW_UPPER_BOUND,
                        a, b, false);
    }
    if (c < a) {
        throw new NumberIsTooSmallException(
                LocalizedFormats.NUMBER_TOO_SMALL, c, a, true);
    }
    if (c > b) {
        throw new NumberIsTooLargeException(
                LocalizedFormats.NUMBER_TOO_LARGE, c, b, true);
    }

    this.a = a;
    this.c = c;
    this.b = b;
    solverAbsoluteAccuracy = FastMath.max(FastMath.ulp(a), FastMath.ulp(b));
}
 
Example 3
Source File: NumberIsTooLargeException.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Construct the exception.
 *
 * @param wrong Value that is larger than the maximum.
 * @param max Maximum.
 * @param boundIsAllowed if true the maximum is included in the allowed range.
 */
public NumberIsTooLargeException(Number wrong,
                                 Number max,
                                 boolean boundIsAllowed) {
    this(boundIsAllowed ?
         LocalizedFormats.NUMBER_TOO_LARGE :
         LocalizedFormats.NUMBER_TOO_LARGE_BOUND_EXCLUDED,
         wrong, max, boundIsAllowed);
}
 
Example 4
Source File: TriangularDistribution.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a triangular distribution.
 *
 * @param rng Random number generator.
 * @param a Lower limit of this distribution (inclusive).
 * @param b Upper limit of this distribution (inclusive).
 * @param c Mode of this distribution.
 * @throws NumberIsTooLargeException if {@code a >= b} or if {@code c > b}.
 * @throws NumberIsTooSmallException if {@code c < a}.
 * @since 3.1
 */
public TriangularDistribution(RandomGenerator rng,
                              double a,
                              double c,
                              double b)
    throws NumberIsTooLargeException, NumberIsTooSmallException {
    super(rng);

    if (a >= b) {
        throw new NumberIsTooLargeException(
                        LocalizedFormats.LOWER_BOUND_NOT_BELOW_UPPER_BOUND,
                        a, b, false);
    }
    if (c < a) {
        throw new NumberIsTooSmallException(
                LocalizedFormats.NUMBER_TOO_SMALL, c, a, true);
    }
    if (c > b) {
        throw new NumberIsTooLargeException(
                LocalizedFormats.NUMBER_TOO_LARGE, c, b, true);
    }

    this.a = a;
    this.c = c;
    this.b = b;
    solverAbsoluteAccuracy = FastMath.max(FastMath.ulp(a), FastMath.ulp(b));
}
 
Example 5
Source File: NumberIsTooLargeException.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Construct the exception.
 *
 * @param wrong Value that is larger than the maximum.
 * @param max Maximum.
 * @param boundIsAllowed if true the maximum is included in the allowed range.
 */
public NumberIsTooLargeException(Number wrong,
                                 Number max,
                                 boolean boundIsAllowed) {
    this(boundIsAllowed ?
         LocalizedFormats.NUMBER_TOO_LARGE :
         LocalizedFormats.NUMBER_TOO_LARGE_BOUND_EXCLUDED,
         wrong, max, boundIsAllowed);
}
 
Example 6
Source File: TriangularDistribution.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a triangular distribution.
 *
 * @param rng Random number generator.
 * @param a Lower limit of this distribution (inclusive).
 * @param b Upper limit of this distribution (inclusive).
 * @param c Mode of this distribution.
 * @throws NumberIsTooLargeException if {@code a >= b} or if {@code c > b}.
 * @throws NumberIsTooSmallException if {@code c < a}.
 * @since 3.1
 */
public TriangularDistribution(RandomGenerator rng,
                              double a,
                              double c,
                              double b)
    throws NumberIsTooLargeException, NumberIsTooSmallException {
    super(rng);

    if (a >= b) {
        throw new NumberIsTooLargeException(
                        LocalizedFormats.LOWER_BOUND_NOT_BELOW_UPPER_BOUND,
                        a, b, false);
    }
    if (c < a) {
        throw new NumberIsTooSmallException(
                LocalizedFormats.NUMBER_TOO_SMALL, c, a, true);
    }
    if (c > b) {
        throw new NumberIsTooLargeException(
                LocalizedFormats.NUMBER_TOO_LARGE, c, b, true);
    }

    this.a = a;
    this.c = c;
    this.b = b;
    solverAbsoluteAccuracy = FastMath.max(FastMath.ulp(a), FastMath.ulp(b));
}
 
Example 7
Source File: NumberIsTooLargeException.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Construct the exception.
 *
 * @param wrong Value that is larger than the maximum.
 * @param max Maximum.
 * @param boundIsAllowed if true the maximum is included in the allowed range.
 */
public NumberIsTooLargeException(Number wrong,
                                 Number max,
                                 boolean boundIsAllowed) {
    this(boundIsAllowed ?
         LocalizedFormats.NUMBER_TOO_LARGE :
         LocalizedFormats.NUMBER_TOO_LARGE_BOUND_EXCLUDED,
         wrong, max, boundIsAllowed);
}
 
Example 8
Source File: TriangularDistribution.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a triangular distribution.
 *
 * @param rng Random number generator.
 * @param a Lower limit of this distribution (inclusive).
 * @param b Upper limit of this distribution (inclusive).
 * @param c Mode of this distribution.
 * @throws NumberIsTooLargeException if {@code a >= b} or if {@code c > b}.
 * @throws NumberIsTooSmallException if {@code c < a}.
 * @since 3.1
 */
public TriangularDistribution(RandomGenerator rng,
                              double a,
                              double c,
                              double b)
    throws NumberIsTooLargeException, NumberIsTooSmallException {
    super(rng);

    if (a >= b) {
        throw new NumberIsTooLargeException(
                        LocalizedFormats.LOWER_BOUND_NOT_BELOW_UPPER_BOUND,
                        a, b, false);
    }
    if (c < a) {
        throw new NumberIsTooSmallException(
                LocalizedFormats.NUMBER_TOO_SMALL, c, a, true);
    }
    if (c > b) {
        throw new NumberIsTooLargeException(
                LocalizedFormats.NUMBER_TOO_LARGE, c, b, true);
    }

    this.a = a;
    this.c = c;
    this.b = b;
    solverAbsoluteAccuracy = FastMath.max(FastMath.ulp(a), FastMath.ulp(b));
}
 
Example 9
Source File: NumberIsTooLargeException.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Construct the exception.
 *
 * @param wrong Value that is larger than the maximum.
 * @param max Maximum.
 * @param boundIsAllowed if true the maximum is included in the allowed range.
 */
public NumberIsTooLargeException(Number wrong,
                                 Number max,
                                 boolean boundIsAllowed) {
    this(boundIsAllowed ?
         LocalizedFormats.NUMBER_TOO_LARGE :
         LocalizedFormats.NUMBER_TOO_LARGE_BOUND_EXCLUDED,
         wrong, max, boundIsAllowed);
}
 
Example 10
Source File: NumberIsTooLargeException.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Construct the exception.
 *
 * @param wrong Value that is larger than the maximum.
 * @param max Maximum.
 * @param boundIsAllowed if true the maximum is included in the allowed range.
 */
public NumberIsTooLargeException(Number wrong,
                                 Number max,
                                 boolean boundIsAllowed) {
    this(boundIsAllowed ?
         LocalizedFormats.NUMBER_TOO_LARGE :
         LocalizedFormats.NUMBER_TOO_LARGE_BOUND_EXCLUDED,
         wrong, max, boundIsAllowed);
}
 
Example 11
Source File: TriangularDistribution.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a triangular distribution.
 *
 * @param rng Random number generator.
 * @param a Lower limit of this distribution (inclusive).
 * @param b Upper limit of this distribution (inclusive).
 * @param c Mode of this distribution.
 * @throws NumberIsTooLargeException if {@code a >= b} or if {@code c > b}.
 * @throws NumberIsTooSmallException if {@code c < a}.
 * @since 3.1
 */
public TriangularDistribution(RandomGenerator rng,
                              double a,
                              double c,
                              double b)
    throws NumberIsTooLargeException, NumberIsTooSmallException {
    super(rng);

    if (a >= b) {
        throw new NumberIsTooLargeException(
                        LocalizedFormats.LOWER_BOUND_NOT_BELOW_UPPER_BOUND,
                        a, b, false);
    }
    if (c < a) {
        throw new NumberIsTooSmallException(
                LocalizedFormats.NUMBER_TOO_SMALL, c, a, true);
    }
    if (c > b) {
        throw new NumberIsTooLargeException(
                LocalizedFormats.NUMBER_TOO_LARGE, c, b, true);
    }

    this.a = a;
    this.c = c;
    this.b = b;
    solverAbsoluteAccuracy = FastMath.max(FastMath.ulp(a), FastMath.ulp(b));
}
 
Example 12
Source File: NumberIsTooLargeException.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Construct the exception.
 *
 * @param wrong Value that is larger than the maximum.
 * @param max Maximum.
 * @param boundIsAllowed if true the maximum is included in the allowed range.
 */
public NumberIsTooLargeException(Number wrong,
                                 Number max,
                                 boolean boundIsAllowed) {
    this(boundIsAllowed ?
         LocalizedFormats.NUMBER_TOO_LARGE :
         LocalizedFormats.NUMBER_TOO_LARGE_BOUND_EXCLUDED,
         wrong, max, boundIsAllowed);
}
 
Example 13
Source File: TriangularDistribution.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a triangular distribution.
 *
 * @param rng Random number generator.
 * @param a Lower limit of this distribution (inclusive).
 * @param b Upper limit of this distribution (inclusive).
 * @param c Mode of this distribution.
 * @throws NumberIsTooLargeException if {@code a >= b} or if {@code c > b}.
 * @throws NumberIsTooSmallException if {@code c < a}.
 * @since 3.1
 */
public TriangularDistribution(RandomGenerator rng,
                              double a,
                              double c,
                              double b)
    throws NumberIsTooLargeException, NumberIsTooSmallException {
    super(rng);

    if (a >= b) {
        throw new NumberIsTooLargeException(
                        LocalizedFormats.LOWER_BOUND_NOT_BELOW_UPPER_BOUND,
                        a, b, false);
    }
    if (c < a) {
        throw new NumberIsTooSmallException(
                LocalizedFormats.NUMBER_TOO_SMALL, c, a, true);
    }
    if (c > b) {
        throw new NumberIsTooLargeException(
                LocalizedFormats.NUMBER_TOO_LARGE, c, b, true);
    }

    this.a = a;
    this.c = c;
    this.b = b;
    solverAbsoluteAccuracy = FastMath.max(FastMath.ulp(a), FastMath.ulp(b));
}
 
Example 14
Source File: NumberIsTooLargeException.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Construct the exception.
 *
 * @param wrong Value that is larger than the maximum.
 * @param max Maximum.
 * @param boundIsAllowed if true the maximum is included in the allowed range.
 */
public NumberIsTooLargeException(Number wrong,
                                 Number max,
                                 boolean boundIsAllowed) {
    this(boundIsAllowed ?
         LocalizedFormats.NUMBER_TOO_LARGE :
         LocalizedFormats.NUMBER_TOO_LARGE_BOUND_EXCLUDED,
         wrong, max, boundIsAllowed);
}
 
Example 15
Source File: TriangularDistribution.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a triangular distribution.
 *
 * @param rng Random number generator.
 * @param a Lower limit of this distribution (inclusive).
 * @param b Upper limit of this distribution (inclusive).
 * @param c Mode of this distribution.
 * @throws NumberIsTooLargeException if {@code a >= b} or if {@code c > b}.
 * @throws NumberIsTooSmallException if {@code c < a}.
 * @since 3.1
 */
public TriangularDistribution(RandomGenerator rng,
                              double a,
                              double c,
                              double b)
    throws NumberIsTooLargeException, NumberIsTooSmallException {
    super(rng);

    if (a >= b) {
        throw new NumberIsTooLargeException(
                        LocalizedFormats.LOWER_BOUND_NOT_BELOW_UPPER_BOUND,
                        a, b, false);
    }
    if (c < a) {
        throw new NumberIsTooSmallException(
                LocalizedFormats.NUMBER_TOO_SMALL, c, a, true);
    }
    if (c > b) {
        throw new NumberIsTooLargeException(
                LocalizedFormats.NUMBER_TOO_LARGE, c, b, true);
    }

    this.a = a;
    this.c = c;
    this.b = b;
    solverAbsoluteAccuracy = FastMath.max(FastMath.ulp(a), FastMath.ulp(b));
}
 
Example 16
Source File: NumberIsTooLargeException.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Construct the exception.
 *
 * @param wrong Value that is larger than the maximum.
 * @param max Maximum.
 * @param boundIsAllowed if true the maximum is included in the allowed range.
 */
public NumberIsTooLargeException(Number wrong,
                                 Number max,
                                 boolean boundIsAllowed) {
    this(boundIsAllowed ?
         LocalizedFormats.NUMBER_TOO_LARGE :
         LocalizedFormats.NUMBER_TOO_LARGE_BOUND_EXCLUDED,
         wrong, max, boundIsAllowed);
}