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

The following examples show how to use org.apache.commons.math3.exception.util.LocalizedFormats#ROOTS_OF_UNITY_NOT_COMPUTED_YET . 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 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 3
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 4
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 5
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 6
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 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 3 votes vote down vote up
/**
 * Returns {@code true} if {@link #computeRoots(int)} was called with a
 * positive value of its argument {@code n}. If {@code true}, then
 * counter-clockwise ordering of the roots of unity should be used.
 *
 * @return {@code true} if the roots of unity are stored in
 * counter-clockwise order
 * @throws MathIllegalStateException if no roots of unity have been computed
 * yet
 */
public synchronized boolean isCounterClockWise()
        throws MathIllegalStateException {

    if (omegaCount == 0) {
        throw new MathIllegalStateException(
                LocalizedFormats.ROOTS_OF_UNITY_NOT_COMPUTED_YET);
    }
    return isCounterClockWise;
}
 
Example 15
Source File: RootsOfUnity.java    From astor with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Returns {@code true} if {@link #computeRoots(int)} was called with a
 * positive value of its argument {@code n}. If {@code true}, then
 * counter-clockwise ordering of the roots of unity should be used.
 *
 * @return {@code true} if the roots of unity are stored in
 * counter-clockwise order
 * @throws MathIllegalStateException if no roots of unity have been computed
 * yet
 */
public synchronized boolean isCounterClockWise()
        throws MathIllegalStateException {

    if (omegaCount == 0) {
        throw new MathIllegalStateException(
                LocalizedFormats.ROOTS_OF_UNITY_NOT_COMPUTED_YET);
    }
    return isCounterClockWise;
}
 
Example 16
Source File: RootsOfUnity.java    From astor with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Returns {@code true} if {@link #computeRoots(int)} was called with a
 * positive value of its argument {@code n}. If {@code true}, then
 * counter-clockwise ordering of the roots of unity should be used.
 *
 * @return {@code true} if the roots of unity are stored in
 * counter-clockwise order
 * @throws MathIllegalStateException if no roots of unity have been computed
 * yet
 */
public synchronized boolean isCounterClockWise()
        throws MathIllegalStateException {

    if (omegaCount == 0) {
        throw new MathIllegalStateException(
                LocalizedFormats.ROOTS_OF_UNITY_NOT_COMPUTED_YET);
    }
    return isCounterClockWise;
}
 
Example 17
Source File: RootsOfUnity.java    From astor with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Returns {@code true} if {@link #computeRoots(int)} was called with a
 * positive value of its argument {@code n}. If {@code true}, then
 * counter-clockwise ordering of the roots of unity should be used.
 *
 * @return {@code true} if the roots of unity are stored in
 * counter-clockwise order
 * @throws MathIllegalStateException if no roots of unity have been computed
 * yet
 */
public synchronized boolean isCounterClockWise()
        throws MathIllegalStateException {

    if (omegaCount == 0) {
        throw new MathIllegalStateException(
                LocalizedFormats.ROOTS_OF_UNITY_NOT_COMPUTED_YET);
    }
    return isCounterClockWise;
}
 
Example 18
Source File: RootsOfUnity.java    From astor with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Returns {@code true} if {@link #computeRoots(int)} was called with a
 * positive value of its argument {@code n}. If {@code true}, then
 * counter-clockwise ordering of the roots of unity should be used.
 *
 * @return {@code true} if the roots of unity are stored in
 * counter-clockwise order
 * @throws MathIllegalStateException if no roots of unity have been computed
 * yet
 */
public synchronized boolean isCounterClockWise()
        throws MathIllegalStateException {

    if (omegaCount == 0) {
        throw new MathIllegalStateException(
                LocalizedFormats.ROOTS_OF_UNITY_NOT_COMPUTED_YET);
    }
    return isCounterClockWise;
}
 
Example 19
Source File: RootsOfUnity.java    From astor with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Returns {@code true} if {@link #computeRoots(int)} was called with a
 * positive value of its argument {@code n}. If {@code true}, then
 * counter-clockwise ordering of the roots of unity should be used.
 *
 * @return {@code true} if the roots of unity are stored in
 * counter-clockwise order
 * @throws MathIllegalStateException if no roots of unity have been computed
 * yet
 */
public synchronized boolean isCounterClockWise()
        throws MathIllegalStateException {

    if (omegaCount == 0) {
        throw new MathIllegalStateException(
                LocalizedFormats.ROOTS_OF_UNITY_NOT_COMPUTED_YET);
    }
    return isCounterClockWise;
}
 
Example 20
Source File: RootsOfUnity.java    From astor with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Returns {@code true} if {@link #computeRoots(int)} was called with a
 * positive value of its argument {@code n}. If {@code true}, then
 * counter-clockwise ordering of the roots of unity should be used.
 *
 * @return {@code true} if the roots of unity are stored in
 * counter-clockwise order
 * @throws MathIllegalStateException if no roots of unity have been computed
 * yet
 */
public synchronized boolean isCounterClockWise()
        throws MathIllegalStateException {

    if (omegaCount == 0) {
        throw new MathIllegalStateException(
                LocalizedFormats.ROOTS_OF_UNITY_NOT_COMPUTED_YET);
    }
    return isCounterClockWise;
}