Ë
    0Ò^j  ã                   ó&   — d Z ddlmZmZ ddlZd„ Zy)a  
This module calculates the reduction ratio for trust-region methods.

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.
é   )Ú	DEBUGGINGÚREALMAXé    Nc                 ó¶  — t         r|dk\  sJ ‚t        j                  | «      rt         }n‘t        j                  |«      s|dk  r| dkD  r|dz  }nlt         }ndt        j                  |«      rt        j                  | «      rd}n7t        j                  |«      rt        j
                  | «      rt         }n| |z  }t         rt        j                  |«      rJ ‚|S )zh
    This function evaluates the reduction ratio of a trust-region step, handling inf/nan properly.
    r   é   r   )r   ÚnpÚisnanr   ÚisposinfÚisneginf)ÚaredÚpredÚrshrinkÚratios       úo/var/www/ramen.bs-engineer-server.com/venv/lib/python3.12/site-packages/scipy/_external/pyprima/common/ratio.pyÚredratr      s±   € õ Ø˜!Š|Ðˆ|ô 
‡x�x�„~ä�‰Ü	�‰�$Œ˜4 1š9ð �!Š8à˜A‘I‰Eô �H‰EÜ	�‰�TÔ	œrŸ{™{¨4Ô0Ø‰Ü	�‰�TÔ	œrŸ{™{¨4Ô0Ü�‰à�T‘	ˆõ Ü—8‘8˜E”?Ð"Ð"Ø€Ló    )Ú__doc__Úconstsr   r   Únumpyr   r   © r   r   ú<module>r      s   ðñ÷ 'Û ó(r   