+
    /i$                         R t ^RIHt ^RIHtHt ^RIHt ^RIH	t	 ^RI
Ht ^RIHt ^RIHt ^RIHt ^ R	ItR
 tR tR	# )z
This module contains subroutines for initialization.

Translated from Zaikun Zhang's modern-Fortran reference implementation in PRIMA.

Dedicated to late Professor M. J. D. Powell FRS (1936--2015).

Python translation by Nickolai Belakovski.
)checkbreak_con)	DEBUGGINGREALMAX)INFO_DEFAULT)evaluate)savehist)inv)fmsg)savefiltNc                    RpRp\         P                  ! V4      pVe   \         P                  ! V4      M^ pVV,
          p\         P                  ! V
4      p\        '       d}   V^ 8  g   Q RV 24       hV^8  g   Q RV 24       h\        V4      ^8:  g   Q RV 24       h\	        \         P
                  ! V
4      4      '       g   Q RV 24       hV	^ 8  g   Q RV 24       h\        p\         P                  ! VV^,           4      V	,          pV
VR	V3&   \         P                  ! V4      V	,          p\         P                  ! V^,           \        R
7      p\         P                  ! V^,           4      \        ,           p\         P                  ! V^,           4      \        ,           p\         P                  ! VV^,           34      \        ,           p\        V^,           4       EF`  pVR	V3,          P                  4       pV^ 8X  d   TpTp Tp!M/V^,
          pVV;;,          V	,          uu&   \        V VVWE4      w  p p!\         P                  ! \         P                  ! ^ V!4      4      p"\!        VRVVV	V VV"V!4	       \#        VVVV VV"VV!V4	       RVV&   V VV&   V!VR	V3&   V"VV&   \%        VVV"VV VV4      p#V#\        8w  d   T#p MVV8  g   K  VV,          VV,          8  g   EK  VV,          VV,          uVV&   VV&   VV,          VV,          uVV&   VV&   VR	VV.3,          VR	VV.3&   VVR	V3&   V	) VVRV^,           13&   EKc  	  \         P&                  ! V4      p$VP	                  4       '       d   \)        VR	RV13,          4      p\        '       Ed   V$V8:  g   Q RV 24       hVP                  V^,           8X  g   Q RV 24       hVP*                  VV^,           38X  g   Q RV 24       h\         P,                  ! V4      P/                  4       '       g+   \         P0                  ! V4      P/                  4       '       d   Q RV 24       hVP                  V^,           8X  d_   \/        V^ 8  4      '       gK   \/        \         P,                  ! V4      4      '       g&   \/        \         P2                  ! V4      4      '       d   Q RV 24       hVP                  V^,           8X  dK   \/        \         P,                  ! V4      4      '       g&   \/        \         P2                  ! V4      4      '       d   Q RV 24       hVP*                  VV^,           38X  g   Q RV 24       h\         P
                  ! V4      P	                  4       '       g   Q RV 24       h\	        \         P                  ! \        VR	RV13,          4      ^ R7      ^ 8  4      '       g   Q RV 24       hVP*                  VV38X  g   Q RV 24       h\         P
                  ! V4      P	                  4       '       g   Q RV 24       h\         P4                  ! VR	RV13,          V,          \         P                  ! V4      RRR7      '       g   \	        V4      '       d   Q RR RV 24       hVVVVVVV$V3# )zY
This subroutine does the initialization concerning X, function values, and
constraints.
COBYLA
INITIALIZENzM >= 0 zN >= 1 z$IPRINT is 0, 1, -1, 2, -2, 3, or -3 zX0 is finite zRHOBEG > 0 NNN)dtypeInitializationTzNF <= MAXFUN zEVALUATED.size == Num_vars + 1 zCONMAT.shape = [M, N+1] z!CONMAT does not contain NaN/-Inf zOCVAL.shape == Num_vars+1 and CVAL does not contain negative values or NaN/+Inf z2FVAL.shape == Num_vars+1 and FVAL is not NaN/+Inf zSIM.shape == [N, N+1] zSIM is finite axiszSIM(:, 1:N) has no zero column zSIMI.shape == [N, N] zSIMI is finite g?)rtolatolzSIMI = SIM(:, 1:N)^ )npsizer   absallisfiniter   eyezerosboolr   rangecopyr   maxappendr	   r   r   count_nonzeror   shapeisnananyisneginfisposinfallclose)%calcfciprintmaxfunconstr0amatbvecctolf0ftargetrhobegx0xhistfhistchistconhistmaxhistsolversrnamenum_constraintsm_lconm_nlconnum_varsinfosimsimi	evaluatedfvalcvalconmatkxjfconstrcstrvsubinfonfs%   &&&&&&&&&&&&&&&&                     b/var/www/html/photoedit/myenv/lib/python3.14/site-packages/scipy/_lib/pyprima/cobyla/initialize.pyinitxfcrP      s^    FF ggg&O".RWWT]AF&Gwwr{H y!#7wvh%77#1}0x00}6{aP#Gx!PP 2;;r?##=}VH%==#z1[11z D &&8A:
&
/CC8 66(f$D !40I 88HQJ')D88HQJ')DXX
34w>F 8a< 8!!#6AAFAAaDFND GT@IAvryyF+, 	V%vq&!QvN 	!UAueUFGL 	!Qq!tQ !E4GQGl"D x<DGd8n4&*8nd1g#DGT(^&*8nd1g#DGT(^'-a(A.>'?F1q(m#$ C8"7C4AaC4LM !P 
		)	$B}}3q)8)|$% yV|5}VH55|~~A-Y1PQWPX/YY- ||A>>cBZ[aZb@cc>HHV$((**bkk&.A.E.E.G.GvLmntmuJvvHyyHqL(#dQh--3rxxPT~CVCVZ]^`^i^ijn^oZpZp  	N  vE  FL  EM  tN  	Nq yyHqL(#bhhtn2E2ER[[Y]M^I_I_  	`  eW  X^  W_  c`  	``yyXx!|44W8Nvh6WW4{{3##%%@x'@@%266#c!YhY,/0q9A=>>jBabhai@jj>zzh11S5J6(3SS1{{4 $$&&B/&(BB&{{3q)8)|,t3RVVH5ECVYZZbefobpbp  	V  uH  IK  HL  LM  NT  MU  sV  	VpfdCtR==    c                X   V P                   ^ ,          pVP                   ^ ,          p\        V	4      p\        '       Ed   V^ 8  g   Q hV^8  g   Q hV^8  g   Q h\        P                  ! V^ 4      V8X  d   \        P                  ! V^4      V8X  g   Q h\        P                  ! V4      V8X  g   Q h\        P                  ! V
^ 4      V8X  d   \        P                  ! V
^4      V8X  g   Q h\        P                  ! V	4      V8X  g   Q h\        P                  ! V ^ 4      V8X  d$   \        P                  ! V ^4      V^,           8X  g   Q h\        P
                  ! V 4      \        P                  ! V 4      ,          P                  4       '       d   Q h\        P                  ! V4      V^,           8X  dK   \        V^ \        P
                  ! V4      ,          \        P                  ! V4      ,          8  4      '       d   Q h\        P                  ! V4      V^,           8X  dA   \        \        P
                  ! V4      \        P                  ! V4      ,          4      '       d   Q h\        P                  ! V^ 4      V8X  d$   \        P                  ! V^4      V^,           8X  g   Q h\        P                  ! V4      P                  4       '       g   Q h\        \        P                  ! \        VRRV13,          4      ^ R7      ^ 8  4      '       g   Q h\        P                  ! V4      V^,           8X  g   Q h^ p\        V^,           4       Fk  pWo,          '       g   K  W8  d   VRV3,          VRV3,          ,           pMVRV3,          p\        W?,          WWO,          VWWV RV3,          V4      w  rrpKm  	  \        '       Ed   W8:  g   Q h\        P                  ! V^ 4      V8X  d   \        P                  ! V^4      V8X  g   Q h\        P
                  ! VRRV13,          4      \        P                  ! VRRV13,          4      ,          P                  4       '       d   Q h\        P                  ! V4      V8X  g   Q h\        VRV ^ \        P
                  ! VRV 4      ,          \        P                  ! VRV 4      ,          8  4      '       d   Q h\        P                  ! V
^ 4      V8X  d   \        P                  ! V
^4      V8X  g   Q h\        P
                  ! V
RRV13,          4      P                  4       '       d   Q h\        P                  ! V	4      V8X  g   Q h\        \        P
                  ! V	RV 4      \        P                  ! V	RV 4      ,          4      '       d   Q hV# )aK  
This function initializes the filter (XFILT, etc) that will be used when selecting
x at the end of the solver.
N.B.:
1. Why not initialize the filters using XHIST, etc? Because the history is empty if
the user chooses not to output it.
2. We decouple INITXFC and INITFILT so that it is easier to parallelize the former
if needed.
r   Nr   )r$   lenr   r   r   r%   r'   r&   r(   r   r   r!   r   r   r
   )rF   r0   cweightrE   rD   rA   rC   cfiltconfiltffiltxfiltr<   r?   maxfiltnfiltirH   s   &&&&&&&&&&&      rO   initfiltr\      sv    ll1oOyy|H%jG y!###1}}!||www"o5"'''1:MQX:XXXwwu~(((wwua H,1Bg1MMMwwu~(((wwvq!_49KxZ[|9[[[HHV$r{{6'::??AAAAwwt}1,SBHHTN@RUWU`U`aeUf@f9f5g5gggwwt}1,S$"++VZJ[9[5\5\\\wwsA(*rwwsA(Q,/NNN{{3##%%%%266#c!YhY,/0q9A=>>>>wwy!X\111 E8A:<<|1IAxK 001I2:47DSWSZ\]_dmr  |B  CD  FG  CG  |H  JQ  3R/E%  ywww"o5"'''1:MQX:XXXHHWQY/02;;wq&5&y?Q3RRWWYYYYwwu~(((uVe}q288E&5M+B'BR[[QVW]X]Q^E_'__````wwua H,1Bg1MMMHHU1fuf9-.335555wwu~(((rxxfu.U6E]1KKLLLLLrQ   )__doc__common.checkbreakr   common.constsr   r   common.infosr   common.evaluater   common.historyr   common.linalgr   common.messager	   common.selectxr
   numpyr   rP   r\    rQ   rO   <module>rh      s4    / . ' & %  ! % }>@ArQ   