+
    /i[\                         R t Rt. ROt^ RIt^RIHtHt ^RIH	t	 ^RI
HtHtHtHt ^RIHt ^R	IHtHtHtHtHtHtHtHt ^R
IHtHtHtHt  ! R R]4      tR t R t! ! R R]]4      t" ! R R]	]4      t#R# )zSparse DIAgonal formatzrestructuredtext en	dia_array
dia_matrixN)_prune_arraycopy_if_needed)spmatrix)issparse_formats_spbasesparray)_data_matrix)isdenseisscalarlikeisshapeupcast_chargetdtypeget_sum_dtypevalidateaxischeck_shape)
dia_matmat
dia_matvecdia_matvecs	dia_tocsrc                     a a ] tR t^t oRtRRR/R lltR tR tRR lt]	P                  P                  ]n
        RR lt]	P                  P                  ]n
        RR	 lt]	P                  P                  ]n
        RR
 ltV 3R ltR tV 3R ltR tR tV 3R ltRR ltRR lt]	P*                  P                  ]n
        RR lt]	P,                  P                  ]n
        RR lt]	P.                  P                  ]n
        RR lt]	P0                  P                  ]n
        RR ltR t]	P4                  P                  ]n
        RtVtV ;t# ) 	_dia_basediaNmaxprintc               v	   \         P                  ! WVR 7       \        V4      '       d   VP                  R8X  dW   V'       d   VP	                  4       pVP
                  V n        VP                  V n        \        VP                  4      V n	        EMVP                  V P                  8X  d   V'       d   VP	                  4       pMVP                  4       pVP
                  V n        VP                  V n        \        VP                  4      V n	        EM\        V\        4      '       EdP   \        V4      '       d   \        V4      V n	        \        P                  ! R\!        V\"        R7      4      V n        V P%                  \'        V P                  4      R7      p\        P                  ! ^ VR7      V n        EMs Vw  rVf   \)        R4      hV'       g   \*        p\        P,                  ! \        P.                  ! V^ ,          W4R7      4      V n        \        P.                  ! V^,          V P%                  \'        V4      R7      VR7      p	\        P0                  ! V	4      V n        \        V4      V n	        M \        P4                  ! V4      p\        T \6        4      '       d+   TP8                  ^8w  d   \)        RTP8                   R24      hT P;                  YTR7      P                  4       pTP
                  T n        TP                  T n        \        TP                  4      T n	        Ve.   \!        V4      pV P
                  P=                  VRR7      V n        V P                  P8                  ^8w  d   \)        R4      hV P
                  P8                  ^8w  d   \)        R4      hV P
                  P                  ^ ,          \?        V P                  4      8w  dA   \)        RV P
                  P                  ^ ,           R\?        V P                  4       R24      h\?        \        P@                  ! V P                  4      4      \?        V P                  4      8w  d   \)        R4      hR#   \2         d   p
Rp\)        T4      T
hRp
?
ii ; i  \2         d    p
\)        R	T P                   R
24      T
hRp
?
ii ; i))r   r   )defaultmaxvaldtypeNzexpected a shape argument)r!   copyz+unrecognized form for dia_array constructorzunrecognized form for z_matrix constructorzDIA arrays don't support zD input. Use 2D)r!   shapeFr"   zoffsets array must have rank 1zdata array must have rank 2znumber of diagonals (z() does not match the number of offsets ()z&offset array contains duplicate values)    r&   )!r   __init__r   formatr"   dataoffsetsr   r#   _shapetodia
isinstancetupler   npzerosr   float_get_index_dtypemax
ValueErrorr   
atleast_2darray
atleast_1d	Exceptionasarrayr
   ndim_coo_containerastypelenunique)selfarg1r#   r!   r"   r   A	idx_dtyper)   r*   emessagenewdtypes   &&&&&$       O/var/www/html/photoedit/myenv/lib/python3.14/site-packages/scipy/sparse/_dia.pyr'   _dia_base.__init__   s   d8<D>>{{e#99;D II	#||)$**5;;$++-$		A

AFF	 yy)!''2e$$t}} *$/HHUHUE,JK	 11TZZ1I	!xx9=5$(MD
 }()DEE- "bhhtAwe.W XDI hhtAw-1-B-B#e*-B-U,02G $&==#9DL"-e"4DKMzz$' $((TYY!^ #<TYYK!WXX##DU#CIIKADI99DL%agg.DKH		(((>DI <<!=>>99>>Q:;;99??1T\\!22'		(:'; <"4<<014  ryy&'3t||+<<EFF =Y ! 5KG$W-145$  M !9$(KK=0C"E FKLMMs0   ;Q- :R -R8RRR8R33R8c                   \         V P                  ,          w  r\        V \        4      '       d   R MRpV P                  P
                  ^ ,          pRV RV RV P                   RV P                   RV RV P
                   R2# )	r6   matrix<z sparse z of dtype 'z'
	with z stored elements (z diagonals) and shape >)r   r(   r-   r
   r)   r#   r!   nnz)r?   _fmt
sparse_clsds   &    rF   __repr___dia_base.__repr__d   s}    $++& *4 9 9Wx
IIOOAuHZLDJJ< @hhZ1!4J4::,VWY	
    c                    V P                   w  r\        P                  ! V P                  P                   ^,          4      pW0P                  R,          ,
          pV^ 8  pWTV8  ,          pWSV8  ,          pV# )zvReturns a mask of the same shape as self.data, where
mask[i,j] is True when data[i,j] corresponds to a stored element.NNNN)r#   r/   aranger)   r*   )r?   num_rowsnum_colsoffset_indsrowmasks   &     rF   
_data_mask_dia_base._data_maskm   sc     "ZZii		 23LL00qx x'(rS   c                    Ve   \        R4      hV P                  4       p\        P                  ! V P                  V,          4      # )Nz<count_nonzero over an axis is not implemented for DIA format)NotImplementedErrorr]   r/   count_nonzeror)   )r?   axisr\   s   && rF   ra   _dia_base.count_nonzerox   s?    %N   		$00rS   c           	     |   Ve   \        R4      hV P                  w  r#\        V P                  P                  ^,          V4      p\	        \
        P                  ! \
        P                  ! W P                  ,           V4      \
        P                  ! V P                  ^ 4      ,
          ^ 4      P                  4       4      # )Nz6_getnnz over an axis is not implemented for DIA format)
r`   r#   minr)   intr/   maximumminimumr*   sum)r?   rb   MNLs   &&   rF   _getnnz_dia_base._getnnz   s    % '7 8 8zz		"A&2::bjj\\)91= jjq9:!!$( 	(rS   c           
     Z   \        V4      p\        V P                  4      pV P                  w  rVR pVR8X  d   V P	                  4       pV P
                  V,          P                  ^ R7      p	V	P                  ^ ,          V8X  d   T	p
M6\        P                  ! WiP                  R7      p
WR V	P                  ^ ,          % V P                  WR7      pM\        P                  ! V^3VR7      p\        P                  ! WdR7      p\        WV\        V P                  4      V P
                  P                  ^,          V P                  V P
                  W4       V P                  V4      pVf   VP                  W#R7      # V P                  VP                  VR7      4      pVP                  RW#R7      # )N)rb   r    )r!   out)rb   r!   rp   r&    )r   r   r!   r#   r]   r)   ri   r/   r0   _ascontaineronesr   r=   r*   )r?   rb   r!   rp   	res_dtyperX   rY   retr\   xresrow_sumsones   &&&&         rF   ri   _dia_base.sum   sT   D!!$**-	!ZZ4<??$DT!&&A&.AwwqzX%hhxww7#$KQWWQZ ##C#9C xx1Y?H''(4Cx3t||+<yyq)4<<CS ((2H|||%|99##HLLdL$;<CwwBew55rS   c                N   \        V\        4      '       g   VP                  V 4      # \        P                  ! V P
                  VP
                  4      '       dV   T P                  V'       d"   V P                  VP                  ,
          4      # V P                  VP                  ,           4      # \        P                  ! V P
                  VP
                  4      p\        P                  ! W0P
                  4      p\        P                  ! W1P
                  4      pV P                  P                  ^,          pVP                  P                  ^,          pWg8X  d   \        V4      \        V P
                  4      8X  di   V P                  \        V4      ,          pV'       d#   WR3;;,          VP                  ,          uu&   EMWR3;;,          VP                  ,          uu&   EMWg8X  d   \        V4      \        VP
                  4      8X  de   V'       d   VP                  \        V4      ,          ) pMVP                  \        V4      ,          pWR3;;,          V P                  ,          uu&   EM\        V P                  ^ ,          VR,          ,           V P                  ^,          4      p	\        P                  ! \        V4      V	3\        P                  ! V P                  VP                  4      R7      pWRV13;;,          V P                  RRV	13,          ,          uu&   V'       d/   WRV13;;,          VP                  RRV	13,          ,          uu&   M-WRV13;;,          VP                  RRV	13,          ,          uu&   V P!                  W3V P                  R7      # )   rV   r    Nr#   )r-   r   _add_sparser/   array_equalr*   
_with_datar)   union1dsearchsortedr#   r=   _invert_indexre   r0   result_type_dia_container)
r?   othersubnew_offsetsself_idx	other_idxself_dother_dnew_datarP   s
   &&&       rF   r   _dia_base._add_sparse   s   %++$$T** >>$,,66??S499uzz#9 ; ;#'99uzz#9; ; jju}}=??;=OOK?	#**""1% [!1S5F!Fyyx!89HA&%**4&A&%**4&3{#3s5==7I#I!JJ}Y'?@@ ::mI&>?q[!TYY.! DJJqMKO3TZZ]CA xx[!1%nnTYY

;H ww&'499QU+;;'HWH,-ArrE1BB-HWH,-ArrE1BB-""H#:$**"MMrS   c                t   < \        V\        4      '       g   \        SV `  V4      # V P	                  VR R7      # )T)r   )r-   r   super_sub_sparser   )r?   r   	__class__s   &&rF   r   _dia_base._sub_sparse   s6    %++7&u--400rS   c                F    V P                  V P                  V,          4      # N)r   r)   )r?   r   s   &&rF   _mul_scalar_dia_base._mul_scalar   s    tyy5011rS   c                  < \        V4      '       d   V P                  V4      # \        V4      '       Ed   VP                  ^8  d   V P	                  4       V,          # ^ V P
                  9   g#   ^V P
                  9   g   ^ VP
                  9   d   \        SV `  V4      # \        P                  ! V4      pVP
                  w  r#V P
                  w  rE\        V P                  P
                  ^,          V4      pV P                  RRV13,          P                  \        P                  ! V P                  V4      4      pV^8X  d   Wq^ RV13,          ,          pMW$8w  d   \        R4      h\        P                  ! V4      pWd8  d"   WP                   R,          ,
          V,          p	M WP                   R,          V,          ,
          p	V^8X  d   ^ pMW58w  d   \        R4      hWqW3,          ,          pV P#                  V4      # \%        V\&        4      '       d   VP
                  V P
                  8w  d   \        SV `  V4      # \        P(                  ! V P                   VP                   RRR7      w  rp\        V P                  P
                  ^,          VP                  P
                  ^,          4      pV P                  VRV13,          VP                  VRV13,          ,          pV P+                  Wz3V P
                  R7      # )   rV   Nzinconsistent shapesT)assume_uniquereturn_indicesr~   rU   )r   r   r   r:   toarrayr#   r   multiplyr/   r5   re   r)   r<   r   r4   rW   r*   r   r-   r   intersect1dr   )r?   r   
other_rows
other_colsrowscolsrl   r)   jir*   r   r   r   s   &&           rF   r   _dia_base.multiply   sS   ##E**5>>zzA~||~-- DJJ!tzz/Q%++5Ew'..MM%(E%*[["JJDDIIOOA&-A99QU#**2>>$))U+KLDQa!e$# !677IIaL8\\'22d:ALL1D88A?A'$%:;;ad#??4(( %++u{{djj/H7#E**
 NN4<<)-dD 	%9 		"EJJ$4$4Q$78yy2A2&IrrM)BB""D?$**"EErS   c                   Tp\         P                  ! V P                  ^ ,          \        V P                  P
                  VP                  P
                  4      R7      pV P                  P                  ^,          pV P                  w  rV\        WV\        V P                  4      W@P                  V P                  VP                  4       VP                  4       4       V# r&   r    )r/   r0   r#   r   r!   charr)   r   r=   r*   ravel)r?   r   rw   yrl   rj   rk   s   &&     rF   _matmul_vector_dia_base._matmul_vector  s    HHTZZ]+djjoo78ww||+E F IIOOAjj1DLL)1llDII779aggi	) rS   c                r   \         P                  ! V P                  ^ ,          VP                  ^,          3\         P                  ! V P                  V4      R7      p\        . V P                  OV P                  P                  OV P                  NV P                  NVP                  ^,          NVNVN5!   V# r   )r/   r0   r#   r   r)   r   r*   )r?   r   rx   s   && rF   _matmul_multivector_dia_base._matmul_multivector)  s    hh

1u{{1~6^^DIIu=? 	0TZZ 	0$))// 	04<< 	0 	0KKN	0$)	0+.	0
rS   c                  < \        V\        4      '       g   \        SV `  V4      # ^ V P                  9   g   ^ VP                  9   d6   V P                  V P                  ^ ,          VP                  ^,          34      # \        . V P                  OV P                  P                  OV P                  NV P                  NVP                  ^,          NVP                  P                  OVP                  NVP                  N5!  w  r#V P                  VP                  \        V4      R4      V3V P                  ^ ,          VP                  ^,          34      # )r&   r   )r-   r   r   _matmul_sparser#   r   r   r)   r*   reshaper=   )r?   r   r*   r)   r   s   &&  rF   r   _dia_base._matmul_sparse0  s   %++7)%00 

?a5;;.&&

1u{{1~'FGG" >DJJ > >#'<<>15>#(;;q>>49JJ4D4D> $)==> 38**> ""DLLWr$BG#L$(JJqM5;;q>#BD 	DrS   c                   V P                   w  r4VP                  ^ 8X  d   \        P                  pM\	        V4      pV^ 8  d   \        W2,           WE4      p^ pTpM\        W4V,
          V4      pTpW&,           pVP                  ^ 8w  d   VRV pV P                  P                   w  rW P                  9   dm   W8  dG   \        P                  ! W3V P                  P                  R7      pV P                  VRRV
13&   Wn        WP                  V P                  V8H  Wx13&   R# \        P                  ! V P                  V P                  P                  P                  V4      4      V n        \        W4      p\        P                  ! V	^,           V3V P                  P                  R7      pV P                  VRR1RV
13&   WRWx13&   Wn        R# )r&   Nr    rV   r   )r#   r:   r/   infr=   re   r)   r*   r0   r!   appendtyper3   )r?   valueskrj   rk   values_nn	min_index	max_index	data_rows	data_colsr)   ms   &&&          rF   _setdiag_dia_base._setdiag@  su   zz;;!vvH6{Hq5AE1'AIIA1uh'AII;;!BQZF#yy	$xx 6diiooN&*iiQ

]# 	@FIIdlla')<<=99T\\4<<3E3E3J3J13MNDLI)A88Y]A.diiooFD$(IID"jyj!,2Y(()IrS   c                6    V'       d   V P                  4       # V # r   r$   )r?   r"   s   &&rF   r,   _dia_base.todiae  s    99;KrS   c                   Ve   VR8w  d   \        R4      hV P                  w  r4\        V P                  4      pV P                  ) p\        P
                  ! \        V4      \        P                  R7      R,          p\        P
                  ! V\        P                  R7      We,          R,          ,
          p\        ^ WPP                  P                  ^,          ,
          4      p	\        P                  ! V P                  \        P                  ! V P                  P                  ^ ,          V	3V P                  P                  R7      34      p
WV3,          p
V P                  W3WC3VR7      # )NzvSparse arrays/matrices do not support an 'axes' parameter because swapping dimensions is the only logical permutation.r    )r#   r"   )r}   r&   rU   )r4   r#   r3   r*   r/   rW   r=   intcr)   hstackr0   r!   r   )r?   axesr"   rX   rY   max_dimr*   rc
pad_amountr)   s   &&&        rF   	transpose_dia_base.transposem  s    L M M "ZZdjj/ <<- IIc'l"''27;IIhbgg.'2CW1MMGIIOOA$667
yy$))RXXtyyq/A:.N48IIOO&E F GqDz""D?; &* # , 	,rS   c                D   V P                   w  r#W) 8:  g   W8  d-   \        P                  ! ^ V P                  P                  R7      # \        P
                  ! V P                  V8H  4      w  p\        ^ V4      p\        W!,           V4      pWe,
          pVP                  ^ 8X  d,   \        P                  ! WpP                  P                  R7      # V P                  V^ ,          WV13,          pV\        V4      ,
          p	V	^ 8  d   \        P                  ! V^ V	3RR7      pV# )r&   r    constant)mode)r#   r/   emptyr)   r!   nonzeror*   r3   re   sizer0   r=   pad)
r?   r   r   r   idx	first_collast_colresult_sizeresultpaddings
   &&        rF   diagonal_dia_base.diagonal  s    ZZ
:88ATYY__55zz$,,!+,1I	tx&*88q=88Kyy??3q69#556F+Q;VVFQLzBFrS   c                   ^ V P                   9   g   \        V P                  4      ^ 8X  d(   V P                  V P                   V P                  R7      # V P                   w  r#V P
                  pV P                  \        WBV4      R7      p\        P                  ! V P                  4      P                  VRR7      p\        P                  ! W@P                  R7      p\        P                  ! WER7      p\        P                  ! ^V,           VR7      p	\        W#.V P                  P                   OV P                  P                  VRR7      NV P                  NVNVNVNV	N5!  p
V P                  \        WV4      R7      p\        VRV
 4      p\        VRV
 P                  VRR7      4      pV	P                  VRR7      p	V P                  WxV	3V P                   V P                  R7      pRVn        V# )r&   r    r   Fr$   N)r#   r!   T)r#   r=   r*   _csr_containerr!   rL   r2   r3   r/   argsortr<   r   r   r)   r   has_canonical_format)r?   r"   n_rowsn_colsmax_nnzrB   ordercsr_dataindicesindptrrL   rp   s   &&          rF   tocsr_dia_base.tocsr  s   

?c$,,/14&&tzz&DD((
 ))Wf1M)N	

4<<(//	/F88G::6((74!f*I6 : :++IE+B:DHII::':)0:28: ))S&1I)J	#/wt}33IE3JKyu5!!8f"=(,

$** " F#' 
rS   c                    V'       d7   V P                  WP                  P                  4       3V P                  R7      # V P                  WP                  3V P                  R7      # )zReturns a matrix with the same sparsity structure as self,
but with different data.  By default the structure arrays are copied.
r~   )r   r*   r"   r#   )r?   r)   r"   s   &&&rF   r   _dia_base._with_data  sb     &&||((*+4:: '   &&||$DJJ '  rS   c                &   \        V4      pVw  r#V P                  R RV13,          V n        W P                  ^ ,          8  d   \        P                  ! V P
                  V P                  ^ ,          ,           V P                  P                  ^,          8  4      '       dm   V P
                  R,          V P                  ^ ,          ,           \        P                  ! V P                  P                  ^,          4      8*  p^ V P                  V&   Wn        R# )rV   NrU   )r   r)   r#   r/   anyr*   rW   r+   )r?   r#   rj   rk   r\   s   &*   rF   resize_dia_base.resize  s    E"IIa!e$	

1t||djjm3diiooa6HHIILL)DJJqM9IIdiiooa012DDIIdOrS   )r+   r)   r*   )NNFr   )NNN)Frq   )NF)T)__name__
__module____qualname____firstlineno___formatr'   rQ   r]   ra   r	   __doc__rm   ri   r   r   r   r   r   r   r   r   r,   r   r   r   r   r   __static_attributes____classdictcell____classcell__)r   __classdict__s   @@rF   r   r      s$    GKGT KGZ
	1 $1199M( oo--GO6@ ++%%CK-N^12/FbD #J MM))EM,,  ))11I  ''//H: MM))EM ^^++FNNrS   r   c                t    \         P                  ! V 4      p\         P                  ! \        V 4      4      W&   V# )z)Helper function to invert an index array.)r/   
zeros_likerW   r=   )r   invs   & rF   r   r     s)    
--
CyyS"CHJrS   c                "    \        V \        4      # )a  Is `x` of dia_matrix type?

Parameters
----------
x
    object to check for being a dia matrix

Returns
-------
bool
    True if `x` is a dia matrix, False otherwise

Examples
--------
>>> from scipy.sparse import dia_array, dia_matrix, coo_matrix, isspmatrix_dia
>>> isspmatrix_dia(dia_matrix([[5]]))
True
>>> isspmatrix_dia(dia_array([[5]]))
False
>>> isspmatrix_dia(coo_matrix([[5]]))
False
)r-   r   )rw   s   &rF   isspmatrix_diar    s    . a$$rS   c                       ] tR tRtRtRtR# )r   i  aH  
Sparse array with DIAgonal storage.

This can be instantiated in several ways:
    dia_array(D)
        where D is a 2-D ndarray

    dia_array(S)
        with another sparse array or matrix S (equivalent to S.todia())

    dia_array((M, N), [dtype])
        to construct an empty array with shape (M, N),
        dtype is optional, defaulting to dtype='d'.

    dia_array((data, offsets), shape=(M, N))
        where the ``data[k,:]`` stores the diagonal entries for
        diagonal ``offsets[k]`` (See example below)

Attributes
----------
dtype : dtype
    Data type of the array
shape : 2-tuple
    Shape of the array
ndim : int
    Number of dimensions (this is always 2)
nnz
size
data
    DIA format data array of the array
offsets
    DIA format offset array of the array
T

Notes
-----

Sparse arrays can be used in arithmetic operations: they support
addition, subtraction, multiplication, division, and matrix power.
Sparse arrays with DIAgonal storage do not support slicing.

Examples
--------

>>> import numpy as np
>>> from scipy.sparse import dia_array
>>> dia_array((3, 4), dtype=np.int8).toarray()
array([[0, 0, 0, 0],
       [0, 0, 0, 0],
       [0, 0, 0, 0]], dtype=int8)

>>> data = np.array([[1, 2, 3, 4]]).repeat(3, axis=0)
>>> offsets = np.array([0, -1, 2])
>>> dia_array((data, offsets), shape=(4, 4)).toarray()
array([[1, 0, 3, 0],
       [1, 2, 0, 4],
       [0, 2, 3, 0],
       [0, 0, 3, 4]])

>>> from scipy.sparse import dia_array
>>> n = 10
>>> ex = np.ones(n)
>>> data = np.array([ex, 2 * ex, ex])
>>> offsets = np.array([-1, 0, 1])
>>> dia_array((data, offsets), shape=(n, n)).toarray()
array([[2., 1., 0., ..., 0., 0., 0.],
       [1., 2., 1., ..., 0., 0., 0.],
       [0., 1., 2., ..., 0., 0., 0.],
       ...,
       [0., 0., 0., ..., 2., 1., 0.],
       [0., 0., 0., ..., 1., 2., 1.],
       [0., 0., 0., ..., 0., 1., 2.]])
rr   Nr   r   r   r   r   r   rr   rS   rF   r   r         HrS   c                       ] tR tRtRtRtR# )r   iD  a[  
Sparse matrix with DIAgonal storage.

This can be instantiated in several ways:
    dia_matrix(D)
        where D is a 2-D ndarray

    dia_matrix(S)
        with another sparse array or matrix S (equivalent to S.todia())

    dia_matrix((M, N), [dtype])
        to construct an empty matrix with shape (M, N),
        dtype is optional, defaulting to dtype='d'.

    dia_matrix((data, offsets), shape=(M, N))
        where the ``data[k,:]`` stores the diagonal entries for
        diagonal ``offsets[k]`` (See example below)

Attributes
----------
dtype : dtype
    Data type of the matrix
shape : 2-tuple
    Shape of the matrix
ndim : int
    Number of dimensions (this is always 2)
nnz
size
data
    DIA format data array of the matrix
offsets
    DIA format offset array of the matrix
T

Notes
-----

Sparse matrices can be used in arithmetic operations: they support
addition, subtraction, multiplication, division, and matrix power.
Sparse matrices with DIAgonal storage do not support slicing.

Examples
--------

>>> import numpy as np
>>> from scipy.sparse import dia_matrix
>>> dia_matrix((3, 4), dtype=np.int8).toarray()
array([[0, 0, 0, 0],
       [0, 0, 0, 0],
       [0, 0, 0, 0]], dtype=int8)

>>> data = np.array([[1, 2, 3, 4]]).repeat(3, axis=0)
>>> offsets = np.array([0, -1, 2])
>>> dia_matrix((data, offsets), shape=(4, 4)).toarray()
array([[1, 0, 3, 0],
       [1, 2, 0, 4],
       [0, 2, 3, 0],
       [0, 0, 3, 4]])

>>> from scipy.sparse import dia_matrix
>>> n = 10
>>> ex = np.ones(n)
>>> data = np.array([ex, 2 * ex, ex])
>>> offsets = np.array([-1, 0, 1])
>>> dia_matrix((data, offsets), shape=(n, n)).toarray()
array([[2., 1., 0., ..., 0., 0., 0.],
       [1., 2., 1., ..., 0., 0., 0.],
       [0., 1., 2., ..., 0., 0., 0.],
       ...,
       [0., 0., 0., ..., 2., 1., 0.],
       [0., 0., 0., ..., 1., 2., 1.],
       [0., 0., 0., ..., 0., 1., 2.]])
rr   Nr  rr   rS   rF   r   r   D  r  rS   )r   r   r  )$r   __docformat____all__numpyr/   
_lib._utilr   r   _matrixr   _baser   r   r	   r
   _datar   _sputilsr   r   r   r   r   r   r   r   _sparsetoolsr   r   r   r   r   r   r  r   r   rr   rS   rF   <module>r     sv    %
7  5  7 7    I H, ,D%6I	7 IXI9 IrS   