本文整理汇总了Java中org.apache.commons.math3.exception.util.LocalizedFormats.OUT_OF_RANGE_ROOT_OF_UNITY_INDEX属性的典型用法代码示例。如果您正苦于以下问题:Java LocalizedFormats.OUT_OF_RANGE_ROOT_OF_UNITY_INDEX属性的具体用法?Java LocalizedFormats.OUT_OF_RANGE_ROOT_OF_UNITY_INDEX怎么用?Java LocalizedFormats.OUT_OF_RANGE_ROOT_OF_UNITY_INDEX使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.apache.commons.math3.exception.util.LocalizedFormats
的用法示例。
在下文中一共展示了LocalizedFormats.OUT_OF_RANGE_ROOT_OF_UNITY_INDEX属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getReal
/**
* 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];
}
示例2: getImaginary
/**
* 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];
}