On 5 February 2024 06:30:45 GMT, 'Animesh Shree' via sage-devel 
<sage-devel@googlegroups.com> wrote:
>The other library that scipy uses is SuperLU : 
>https://portal.nersc.gov/project/sparse/superlu/
>for the function scipy.sparse.linalg.splu : 
>https://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.linalg.splu.html#scipy-sparse-linalg-splu
>
>Scipy supports only factorization for square matrices
>the developer asks whether its a limitation or not : 
>https://github.com/scipy/scipy/blob/4edfcaa3ce8a387450b6efce968572def71be089/scipy/sparse/linalg/_dsolve/linsolve.py#L424
>
>In reference manual of SuperLU : 
>https://portal.nersc.gov/project/sparse/superlu/ug.pdf
>In Section 2.4, page 23 we can see code where *"nrow = 5; ncol = 5; *"  are 
>defined separately. (  The example intended to solved a 5x5 system )

it is the matter of adding extra zero rows or columns to the matrix you want to 
decompose. This could be a quick fix.

A good implementation of LU decomposition ought actually to take non-square 
matrix as input, and have the indices adjusted appropriately in the algorithm,
so it's indeed a bit strange that superLU only takes square matrices (?). 
Perhaps it's a good idea to look at its docs and the source code.







>
>On Tuesday, January 30, 2024 at 4:21:48 AM UTC+5:30 Nils Bruin wrote:
>
>> By the looks of it, the routines you'd be using would be coming from 
>> umfpack. cvxopt has chosen to package the details of LU factorization in 
>> opaque objects and instead offer routines to use these decompositions (via 
>> taking the opaque object as input). In scipy, umfpack is also used: 
>> https://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.linalg.spsolve.html#scipy.sparse.linalg.spsolve
>>  
>> . Scipy also offers LU decomposition routines: 
>> https://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.linalg.splu.html#scipy.sparse.linalg.splu
>>  
>> but that uses a different library. It looks suspicious that two packages 
>> offer umfpack for solving sparse problems, but don't give explicit access 
>> to LU factorizations produced in the process, when using UMFPACK. Perhaps 
>> UMFPACK isn't suited to provide the explicit factorization (but it may be 
>> very good at using its internally computed data).
>>
>>
>>
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/2E4059A0-D9C2-48A2-8281-D3FCD8DD5900%40gmail.com.

Reply via email to