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


Java LocalizedFormats.AT_LEAST_ONE_ROW属性代码示例

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


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

示例1: Array2DRowFieldMatrix

/**
 * Create a new {@code FieldMatrix<T>} using the input array as the underlying
 * data array.
 * <p>If an array is built specially in order to be embedded in a
 * {@code FieldMatrix<T>} and not used directly, the {@code copyArray} may be
 * set to {@code false}. This will prevent the copying and improve
 * performance as no new array will be built and no data will be copied.</p>
 *
 * @param field Field to which the elements belong.
 * @param d Data for the new matrix.
 * @param copyArray Whether to copy or reference the input array.
 * @throws DimensionMismatchException if {@code d} is not rectangular.
 * @throws NoDataException if there are not at least one row and one column.
 * @throws NullArgumentException if {@code d} is {@code null}.
 * @see #Array2DRowFieldMatrix(FieldElement[][])
 */
public Array2DRowFieldMatrix(final Field<T> field, final T[][] d, final boolean copyArray)
    throws DimensionMismatchException, NoDataException, NullArgumentException {
    super(field);
    if (copyArray) {
        copyIn(d);
    } else {
        MathUtils.checkNotNull(d);
        final int nRows = d.length;
        if (nRows == 0) {
            throw new NoDataException(LocalizedFormats.AT_LEAST_ONE_ROW);
        }
        final int nCols = d[0].length;
        if (nCols == 0) {
            throw new NoDataException(LocalizedFormats.AT_LEAST_ONE_COLUMN);
        }
        for (int r = 1; r < nRows; r++) {
            if (d[r].length != nCols) {
                throw new DimensionMismatchException(nCols, d[r].length);
            }
        }
        data = d;
    }
}
 
开发者ID:biocompibens,项目名称:SME,代码行数:39,代码来源:Array2DRowFieldMatrix.java

示例2: Array2DRowRealMatrix

/**
 * Create a new RealMatrix using the input array as the underlying
 * data array.
 * If an array is built specially in order to be embedded in a
 * RealMatrix and not used directly, the {@code copyArray} may be
 * set to {@code false}. This will prevent the copying and improve
 * performance as no new array will be built and no data will be copied.
 *
 * @param d Data for new matrix.
 * @param copyArray if {@code true}, the input array will be copied,
 * otherwise it will be referenced.
 * @throws DimensionMismatchException if {@code d} is not rectangular.
 * @throws NoDataException if {@code d} row or column dimension is zero.
 * @throws NullArgumentException if {@code d} is {@code null}.
 * @see #Array2DRowRealMatrix(double[][])
 */
public Array2DRowRealMatrix(final double[][] d, final boolean copyArray)
    throws DimensionMismatchException, NoDataException,
    NullArgumentException {
    if (copyArray) {
        copyIn(d);
    } else {
        if (d == null) {
            throw new NullArgumentException();
        }
        final int nRows = d.length;
        if (nRows == 0) {
            throw new NoDataException(LocalizedFormats.AT_LEAST_ONE_ROW);
        }
        final int nCols = d[0].length;
        if (nCols == 0) {
            throw new NoDataException(LocalizedFormats.AT_LEAST_ONE_COLUMN);
        }
        for (int r = 1; r < nRows; r++) {
            if (d[r].length != nCols) {
                throw new DimensionMismatchException(d[r].length, nCols);
            }
        }
        data = d;
    }
}
 
开发者ID:biocompibens,项目名称:SME,代码行数:41,代码来源:Array2DRowRealMatrix.java

示例3: createColumnFieldMatrix

/**
 * Creates a column {@link FieldMatrix} using the data from the input
 * array.
 *
 * @param <T> the type of the field elements
 * @param columnData  the input column data
 * @return a columnData x 1 FieldMatrix
 * @throws NoDataException if {@code data} is empty.
 * @throws NullArgumentException if {@code columnData} is {@code null}.
 */
public static <T extends FieldElement<T>> FieldMatrix<T>
    createColumnFieldMatrix(final T[] columnData)
    throws NoDataException, NullArgumentException {
    if (columnData == null) {
        throw new NullArgumentException();
    }
    final int nRows = columnData.length;
    if (nRows == 0) {
        throw new NoDataException(LocalizedFormats.AT_LEAST_ONE_ROW);
    }
    final FieldMatrix<T> m = createFieldMatrix(columnData[0].getField(), nRows, 1);
    for (int i = 0; i < nRows; ++i) {
        m.setEntry(i, 0, columnData[i]);
    }
    return m;
}
 
开发者ID:biocompibens,项目名称:SME,代码行数:26,代码来源:MatrixUtils.java

示例4: Array2DRowRealMatrix

/**
 * Create a new RealMatrix using the input array as the underlying
 * data array.
 * If an array is built specially in order to be embedded in a
 * RealMatrix and not used directly, the {@code copyArray} may be
 * set to {@code false}. This will prevent the copying and improve
 * performance as no new array will be built and no data will be copied.
 *
 * @param d Data for new matrix.
 * @param copyArray if {@code true}, the input array will be copied,
 * otherwise it will be referenced.
 * @throws DimensionMismatchException if {@code d} is not rectangular
 * (not all rows have the same length) or empty.
 * @throws NullArgumentException if {@code d} is {@code null}.
 * @throws NoDataException if there are not at least one row and one column.
 * @see #Array2DRowRealMatrix(double[][])
 */
public Array2DRowRealMatrix(final double[][] d, final boolean copyArray) {
    if (copyArray) {
        copyIn(d);
    } else {
        if (d == null) {
            throw new NullArgumentException();
        }
        final int nRows = d.length;
        if (nRows == 0) {
            throw new NoDataException(LocalizedFormats.AT_LEAST_ONE_ROW);
        }
        final int nCols = d[0].length;
        if (nCols == 0) {
            throw new NoDataException(LocalizedFormats.AT_LEAST_ONE_COLUMN);
        }
        for (int r = 1; r < nRows; r++) {
            if (d[r].length != nCols) {
                throw new DimensionMismatchException(d[r].length, nCols);
            }
        }
        data = d;
    }
}
 
开发者ID:jiaminghan,项目名称:droidplanner-master,代码行数:40,代码来源:Array2DRowRealMatrix.java

示例5: createColumnFieldMatrix

/**
 * Creates a column {@link FieldMatrix} using the data from the input
 * array.
 *
 * @param <T> the type of the field elements
 * @param columnData  the input column data
 * @return a columnData x 1 FieldMatrix
 * @throws NoDataException if {@code data} is empty.
 * @throws NullArgumentException if {@code columnData} is {@code null}.
 */
public static <T extends FieldElement<T>> FieldMatrix<T>
    createColumnFieldMatrix(final T[] columnData) {
    if (columnData == null) {
        throw new NullArgumentException();
    }
    final int nRows = columnData.length;
    if (nRows == 0) {
        throw new NoDataException(LocalizedFormats.AT_LEAST_ONE_ROW);
    }
    final FieldMatrix<T> m = createFieldMatrix(columnData[0].getField(), nRows, 1);
    for (int i = 0; i < nRows; ++i) {
        m.setEntry(i, 0, columnData[i]);
    }
    return m;
}
 
开发者ID:jiaminghan,项目名称:droidplanner-master,代码行数:25,代码来源:MatrixUtils.java

示例6: setSubMatrix

/** {@inheritDoc} */
@Override
public void setSubMatrix(final T[][] subMatrix, final int row,
                         final int column)
    throws OutOfRangeException, NullArgumentException, NoDataException,
    DimensionMismatchException {
    if (data == null) {
        if (row > 0) {
            throw new MathIllegalStateException(LocalizedFormats.FIRST_ROWS_NOT_INITIALIZED_YET, row);
        }
        if (column > 0) {
            throw new MathIllegalStateException(LocalizedFormats.FIRST_COLUMNS_NOT_INITIALIZED_YET, column);
        }
        final int nRows = subMatrix.length;
        if (nRows == 0) {
            throw new NoDataException(LocalizedFormats.AT_LEAST_ONE_ROW);
        }

        final int nCols = subMatrix[0].length;
        if (nCols == 0) {
            throw new NoDataException(LocalizedFormats.AT_LEAST_ONE_COLUMN);
        }
        data = MathArrays.buildArray(getField(), subMatrix.length, nCols);
        for (int i = 0; i < data.length; ++i) {
            if (subMatrix[i].length != nCols) {
                throw new DimensionMismatchException(nCols, subMatrix[i].length);
            }
            System.arraycopy(subMatrix[i], 0, data[i + row], column, nCols);
        }
    } else {
        super.setSubMatrix(subMatrix, row, column);
    }

}
 
开发者ID:biocompibens,项目名称:SME,代码行数:34,代码来源:Array2DRowFieldMatrix.java

示例7: setSubMatrix

/** {@inheritDoc} */
@Override
public void setSubMatrix(final double[][] subMatrix, final int row,
                         final int column)
    throws NoDataException, OutOfRangeException,
    DimensionMismatchException, NullArgumentException {
    if (data == null) {
        if (row > 0) {
            throw new MathIllegalStateException(LocalizedFormats.FIRST_ROWS_NOT_INITIALIZED_YET, row);
        }
        if (column > 0) {
            throw new MathIllegalStateException(LocalizedFormats.FIRST_COLUMNS_NOT_INITIALIZED_YET, column);
        }
        MathUtils.checkNotNull(subMatrix);
        final int nRows = subMatrix.length;
        if (nRows == 0) {
            throw new NoDataException(LocalizedFormats.AT_LEAST_ONE_ROW);
        }

        final int nCols = subMatrix[0].length;
        if (nCols == 0) {
            throw new NoDataException(LocalizedFormats.AT_LEAST_ONE_COLUMN);
        }
        data = new double[subMatrix.length][nCols];
        for (int i = 0; i < data.length; ++i) {
            if (subMatrix[i].length != nCols) {
                throw new DimensionMismatchException(subMatrix[i].length, nCols);
            }
            System.arraycopy(subMatrix[i], 0, data[i + row], column, nCols);
        }
    } else {
        super.setSubMatrix(subMatrix, row, column);
    }

}
 
开发者ID:biocompibens,项目名称:SME,代码行数:35,代码来源:Array2DRowRealMatrix.java

示例8: extractField

/**
 * Get the elements type from an array.
 *
 * @param <T> Type of the field elements.
 * @param d Data array.
 * @return the field to which the array elements belong.
 * @throws NullArgumentException if the array is {@code null}.
 * @throws NoDataException if the array is empty.
 */
protected static <T extends FieldElement<T>> Field<T> extractField(final T[][] d)
    throws NoDataException, NullArgumentException {
    if (d == null) {
        throw new NullArgumentException();
    }
    if (d.length == 0) {
        throw new NoDataException(LocalizedFormats.AT_LEAST_ONE_ROW);
    }
    if (d[0].length == 0) {
        throw new NoDataException(LocalizedFormats.AT_LEAST_ONE_COLUMN);
    }
    return d[0][0].getField();
}
 
开发者ID:biocompibens,项目名称:SME,代码行数:22,代码来源:AbstractFieldMatrix.java

示例9: setSubMatrix

/** {@inheritDoc} */
public void setSubMatrix(final T[][] subMatrix, final int row,
                         final int column)
    throws DimensionMismatchException, OutOfRangeException,
    NoDataException, NullArgumentException {
    if (subMatrix == null) {
        throw new NullArgumentException();
    }
    final int nRows = subMatrix.length;
    if (nRows == 0) {
        throw new NoDataException(LocalizedFormats.AT_LEAST_ONE_ROW);
    }

    final int nCols = subMatrix[0].length;
    if (nCols == 0) {
        throw new NoDataException(LocalizedFormats.AT_LEAST_ONE_COLUMN);
    }

    for (int r = 1; r < nRows; ++r) {
        if (subMatrix[r].length != nCols) {
            throw new DimensionMismatchException(nCols, subMatrix[r].length);
        }
    }

    checkRowIndex(row);
    checkColumnIndex(column);
    checkRowIndex(nRows + row - 1);
    checkColumnIndex(nCols + column - 1);

    for (int i = 0; i < nRows; ++i) {
        for (int j = 0; j < nCols; ++j) {
            setEntry(row + i, column + j, subMatrix[i][j]);
        }
    }
}
 
开发者ID:biocompibens,项目名称:SME,代码行数:35,代码来源:AbstractFieldMatrix.java

示例10: setSubMatrix

/** {@inheritDoc} */
public void setSubMatrix(final double[][] subMatrix, final int row, final int column)
    throws NoDataException, OutOfRangeException,
    DimensionMismatchException, NullArgumentException {
    MathUtils.checkNotNull(subMatrix);
    final int nRows = subMatrix.length;
    if (nRows == 0) {
        throw new NoDataException(LocalizedFormats.AT_LEAST_ONE_ROW);
    }

    final int nCols = subMatrix[0].length;
    if (nCols == 0) {
        throw new NoDataException(LocalizedFormats.AT_LEAST_ONE_COLUMN);
    }

    for (int r = 1; r < nRows; ++r) {
        if (subMatrix[r].length != nCols) {
            throw new DimensionMismatchException(nCols, subMatrix[r].length);
        }
    }

    MatrixUtils.checkRowIndex(this, row);
    MatrixUtils.checkColumnIndex(this, column);
    MatrixUtils.checkRowIndex(this, nRows + row - 1);
    MatrixUtils.checkColumnIndex(this, nCols + column - 1);

    for (int i = 0; i < nRows; ++i) {
        for (int j = 0; j < nCols; ++j) {
            setEntry(row + i, column + j, subMatrix[i][j]);
        }
    }
}
 
开发者ID:biocompibens,项目名称:SME,代码行数:32,代码来源:AbstractRealMatrix.java

示例11: setSubMatrix

/** {@inheritDoc} */
@Override
public void setSubMatrix(final T[][] subMatrix, final int row, final int column) {
    if (data == null) {
        if (row > 0) {
            throw new MathIllegalStateException(LocalizedFormats.FIRST_ROWS_NOT_INITIALIZED_YET, row);
        }
        if (column > 0) {
            throw new MathIllegalStateException(LocalizedFormats.FIRST_COLUMNS_NOT_INITIALIZED_YET, column);
        }
        final int nRows = subMatrix.length;
        if (nRows == 0) {
            throw new NoDataException(LocalizedFormats.AT_LEAST_ONE_ROW);
        }

        final int nCols = subMatrix[0].length;
        if (nCols == 0) {
            throw new NoDataException(LocalizedFormats.AT_LEAST_ONE_COLUMN);
        }
        data = buildArray(getField(), subMatrix.length, nCols);
        for (int i = 0; i < data.length; ++i) {
            if (subMatrix[i].length != nCols) {
                throw new DimensionMismatchException(nCols, subMatrix[i].length);
            }
            System.arraycopy(subMatrix[i], 0, data[i + row], column, nCols);
        }
    } else {
        super.setSubMatrix(subMatrix, row, column);
    }

}
 
开发者ID:jiaminghan,项目名称:droidplanner-master,代码行数:31,代码来源:Array2DRowFieldMatrix.java

示例12: setSubMatrix

/** {@inheritDoc} */
@Override
public void setSubMatrix(final double[][] subMatrix,
                         final int row, final int column) {
    if (data == null) {
        if (row > 0) {
            throw new MathIllegalStateException(LocalizedFormats.FIRST_ROWS_NOT_INITIALIZED_YET, row);
        }
        if (column > 0) {
            throw new MathIllegalStateException(LocalizedFormats.FIRST_COLUMNS_NOT_INITIALIZED_YET, column);
        }
        MathUtils.checkNotNull(subMatrix);
        final int nRows = subMatrix.length;
        if (nRows == 0) {
            throw new NoDataException(LocalizedFormats.AT_LEAST_ONE_ROW);
        }

        final int nCols = subMatrix[0].length;
        if (nCols == 0) {
            throw new NoDataException(LocalizedFormats.AT_LEAST_ONE_COLUMN);
        }
        data = new double[subMatrix.length][nCols];
        for (int i = 0; i < data.length; ++i) {
            if (subMatrix[i].length != nCols) {
                throw new DimensionMismatchException(subMatrix[i].length, nCols);
            }
            System.arraycopy(subMatrix[i], 0, data[i + row], column, nCols);
        }
    } else {
        super.setSubMatrix(subMatrix, row, column);
    }

}
 
开发者ID:jiaminghan,项目名称:droidplanner-master,代码行数:33,代码来源:Array2DRowRealMatrix.java

示例13: extractField

/**
 * Get the elements type from an array.
 *
 * @param <T> Type of the field elements.
 * @param d Data array.
 * @return the field to which the array elements belong.
 * @throws NullArgumentException if the array is {@code null}.
 * @throws NoDataException if the array is empty.
 */
protected static <T extends FieldElement<T>> Field<T> extractField(final T[][] d) {
    if (d == null) {
        throw new NullArgumentException();
    }
    if (d.length == 0) {
        throw new NoDataException(LocalizedFormats.AT_LEAST_ONE_ROW);
    }
    if (d[0].length == 0) {
        throw new NoDataException(LocalizedFormats.AT_LEAST_ONE_COLUMN);
    }
    return d[0][0].getField();
}
 
开发者ID:jiaminghan,项目名称:droidplanner-master,代码行数:21,代码来源:AbstractFieldMatrix.java

示例14: setSubMatrix

/** {@inheritDoc} */
public void setSubMatrix(final T[][] subMatrix, final int row, final int column) {
    if (subMatrix == null) {
        throw new NullArgumentException();
    }
    final int nRows = subMatrix.length;
    if (nRows == 0) {
        throw new NoDataException(LocalizedFormats.AT_LEAST_ONE_ROW);
    }

    final int nCols = subMatrix[0].length;
    if (nCols == 0) {
        throw new NoDataException(LocalizedFormats.AT_LEAST_ONE_COLUMN);
    }

    for (int r = 1; r < nRows; ++r) {
        if (subMatrix[r].length != nCols) {
            throw new DimensionMismatchException(nCols, subMatrix[r].length);
        }
    }

    checkRowIndex(row);
    checkColumnIndex(column);
    checkRowIndex(nRows + row - 1);
    checkColumnIndex(nCols + column - 1);

    for (int i = 0; i < nRows; ++i) {
        for (int j = 0; j < nCols; ++j) {
            setEntry(row + i, column + j, subMatrix[i][j]);
        }
    }
}
 
开发者ID:jiaminghan,项目名称:droidplanner-master,代码行数:32,代码来源:AbstractFieldMatrix.java

示例15: setSubMatrix

/** {@inheritDoc} */
public void setSubMatrix(final double[][] subMatrix, final int row, final int column)
    throws NoDataException, DimensionMismatchException, NullArgumentException {
    MathUtils.checkNotNull(subMatrix);
    final int nRows = subMatrix.length;
    if (nRows == 0) {
        throw new NoDataException(LocalizedFormats.AT_LEAST_ONE_ROW);
    }

    final int nCols = subMatrix[0].length;
    if (nCols == 0) {
        throw new NoDataException(LocalizedFormats.AT_LEAST_ONE_COLUMN);
    }

    for (int r = 1; r < nRows; ++r) {
        if (subMatrix[r].length != nCols) {
            throw new DimensionMismatchException(nCols, subMatrix[r].length);
        }
    }

    MatrixUtils.checkRowIndex(this, row);
    MatrixUtils.checkColumnIndex(this, column);
    MatrixUtils.checkRowIndex(this, nRows + row - 1);
    MatrixUtils.checkColumnIndex(this, nCols + column - 1);

    for (int i = 0; i < nRows; ++i) {
        for (int j = 0; j < nCols; ++j) {
            setEntry(row + i, column + j, subMatrix[i][j]);
        }
    }
}
 
开发者ID:jiaminghan,项目名称:droidplanner-master,代码行数:31,代码来源:AbstractRealMatrix.java


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