+
    /iN                     R    R t ^ RIt^RIHtHtHtHt ^RIH	t	H
t
 R tR tR tR tR# )a  
This is a module evaluating the objective/constraint function with Nan/Inf handling.

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.
N)FUNCMAX	CONSTRMAXREALMAX	DEBUGGING)matprodprimasumc                z    ^ V \         P                  ! V 4      &   \         P                  ! V \        ) \        4      p V # )ze
This function moderates a decision variable. It replaces NaN by 0 and Inf/-Inf by
REALMAX/-REALMAX.
)npisnanclipr   )xs   &`/var/www/html/photoedit/myenv/lib/python3.14/site-packages/scipy/_lib/pyprima/common/evaluate.py	moderatexr      s.    
 AbhhqkN
G8W%AH    c                    \         P                  ! V 4      '       d   \        MT p \         P                  ! V \        ) \        4      p V # )z
This function moderates the function value of a MINIMIZATION problem. It replaces
NaN and any value above FUNCMAX by FUNCMAX.
)r	   r
   r   r   r   )fs   &r   	moderatefr      s2    
 88A;;AA
G8W%A Hr   c                    \         P                  ! V R\        R7       \         P                  ! V \        ) \        4      p V # )z
This function moderates the constraint value, the constraint demanding this value
to be NONNEGATIVE. It replaces any value below -CONSTRMAX by -CONSTRMAX, and any
NaN or value above CONSTRMAX by CONSTRMAX.
F)copynan)r	   
nan_to_numr   r   )cs   &r   	moderatecr   '   s-     MM!%Y/
I:y)AHr   c                   Ve   \        V4      M^ p\        '       d(   \        \        P                  ! V4      4      '       d   Q h\        P
                  ! WR,           4      pVe    \        WP                  4      V,
          VRV% \        \        P                  ! V4      4      '       d*   \        V4      p\        P                  ! V4      V,          pM0V ! \        V4      4      w  qvVR% \        V4      p\        WeR 4      WeR% \        '       d}   \        P                  ! V4      '       g   \        P                  ! V4      '       d   Q h\        \        P                  ! V4      \        P                  ! V4      ,          4      '       d   Q hWv3# )z
This function evaluates CALCFC at X, returning the objective function value and the
constraint value. Nan/Inf are handled by a moderated extreme barrier.
N)lenr   anyr	   r
   zerosr   Tr   onesr   r   r   isposinf)calcfcr   m_nlconamatbvecm_lconconstrr   s   &&&&&   r   evaluater&   2   s%    *SYF y rxx{#### XXf&'F!!VV,t3w
288A; QK!A%#IaL1&'?
 aL#F7O4w y HHQKK2;;q>>22rxx'"++f*==>>>>9r   )__doc__numpyr	   constsr   r   r   r   linalgr   r   r   r   r   r&    r   r   <module>r,      s,     : : %
	1r   