/** * Creates a new matrix with the given vector into the first column and the other matrix to the * other columns. This is usually used in machine learning algorithms that add a bias on the * zero-index column. * * @param first the new first column. * @param otherMatrix the other matrix to set on from the second column. */ public SparseDoubleRowMatrix(DenseDoubleVector first, DoubleMatrix otherMatrix) { this(otherMatrix.getRowCount(), otherMatrix.getColumnCount() + 1); setColumnVector(0, first); for (int i = 1; i < numColumns; i++) { setColumnVector(i, otherMatrix.getColumnVector(i - 1)); } }