MCPcopy Create free account
hub / github.com/EdwardRaff/JSAT / getRow

Method getRow

JSAT/src/jsat/linear/Matrix.java:679–687  ·  view source on GitHub ↗

Creates a vector that has a copy of the values in row i of this matrix. Altering it will not effect the values in this matrix. @param r the row to copy @return a clone of the row as a Vec

(int r)

Source from the content-addressed store, hash-verified

677 * @return a clone of the row as a {@link Vec}
678 */
679 public Vec getRow(int r)
680 {
681 if(r < 0 || r >= rows())
682 throw new ArithmeticException("Row was not a valid value " + r + " not in [0," + (rows()-1) + "]");
683 DenseVector c = new DenseVector(cols());
684 for(int j =0; j < cols(); j++)
685 c.set(j, get(r, j));
686 return c;
687 }
688
689 /**
690 * Obtains a vector that is backed by <i>this</i>, at very little memory

Calls 4

rowsMethod · 0.95
colsMethod · 0.95
setMethod · 0.95
getMethod · 0.95