
    Ti{                     :    d Z ddlmZmZmZmZmZ ddlZd Z	d Z
dS )z
This module checks whether to break out of the solver loop.

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.
   )INFO_DEFAULT	NAN_INF_X	NAN_INF_FFTARGET_ACHIEVEDMAXFUN_REACHED    Nc                    t           }d}t           t          t          t          t          fvsJ d|             t          t          j        |                    rJ d|             t          t          j        |                    s!t          t          j        |                    rJ d|             t          t          j        |                    s!t          t          j	        |                    rt          }t          t          j        |                    s!t          t          j        |                    rt          }||k    rt          }|| k    rt          }|S )z_
    This module checks whether to break out of the solver loop in the unconstrained case.
    CHECKbreak_UNCPNAN_INF_X, NAN_INF_F, FTARGET_ACHIEVED, and MAXFUN_REACHED differ from INFO_DFT X does not contain NaN zF is not NaN/+Inf 
r   r   r   r   r   anynpisnanisposinfisinf)maxfunnffftargetxinfosrnames          |/var/www/development/aibuddy-work/election-extract/venv/lib/python3.11/site-packages/scipy/_lib/pyprima/common/checkbreak.pycheckbreak_uncr      sM    D F 	96FWWWW  Zu  ms  Zu  ZuWWW 28A;;CC!C6!C!CCCCBHQKK  WCA$7$7WW:Wv:W:WWWW 28A;; 3rx{{++  28A;; 3r{1~~.. G||	V||K    c                 
   t           }d}t           t          t          t          t          fvsJ d|             t          t          j        |                    rJ d|             t          j        |          s<t          j        |          s(t          j        |          st          j        |          rJ d|             t          t          j        |                    s!t          t          j	        |                    rt          }t          j        |          s<t          j        |          s(t          j        |          st          j        |          rt          }||k    r||k    rt          }|| k    rt          }|S )z]
    This module checks whether to break out of the solver loop in the constrained case.
    CHECKbreak_CONr   r   zF or CSTRV is not NaN/+Inf r   )	r   r   cstrvctolr   r   r   r   r   s	            r   checkbreak_conr!   7   ss    D F 	96FWWWW  Zu  ms  Zu  ZuWWW 28A;;CC!C6!C!CCCCr{1~~%BKPUDVDVYw}YY 28A;; 3rx{{++  
x{{ bk!nn  2;u;M;M }}g	V||Kr   )__doc__infosr   r   r   r   r   numpyr   r   r!    r   r   <module>r&      sq     X W W W W W W W W W W W W W    & & &P& & & & &r   