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)
| 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 |