aesara.tensor.nlinalg.qr

Contents

aesara.tensor.nlinalg.qr#

aesara.tensor.nlinalg.qr(a, mode='reduced')[source]#

Computes the QR decomposition of a matrix. Factor the matrix a as qr, where q is orthonormal and r is upper-triangular.

Parameters:
  • a (array_like, shape (M, N)) – Matrix to be factored.

  • mode ({'reduced', 'complete', 'r', 'raw'}, optional) –

    If K = min(M, N), then

    ’reduced’

    returns q, r with dimensions (M, K), (K, N)

    ’complete’

    returns q, r with dimensions (M, M), (M, N)

    ’r’

    returns r only with dimensions (K, N)

    ’raw’

    returns h, tau with dimensions (N, M), (K,)

    Note that array h returned in ‘raw’ mode is transposed for calling Fortran.

    Default mode is ‘reduced’

Returns:

  • q (matrix of float or complex, optional) – A matrix with orthonormal columns. When mode = ‘complete’ the result is an orthogonal/unitary matrix depending on whether or not a is real/complex. The determinant may be either +/- 1 in that case.

  • r (matrix of float or complex, optional) – The upper-triangular matrix.