Skip to content
This repository
Browse code

Fix #704, factual error in cho_factor docstring

  • Loading branch information...
commit 9a90ca4cfcc7cb949e96643439af955b1d4a0281 1 parent f27946d
Pauli Virtanen pv authored

Showing 1 changed file with 15 additions and 7 deletions. Show diff stats Hide diff stats

  1. +15 7 scipy/linalg/decomp.py
22 scipy/linalg/decomp.py
@@ -903,11 +903,15 @@ def cholesky(a,lower=0,overwrite_a=0):
903 903 def cho_factor(a, lower=0, overwrite_a=0):
904 904 """Compute the Cholesky decomposition of a matrix, to use in cho_solve
905 905
906   - Returns the Cholesky decomposition, :lm:`A = L L^*` or :lm:`A = U^* U`
907   - of a Hermitian positive-definite matrix :lm:`A`.
908   -
  906 + Returns a matrix containing the Cholesky decomposition,
  907 + ``A = L L*`` or ``A = U* U`` of a Hermitian positive-definite matrix `a`.
909 908 The return value can be directly used as the first parameter to cho_solve.
910 909
  910 + .. warning::
  911 + The returned matrix also contains random data in the entries not
  912 + used by the Cholesky decomposition. If you need to zero these
  913 + entries, use the function `cholesky` instead.
  914 +
911 915 Parameters
912 916 ----------
913 917 a : array, shape (M, M)
@@ -921,11 +925,15 @@ def cho_factor(a, lower=0, overwrite_a=0):
921 925 Returns
922 926 -------
923 927 c : array, shape (M, M)
924   - Upper- or lower-triangular Cholesky factor of A
925   - lower : array, shape (M, M)
926   - Flag indicating whether the factor is lower or upper triangular
  928 + Matrix whose upper or lower triangle contains the Cholesky factor
  929 + of `a`. Other parts of the matrix contain random data.
  930 + lower : boolean
  931 + Flag indicating whether the factor is in the lower or upper triangle
927 932
928   - Raises LinAlgError if decomposition fails
  933 + Raises
  934 + ------
  935 + LinAlgError
  936 + Raised if decomposition fails.
929 937
930 938 """
931 939 a1 = asarray_chkfinite(a)

0 comments on commit 9a90ca4

Please sign in to comment.
Something went wrong with that request. Please try again.