List of usage examples for org.apache.commons.math3.exception.util LocalizedFormats AT_LEAST_ONE_COLUMN
LocalizedFormats AT_LEAST_ONE_COLUMN
To view the source code for org.apache.commons.math3.exception.util LocalizedFormats AT_LEAST_ONE_COLUMN.
Click Source Link
From source file:lirmm.inria.fr.math.BigSparseRealMatrix.java
/** * Create a new {@code BigSparseRealMatrix} using the input array as the * underlying data array.//from ww w. j a v a 2s . c o m * * @param data Data for the new matrix. * @throws DimensionMismatchException if {@code d} is not rectangular. * @throws NoDataException if {@code d} i or column dimension is zero. */ public BigSparseRealMatrix(final double[][] data) throws DimensionMismatchException, NoDataException { MathUtils.checkNotNull(data); this.entries = new OpenLongToDoubleHashMap(0.0); rows = data.length; if (rows == 0) { throw new NoDataException(LocalizedFormats.AT_LEAST_ONE_ROW); } columns = data[0].length; if (columns == 0) { throw new NoDataException(LocalizedFormats.AT_LEAST_ONE_COLUMN); } for (int i = 0; i < rows; i++) { for (int j = 0; j < columns; j++) { setEntry(i, j, data[i][j]); } } }