Skip to content

Commit 2af8108

Browse files
authored
DOC: sparse.linalg: add note about complex matrices to splu and spilu (scipy#22052)
* Add a note in the docstring of splu and spilu * Fix linting failure * Make grammatical changes to the docstring in splu and spilu
1 parent e29b9a4 commit 2af8108

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

scipy/sparse/linalg/_dsolve/linsolve.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,10 @@ def splu(A, permc_spec=None, diag_pivot_thresh=None,
371371
372372
Notes
373373
-----
374+
When a real array is factorized and the returned SuperLU object's ``solve()`` method
375+
is used with complex arguments an error is generated. Instead, cast the initial
376+
array to complex and then factorize.
377+
374378
This function uses the SuperLU library.
375379
376380
References
@@ -468,6 +472,10 @@ def spilu(A, drop_tol=None, fill_factor=None, drop_rule=None, permc_spec=None,
468472
469473
Notes
470474
-----
475+
When a real array is factorized and the returned SuperLU object's ``solve()`` method
476+
is used with complex arguments an error is generated. Instead, cast the initial
477+
array to complex and then factorize.
478+
471479
To improve the better approximation to the inverse, you may need to
472480
increase `fill_factor` AND decrease `drop_tol`.
473481

0 commit comments

Comments
 (0)