Ë
    Ýbi  ã                   ó   — d Z dZd„ Zd„ Zy)a,  
Copyright 2013 Steven Diamond

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
g•Ö&è.>c                 ó    — t        |||«      }|S )aô  
    The meanings of arguments in this function are identical to those of the
    function cvxopt.solvers.conelp. Refer to CVXOPT documentation

        https://cvxopt.org/userguide/coneprog.html#linear-cone-programs

    for more information.

    Note: CVXOPT allows G and A to be passed as dense matrix objects. However,
    this function will only ever be called with spmatrix objects. If creating
    a custom kktsolver of your own, you need to conform to this sparse matrix
    assumption.
    )Úkkt_ldl)ÚcÚGÚhÚdimsÚAÚbÚfactors          ú]/home/cdr/jupyterlab/.venv/lib/python3.12/site-packages/cvxpy/reductions/solvers/kktsolver.pyÚsetup_ldl_factorr      s   € ô Q˜˜aÓ €FØ€Mó    c                 ó¨  ‡ ‡‡‡‡‡‡	‡
‡‡‡‡‡‡‡— ddl mŠmŠ
 ddlm} ddlmŠmŠmŠ ‰j                  \  ŠŠ‰‰z   ‰d   z   t        ‰d   «      z   t        ‰d   D cg c]  }t        ||dz   z  d	z  «      ‘Œ c}«      z   Š |d
‰‰f«      Š |d‰df«      Š	 |d
‰df«      Š |d
‰ j                  d   df«      Šdˆˆ ˆˆˆˆˆ	ˆ
ˆˆˆˆˆˆˆfd„	}|S c c}w )aÑ  
    Returns a function handle "factor", which conforms to the CVXOPT
    custom KKT solver specifications:

        https://cvxopt.org/userguide/coneprog.html#exploiting-structure.

    For convenience, we provide a short outline for how this function works.

    First, we allocate workspace for use in "factor". The factor function is
    called with data (H, W). Once called, the factor function computes an LDL
    factorization of the 3 x 3 system:

        [ H           A'   G'*W^{-1}  ]
        [ A           0    0          ].
        [ W^{-T}*G    0   -I          ]

    Once that LDL factorization is computed, "factor" constructs another
    inner function, called "solve". The solve function uses the newly
    constructed LDL factorization to compute solutions to linear systems of
    the form

        [ H     A'   G'    ]   [ ux ]   [ bx ]
        [ A     0    0     ] * [ uy ] = [ by ].
        [ G     0   -W'*W  ]   [ uz ]   [ bz ]

    The factor function concludes by returning a reference to the solve function.

    Notes: In the 3 x 3 system, H is n x n, A is p x n, and G is N x n, where
    N = dims['l'] + sum(dims['q']) + sum( k**2 for k in dims['s'] ). For cone
    programs, H is the zero matrix.
    é    )ÚblasÚlapack)Úmatrix)ÚpackÚscaleÚunpackÚlÚqÚsé   é   ç        c                 óÂ  •‡ — ‰j                  d‰«       ||‰d ‰…d ‰…f<   ‰‰‰‰‰z   …d ‰…f<   t        ‰«      D ]0  }‰d d …|f   ‰	d d   ‰‰	‰ dd¬«        ‰‰	‰‰d|‰z  ‰z   ‰z   ¬«       Œ2 d‰‰dz   ‰‰z   z  d ‰dz   …<   ‰d‰dz   ‰z  ‰dz   …xx   t        z  cc<   ‰‰dz   ‰z  d ‰dz   …xx   t         z  cc<   ‰j                  ‰‰
«       ˆˆ ˆˆˆ
ˆˆˆˆˆˆˆfd	„}|S )
Nr   ÚTÚI©ÚtransÚinverser   ©Úoffsetyg      ð¿r   c                 ó"  •— ‰j                  | ‰«       ‰j                  |‰‰	¬«        ‰|‰dd¬«        ‰|‰‰d‰	‰
z   ¬«       ‰j                  ‰‰‰«       ‰j                  ‰| ‰	¬«       ‰j                  ‰|‰	‰
¬«        ‰‰|‰d‰	‰
z   ¬«       y )	Nr"   r   r   r   r   )Ún)Úoffsetxr%   )r&   )ÚcopyÚsytrs)ÚxÚyÚzÚKÚWr   r   Úipivr   r%   Úpr   r   Úur   s      €€€€€€€€€€€€r   Úsolvez&kkt_ldl.<locals>.factor.<locals>.solvee   s   ø€ ð I‰Ia˜ŒOØI‰Ia˜ AˆIÔ&Ù!Q˜c¨3Õ/ÙAt˜Q¨¨A©Õ.ØL‰L˜˜D !Ô$ØI‰Ia˜˜aˆIÔ ØI‰Ia˜ A¨ˆIÔ+Ù1a˜˜q¨!¨a©%Ö0r   )ÚscalÚrangeÚREG_EPSÚsytrf)r-   ÚHÚkr1   r   r   r,   r   r   Úgr.   r   ÚldKr%   r/   r   r   r0   r   s   `   €€€€€€€€€€€€€€€r   r
   zkkt_ldl.<locals>.factorV   s  ù€ Ø	‰	#qÔØˆ=ØˆAˆbˆqˆb"1"ˆf‰IØˆˆ!ˆAˆa‰Cˆ%!ˆ)‰Üq“ò 	7ˆAØ’Q˜T‘7ˆA‰aˆDÙ!Q˜c¨3Õ/ÙAt˜Q¨¨#©°©	°A©Ö6ð	7ð $(ˆˆ3ˆq‰51Q‘3‰-Ð
˜#˜a™%Ð
Ñ à	ˆ!ˆc!‰eQ‰Y˜˜A™Ð
Ó¤'Ñ)ÓØ	ˆ3ˆq‰5!‰)Ð
c˜!‘eÐ
Ó¤ Ñ(ÓØ‰Q˜Ô÷	1÷ 	1ð* ˆr   )N)Úcvxoptr   r   Úcvxopt.baser   Úcvxopt.miscr   r   r   ÚsizeÚsumÚint)r   r   r   r   r7   r
   r,   r   r8   r.   r   r9   r%   r/   r   r   r0   r   s   ```   @@@@@@@@@@@@r   r   r   *   sß   ÿþ€ ÷@ $Ý"ß/Ñ/à6‰6D€A€qØ
ˆa‰%$s‘)Ñ
œc $ s¡)›nÑ
,¬sØ=AÀ#¹Yö4HØ89ô 58¸¸1¸Q¹3¹À¹	µNò 4Hó 0Iñ I€CáˆsS˜#JÓ€AÙ!c˜1XÓ€DÙˆsS˜!HÓ€AÙˆsQ—V‘V˜A‘Y NÓ#€A÷$÷ $ó $ðL €Mùò[4Hs   ÁC
N)Ú__doc__r4   r   r   © r   r   ú<module>rB      s   ðñð( €òó$Rr   