Permalink
Browse files

Fix #704, factual error in cho_factor docstring

  • Loading branch information...
1 parent f27946d commit 9a90ca4cfcc7cb949e96643439af955b1d4a0281 @pv pv committed Jul 19, 2008
Showing with 15 additions and 7 deletions.
  1. +15 −7 scipy/linalg/decomp.py
View
@@ -903,11 +903,15 @@ def cholesky(a,lower=0,overwrite_a=0):
def cho_factor(a, lower=0, overwrite_a=0):
"""Compute the Cholesky decomposition of a matrix, to use in cho_solve
- Returns the Cholesky decomposition, :lm:`A = L L^*` or :lm:`A = U^* U`
- of a Hermitian positive-definite matrix :lm:`A`.
-
+ Returns a matrix containing the Cholesky decomposition,
+ ``A = L L*`` or ``A = U* U`` of a Hermitian positive-definite matrix `a`.
The return value can be directly used as the first parameter to cho_solve.
+ .. warning::
+ The returned matrix also contains random data in the entries not
+ used by the Cholesky decomposition. If you need to zero these
+ entries, use the function `cholesky` instead.
+
Parameters
----------
a : array, shape (M, M)
@@ -921,11 +925,15 @@ def cho_factor(a, lower=0, overwrite_a=0):
Returns
-------
c : array, shape (M, M)
- Upper- or lower-triangular Cholesky factor of A
- lower : array, shape (M, M)
- Flag indicating whether the factor is lower or upper triangular
+ Matrix whose upper or lower triangle contains the Cholesky factor
+ of `a`. Other parts of the matrix contain random data.
+ lower : boolean
+ Flag indicating whether the factor is in the lower or upper triangle
- Raises LinAlgError if decomposition fails
+ Raises
+ ------
+ LinAlgError
+ Raised if decomposition fails.
"""
a1 = asarray_chkfinite(a)

0 comments on commit 9a90ca4

Please sign in to comment.