/** * Constructs a matrix with a copy of the given indexes and a single value. * * @param rows * the number of rows the matrix shall have. * @param columns * the number of columns the matrix shall have. * @param rowIndexes * row indexes * @param columnIndexes * column indexes * @param value * numerical value */ public SparseDoubleMatrix2D(int rows, int columns, int[] rowIndexes, int[] columnIndexes, double value) { 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; } this.elements = new OpenLongDoubleHashMap(rowIndexes.length); insert(rowIndexes, columnIndexes, value); }
/** * Constructs a matrix with a copy of the given indexes and values. * * @param rows * the number of rows the matrix shall have. * @param columns * the number of columns the matrix shall have. * @param rowIndexes * row indexes * @param columnIndexes * column indexes * @param values * numerical values */ public SparseDoubleMatrix2D(int rows, int columns, int[] rowIndexes, int[] columnIndexes, double[] values) { 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; } this.elements = new OpenLongDoubleHashMap(rowIndexes.length); insert(rowIndexes, columnIndexes, values); }
/** * Constructs a matrix with a copy of the given indexes and a single value. * * @param rows * the number of rows the matrix shall have. * @param columns * the number of columns the matrix shall have. * @param rowIndexes * row indexes * @param columnIndexes * column indexes * @param value * numerical value */ public SparseDoubleMatrix2D(int rows, int columns, int[] rowIndexes, int[] columnIndexes, double value) { 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; } this.elements = new OpenLongDoubleHashMap(rowIndexes.length); insert(rowIndexes, columnIndexes, value); }
/** * Constructs a matrix with a copy of the given indexes and values. * * @param rows * the number of rows the matrix shall have. * @param columns * the number of columns the matrix shall have. * @param rowIndexes * row indexes * @param columnIndexes * column indexes * @param values * numerical values */ public SparseDoubleMatrix2D(int rows, int columns, int[] rowIndexes, int[] columnIndexes, double[] values) { 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; } this.elements = new OpenLongDoubleHashMap(rowIndexes.length); insert(rowIndexes, columnIndexes, values); }
this.elements = new OpenLongDoubleHashMap(rowIndexes.length); insert(rowIndexes, columnIndexes, values);
this.elements = new OpenLongDoubleHashMap(rowIndexes.length); insert(rowIndexes, columnIndexes, values);