Your IP : 216.73.216.213


Current Path : /opt/alt/python35/lib64/python3.5/site-packages/numpy/core/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib64/python3.5/site-packages/numpy/core/__pycache__/getlimits.cpython-35.pyc



(��^�G�,@sdZddlmZmZmZddgZddlZddlmZddl	m
Z
dd	l	mZdd
l
m
Z
mZddlmZmZddl	mZd
d�Zdd�ZejejejejejejiZdZejedejdddejd��ejedej dddejd��ej!edej"dddejd��ej#edej$dddejd��iZ%Gdd�de&�Z'ej(Z)e'e)dd[d!d\d#d]d%d&d'd d(d)d*d+d,d)d-dd.ee)d^��d/ee)d_��d0e)d1�d2e)da��
Z*ej+Z,e'e,ddbd!dcd#ddd%d6d'd3d(d7d*d+d,d)d-dd.ee,de��d/ee,df��d0e,dk�d2ee,dl���
Z-ej.Z/dnZ0dpZ1e'e/ddqd!drd#dsd%d>d'd;d(d"d*d+d,d)d-dd.dud/e0d0d@e0e1e/dA�d2e1�
Z2ej!Z3ee3dv��Z4ee3dw��Z5e
j6dDdE��#e3d�e4e5e3dA�Z7WdQRXe'e3ddxd!dyd#dzd%dGd'dFd(dHd*d+d,d)d-dd.ee3d{��d/e4d0e7d2e5�
Z8ee3d|��Z9ee3d}��Z:e
j6dDdE��#e3d�e9e:e3dA�Z;WdQRXe'e3dd~d!dd#d�d%dGd'dJd(dHd*d+d,d)d-dd.ee3d���d/e9d0e;d2e:�
Z<e=edK�rej>e3e�e3d��ne2j?Z@e'e3dd�d!d�d#d�d%d>d'dLd(d"d*d+d,d)d-dd.ee3d���d/ee3d���d0e@d2ee3d����
ZAdNe2dOe-dPe*dQe<dReAdSeAdTe8iZBdUdV�ZCdWdX�ZDGdYd�de&�ZEGdZd�de&�ZFdS)�zJMachine limits for Float32 and Float64 and (long double) if available...

�)�division�absolute_import�print_function�finfo�iinfoN�)�MachAr)�numeric)�numerictypes)�array�inf)�log10�exp2)�umathcCs(|jdkr$|j�}d|_|S)zfix rank-0 --> rank-1rr)r)�ndim�copy�shape)�a�r�G/opt/alt/python35/lib64/python3.5/site-packages/numpy/core/getlimits.py�_fr0s	rcCs(|jdkr$|j�}f|_|S)zfix rank > 0 --> rank-0r)�sizerr)rrrr�_fr1s	rz(numpy {} precision floating point number�itype�fmtz%24.16e�title�doublez%15.7e�singlez%szlong doublez%12.5e�halfc@s|eZdZdZdd�Zedd��Zedd��Zedd	��Zed
d��Z	edd
��Z
dS)�
MachArLikez$ Object to simulate MachAr instance cs.t���fdd���fdd�}��fdd�|_�d|_||jd��|_|_||jd��|_||jd��|_|_||jd	��|_	|_
�d
|jd��|_|jj
|�tt|j��|_|�d�|j�|_dS)
Ncst|g��S)N)r)�v)�ftyperr�<lambda>Esz%MachArLike.__init__.<locals>.<lambda>cst�|��S)N)r)r )�
float_convrrr"Fscs�dtt|�d��S)Nrr)rr)r )r!�paramsrrr"Gsr�eps�epsneg�huge�tinyr�ibeta�
)�_MACHAR_PARAMS�
_float_to_strr�pop�epsilonr%r&�xmaxr'�xminr(r)�__dict__�update�intr
�	precision�
resolution)�selfr!�kwargsZfloat_to_floatr)r#r!r$r�__init__As

zMachArLike.__init__cCs|j|j�S)N)r,r%)r6rrr�_str_epsXszMachArLike._str_epscCs|j|j�S)N)r,r&)r6rrr�_str_epsneg\szMachArLike._str_epsnegcCs|j|j�S)N)r,r0)r6rrr�	_str_xmin`szMachArLike._str_xmincCs|j|j�S)N)r,r/)r6rrr�	_str_xmaxdszMachArLike._str_xmaxcCs|j|j�S)N)r,r5)r6rrr�_str_resolutionhszMachArLike._str_resolutionN)�__name__�
__module__�__qualname__�__doc__r8�propertyr9r:r;r<r=rrrrr>sr�machepr*�negep��minexp��maxexp��it�iexp�r)�ZirndZngrdr%r&r'i�r(���~��g@g�J@g�@�4�5i�igJ@g�?��qi�?�all�ignore�pi@��@�?�	nextafter�i�js��������s��̽sf�s
���������s������Y<��������s��������������Y<s����������������cCs�tj|�}|dkr-tt|���|d�jd�j�}tj|�}|dkr�|tjkr�tj|dd��}|dk	r�|St	j
dj||�tdd�t
|�S)a� Get MachAr instance or MachAr-like instance

    Get parameters for floating point type, by first trying signatures of
    various known floating point types, then, if none match, attempting to
    identify parameters by analysis.

    Parameters
    ----------
    ftype : class
        Numpy floating point type class (e.g. ``np.float64``)

    Returns
    -------
    ma_like : instance of :class:`MachAr` or :class:`MachArLike`
        Object giving floating point parameters for `ftype`.

    Warns
    -----
    UserWarning
        If the binary signature of the float type is not in the dictionary of
        known float types.
    Nz-0.1�<r*zVSignature {} for {} does not match any known type: falling back to type probe function�
stacklevelrM)r+�get�
ValueError�reprZnewbyteorder�tobytes�_KNOWN_TYPES�ntypes�
longdouble�warnings�warn�format�UserWarning�_discovered_machar)r!r$�keyZma_likerrr�_get_machar�s	
rocsWt��t�fdd��fdd��fdd���fdd��d�S)zB Create MachAr instance with found information on float types
    cst|g��S)N)r)r )r!rrr"*sz$_discovered_machar.<locals>.<lambda>cst|j�d��dS)Nrr)r�astype)r )r$rrr"+scstt|�d��S)Nr)rr)r )r!rrr",scs�dtt|�d��S)Nrr)rr)r )r!r$rrr"-sr)r+r)r!r)r!r$rrm&s
rmc@sLeZdZdZiZdd�Zdd�Zdd�Zdd	�Zd
S)ran	
    finfo(dtype)

    Machine limits for floating point types.

    Attributes
    ----------
    bits : int
        The number of bits occupied by the type.
    eps : float
        The smallest representable positive number such that
        ``1.0 + eps != 1.0``.  Type of `eps` is an appropriate floating
        point type.
    epsneg : floating point number of the appropriate type
        The smallest representable positive number such that
        ``1.0 - epsneg != 1.0``.
    iexp : int
        The number of bits in the exponent portion of the floating point
        representation.
    machar : MachAr
        The object which calculated these parameters and holds more
        detailed information.
    machep : int
        The exponent that yields `eps`.
    max : floating point number of the appropriate type
        The largest representable number.
    maxexp : int
        The smallest positive power of the base (2) that causes overflow.
    min : floating point number of the appropriate type
        The smallest representable number, typically ``-max``.
    minexp : int
        The most negative power of the base (2) consistent with there
        being no leading 0's in the mantissa.
    negep : int
        The exponent that yields `epsneg`.
    nexp : int
        The number of bits in the exponent including its sign and bias.
    nmant : int
        The number of bits in the mantissa.
    precision : int
        The approximate number of decimal digits to which this kind of
        float is precise.
    resolution : floating point number of the appropriate type
        The approximate decimal resolution of this type, i.e.,
        ``10**-precision``.
    tiny : float
        The smallest positive usable number.  Type of `tiny` is an
        appropriate floating point type.

    Parameters
    ----------
    dtype : float, dtype, or instance
        Kind of floating point data-type about which to get information.

    See Also
    --------
    MachAr : The implementation of the tests that produce this information.
    iinfo : The equivalent for integer data types.

    Notes
    -----
    For developers of NumPy: do not instantiate this at the module level.
    The initial calculation of these parameters is expensive and negatively
    impacts import times.  These objects are cached, so calling ``finfo()``
    repeatedly inside your functions is not a problem.

    cCszytj|�}Wn'tk
r<tjt|��}YnX|jj|d�}|dk	rb|S|g}tj|�}||k	r�|j|�|}t|tj	�s�t
d|��|jj|d�}|dk	r�|St|tj�st|}||k	r|j|�|}|jj|d�}|dk	r@|St
j|�j|�}x|D]}||j|<q_W|S)Nzdata type %r not inexact)r	�dtype�	TypeError�type�_finfo_cacherbZ
obj2sctype�append�
issubclass�inexactrcZfloating�_convert_to_float�object�__new__�_init)�clsrq�objZdtypesZnewdtype�dtrrrrzxs:
	



z
finfo.__new__cCsYtj|�|_t|�}x9ddddddgD]}t||t||��q7Wx7ddd	gD]&}t||t||�jd
�qjW|jjd|_|jjd
|_	|j	|_
|jjd
|_|j|_
|j|_||_|jj�|_|jj�|_|jj�|_|jj�|_|jj�|_|S)Nr4rKrHrFrDrCr(r5r&rrR)r	rqro�setattr�getattrZflat�itemsize�bitsr'�max�minr%rKZnexprJZnmant�macharr;�stripZ	_str_tinyr<Z_str_maxr:r9r=)r6rqr��wordrrrr{�s*		
$
	zfinfo._initcCsd}||jS)Na�Machine parameters for %(dtype)s
---------------------------------------------------------------
precision = %(precision)3s   resolution = %(_str_resolution)s
machep = %(machep)6s   eps =        %(_str_eps)s
negep =  %(negep)6s   epsneg =     %(_str_epsneg)s
minexp = %(minexp)6s   tiny =       %(_str_tiny)s
maxexp = %(maxexp)6s   max =        %(_str_max)s
nexp =   %(nexp)6s   min =        -max
---------------------------------------------------------------
)r1)r6rrrr�__str__�s
z
finfo.__str__cCs-|jj}|jj�}||d<d|S)N�klasszZ%(klass)s(resolution=%(resolution)s, min=-%(_str_max)s, max=%(_str_max)s, dtype=%(dtype)s))�	__class__r>r1r)r6�c�drrr�__repr__�s

zfinfo.__repr__N)	r>r?r@rArtrzr{r�r�rrrrr1sC!c@sveZdZdZiZiZdd�Zdd�Zee�Zdd�Z	ee	�Z	dd	�Z
d
d�ZdS)
ral
    iinfo(type)

    Machine limits for integer types.

    Attributes
    ----------
    bits : int
        The number of bits occupied by the type.
    min : int
        The smallest integer expressible by the type.
    max : int
        The largest integer expressible by the type.

    Parameters
    ----------
    int_type : integer type, dtype, or instance
        The kind of integer data type to get information about.

    See Also
    --------
    finfo : The equivalent for floating point data types.

    Examples
    --------
    With types:

    >>> ii16 = np.iinfo(np.int16)
    >>> ii16.min
    -32768
    >>> ii16.max
    32767
    >>> ii32 = np.iinfo(np.int32)
    >>> ii32.min
    -2147483648
    >>> ii32.max
    2147483647

    With instances:

    >>> ii32 = np.iinfo(np.int32(10))
    >>> ii32.min
    -2147483648
    >>> ii32.max
    2147483647

    cCs�ytj|�|_Wn*tk
rBtjt|��|_YnX|jj|_|jjd|_d|j|jf|_|jdkr�td��dS)NrRz%s%d�iuzInvalid integer data type.)	r	rqrrrs�kindr�r�rnrc)r6Zint_typerrrr8�s
ziinfo.__init__cCsl|jdkrdSytj|j}Wn:tk
rctd|jd>�}|tj|j<YnX|SdS)zMinimum value of given dtype.�urrN)r�r�	_min_valsrn�KeyErrorr3r�)r6�valrrrr�s
z	iinfo.mincCs�ytj|j}Wnftk
r||jdkrMtd|j>d�}ntd|jd>d�}|tj|j<YnX|S)zMaximum value of given dtype.r�r)r�	_max_valsrnr�r�r3r�)r6r�rrrr�s
z	iinfo.maxcCs)d}|d|jd|jd|jiS)zString representation.z�Machine parameters for %(dtype)s
---------------------------------------------------------------
min = %(min)s
max = %(max)s
---------------------------------------------------------------
rqr�r�)rqr�r�)r6rrrrr�"sz
iinfo.__str__cCs#d|jj|j|j|jfS)Nz%s(min=%s, max=%s, dtype=%s))r�r>r�r�rq)r6rrrr�-sziinfo.__repr__N)r>r?r@rAr�r�r8r�rBr�r�r�rrrrr�s/i����i����i�i����i����i�g?i��i��i����i��i��i��gp>g��?l	g��Gi����g�J�g�<g�gi���i���i���gJ�g�<i����i���i����i����i���i����i����i���i����i����i���i����i����i����i���i����i����i���)GrA�
__future__rrr�__all__rir�r�r	r
rgrrrr
rrrZcsinglerZcomplex_Zfloat_Z
clongfloatZ	longfloatrxZ
_title_fmtr�dict�int64rkZint32rh�longlongrZint16r+ryrZfloat16Z_f16Z_float16_maZfloat32Z_f32Z_float32_maZfloat64Z_f64Z_epsneg_f64Z	_tiny_f64Z_float64_maZ_ldZ_epsneg_f128Z
_tiny_f128ZerrstateZ
_huge_f128Z_float128_maZ_epsneg_f80Z	_tiny_f80Z	_huge_f80Z_float80_ma�hasattrr]r'Z_huge_ddZ_float_dd_marfrormrrrrrr�<module>s$					1								%		%		-			+�