+
    ,i                         R t ^ RIt^RIHt ^ RIHt ]]]P                  3t
]P                  ! ]P                  4      P                  tR tR# )a   
This module provides the _project function that attempts to project the initial guess
onto the feasible set.

Adapted from the corresponding function in the PDFO package (https://www.pdfo.net) by
Tom M. Ragonneau (https://ragonneau.github.io) and Zaikun Zhang (https://www.zhangzk.net).
NLinearConstraint)OptimizeResultc           	       a Rp\        V \        4      '       d   V .oM/\        V R4      '       d   V oM\        RP	                  V4      4      h \
        P                  ! S\
        P                  R7      o\        SP                  4      ^8w  d   \        RP	                  T4      4      hSP                  p\        T\        4      '       d   T.pM/\        TR4      '       d   TpM\        RP	                  T4      4      h \
        P                  ! T\
        P                  R7      p\        TP                  4      ^8w  g   TP                  T8w  d   \        RP	                  T4      4      h\        T\        4      '       d   T.pM/\        TR4      '       d   TpM\        R	P	                  T4      4      h \
        P                  ! T\
        P                  R7      p\        TP                  4      ^8w  g   TP                  T8w  d   \        RP	                  T4      4      h\        T\        4      '       dI   RR0\        TP                  4       4      8:  d)   \        TR,          \        4      '       g&   TR,          e   \        RP	                  T4      4      hRpTR,          f?   \
        P                  ! \
        P                   ! ST3^ R7      T3^ R7      p	\#        T	R7      # \%        \
        P&                  ! \
        P(                  ! TR,          P*                  TR,          P,                  ,
          4      \.        4      4      '       Ed   \
        P0                  ! T4      T) 8:  d   \
        P2                  ! T4      T8  d   TR,          P4                  p
TR,          P,                  TR,          P*                  ,           ^,          p\
        P6                  P9                  Y\
        P:                  ! T
S4      ,
          RR7      w  p  p\
        P                  ! \
        P                   ! ST,           T3^ R7      T3^ R7      p	\#        T	R7      # TR,          Ee    ^ RIHp ^ RIH p ^ RIHp TR,          p\        4       \        4       pp\
        P                  ! . .4      \
        P                  ! . .4      uTR&   TR&   TR,          PC                  ^ TP4                  P                  ^,          4      TR&   TR,          PC                  ^ TP4                  P                  ^,          4      TR&   \
        P                  ! . 4      \
        P                  ! . 4      uTR&   TR&   \
        P                  ! . 4      \
        P                  ! . 4      uTR&   TR&   \E        TP,                  P                  4       EF  pTP,                  T,          TP*                  T,          8w  d   \
        PF                  ! TR,          TP4                  TT^,           1R3,          3^ R7      TR&   \
        PH                  TR,          TP,                  T,          3,          TR&   \
        PH                  TR,          TP*                  T,          3,          TR&   K  \
        PF                  ! TR,          TP4                  TT^,           1R3,          3^ R7      TR&   \
        PH                  TR,          TP,                  T,          3,          TR&   \
        PH                  TR,          TP*                  T,          3,          TR&   EK  	  TR,          P                  ^ 8  dB   TR,          P                  ^ 8  d*   TR,          P                  ^ 8  d   T! R/ TB T! R/ TB .pM\TR,          P                  ^ 8  d"   TR,          P                  ^ 8  d
   T! R/ TB pM#TR,          P                  ^ 8  d
   T! R/ TB pMRp\
        P:                  ! TR,          S4      p\
        P:                  ! TR,          S4      p\
        PJ                  ! TTR,          4      PM                  4       '       g   \
        PJ                  ! TR,          T4      PM                  4       '       g   \
        PN                  ! TTR,          4      PM                  4       '       gW   \
        PJ                  ! ST4      PM                  4       '       g,   \
        PJ                  ! TS4      PM                  4       '       d   T! T3R lST3R lT! Yg4      TR7      # \#        SR7      # \#        SR7      #   \         d    \        RP	                  T4      4      hi ; i  \         d    \        RP	                  T4      4      hi ; i  \         d    \        R
P	                  T4      4      hi ; i  \P         d    \#        SR7      u # i ; i)a(  Projection of the initial guess onto the feasible set.

Parameters
----------
x0: ndarray, shape (n,)
    The same as in prepdfo.
lb: ndarray, shape (n,)
    The same as in prepdfo.
ub: ndarray, shape (n,)
    The same as in prepdfo.
constraints: dict
    The general constraints of the problem, defined as a dictionary with
    fields:
        linear: LinearConstraint
            The linear constraints of the problem.
        nonlinear: dict
            The nonlinear constraints of the problem. When ``_project`` is called, the nonlinear constraints are
            None.

Returns
-------
result: OptimizeResult
    The result of the projection.

Authors
-------
Tom M. RAGONNEAU (ragonneau.github.io)
and Zaikun ZHANG (www.zhangzk.net)

Dedicated to the late Professor M. J. D. Powell FRS (1936--2015).
prima__len__z,{}: UNEXPECTED ERROR: x0 should be a vector.)dtypez5{}: UNEXPECTED ERROR: x0 should contain only scalars.z,{}: UNEXPECTED ERROR: lb should be a vector.z5{}: UNEXPECTED ERROR: lb should contain only scalars.z={}: UNEXPECTED ERROR: the size of lb is inconsistent with x0.z,{}: UNEXPECTED ERROR: ub should be a vector.z5{}: UNEXPECTED ERROR: ub should contain only scalars.z={}: UNEXPECTED ERROR: the size of ub is inconsistent with x0.linear	nonlinearNz6{}: UNEXPECTED ERROR: The constraints are ill-defined.g@xD)axis)x)rcond)minimize)Boundsr   Albub:NNNc                 \   < \         P                  ! V S,
          V S,
          4      ^,          # )   )npdotr   x0_cs   &D/usr/lib/python3/dist-packages/scipy/_lib/pyprima/common/_project.py<lambda>_project.<locals>.<lambda>   s    "&&T1t8*Dq*H    c                    < V S,
          # )N r   s   &r   r   r      s    _`cg_gr   )jacboundsconstraintsr   ))
isinstancescalar_typeshasattr
ValueErrorformatr   asarrayfloat64lenshapesizedictsetkeysr   nanminnanmaxr   all
less_equalabsr   r   epsmaxminr   linalglstsqr   scipy.optimizer   r   reshaperangeconcatenater_greaterany	not_equalImportError)x0r   r   r!   invokerlenx0lb_cub_cmax_conx_projabxi_r   ScipyBoundsScipyLinearConstraintr	   pc_args_ineq
pc_args_eqiproject_constraintsax_ineqax_eqr   s   &&&&                    @r   _projectrU      s   @ G "l##t	Y		GNNwWXXbzz$bjj1 4::!GNNwWXXIIE "l##t	Y		GNNwWXXbzz$bjj1 4::!tyyE1X__`ghii "l##t	Y		GNNwWXXbzz$bjj1 4::!tyyE1X__`ghii k4(((K1HCP[P`P`PbLc1cK13CDDT\H]HeQXXY`abbG 8$BIItTl;TBK''	R]]266+h"7":":[=R=U=U"UVX[\	]	]FF4LWH$)@ !##"%%H(=(@(@@AEiiooaRVVAt_)<DoIAq! BIItby$&7a@$GaP''8(1	*/<P *F (,vtv*L13RD1A2::rdCS.Lz# ,S 1 9 9!VXX^^A=N OL(o55a9JKJsO35::b>2::b>0L
4 035::b>2::b>0L
4 0699>>*99Q<699Q</(*S8I688TUVWXYVYTY[\T\K]7^ef(gL%)+|D/A699Q</O)PL&)+|D/A699Q</O)PL&&(nnjovxxPQRSTURUPUWXPXGY5Zab&cJsO')uuZ-=vyy|-K'LJt$')uuZ-=vyy|-K'LJt$ + C %%)l4.@.E.E.IjY]N^NcNcfgNg'<'L|'LNcNqfpNq&r#c"''!+T0B0G0G!0K&;&Kl&K#C%%)&;&Ij&I#&(# ff\#.5GFF:c?D1Ezz'<#56::<<

<X\K]_f@g@k@k@m@mLL
4(89==??JJtT*..00BJJtT4J4N4N4P4P H$Th'24'>L_a a &--
 D!!c  bPWWX_`aab  bPWWX_`aab  bPWWX_`aabb  	*!D))	*s[   &e >&e- 3&f O=f? 1f? 	1f? ;*f? &*f? f? ,f? &e*-&f&f<?gg)__doc__numpyr   _linear_constraintsr   r9   r   intfloatgenericr#   finfor(   r4   rU   r   r   r   <module>r]      sE     1 ) UBJJ'hhrzz\"r   