/** * Constructs a matrix with a given number of rows and columns. All entries * are initially <tt>0</tt>. * * @param rows * the number of rows the matrix shall have. * @param columns * the number of columns the matrix shall have. * @throws IllegalArgumentException * if * <tt>rows<0 || columns<0 || (double)columns*rows > Integer.MAX_VALUE</tt> * . */ public SparseCCMDoubleMatrix2D(int rows, int columns) { super(null); try { setUp(rows, columns); } catch (IllegalArgumentException exc) { // we can hold rows*columns>Integer.MAX_VALUE cells ! if (!"matrix too large".equals(exc.getMessage())) throw exc; } elements = new SparseDoubleMatrix1D[columns]; for (int i = 0; i < columns; ++i) elements[i] = new SparseDoubleMatrix1D(rows); }
/** * Constructs a matrix with a given number of rows and columns. All entries * are initially <tt>0</tt>. * * @param rows * the number of rows the matrix shall have. * @param columns * the number of columns the matrix shall have. * @throws IllegalArgumentException * if * <tt>rows<0 || columns<0 || (double)columns*rows > Integer.MAX_VALUE</tt> * . */ public SparseCCMDoubleMatrix2D(int rows, int columns) { super(null); try { setUp(rows, columns); } catch (IllegalArgumentException exc) { // we can hold rows*columns>Integer.MAX_VALUE cells ! if (!"matrix too large".equals(exc.getMessage())) throw exc; } elements = new SparseDoubleMatrix1D[columns]; for (int i = 0; i < columns; ++i) elements[i] = new SparseDoubleMatrix1D(rows); }