+
    0i%=              	          R t ^ RIt^ RIt^ RIt^ RIHtHt ^ RIH	t	 ^ RI
HtHtHtHtHtHtHt ^ RIHtHt ]]].t]P,                  ]P.                  ]P0                  .t]P4                  R 4       t]P4                  R 4       t]P:                  P=                  R]]]].4      R	 4       t]P:                  P=                  R]]]]]].4      R
 4       t ]P:                  P=                  R]4       ! R R4      4       t!R# )z*Test of 1D aspects of sparse array classesN)assert_equalassert_allclose)ComplexWarning)	bsr_array	csc_array	dia_array	lil_array	coo_array	csr_array	dok_array)supported_dtypesmatrixc                  4    \         P                  ! . ROR4      # )   d)r          r   )nparray     ^/var/www/html/photoedit/myenv/lib/python3.14/site-packages/scipy/sparse/tests/test_common1d.pydat1dr      s    88L#&&r   c                     \          Uu/ uF  qV P                  V4      bK  	  pp\         UUUu/ uF/  pY2P                  4        UUu. uF  w  rWV! V4      3NK  	  uppbK1  	  uppp# u upi u uppi u upppi N)math_dtypesastype
spcreatorsitems)r   dtype
dat_dtypes	spcreatordats   &    r   datsp_math_dtypesr#      sz    :EF+e,,+JF $#I 	CSCSCUVCUZUU30CUVV#  GVs   A)A4A.A4.A4r!   c                     \         P                  ! \        R R7      ;_uu_ 4        V ! . RO4       RRR4       R#   + '       g   i     R# ; i)zarrays don't support 1D inputmatchNr   r      r   pytestraises
ValueErrorr!   s   &r   test_no_1d_support_in_initr.   %   s,    	z)H	I	I, 
J	I	I	Is	   :A	c                     \         P                  ! \        R R7      ;_uu_ 4        V ! \        P                  ! R4      4       RRR4       R#   + '       g   i     R# ; i)zarrays don't.*support 3Dr%   N)r   r(      )r*   r+   r,   r   onesr-   s   &r   test_no_nd_support_in_initr2   -   s7     
z)C	D	D"'')$% 
E	D	D	Ds   AA	c                      a  ] tR t^6t o RtR tR tR tR tR t	R t
R tR	 tR
 tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR t R t!R t"R  t#R!t$V t%R"# )#TestCommon1Dz5test common functionality shared by 1D sparse formatsc                    \        V! R4      P                  4       \        P                  ! ^4      4       \        V! R4      P                  ^ 4       \        V! R4      P                  4       ^ 4       R# )r   Nr   )r   toarrayr   zerosnnzcount_nonzeroselfr!   s   &&r   test_create_emptyTestCommon1D.test_create_empty:   sL    Yt_,,.<Yt_((!,Yt_224a8r   c                    \         P                  ! \        R R7      ;_uu_ 4        V! R4       RRR4       R#   + '       g   i     R# ; i)zelements cannot be negativer%   N)r)   r;   s   &&r   test_invalid_shapes TestCommon1D.test_invalid_shapes?   s,    ]]:-JKKe LKKKs	   	8A		c                (    \        V! V4      4       R # r   )reprr<   r!   r   s   &&&r   	test_reprTestCommon1D.test_reprC   s    Yur   c                (    \        V! V4      4       R # r   )strrE   s   &&&r   test_strTestCommon1D.test_strF   s    Ier   c                |    \         P                  ! . ROR4      p\        V) V! V4      ) P                  4       4       R# )r   r   N)r      r   r   r   r   r   r   r   r   r   r   r7   r<   r!   As   && r   test_negTestCommon1D.test_negI   s.    HH=sCaR9Q<-0023r   c                @    V! . RO4      pVP                   ^8X  g   Q hR# )r   Nr'   )ndimrR   s   && r   test_1d_supported_init#TestCommon1D.test_1d_supported_initM   s    l#vv{{r   c                   V! . RO4      pVP                  ^^4      p. RO.p\        VP                  4       V4       V! V4      pVP                  ^4      p\        VP                  4       V^ ,          4       VP                  R4      pVP                  VP                  8X  g   Q hVP                  P                  ^4      p\        VP                  4       V^ ,          4       R# )r   Nr   r      r   r   r   r   r@   r   r   r         )reshaper   r7   shapeT)r<   r!   xydesiredy2s   &&    r   $test_reshape_1d_tofrom_row_or_column1TestCommon1D.test_reshape_1d_tofrom_row_or_columnQ   s    ;<IIa89QYY['* gIIbMQYY['!*-YYuww"((""" CCKKOQYY['!*-r   c                .   V! . RO4      pVP                  R4      p. RO. RO. RO. RO.p\        VP                  4       V4       VP                  R4      pW2J g   Q hVP                  ^4      p\        VP                  4       VP                  4       4       R# )	r   Nr[   )r0   r   )r   r   r\   r   r   r   )r   r@   r   )r   r   r]   r^   )r`   r   r7   )r<   r!   rc   rd   re   s   &&   r   test_reshapeTestCommon1D.test_reshapec   ss    ;<IIfiY?QYY['*IIevvIIbMQYY[!))+.r   c           
        \         P                  P                  R 4       \         P                  ! . RO4      p\         P                  P	                  ^4      p\         P                  ! . 4      p\         P
                  ! R4      pW#WE.pV EF  pV! V4      p\         P                  ! RR7      ;_uu_ 4        \         P                  ! VP                  4       4      '       g   Q h\        VP                  4       VP                  4       4       \        VP                  RR7      VP                  RR7      4       \        VP                  ^ R7      VP                  ^ R7      4       \        VP                  RR7      VP                  RR7      4       RRR4       EK  	  XP                  ^ \         P
                  ! R	4      R7       R#   + '       g   i     EKL  ; i)
i  ignore)overNaxisrq   out)	r   r   r(   r   rP   r]   r\   	   )(   rM   r   )
r   randomseedr   randr8   errstateisscalarsumr   )	r<   r!   dat_1dat_2dat_3dat_4arraysr"   datsps	   &&       r   test_sumTestCommon1D.test_sumo   s7   
		t67		q!-CcNE(++{{599;////	599;7T 2EII4I4HIQ1BCR 0%)))2DE ,+  			qbhhrl	+ ,++s   4CGGc                   \         P                  ! R	4      p\         P                  ! . R
O4      pV! V4      p\        P                  ! \
        RR7      ;_uu_ 4        VP                  ^R7       RRR4       \        P                  ! \
        RR7      ;_uu_ 4        VP                  RR7       RRR4       \        P                  ! \        RR7      ;_uu_ 4        VP                  RR7       RRR4       \        P                  ! \
        RR7      ;_uu_ 4        VP                  ^ VR7       RRR4       R#   + '       g   i     L; i  + '       g   i     L; i  + '       g   i     Lx; i  + '       g   i     R# ; i)r   axis out of ranger%   rp   Naxis must be an integer      ?z"output parameter.*wrong.*dimensionrr   r6   r   r   r(   r   r   )r   r8   r   r*   r+   r,   r|   	TypeErrorr<   r!   rs   r"   r   s   &&   r   test_sum_invalid_params$TestCommon1D.test_sum_invalid_params   s    hhtnhhy!#]]:-@AAII1I B]]:-@AAII6I" B]]9,EFFII3I G]]:-QRRII1#I& SR BAAAFFRRRs0   D6E	EE/6E		E	E,	/F 	c                    \         P                  ! . RO4      pV! V4      p\         P                  ! V4      p\         P                  ! V4      p\        WE4       R# r   Nr   )r   r   r|   r   )r<   r!   r"   r   dat_sum	datsp_sums   &&    r   test_numpy_sumTestCommon1D.test_numpy_sum   s;    hhy!#&&+FF5M	+r   c                D   \         P                  ! . RO4      pV! V4      p\        VP                  4       VP                  4       4       \         P                  ! VP                  RR7      4      '       g   Q h\        VP                  RR7      VP                  RR7      4       \        VP                  ^ R7      VP                  ^ R7      4       \        VP                  RR7      VP                  RR7      4       \
        P                  ! \        RR7      ;_uu_ 4        VP                  ^R7       RRR4       \
        P                  ! \        RR7      ;_uu_ 4        VP                  RR7       RRR4       R#   + '       g   i     LQ; i  + '       g   i     R# ; i)r   Nrp   rq   r%   r   rM   )r   r   r   meanr{   r*   r+   r,   )r<   r!   r"   r   s   &&  r   	test_meanTestCommon1D.test_mean   s   hhy!#
EJJL1{{5::4:01111d+UZZTZ-BCa(%**!**<=b)5::2:+>?]]:V44JJAJ 5]]:V44JJBJ 54 54444s   E;F;F	F	c                <   \         P                  ! \         P                  ! R	4      4      p\         P                  ! . R
O. RO. RO.4      pV! V4      p\        P
                  ! \        RR7      ;_uu_ 4        VP                  ^R7       RRR4       \        P
                  ! \        RR7      ;_uu_ 4        VP                  RR7       RRR4       \        P
                  ! \        RR7      ;_uu_ 4        VP                  RR7       RRR4       \        P
                  ! \        RR7      ;_uu_ 4        VP                  ^VR7       RRR4       R#   + '       g   i     L; i  + '       g   i     L; i  + '       g   i     Lx; i  + '       g   i     R# ; i)r   r   r%   rp   Nr   r   zout.*not match shaperr   )r   r   r   )r   rP   r]   )rt   r\   ru   r   )	r   asarrayr8   r   r*   r+   r,   r   r   r   s   &&   r   test_mean_invalid_params%TestCommon1D.test_mean_invalid_params   s    jj&)*hh	:z:;#]]:-@AAJJAJ B]]:-@AAJJFJ# B]]9,EFFJJCJ  G]]:-CDDJJA3J' ED BAAAFFDDDs0   6E5E$4E73F
E!	$E4	7F	
F	c                    \         P                  ! . RO4      pV! V4      p\         FR  pVP                  VR7      pVP                  VR7      p\	        WV4       \        VP                  VP                  4       KT  	  R# r   r   Nr   )r   r   r   r|   r   r   r   )r<   r!   r"   r   r   r   r   s   &&     r   test_sum_dtypeTestCommon1D.test_sum_dtype   s]    hhy!#%EggEg*G			.IG/	8 &r   c                    \         P                  ! . RO4      pV! V4      p\         FR  pVP                  VR7      pVP                  VR7      p\	        WV4       \        VP                  VP                  4       KT  	  R# r   )r   r   r   r   r   r   r   )r<   r!   r"   r   r   dat_mean
datsp_means   &&     r   test_mean_dtypeTestCommon1D.test_mean_dtype   s_    hhy!#%Exxex,H%0JH1)9)9: &r   c                   \         P                  ! . RO4      pV! V4      p\         P                  ! ^ 4      p\         P                  ! ^ 4      pVP                  VR7       VP                  VR7       \        WE4       VP                  ^ VR7       VP                  ^ VR7       \        WE4       \        P
                  ! \        RR7      ;_uu_ 4        VP                  \         P                  ! ^ .4      R7       RRR4       \        P
                  ! \        RR7      ;_uu_ 4        VP                  \         P                  ! ^ ..4      R7       RRR4       R#   + '       g   i     Lg; i  + '       g   i     R# ; i)r   rs   rr   zoutput parameter.*dimensionr%   Nr   )r   r   r   r   r*   r+   r,   )r<   r!   r"   r   dat_out	datsp_outs   &&    r   test_mean_outTestCommon1D.test_mean_out   s    hhy!#((1+HHQK	W

y
!+aW%

y
)+]]:-JKKJJ288QC=J) L]]:-JKKJJ288aSE?J+ LK LKKKKs   (E%)E+E(	+E<	c                    \         P                  ! . RO4      pV! V4      p\         P                  ! V4      p\         P                  ! V4      p\        WE4       \	        VP
                  VP
                  4       R# r   )r   r   r   r   r   r   )r<   r!   r"   r   r   r   s   &&    r   test_numpy_meanTestCommon1D.test_numpy_mean   sO    hhy!#773<WWU^
-X^^Z%5%56r   c           	        \         P                  ! 4       ;_uu_ 4        \         P                  ! R \        4       \        P
                  ! . RO4      p\        V! V4      P                  4       V4       \        P
                  ! . RO4      p\        V! V4      P                  4       V4       \        V! VRR7      P                  4       VP                  R4      4       RRR4       R#   + '       g   i     R# ; irn   int16r   N)r(   r   r0   y      ?      @r   rM   )	warningscatch_warningssimplefilterr   r   r   r   r7   r   rR   s   && r   test_from_arrayTestCommon1D.test_from_array   s    $$&&!!(N;#A1--/3*+A1--/31G4<<>@QR '&&&   B=C%%C6	c           	        \         P                  ! 4       ;_uu_ 4        \         P                  ! R \        4       . ROp\	        V! V4      P                  4       V4       . ROp\	        V! V4      P                  4       \        P                  ! V4      4       \	        V! VRR7      P                  4       \        P                  ! V4      P                  R4      4       RRR4       R#   + '       g   i     R# ; ir   )	r   r   r   r   r   r7   r   r   r   rR   s   && r   test_from_listTestCommon1D.test_from_list   s    $$&&!!(N;A1--/3!A1--/!=!7+335rxx{7I7I'7R
 '&&&r   c           	         \         P                  ! 4       ;_uu_ 4        \         P                  ! R \        4       \        P
                  ! . RO4      p\        V4      p\        V! V4      P                  4       V4       V! V4      p\        V! V4      P                  4       V4       \        P
                  ! . RO4      p\        V4      p\        V! V4      P                  4       V4       \        V! VRR7      P                  4       VP                  R4      4       V! V4      p\        V! V4      P                  4       V4       \        V! VRR7      P                  4       VP                  R4      4       RRR4       R#   + '       g   i     R# ; i)rn   r   r   N)r   r   r   r   )
r   r   r   r   r   r   r	   r   r7   r   r<   r!   DSs   &&  r   test_from_sparseTestCommon1D.test_from_sparse  s   $$&&!!(N;#A!A1--/3!A1--/3*+A!A1--/31G4<<>@QR!A1--/31G4<<>@QR '&&&s   EE<<F	c                   V! V4      pVP                  4       p\        WB4       VP                  P                  VP                  P                  8X  g   Q hVP                  R R7      p\        WB4       VP                  P                  '       g   Q hVP                  P                  '       g   Q hVP                  RR7      p\        WB4       VP                  P                  '       g   Q hVP                  P                  '       g   Q h\
        P                  ! VP                  VP                  R7      pVP                  VR7       \        WR4       RVR&   VP                  VR7       \        WR4       \
        P                  ! . RO4      p\
        P                  ! Wb4      p\
        P                  ! WcP                  4       4      p\        Wx4       \
        P                  ! . RO4      p	\
        P                  ! W)4      p\
        P                  ! VP                  4       V	4      p\        Wx4       V! V\        R7      p
VP                  \        4      p\        V
P                  4       V4       R# )	C)orderFr   r         ?.N)r          @      @g      @)r7   r   flagsc_contiguousf_contiguousr   r8   ra   r   r   dotboolr   )r<   r!   r   r   chkrs   adense_dot_densecheckbspboolarrbools   &&&         r   test_toarrayTestCommon1D.test_toarray  s   % mmoS yy%%)?)???? mm#m&S yy%%%%%yy%%%%% mm#m&S yy%%%%%yy%%%%% hhu{{%++6#S  C#S  HH)*&&*q--/*_,HH)*&&*u}}*_, 5-,,t$V^^%w/r   c                   W!,           F{  w  r4pVP                  4       pR V^ &   TpWv,           p\        WP                  4       V,           4       WvR,          ,           p\        WP                  4       V^ ,          ,           4       K}  	  R# )r   :r   r   NNcopyr   r7   	r<   r!   r#   r   r"   r   r   r   cs	   &&&      r   test_addTestCommon1D.test_add@  sm    !2!=!=E
AAaDAAIIK!O, cF
AIIK!A$./ ">r   c                    W!,           FE  w  r4pVP                  4       pR V^ &   TpWg,           p\        WVP                  4       ,           4       KG  	  R# )r   Nr   r   s	   &&&      r   	test_raddTestCommon1D.test_raddM  sI    !2!=!=E
AAaDAA		O, ">r   c                   W!,           EFY  w  r4pV\         P                  ! R 4      8X  d   K$  \        WE,
          . RO4       \        WT,
          . RO4       \        ^ V,
          P                  4       V) 4       V! . RORR7      p\        WF,
          WFP                  4       ,
          4       \        Wd,
          VP                  4       V,
          4       \        VP                  4       V,
          VP                  4       V,
          4       \        WVP                  4       ,
          WFP                  4       ,
          4       \        VR,          V,
          VR,          V,
          4       EK\  	  R# )r   r   r   :Nr   NN)r   r   r   r   )r   rP   r   r(   )r   r   r   r7   )r<   r!   r#   r   r"   r   rS   s   &&&    r   	test_rsubTestCommon1D.test_rsubU  s    !2!=!=E((#+5%+5!e),,.5-s3A#'C))+$56!'AIIK#$56u,aiikC.?@,cIIK.?@ R5#b'C-8! ">r   c                (   \         P                  ! . RO. RO. RO.4      p\         P                  ! . RO4      pV! V4      pV! V4      p\        WE,          P                  4       W#,          4       \        W%,          W#,          4       \        WC,          W#,          4       \        WT,          P                  4       W2,          4       \        WR,          W2,          4       \        W4,          W2,          4       \        WU,          W3,          4       \        W5,          W3,          4       \        WS,          W3,          4       \        WD,          P                  4       W",          4       \        W$,          W",          4       \        WB,          W",          4       R# )r(   Nr(   r   r   rj   r   r   r   r   rQ   )r<   r!   rS   vAspvsps   &&    r   test_matmul_basicTestCommon1D.test_matmul_basich  s    HHk9i89HHYll 	ci((*AE2QWae$SWae$ci((*AE2SWae$QWae$SY&QWae$SWae$ci((*AE2QWae$SWae$r   c                   \         P                  ! . RO4      pV! V4      p\         P                  ! . RO.4      P                  p\        W4,          VP	                  4       V,          4       V\         P                  ! . RO4      ,          P
                  R8X  g   Q hV\         P                  ! . RO4      ,          ^8X  g   Q hV\         P                  ! . RO4      ,          P
                  R8X  g   Q hV\         P                  ! ^.^.^..4      ,          P
                  R8X  g   Q h\        V\        . RO.4      P                  ,          \         P                  4      '       g   Q h\         P                  ! ^^.4      \         P                  ! . RO4      \         P                  ! ^.^..4      .pV F8  p\        P                  ! \        RR7      ;_uu_ 4        W6,           RRR4       K:  	  \         P                  ! VP	                  4       . RO4      p\        V\         P                  ! . RO4      ,          V4       \        V^.^.^..,          VP                  4       R#   + '       g   i     K  ; i)	r(   zdimension mismatchr%   Nr   )r   r(   r   r   )r   r   r(   r   r0   )r   r   rb   r   r7   ra   
isinstancer   ndarrayr*   r+   r,   r   )r<   r!   rS   r   colbad_vecsrc   
dot_results   &&      r   test_matvecTestCommon1D.test_matvec}  s   HH[!lhh	{#%%	3;;=3#67BHHY''.."444RXXi((B...bhhy))00B666bhhaS1#//66$>>>#	{ 3 5 55rzzBBBB HHaV$bhh|&<bhhaSz>RSAz1EFF GF  VVCKKM95
bhhy11:>sQC!o-z||< GFFs   	I  I1c                   V! V4      p\        . ROV,          \        P                  ! . ROVP                  4       4      4       \        P                  ! . RO.4      p\        WC,          WCP                  4       ,          4       R# )r   Nr   )r   r   r   r7   r   )r<   r!   r   Mrows   &&&  r   test_rmatvecTestCommon1D.test_rmatvec  sQ    eq("&&qyy{*KLhh~&yy{!23r   c                   V\         P                  ! . 4      3 Fm  pV! V4      p\        VP                  4       V4       \        VP	                  4       P                  4       V4       \        VP
                  VP
                  4       Ko  	  R # r   )r   r   r   r7   	transposer   )r<   r!   r   rS   Bs   &&&  r   test_transposeTestCommon1D.test_transpose  s]    "&A!Aa(..0!4!''*	 'r   c                    W!,           F:  w  r4pWE,           p\        WdV,           4       WT,           p\        WtV,           4       K<  	  R # r   )r   )r<   r!   r#   r   r"   r   sum1sum2s   &&&     r   test_add_dense_to_sparse%TestCommon1D.test_add_dense_to_sparse  s=    !2!=!=E;DSy);DSy)	 ">r   c                    \         P                  ! ^4      pV! V4      pVP                  R9  d"   \        W24       F  w  rE\	        WE4       K  	  R# R# )r]   N)coodiabsr)r   arangeformatzipr   )r<   r!   r   rS   rc   rd   s   &&    r   test_iteratorTestCommon1D.test_iterator  sB    IIaLaL8800A	Q" " 1r   c                   \         P                  ! . RO4      pV! V4      pVP                  R4      e   Q h\        VP	                  4       . RO4       VP                  R4       \        VP	                  4       . RO4       R# )r   N)r   r   r   r0   r6   r   )r]   )r   r   r   r   r   )r   r   resizer   r7   r   s   &&  r   test_resizeTestCommon1D.test_resize  sX    HH\"aLxx~%%%QYY[),	QYY[/2r   r   N)&__name__
__module____qualname____firstlineno____doc__r=   rA   rF   rJ   rT   rX   rg   rk   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  __static_attributes____classdictcell__)__classdict__s   @r   r4   r4   6   s     ?9
4.$
/,(', (	9	;,(7S

S",0\0-9&%*=64+*#3 3r   r4   )"r  r   r*   numpyr   numpy.testingr   r   numpy.exceptionsr   scipy.sparser   r   r   r   r	   r
   r   scipy.sparse._sputilsr   r   r   int64float64
complex128r   fixturer   r#   markparametrizer.   r2   r4   r   r   r   <module>r&     s   0    7 +   ; I.
xxR]]3 ' '   y)Y	&RS  T  )Y	9iS&& j1E3 E3 2E3r   