ph-math/src/main/java/com/helger/numbercruncher/matrix/Matrix.java
public RowVector getRow (final int r) throws MatrixException
  {
    if ((r < 0) || (r >= m_nRows))
    {
      throw new MatrixException (MatrixException.INVALID_INDEX);
    }

    final RowVector rv = new RowVector (m_nCols);
    for (int c = 0; c < m_nCols; ++c)
    {
      rv.m_aValues[0][c] = m_aValues[r][c];
    }

    return rv;
  }
public RowVector getRow (final int r) throws MatrixException
  {
    if ((r < 0) || (r >= m_nRows))
    {
      throw new MatrixException (MatrixException.INVALID_INDEX);
    }

    final RowVector rv = new RowVector (m_nCols);
    for (int c = 0; c < m_nCols; ++c)
    {
      rv.m_aValues[0][c] = m_aValues[r][c];
    }

    return rv;
  }
Get a row of this matrix.

@param r
the row index
@return the row as a row vector
@throws MatrixException
for an invalid index