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

The following examples show how to use org.apache.commons.math3.exception.util.LocalizedFormats#OUT_OF_RANGE_ROOT_OF_UNITY_INDEX . 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: RootsOfUnity.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Get the real part of the {@code k}-th {@code n}-th root of unity.
 *
 * @param k index of the {@code n}-th root of unity
 * @return real part of the {@code k}-th {@code n}-th root of unity
 * @throws MathIllegalStateException if no roots of unity have been
 * computed yet
 * @throws MathIllegalArgumentException if {@code k} is out of range
 */
public synchronized double getReal(int k)
        throws MathIllegalStateException, MathIllegalArgumentException {

    if (omegaCount == 0) {
        throw new MathIllegalStateException(
                LocalizedFormats.ROOTS_OF_UNITY_NOT_COMPUTED_YET);
    }
    if ((k < 0) || (k >= omegaCount)) {
        throw new OutOfRangeException(
                LocalizedFormats.OUT_OF_RANGE_ROOT_OF_UNITY_INDEX,
                Integer.valueOf(k),
                Integer.valueOf(0),
                Integer.valueOf(omegaCount - 1));
    }

    return omegaReal[k];
}
 
Example 2
Source File: RootsOfUnity.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Get the imaginary part of the {@code k}-th {@code n}-th root of unity.
 *
 * @param k index of the {@code n}-th root of unity
 * @return imaginary part of the {@code k}-th {@code n}-th root of unity
 * @throws MathIllegalStateException if no roots of unity have been
 * computed yet
 * @throws OutOfRangeException if {@code k} is out of range
 */
public synchronized double getImaginary(int k)
        throws MathIllegalStateException, OutOfRangeException {

    if (omegaCount == 0) {
        throw new MathIllegalStateException(
                LocalizedFormats.ROOTS_OF_UNITY_NOT_COMPUTED_YET);
    }
    if ((k < 0) || (k >= omegaCount)) {
        throw new OutOfRangeException(
                LocalizedFormats.OUT_OF_RANGE_ROOT_OF_UNITY_INDEX,
                Integer.valueOf(k),
                Integer.valueOf(0),
                Integer.valueOf(omegaCount - 1));
    }

    return isCounterClockWise ? omegaImaginaryCounterClockwise[k] :
        omegaImaginaryClockwise[k];
}
 
Example 3
Source File: RootsOfUnity.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Get the real part of the {@code k}-th {@code n}-th root of unity.
 *
 * @param k index of the {@code n}-th root of unity
 * @return real part of the {@code k}-th {@code n}-th root of unity
 * @throws MathIllegalStateException if no roots of unity have been
 * computed yet
 * @throws MathIllegalArgumentException if {@code k} is out of range
 */
public synchronized double getReal(int k)
        throws MathIllegalStateException, MathIllegalArgumentException {

    if (omegaCount == 0) {
        throw new MathIllegalStateException(
                LocalizedFormats.ROOTS_OF_UNITY_NOT_COMPUTED_YET);
    }
    if ((k < 0) || (k >= omegaCount)) {
        throw new OutOfRangeException(
                LocalizedFormats.OUT_OF_RANGE_ROOT_OF_UNITY_INDEX,
                Integer.valueOf(k),
                Integer.valueOf(0),
                Integer.valueOf(omegaCount - 1));
    }

    return omegaReal[k];
}
 
Example 4
Source File: RootsOfUnity.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Get the imaginary part of the {@code k}-th {@code n}-th root of unity.
 *
 * @param k index of the {@code n}-th root of unity
 * @return imaginary part of the {@code k}-th {@code n}-th root of unity
 * @throws MathIllegalStateException if no roots of unity have been
 * computed yet
 * @throws OutOfRangeException if {@code k} is out of range
 */
public synchronized double getImaginary(int k)
        throws MathIllegalStateException, OutOfRangeException {

    if (omegaCount == 0) {
        throw new MathIllegalStateException(
                LocalizedFormats.ROOTS_OF_UNITY_NOT_COMPUTED_YET);
    }
    if ((k < 0) || (k >= omegaCount)) {
        throw new OutOfRangeException(
                LocalizedFormats.OUT_OF_RANGE_ROOT_OF_UNITY_INDEX,
                Integer.valueOf(k),
                Integer.valueOf(0),
                Integer.valueOf(omegaCount - 1));
    }

    return isCounterClockWise ? omegaImaginaryCounterClockwise[k] :
        omegaImaginaryClockwise[k];
}
 
Example 5
Source File: RootsOfUnity.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Get the real part of the {@code k}-th {@code n}-th root of unity.
 *
 * @param k index of the {@code n}-th root of unity
 * @return real part of the {@code k}-th {@code n}-th root of unity
 * @throws MathIllegalStateException if no roots of unity have been
 * computed yet
 * @throws MathIllegalArgumentException if {@code k} is out of range
 */
public synchronized double getReal(int k)
        throws MathIllegalStateException, MathIllegalArgumentException {

    if (omegaCount == 0) {
        throw new MathIllegalStateException(
                LocalizedFormats.ROOTS_OF_UNITY_NOT_COMPUTED_YET);
    }
    if ((k < 0) || (k >= omegaCount)) {
        throw new OutOfRangeException(
                LocalizedFormats.OUT_OF_RANGE_ROOT_OF_UNITY_INDEX,
                Integer.valueOf(k),
                Integer.valueOf(0),
                Integer.valueOf(omegaCount - 1));
    }

    return omegaReal[k];
}
 
Example 6
Source File: RootsOfUnity.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Get the imaginary part of the {@code k}-th {@code n}-th root of unity.
 *
 * @param k index of the {@code n}-th root of unity
 * @return imaginary part of the {@code k}-th {@code n}-th root of unity
 * @throws MathIllegalStateException if no roots of unity have been
 * computed yet
 * @throws OutOfRangeException if {@code k} is out of range
 */
public synchronized double getImaginary(int k)
        throws MathIllegalStateException, OutOfRangeException {

    if (omegaCount == 0) {
        throw new MathIllegalStateException(
                LocalizedFormats.ROOTS_OF_UNITY_NOT_COMPUTED_YET);
    }
    if ((k < 0) || (k >= omegaCount)) {
        throw new OutOfRangeException(
                LocalizedFormats.OUT_OF_RANGE_ROOT_OF_UNITY_INDEX,
                Integer.valueOf(k),
                Integer.valueOf(0),
                Integer.valueOf(omegaCount - 1));
    }

    return isCounterClockWise ? omegaImaginaryCounterClockwise[k] :
        omegaImaginaryClockwise[k];
}
 
Example 7
Source File: RootsOfUnity.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Get the real part of the {@code k}-th {@code n}-th root of unity.
 *
 * @param k index of the {@code n}-th root of unity
 * @return real part of the {@code k}-th {@code n}-th root of unity
 * @throws MathIllegalStateException if no roots of unity have been
 * computed yet
 * @throws MathIllegalArgumentException if {@code k} is out of range
 */
public synchronized double getReal(int k)
        throws MathIllegalStateException, MathIllegalArgumentException {

    if (omegaCount == 0) {
        throw new MathIllegalStateException(
                LocalizedFormats.ROOTS_OF_UNITY_NOT_COMPUTED_YET);
    }
    if ((k < 0) || (k >= omegaCount)) {
        throw new OutOfRangeException(
                LocalizedFormats.OUT_OF_RANGE_ROOT_OF_UNITY_INDEX,
                Integer.valueOf(k),
                Integer.valueOf(0),
                Integer.valueOf(omegaCount - 1));
    }

    return omegaReal[k];
}
 
Example 8
Source File: RootsOfUnity.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Get the imaginary part of the {@code k}-th {@code n}-th root of unity.
 *
 * @param k index of the {@code n}-th root of unity
 * @return imaginary part of the {@code k}-th {@code n}-th root of unity
 * @throws MathIllegalStateException if no roots of unity have been
 * computed yet
 * @throws OutOfRangeException if {@code k} is out of range
 */
public synchronized double getImaginary(int k)
        throws MathIllegalStateException, OutOfRangeException {

    if (omegaCount == 0) {
        throw new MathIllegalStateException(
                LocalizedFormats.ROOTS_OF_UNITY_NOT_COMPUTED_YET);
    }
    if ((k < 0) || (k >= omegaCount)) {
        throw new OutOfRangeException(
                LocalizedFormats.OUT_OF_RANGE_ROOT_OF_UNITY_INDEX,
                Integer.valueOf(k),
                Integer.valueOf(0),
                Integer.valueOf(omegaCount - 1));
    }

    return isCounterClockWise ? omegaImaginaryCounterClockwise[k] :
        omegaImaginaryClockwise[k];
}
 
Example 9
Source File: RootsOfUnity.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Get the real part of the {@code k}-th {@code n}-th root of unity.
 *
 * @param k index of the {@code n}-th root of unity
 * @return real part of the {@code k}-th {@code n}-th root of unity
 * @throws MathIllegalStateException if no roots of unity have been
 * computed yet
 * @throws MathIllegalArgumentException if {@code k} is out of range
 */
public synchronized double getReal(int k)
        throws MathIllegalStateException, MathIllegalArgumentException {

    if (omegaCount == 0) {
        throw new MathIllegalStateException(
                LocalizedFormats.ROOTS_OF_UNITY_NOT_COMPUTED_YET);
    }
    if ((k < 0) || (k >= omegaCount)) {
        throw new OutOfRangeException(
                LocalizedFormats.OUT_OF_RANGE_ROOT_OF_UNITY_INDEX,
                Integer.valueOf(k),
                Integer.valueOf(0),
                Integer.valueOf(omegaCount - 1));
    }

    return omegaReal[k];
}
 
Example 10
Source File: RootsOfUnity.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Get the imaginary part of the {@code k}-th {@code n}-th root of unity.
 *
 * @param k index of the {@code n}-th root of unity
 * @return imaginary part of the {@code k}-th {@code n}-th root of unity
 * @throws MathIllegalStateException if no roots of unity have been
 * computed yet
 * @throws OutOfRangeException if {@code k} is out of range
 */
public synchronized double getImaginary(int k)
        throws MathIllegalStateException, OutOfRangeException {

    if (omegaCount == 0) {
        throw new MathIllegalStateException(
                LocalizedFormats.ROOTS_OF_UNITY_NOT_COMPUTED_YET);
    }
    if ((k < 0) || (k >= omegaCount)) {
        throw new OutOfRangeException(
                LocalizedFormats.OUT_OF_RANGE_ROOT_OF_UNITY_INDEX,
                Integer.valueOf(k),
                Integer.valueOf(0),
                Integer.valueOf(omegaCount - 1));
    }

    return isCounterClockWise ? omegaImaginaryCounterClockwise[k] :
        omegaImaginaryClockwise[k];
}
 
Example 11
Source File: RootsOfUnity.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Get the real part of the {@code k}-th {@code n}-th root of unity.
 *
 * @param k index of the {@code n}-th root of unity
 * @return real part of the {@code k}-th {@code n}-th root of unity
 * @throws MathIllegalStateException if no roots of unity have been
 * computed yet
 * @throws MathIllegalArgumentException if {@code k} is out of range
 */
public synchronized double getReal(int k)
        throws MathIllegalStateException, MathIllegalArgumentException {

    if (omegaCount == 0) {
        throw new MathIllegalStateException(
                LocalizedFormats.ROOTS_OF_UNITY_NOT_COMPUTED_YET);
    }
    if ((k < 0) || (k >= omegaCount)) {
        throw new OutOfRangeException(
                LocalizedFormats.OUT_OF_RANGE_ROOT_OF_UNITY_INDEX,
                Integer.valueOf(k),
                Integer.valueOf(0),
                Integer.valueOf(omegaCount - 1));
    }

    return omegaReal[k];
}
 
Example 12
Source File: RootsOfUnity.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Get the imaginary part of the {@code k}-th {@code n}-th root of unity.
 *
 * @param k index of the {@code n}-th root of unity
 * @return imaginary part of the {@code k}-th {@code n}-th root of unity
 * @throws MathIllegalStateException if no roots of unity have been
 * computed yet
 * @throws OutOfRangeException if {@code k} is out of range
 */
public synchronized double getImaginary(int k)
        throws MathIllegalStateException, OutOfRangeException {

    if (omegaCount == 0) {
        throw new MathIllegalStateException(
                LocalizedFormats.ROOTS_OF_UNITY_NOT_COMPUTED_YET);
    }
    if ((k < 0) || (k >= omegaCount)) {
        throw new OutOfRangeException(
                LocalizedFormats.OUT_OF_RANGE_ROOT_OF_UNITY_INDEX,
                Integer.valueOf(k),
                Integer.valueOf(0),
                Integer.valueOf(omegaCount - 1));
    }

    return isCounterClockWise ? omegaImaginaryCounterClockwise[k] :
        omegaImaginaryClockwise[k];
}
 
Example 13
Source File: RootsOfUnity.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Get the real part of the {@code k}-th {@code n}-th root of unity.
 *
 * @param k index of the {@code n}-th root of unity
 * @return real part of the {@code k}-th {@code n}-th root of unity
 * @throws MathIllegalStateException if no roots of unity have been
 * computed yet
 * @throws MathIllegalArgumentException if {@code k} is out of range
 */
public synchronized double getReal(int k)
        throws MathIllegalStateException, MathIllegalArgumentException {

    if (omegaCount == 0) {
        throw new MathIllegalStateException(
                LocalizedFormats.ROOTS_OF_UNITY_NOT_COMPUTED_YET);
    }
    if ((k < 0) || (k >= omegaCount)) {
        throw new OutOfRangeException(
                LocalizedFormats.OUT_OF_RANGE_ROOT_OF_UNITY_INDEX,
                Integer.valueOf(k),
                Integer.valueOf(0),
                Integer.valueOf(omegaCount - 1));
    }

    return omegaReal[k];
}
 
Example 14
Source File: RootsOfUnity.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Get the imaginary part of the {@code k}-th {@code n}-th root of unity.
 *
 * @param k index of the {@code n}-th root of unity
 * @return imaginary part of the {@code k}-th {@code n}-th root of unity
 * @throws MathIllegalStateException if no roots of unity have been
 * computed yet
 * @throws OutOfRangeException if {@code k} is out of range
 */
public synchronized double getImaginary(int k)
        throws MathIllegalStateException, OutOfRangeException {

    if (omegaCount == 0) {
        throw new MathIllegalStateException(
                LocalizedFormats.ROOTS_OF_UNITY_NOT_COMPUTED_YET);
    }
    if ((k < 0) || (k >= omegaCount)) {
        throw new OutOfRangeException(
                LocalizedFormats.OUT_OF_RANGE_ROOT_OF_UNITY_INDEX,
                Integer.valueOf(k),
                Integer.valueOf(0),
                Integer.valueOf(omegaCount - 1));
    }

    return isCounterClockWise ? omegaImaginaryCounterClockwise[k] :
        omegaImaginaryClockwise[k];
}
 
Example 15
Source File: RootsOfUnity.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Get the real part of the {@code k}-th {@code n}-th root of unity.
 *
 * @param k index of the {@code n}-th root of unity
 * @return real part of the {@code k}-th {@code n}-th root of unity
 * @throws MathIllegalStateException if no roots of unity have been
 * computed yet
 * @throws MathIllegalArgumentException if {@code k} is out of range
 */
public synchronized double getReal(int k)
        throws MathIllegalStateException, MathIllegalArgumentException {

    if (omegaCount == 0) {
        throw new MathIllegalStateException(
                LocalizedFormats.ROOTS_OF_UNITY_NOT_COMPUTED_YET);
    }
    if ((k < 0) || (k >= omegaCount)) {
        throw new OutOfRangeException(
                LocalizedFormats.OUT_OF_RANGE_ROOT_OF_UNITY_INDEX,
                Integer.valueOf(k),
                Integer.valueOf(0),
                Integer.valueOf(omegaCount - 1));
    }

    return omegaReal[k];
}
 
Example 16
Source File: RootsOfUnity.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Get the imaginary part of the {@code k}-th {@code n}-th root of unity.
 *
 * @param k index of the {@code n}-th root of unity
 * @return imaginary part of the {@code k}-th {@code n}-th root of unity
 * @throws MathIllegalStateException if no roots of unity have been
 * computed yet
 * @throws OutOfRangeException if {@code k} is out of range
 */
public synchronized double getImaginary(int k)
        throws MathIllegalStateException, OutOfRangeException {

    if (omegaCount == 0) {
        throw new MathIllegalStateException(
                LocalizedFormats.ROOTS_OF_UNITY_NOT_COMPUTED_YET);
    }
    if ((k < 0) || (k >= omegaCount)) {
        throw new OutOfRangeException(
                LocalizedFormats.OUT_OF_RANGE_ROOT_OF_UNITY_INDEX,
                Integer.valueOf(k),
                Integer.valueOf(0),
                Integer.valueOf(omegaCount - 1));
    }

    return isCounterClockWise ? omegaImaginaryCounterClockwise[k] :
        omegaImaginaryClockwise[k];
}