Get a row of this matrix.
@param r the row index
@return the row as a row vector
@throws numbercruncher.MatrixException for an invalid index
771897
public RowVector getRow(int r) throws MatrixException
    {
        if ((r < 0) || (r >= nRows)) {
            throw new MatrixException(MatrixException.INVALID_INDEX);
        }

        RowVector rv = new RowVector(nCols);
        for (int c = 0; c < nCols; ++c) {
            rv.values[0][c] = this.values[r][c];
        }

        return rv;
    }
550777
function _getRows(matrix) {
  var rows = [];
  for (var i=0; i<matrix.size.rows; i++) {
    rows.push([]);
    for (var j=0; j<matrix.size.columns; j++)
      rows[i].push(matrix.values[matrix.size.columns * i + j]);
  }
  return rows;
}
1185311
@Nonnull
  @ReturnsMutableCopy
  public Matrix getL ()
  {
    final Matrix aNewMatrix = new Matrix (m_nRows, m_nCols);
    final double [] [] aNewArray = aNewMatrix.internalGetArray ();
    for (int nRow = 0; nRow < m_nRows; nRow++)
    {
      final double [] aSrcRow = m_aLU[nRow];
      final double [] aDstRow = aNewArray[nRow];
      for (int nCol = 0; nCol < m_nCols; nCol++)
        if (nRow > nCol)
          aDstRow[nCol] = aSrcRow[nCol];
        else
          if (nRow == nCol)
            aDstRow[nCol] = 1.0;
          else
            aDstRow[nCol] = 0.0;
    }
    return aNewMatrix;
  }
241017
public Matrix transpose() {
        Matrix result = blankOfShape(columns, rows);
        MatrixIterator it = result.iterator();

        while (it.hasNext()) {
            it.next();
            int i = it.rowIndex();
            int j = it.columnIndex();
            it.set(get(j, i));
        }

        return result;
    }
1212149
public static AbstractMatrix getInstance(int rows, Object values, Class<?> cls)
    {
        int length = Array.getLength(values);
        if (length % rows != 0)
        {
            throw new IllegalArgumentException("not full rows");
        }
        return new AbstractMatrix(rows, copyOf(values, cls));
    }
1223854
public double at(int r, int c) throws MatrixException
    {
        if ((r < 0) || (r >= nRows) || (c < 0) || (c >= nCols)) {
            throw new MatrixException(MatrixException.INVALID_INDEX);
        }

        return values[r][c];
    }
146484
public ArrayList<String> getDiscreteRowValues(String row) throws Exception {
		HashMap<String, String> hashMapValues = new HashMap<String, String>();
		ArrayList<String> values = new ArrayList<String>();
		for (String column : getColumns()) {
			String value = getCell(row, column);
			if (!hashMapValues.containsKey(value)) {
				hashMapValues.put(value, value);
				values.add(value);
			}
		}
		return values;
	}
1062788
public static double[] rowMeans (RealMatrix matrix) {
        // Get the col sums:
        double[] retval = EMatrixUtils.rowSums(matrix);

        // Iterate over return value and divide by the length:
        for (int i = 0; i < retval.length; i++) {
            retval[i] = retval[i] / matrix.getColumnDimension();
        }

        // Done, return row means:
        return retval;
    }
45219
public static double[][] getMatrix(final double[][] m1, final int r0, final int r1, final int[] c) {
    assert r0 <= r1 : ERR_INVALID_RANGE;
    assert r1 <= m1.length : ERR_MATRIX_DIMENSIONS;
    final int rowdim = r1 - r0, coldim = c.length;
    final double[][] X = new double[rowdim][coldim];
    for(int i = r0; i < r1; i++) {
      final double[] row = m1[i];
      final double[] Xi = X[i - r0];
      for(int j = 0; j < coldim; j++) {
        Xi[j] = row[c[j]];
      }
    }
    return X;
  }
286327
public static int findRow(DenseMatrix64F m, double... row)
    {
        int cols = m.numCols;
        if (row.length != cols)
        {
            throw new IllegalArgumentException("illegal column count");
        }
        double[] d = m.data;
        int rows = m.numRows;
        for (int r=0;r<rows;r++)
        {
            boolean eq=true;
            for (int c=0;c<cols;c++)
            {
                if (d[cols*r+c] != row[c])
                {
                    eq = false;
                    break;
                }
            }
            if (eq)
            {
                return r;
            }
        }
        return -1;
    }
905091
public static RealMatrix colSubtract (RealMatrix matrix, double[] vector) {
        // Declare and initialize the new matrix:
        double[][] retval = new double[matrix.getRowDimension()][matrix.getColumnDimension()];

        // Iterate over rows:
        for (int col = 0; col < retval.length; col++) {
            // Iterate over columns:
            for (int row = 0; row < retval[0].length; row++) {
                retval[row][col] = matrix.getEntry(row, col) - vector[row];
            }
        }

        // Done, return a new matrix:
        return MatrixUtils.createRealMatrix(retval);
    }
246913
public Vector3f getRow(int row, Vector3f dest) throws IndexOutOfBoundsException {
        switch (row) {
        case 0:
            dest.x = m00;
            dest.y = m10;
            dest.z = m20;
            break;
        case 1:
            dest.x = m01;
            dest.y = m11;
            dest.z = m21;
            break;
        case 2:
            dest.x = m02;
            dest.y = m12;
            dest.z = m22;
            break;
        default:
            throw new IndexOutOfBoundsException();
        }
        
        return dest;
    }
387250
public double get(int column, int row) {
        switch (column) {
        case 0:
            switch (row) {
            case 0:
                return m00;
            case 1:
                return m01;
            case 2:
                return m02;
            default:
                break;
            }
            break;
        case 1:
            switch (row) {
            case 0:
                return m10;
            case 1:
                return m11;
            case 2:
                return m12;
            default:
                break;
            }
            break;
        case 2:
            switch (row) {
            case 0:
                return m20;
            case 1:
                return m21;
            case 2:
                return m22;
            default:
                break;
            }
            break;
        default:
            break;
        }
        throw new IllegalArgumentException();
    }
156576
public IVector getVectorFromRow(int index) {
        IVector result = new IVector(columns);
        for (int i = 0; i < columns; i++) {
            result.realvector[i] = realmatrix[index][i];
            result.imagvector[i] = imagmatrix[index][i];
        }
        return result;
    }
435176
public SimpleMatrix getR() {
        SimpleMatrix R = new SimpleMatrix(QR.numRows(),QR.numCols());

        int N = Math.min(QR.numCols(),QR.numRows());

        for( int i = 0; i < N; i++ ) {
            for( int j = i; j < QR.numCols(); j++ ) {
                R.set(i,j, QR.get(i,j));
            }
        }

        return R;
    }
272757
@Override
  public IndexedInts getRow()
  {
    final IndexedInts row = selector.getRow();

    if (row.size() == 1) {
      if (nullAdjustment == 0) {
        return row;
      } else {
        nullAdjustedRow.setValue(row.get(0) + nullAdjustment);
        return nullAdjustedRow;
      }
    } else {
      // Can't handle non-singly-valued rows in expressions.
      // Treat them as nulls until we think of something better to do.
      return ZeroIndexedInts.instance();
    }
  }
627770
public static DoubleMatrix getInstance(int rows, double... values)
    {
        if (rows < 1)
        {
            throw new IllegalArgumentException("rows");
        }
        if (values.length % rows != 0)
        {
            throw new IllegalArgumentException("not full rows");
        }
        return new DoubleMatrix(rows, Arrays.copyOf(values, values.length));
    }