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

Method getColumn

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

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

(int j)

Source from the content-addressed store, hash-verified

608 * @return a clone of the column as a {@link Vec}
609 */
610 public Vec getColumn(int j)
611 {
612 if(j < 0 || j >= cols())
613 throw new ArithmeticException("Column was not a valid value " + j + " not in [0," + (cols()-1) + "]");
614 DenseVector c = new DenseVector(rows());
615 for(int i =0; i < rows(); i++)
616 c.set(i, get(i, j));
617 return c;
618 }
619
620 /**
621 * Obtains a vector that is backed by <i>this</i>, at very little memory

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected