/** * {@inheritDoc} */ public void setColumn(int column, double[] values) { checkIndices(0, column); for (int row = 0; row < rows.get(); ++row) set(row, column, values[row]); }
/** * {@inheritDoc} */ public void setColumn(int column, double[] values) { checkIndices(0, column); for (int row = 0; row < rows.get(); ++row) set(row, column, values[row]); }
/** * {@inheritDoc} The length of the returned column reflects the size of * matrix at the time of the call, which may be different from earlier calls * to {@link #rows()} */ public double[] getColumn(int column) { checkIndices(0, column); rowReadLock.lock(); double[] values = new double[rows.get()]; for (int row = 0; row < rows.get(); ++row) values[row] = get(row, column); rowReadLock.unlock(); return values; }
/** * {@inheritDoc} The length of the returned column reflects the size of * matrix at the time of the call, which may be different from earlier calls * to {@link #rows()} */ public double[] getColumn(int column) { checkIndices(0, column); rowReadLock.lock(); double[] values = new double[rows.get()]; for (int row = 0; row < rows.get(); ++row) values[row] = get(row, column); rowReadLock.unlock(); return values; }
/** * {@inheritDoc} */ public void set(int row, int col, double val) { checkIndices(row, col); AtomicVector rowEntry = getRow(row, col, true); denseArrayReadLock.lock(); rowEntry.set(col, val); denseArrayReadLock.unlock(); }
/** * {@inheritDoc} */ public void setRow(int row, double[] columns) { checkIndices(row, 0); AtomicVector rowEntry = getRow(row, columns.length - 1, true); denseArrayReadLock.lock(); for (int i = 0; i < columns.length; ++i) rowEntry.set(i, columns[i]); denseArrayReadLock.unlock(); }
/** * {@inheritDoc} */ public void set(int row, int col, double val) { checkIndices(row, col); AtomicVector rowEntry = getRow(row, col, true); denseArrayReadLock.lock(); rowEntry.set(col, val); denseArrayReadLock.unlock(); }
/** * {@inheritDoc} */ public void setRow(int row, double[] columns) { checkIndices(row, 0); AtomicVector rowEntry = getRow(row, columns.length - 1, true); denseArrayReadLock.lock(); for (int i = 0; i < columns.length; ++i) rowEntry.set(i, columns[i]); denseArrayReadLock.unlock(); }
/** * {@inheritDoc} The length of the returned row reflects the size of matrix * at the time of the call, which may be different from earlier calls to * {@link #columns()}. */ public double[] getRow(int row) { checkIndices(row, 0); AtomicVector rowEntry = getRow(row, -1, false); return (rowEntry == null) ? new double[cols.get()] : toArray(rowEntry, cols.get()); }
/** * {@inheritDoc} The length of the returned row reflects the size of matrix * at the time of the call, which may be different from earlier calls to * {@link #columns()}. */ public double[] getRow(int row) { checkIndices(row, 0); AtomicVector rowEntry = getRow(row, -1, false); return (rowEntry == null) ? new double[cols.get()] : toArray(rowEntry, cols.get()); }
/** * {@inheritDoc} */ public void setColumn(int column, DoubleVector values) { checkIndices(0, column); for (int row = 0; row < rows.get(); ++row) set(row, column, values.get(row)); }
/** * {@inheritDoc} */ public void setColumn(int column, DoubleVector values) { checkIndices(0, column); for (int row = 0; row < rows.get(); ++row) set(row, column, values.get(row)); }
/** * {@inheritDoc} */ public double getAndAdd(int row, int col, double delta) { checkIndices(row, col); AtomicVector rowEntry = getRow(row, col, true); return rowEntry.getAndAdd(col, delta); }
/** * {@inheritDoc} */ public double get(int row, int col) { checkIndices(row, col); AtomicVector rowEntry = getRow(row, col, false); return (rowEntry == null) ? 0d : rowEntry.get(col); }
/** * {@inheritDoc} */ public double add(int row, int col, double delta) { checkIndices(row, col); AtomicVector rowEntry = getRow(row, col, true); return rowEntry.getAndAdd(col, delta); }
/** * {@inheritDoc} */ public void setRow(int row, DoubleVector values) { checkIndices(row, 0); AtomicVector rowEntry = getRow(row, values.length() - 1, true); denseArrayReadLock.lock(); Vectors.copy(rowEntry, values); denseArrayReadLock.unlock(); }
/** * {@inheritDoc} */ public double addAndGet(int row, int col, double delta) { checkIndices(row, col); AtomicVector rowEntry = getRow(row, col, true); return rowEntry.addAndGet(col, delta); }
/** * {@inheritDoc} */ public double get(int row, int col) { checkIndices(row, col); AtomicVector rowEntry = getRow(row, col, false); return (rowEntry == null) ? 0d : rowEntry.get(col); }
/** * {@inheritDoc} */ public double addAndGet(int row, int col, double delta) { checkIndices(row, col); AtomicVector rowEntry = getRow(row, col, true); return rowEntry.addAndGet(col, delta); }
/** * {@inheritDoc} */ public void setRow(int row, DoubleVector values) { checkIndices(row, 0); AtomicVector rowEntry = getRow(row, values.length() - 1, true); denseArrayReadLock.lock(); Vectors.copy(rowEntry, values); denseArrayReadLock.unlock(); }