/opt/cloudlinux/venv/lib/python3.11/site-packages/numpy/lib/__pycache__
Edit: /opt/cloudlinux/venv/lib/python3.11/site-packages/numpy/lib/__pycache__/scimath.cpython-311.pyc (18234B)
§
»/Æû+6§5ã ó — d Z ddlmc mZ ddlmc mZ ddlmZm Z ddl
mZ ddlm
Z
g d¢Z ej d¦ « Zd„ Zd „ Zd
„ Zd„ Zd„ Z ee¦ « d
„ ¦ « Z ee¦ « d„ ¦ « Z ee¦ « d„ ¦ « Zd„ Z ee¦ « d„ ¦ « Z ee¦ « d„ ¦ « Zd„ Z ee¦ « d„ ¦ « Z ee¦ « d„ ¦ « Z ee¦ « d„ ¦ « Z ee¦ « d„ ¦ « ZdS )a±
Wrapper functions to more user-friendly calling of certain math functions
whose output data-type is different than the input data-type in certain
domains of the input.
For example, for functions like `log` with branch cuts, the versions in this
module provide the mathematically valid answers in the complex plane::
>>> import math
>>> np.emath.log(-math.exp(1)) == (1+1j*math.pi)
True
Similarly, `sqrt`, other base logarithms, `power` and trig functions are
correctly handled. See their respective docstrings for specific examples.
Functions
---------
.. autosummary::
:toctree: generated/
sqrt
log
log2
logn
log10
power
arccos
arcsin
arctanh
é N)ÚasarrayÚany)Úarray_function_dispatch)Úisreal) ÚsqrtÚlogÚlog2ÚlognÚlog10ÚpowerÚarccosÚarcsinÚarctanhg @c ó6 — t | j j t j t j t j t j t j t j f¦ « r|
t j ¦ « S |
t j ¦ « S )a_ Convert its input `arr` to a complex array.
The input is returned as a complex array of the smallest type that will fit
the original data: types like single, byte, short, etc. become csingle,
while others become cdouble.
A copy of the input is always made.
Parameters
----------
arr : array
Returns
-------
array
An array with the same input data as the input but in complex form.
Examples
--------
First, consider an input of type short:
>>> a = np.array([1,2,3],np.short)
>>> ac = np.lib.scimath._tocomplex(a); ac
array([1.+0.j, 2.+0.j, 3.+0.j], dtype=complex64)
>>> ac.dtype
dtype('complex64')
If the input is of type double, the output is correspondingly of the
complex double type as well:
>>> b = np.array([1,2,3],np.double)
>>> bc = np.lib.scimath._tocomplex(b); bc
array([1.+0.j, 2.+0.j, 3.+0.j])
>>> bc.dtype
dtype('complex128')
Note that even if the input was complex to begin with, a copy is still
made, since the astype() method always copies:
>>> c = np.array([1,2,3],np.csingle)
>>> cc = np.lib.scimath._tocomplex(c); cc
array([1.+0.j, 2.+0.j, 3.+0.j], dtype=complex64)
>>> c *= 2; c
array([2.+0.j, 4.+0.j, 6.+0.j], dtype=complex64)
>>> cc
array([1.+0.j, 2.+0.j, 3.+0.j], dtype=complex64)
)Ú
issubclassÚdtypeÚtypeÚntÚsingleÚbyteÚshortÚubyteÚushortÚcsingleÚastypeÚcdouble)Úarrs úe/builddir/build/BUILD/cloudlinux-venv-1.0.12/venv/lib64/python3.11/site-packages/numpy/lib/scimath.pyÚ
_tocomplexr 1 sc € õp �#”)”.¥2¤9b¬gµr´xÅÄÝ#%¤9b¬jð#:ñ ;ô ;ð &à�zŠz�"œ*Ñ%Ô%Ð%à�zŠz�"œ*Ñ%Ô%Ð%ó c óˆ — t | ¦ « } t t | ¦ « | dk z ¦ « rt | ¦ « } | S )a� Convert `x` to complex if it has real, negative components.
Otherwise, output is just the array version of the input (via asarray).
Parameters
----------
x : array_like
Returns
-------
array
Examples
--------
>>> np.lib.scimath._fix_real_lt_zero([1,2])
array([1, 2])
>>> np.lib.scimath._fix_real_lt_zero([-1,2])
array([-1.+0.j, 2.+0.j])
r )r r r r ©Úxs r Ú_fix_real_lt_zeror$ p s> € õ, �‰
Œ
€AÝ
�6�!‰9Œ9˜˜AšÑÑÔð Ý�q‰MŒMˆØ€Hr c ót — t | ¦ « } t t | ¦ « | dk z ¦ « r| dz } | S )a„ Convert `x` to double if it has real, negative components.
Otherwise, output is just the array version of the input (via asarray).
Parameters
----------
x : array_like
Returns
-------
array
Examples
--------
>>> np.lib.scimath._fix_int_lt_zero([1,2])
array([1, 2])
>>> np.lib.scimath._fix_int_lt_zero([-1,2])
array([-1., 2.])
r g ð?)r r r r" s r Ú_fix_int_lt_zeror&