
    
9j2                    J    S SK Jr  S SKrS SKrS SKJr  S SKJr  S SKJ	r	  S r
g)    )annotationsN)device)_util)sparsec                   SSK Jn  [        R                  " U 5      (       d  [        R                  " U 5      n [
        R                  " U 5        [
        R                  " U5        U R                  S   nUR                  S:w  d  [        U5      U:w  a  [        S5      eU R                  S:X  d  U R                  S:X  a  U R                  nO![        R                  " U R                  S5      n[        R                   " 5       nU R"                  nSnSn[$        R&                  " X4S9n	[        R&                  " S[        R(                  5      n
US:X  a  UR*                  nOUR,                  nU" XSX`R.                  R0                  U R2                  R2                  R4                  U R6                  R2                  R4                  U R8                  R2                  R4                  UR2                  R4                  XxU	R2                  R4                  U
R:                  R2                  5        U	R=                  [        R>                  5      n	U	$ )	a  Solves linear system with cholesky decomposition.

Find the solution to a large, sparse, linear system of equations.
The function solves ``Ax = b``. Given two-dimensional matrix ``A`` is
decomposed into ``L * L^*``.

Args:
    A (cupy.ndarray or cupyx.scipy.sparse.csr_matrix): The input matrix
        with dimension ``(N, N)``. Must be positive-definite input matrix.
        Only symmetric real matrix is supported currently.
    b (cupy.ndarray): Right-hand side vector.

Returns:
    ret (cupy.ndarray): The solution vector ``x``.

r   )cusolver   z+b must be 1-d array whose size is same as Afdg      ?)dtype) cupy_backends.cuda.libsr   r   isspmatrix_csr
csr_matrixr   _assert_stacked_square_assert_cupy_arrayshapendimlen
ValueErrorr   numpypromote_typesr   get_cusolver_sp_handlennzcupyemptyint32scsrlsvcholdcsrlsvchol_descr
descriptordataptrindptrindicesctypesastypefloat64)Abr   mr   handler   tolreorderxsingularity
csrlsvchols               T/home/wildlama/miniconda3/lib/python3.13/site-packages/cupyx/linalg/sparse/_solve.pylscholr2      s   " 1  ##a 	  #	Q	
Avv{c!fkFGG 	ww#~C##AGGS1**,F
%%C
CG

1"A++a-K|))
))
3++QVV[[__	199>>--qvvzz3	

K&&++- 	
AH    )
__future__r   r   r   	cupy.cudar   cupy.linalgr   cupyx.scipyr   r2    r3   r1   <module>r9      s    "     5r3   