
    >qj                     j    d dl Zd dlmZmZ d dlmc mZ  G d d      Z	 G d d      Z
 G d d      Zy)	    N)assert_allcloseassert_equalc                       e Zd ZdZd Zd Zy)TestBlasIntz:Tests for blas_int type used in cython_blas/cython_lapack.c                     ddl m} t        j                         }|d   d   d   }|r|dk(  sJ d| d       |d	k(  sJ d
| d       t        j                         }|r|dk(  sJ y|dk(  sJ y)z5Verify blas_int size matches the build configuration.r   )CONFIGzBuild Dependenciesblaszcython blas ilp64   zILP64 build but blas_int is z bytes   zLP64 build but blas_int is )r
   r   )r   r   N)scipy.__config__r   r	   _blas_int_size_blas_bint_bint_sizes)selfr   sizecython_blas_ilp64
bint_sizess        b/opt/rentech/trading_bot/.venv/lib/python3.12/site-packages/scipy/linalg/tests/test_cython_blas.pytest_blas_int_sizezTestBlasInt.test_blas_int_size
   s    +""$"#78@ATU19I <TF&II919H ;D6HH9 //1
''''''    c                 J   t        j                  dt         j                        }t        j                  dt         j                        j	                  d      }t        j
                  dt         j                        }t        j                  d||d|       t        ||       y)z?Test dgemm works correctly - exercises blas_int for dimensions.   dtype	   )r   r         ?        N)	npeyefloat64arangereshapeemptyr	   _test_dgemmr   r   abcs       r   #test_dgemm_with_blas_int_dimensionsz/TestBlasInt.test_dgemm_with_blas_int_dimensions   si    FF1BJJ'IIarzz*226:HHV2::.Q2q)1r   N)__name__
__module____qualname____doc__r   r(    r   r   r   r      s    D("r   r   c                       e Zd Zd Zd Zy)	TestDGEMMc                 v   t        j                  dt         j                        j                  d      d dd df   }t        j                  ddt         j                        j                  d      d dd df   }t        j                  dt         j                        d dd df   }t        j                  d	||d
|       t        ||j                  |             t        j                  d	|j                  |d
|       t        ||j                  j                  |             t        j                  d	||j                  d
|       t        ||j                  |j                               t        j                  d	|j                  |j                  d
|       t        ||j                  j                  |j                               t        j                  d	||d
|j                         t        ||j                  |      j                         t        j                  d	|j                  |d
|j                         t        ||j                  j                  |      j                         t        j                  d	||j                  d
|j                         t        ||j                  |j                        j                         t        j                  d	|j                  |j                  d
|j                         t        ||j                  j                  |j                        j                         y )N   r   r   r            )r   r   r3   r   r   r   
r   r    r   r!   r"   r	   r#   r   dotTr$   s       r   test_transposeszTestDGEMM.test_transposes&   s)   IIb

+33F;BQBrrEBIIa2::.66v>rr"1"uEHHV2::.rr"1"u5Q2q)1558$QSS!R+133771:&QR+155:&QSS!##r1-13377133<(Q2qss+1558::&QSS!R-133771:<<(QR-155:<<(QSS!##r133/13377133<>>*r   c                 h   t        j                  dt         j                        j                  d      }t        j                  ddt         j                        j                  d      }t        j                  dt         j                        }t        j                  d||d	|       t        ||j                  |             t        j                  d|j                  |j                  d	|j                         t        ||j                  j                  |j                        j                         y )
N   r   )r   r3   ir3   r6   r2   r   r   r7   r$   s       r   test_shapeszTestDGEMM.test_shapesD   s    IIarzz*226:IIb!2::.66v>HHV2::.Q2q)1558$QSS!##r133/13377133<>>*r   N)r)   r*   r+   r:   r=   r-   r   r   r/   r/   $   s    +<	+r   r/   c                   (    e Zd ZdZd Zd Zd Zd Zy)TestWfuncPointersz Test the function pointers that are expected to fail on
    Mac OS X without the additional entry statement in their definitions
    in fblas_l1.pyf.src. c           	         t        j                  g dt         j                        }t        j                  g dt         j                        }t        t	        j
                  ||      d       t        t	        j                  ||      d       t        t	        j                  |      d       t        t	        j                  |      d       t        t	        j                  |      d       t        t	        j
                  |d d d   |d d d         d	       t        t	        j                  |d d d   |d d d         d
       t        t	        j                  |d d d         d       t        t	        j                  |d d d         d       y )N)      ?      ?      ?      ؿy      )@      )y?       @      ?                   @yI! 1?3_5@y4 fva+ P>@r   g     2@gKg [*@r3   yI! 2?335@y4 ffa+ >@g      2@g8f X*@)r   array	complex64r   r	   _test_cdotc_test_cdotur   _test_icamax_test_scasum_test_scnrm2r   cxcys      r   test_complex_argsz#TestWfuncPointers.test_complex_argsT   s/   XX92<<HXX92<<H((R05	7((R05	7 	T&&r*A.))"-v6))"-}=((CaC"SqS':5	7((CaC"SqS':5	7))"SqS'2C8))"SqS'2MBr   c           	         t        j                  g dt         j                        }t        j                  g dt         j                        }t        t	        j
                  |      d       t        t	        j                  ||      d       t        t	        j                  |      d       t        t	        j
                  |d d d         d       t        t	        j                  |d d d   |d d d         d       t        t	        j                  |d d d         d	       t        t	        j                  |      d
       y )Ng      @g      ࿩r3   r4   g      ?      !@      @ `h@r3         @     #@J @@r4   )
r   rE   r   r   r	   _test_dasum
_test_ddot_test_dnrm2r   _test_idamaxr   xys      r   test_double_argsz"TestWfuncPointers.test_double_argsj   s    HH]BJJ/HHZ,((+S11-t4((+];((3Q30#6#A##A#7>((3Q30,?T&&q)1-r   c           	         t        j                  g dt         j                        }t        j                  g dt         j                        }t        t	        j
                  |      d       t        t	        j                  |      d       t        t	        j                  ||      d       t        t	        j                  |      d       t        t	        j                  |d d d         d       t        t	        j                  |d d d   |d d d         d	       t        t	        j                  |d d d         d
       y )NrQ   rS   r4   rT   rU   rV   r3   rW   rX   rY   )
r   rE   float32r   r	   _test_isamaxr   _test_sasum
_test_sdot_test_snrm2r^   s      r   test_float_argsz!TestWfuncPointers.test_float_argsy   s    HH]BJJ/HHZ,T&&q)1-((+S11-t4((+];((3Q30#6#A##A#7>((3Q30,?r   c           	      
   t        j                  g dt         j                        }t        j                  g dt         j                        }t        t	        j
                  |      d       t        t	        j                  ||      d       t        t	        j                  ||      d       t        t	        j                  |d d d   |d d d         d       t        t	        j                  |d d d   |d d d         d       y )	N)rA   rB   y      *@      )y      ?       @rC   rD   r   y     2     L6@y     P     d?@r3   y     2      6@y     @     ?@)	r   rE   
complex128r   r	   _test_izamaxr   _test_zdotc_test_zdoturL   s      r   test_double_complex_argsz*TestWfuncPointers.test_double_complex_args   s    XX8"--HXX;R]]KT&&r*A.((R02GH((R02FG((CaC"SqS':<LM((CaC"SqS':OLr   N)r)   r*   r+   r,   rO   ra   rh   rn   r-   r   r   r?   r?   O   s    C,.@Mr   r?   )numpyr   numpy.testingr   r   scipy.linalg.cython_blaslinalgcython_blasr	   r   r/   r?   r-   r   r   <module>rt      s6    ) ' ' :)+ )+VDM DMr   