当前位置: 首页>>代码示例>>Java>>正文


Java LocalizedFormats.INDEX属性代码示例

本文整理汇总了Java中org.apache.commons.math3.exception.util.LocalizedFormats.INDEX属性的典型用法代码示例。如果您正苦于以下问题:Java LocalizedFormats.INDEX属性的具体用法?Java LocalizedFormats.INDEX怎么用?Java LocalizedFormats.INDEX使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.apache.commons.math3.exception.util.LocalizedFormats的用法示例。


在下文中一共展示了LocalizedFormats.INDEX属性的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: checkIndices

/**
 * Checks that the indices of a subvector are valid.
 *
 * @param start the index of the first entry of the subvector
 * @param end the index of the last entry of the subvector (inclusive)
 * @throws OutOfRangeException if {@code start} of {@code end} are not valid
 * @throws NumberIsTooSmallException if {@code end < start}
 * @since 3.3
 */
private void checkIndices(final int start, final int end)
    throws NumberIsTooSmallException, OutOfRangeException {
    final int dim = getDimension();
    if ((start < 0) || (start >= dim)) {
        throw new OutOfRangeException(LocalizedFormats.INDEX, start, 0,
                                      dim - 1);
    }
    if ((end < 0) || (end >= dim)) {
        throw new OutOfRangeException(LocalizedFormats.INDEX, end, 0,
                                      dim - 1);
    }
    if (end < start) {
        throw new NumberIsTooSmallException(LocalizedFormats.INITIAL_ROW_AFTER_FINAL_ROW,
                                            end, start, false);
    }
}
 
开发者ID:biocompibens,项目名称:SME,代码行数:25,代码来源:SparseFieldVector.java

示例2: ebeDivide

/** {@inheritDoc} */
public FieldVector<T> ebeDivide(FieldVector<T> v)
    throws DimensionMismatchException, MathArithmeticException {
    try {
        return ebeDivide((ArrayFieldVector<T>) v);
    } catch (ClassCastException cce) {
        checkVectorDimensions(v);
        T[] out = MathArrays.buildArray(field, data.length);
        for (int i = 0; i < data.length; i++) {
            try {
                out[i] = data[i].divide(v.getEntry(i));
            } catch (final MathArithmeticException e) {
                throw new MathArithmeticException(LocalizedFormats.INDEX, i);
            }
        }
        return new ArrayFieldVector<T>(field, out, false);
    }
}
 
开发者ID:biocompibens,项目名称:SME,代码行数:18,代码来源:ArrayFieldVector.java

示例3: checkIndices

/**
 * Checks that the indices of a subvector are valid.
 *
 * @param start the index of the first entry of the subvector
 * @param end the index of the last entry of the subvector (inclusive)
 * @throws OutOfRangeException if {@code start} of {@code end} are not valid
 * @throws NumberIsTooSmallException if {@code end < start}
 * @since 3.1
 */
protected void checkIndices(final int start, final int end)
    throws NumberIsTooSmallException, OutOfRangeException {
    final int dim = getDimension();
    if ((start < 0) || (start >= dim)) {
        throw new OutOfRangeException(LocalizedFormats.INDEX, start, 0,
                                      dim - 1);
    }
    if ((end < 0) || (end >= dim)) {
        throw new OutOfRangeException(LocalizedFormats.INDEX, end, 0,
                                      dim - 1);
    }
    if (end < start) {
        // TODO Use more specific error message
        throw new NumberIsTooSmallException(LocalizedFormats.INITIAL_ROW_AFTER_FINAL_ROW,
                                            end, start, false);
    }
}
 
开发者ID:biocompibens,项目名称:SME,代码行数:26,代码来源:RealVector.java

示例4: mapInv

/** {@inheritDoc} */
public FieldVector<T> mapInv() throws MathArithmeticException {
    T[] out = MathArrays.buildArray(field, data.length);
    final T one = field.getOne();
    for (int i = 0; i < data.length; i++) {
        try {
            out[i] = one.divide(data[i]);
        } catch (final MathArithmeticException e) {
            throw new MathArithmeticException(LocalizedFormats.INDEX, i);
        }
    }
    return new ArrayFieldVector<T>(field, out, false);
}
 
开发者ID:biocompibens,项目名称:SME,代码行数:13,代码来源:ArrayFieldVector.java

示例5: mapInvToSelf

/** {@inheritDoc} */
public FieldVector<T> mapInvToSelf() throws MathArithmeticException {
    final T one = field.getOne();
    for (int i = 0; i < data.length; i++) {
        try {
            data[i] = one.divide(data[i]);
        } catch (final MathArithmeticException e) {
            throw new MathArithmeticException(LocalizedFormats.INDEX, i);
        }
    }
    return this;
}
 
开发者ID:biocompibens,项目名称:SME,代码行数:12,代码来源:ArrayFieldVector.java

示例6: checkIndex

/**
 * Check if an index is valid.
 *
 * @param index Index to check.
 * @exception OutOfRangeException if the index is not valid.
 */
private void checkIndex(final int index) throws OutOfRangeException {
    if (index < 0 || index >= getDimension()) {
        throw new OutOfRangeException(LocalizedFormats.INDEX,
                                      index, 0, getDimension() - 1);
    }
}
 
开发者ID:biocompibens,项目名称:SME,代码行数:12,代码来源:ArrayFieldVector.java

示例7: getEntry

/** {@inheritDoc} */
@Override
public double getEntry(int index) throws OutOfRangeException {
    try {
        return data[index];
    } catch (IndexOutOfBoundsException e) {
        throw new OutOfRangeException(LocalizedFormats.INDEX, index, 0,
            getDimension() - 1);
    }
}
 
开发者ID:biocompibens,项目名称:SME,代码行数:10,代码来源:ArrayRealVector.java

示例8: addToEntry

/** {@inheritDoc} */
@Override
public void addToEntry(int index, double increment)
    throws OutOfRangeException {
    try {
    data[index] += increment;
    } catch(IndexOutOfBoundsException e){
        throw new OutOfRangeException(LocalizedFormats.INDEX,
                                      index, 0, data.length - 1);
    }
}
 
开发者ID:biocompibens,项目名称:SME,代码行数:11,代码来源:ArrayRealVector.java

示例9: checkIndex

/**
 * Check if an index is valid.
 *
 * @param index Index to check.
 * @exception OutOfRangeException if {@code index} is not valid.
 */
protected void checkIndex(final int index) throws OutOfRangeException {
    if (index < 0 ||
        index >= getDimension()) {
        throw new OutOfRangeException(LocalizedFormats.INDEX,
                                      index, 0, getDimension() - 1);
    }
}
 
开发者ID:biocompibens,项目名称:SME,代码行数:13,代码来源:RealVector.java

示例10: checkIndex

/**
 * Check if an index is valid.
 *
 * @param index Index to check.
 * @exception OutOfRangeException if the index is not valid.
 */
private void checkIndex(final int index) {
    if (index < 0 || index >= getDimension()) {
        throw new OutOfRangeException(LocalizedFormats.INDEX,
                                      index, 0, getDimension() - 1);
    }
}
 
开发者ID:jiaminghan,项目名称:droidplanner-master,代码行数:12,代码来源:ArrayFieldVector.java

示例11: checkIndex

/**
 * Check if an index is valid.
 *
 * @param index Index to check.
 * @exception OutOfRangeException if {@code index} is not valid.
 */
protected void checkIndex(final int index) {
    if (index < 0 ||
        index >= getDimension()) {
        throw new OutOfRangeException(LocalizedFormats.INDEX,
                                      index, 0, getDimension() - 1);
    }
}
 
开发者ID:jiaminghan,项目名称:droidplanner-master,代码行数:13,代码来源:RealVector.java


注:本文中的org.apache.commons.math3.exception.util.LocalizedFormats.INDEX属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。