Your IP : 216.73.216.213


Current Path : /opt/alt/python27/lib64/python2.7/site-packages/numpy/core/
Upload File :
Current File : //opt/alt/python27/lib64/python2.7/site-packages/numpy/core/getlimits.pyc

�
��]c @`sdZddlmZmZmZddgZddlZddlmZddl	m
Z
dd	l	mZdd
l
m
Z
mZddlmZmZddl	mZd
�Zd�Ziejej6ejej6ejej6ZdZiedejdddejd��ej6edej dddejd��ej6edej!dddejd��ej"6edej#dddejd��ej$6Z%de&fd��YZ'ej(Z)e'e)dddd d!d"d#d$d%d&d'd(d)d*d+d(d,dd-ee)d��d.ee)d ��d/e)d0�d1e)d^��
Z*ej+Z,e'e,dd2dd3d!d4d#d5d%d6d'd7d)d*d+d(d,dd-ee,d2��d.ee,d3��d/e,dd_d`�d1ee,d4���
Z-ej.Z/daZ0dbZ1e'e/dd;dd<d!d=d#d>d%d?d'd@d)d*d+d(d,dd-dcd.e0d/dBe0e1e/dC�d1e1�
Z2ej"Z3ee3dD��Z4ee3dE��Z5e
j6dFdG��#e3d�e4e5e3dC�Z7WdQXe'e3ddHddDd!dEd#dId%dJd'dKd)d*d+d(d,dd-ee3dH��d.e4d/e7d1e5�
Z8ee3dL��Z9ee3dE��Z:e
j6dFdG��#e3d�e9e:e3dC�Z;WdQXe'e3ddMddLd!dEd#dId%dNd'dKd)d*d+d(d,dd-ee3dM��d.e9d/e;d1e:�
Z<e=edO�rej>e3e�e3d��ne2j?Z@e'e3ddPddQd!d=d#d>d%dRd'd@d)d*d+d(d,dd-ee3dP��d.ee3dQ��d/e@d1ee3d=���
ZAie2dS6e-dT6e*dU6e<dV6eAdW6eAdX6e8dY6ZBdZ�ZCd[�ZDde&fd\��YZEde&fd]��YZFdS(dsJMachine limits for Float32 and Float64 and (long double) if available...

i(tdivisiontabsolute_importtprint_functiontfinfotiinfoNi(tMachAr(tnumeric(tnumerictypes(tarraytinf(tlog10texp2(tumathcC`s+|jdkr'|j�}d|_n|S(sfix rank-0 --> rank-1ii(i(tndimtcopytshape(ta((sG/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/getlimits.pyt_fr0scC`s+|jdkr'|j�}d|_n|S(sfix rank > 0 --> rank-0i((tsizeRR(R((sG/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/getlimits.pyt_fr1ss(numpy {} precision floating point numbertitypetfmts%24.16ettitletdoubles%15.7etsingles%sslong doubles%12.5ethalft
MachArLikecB`sbeZdZd�Zed��Zed��Zed��Zed��Zed��Z	RS(s$ Object to simulate MachAr instance c`s%t���fd���fd�}��fd�|_�d|_||jd��|_|_||jd��|_||jd��|_|_||jd��|_	|_
�d	|jd
��|_|jj
|�tt|j��|_|�d�|j�|_dS(Nc`st|g��S(N(R(tv(tftype(sG/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/getlimits.pyt<lambda>Etc`st�|��S(N(R(R(t
float_conv(sG/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/getlimits.pyRFRc`s�dtt|�d��S(NRi(RR(R(Rtparams(sG/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/getlimits.pyRGsRtepstepsnegthugettinyRtibetai
(t_MACHAR_PARAMSt
_float_to_strRtpoptepsilonR!R"txmaxR#txminR$R%t__dict__tupdatetintR
t	precisiont
resolution(tselfRtkwargstfloat_to_float((RRR sG/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/getlimits.pyt__init__As

cC`s|j|j�S(N(R'R!(R1((sG/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/getlimits.pyt_str_epsXscC`s|j|j�S(N(R'R"(R1((sG/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/getlimits.pyt_str_epsneg\scC`s|j|j�S(N(R'R+(R1((sG/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/getlimits.pyt	_str_xmin`scC`s|j|j�S(N(R'R*(R1((sG/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/getlimits.pyt	_str_xmaxdscC`s|j|j�S(N(R'R0(R1((sG/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/getlimits.pyt_str_resolutionhs(
t__name__t
__module__t__doc__R4tpropertyR5R6R7R8R9(((sG/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/getlimits.pyR>s	tmachepi����tnegepi����tminexpi�tmaxexpititi
tiexpiR%itirndtngrdR!R"R#i�R$i��i��i����i�iig@g�J�g�i���i���i���ii4igJ�g�?ii����i���talltignorei����i@ipii����i����i?t	nextafteri����i����iis��������s��̽sf�s
���������s������Y<��������s��������������Y<s����������������cC`s�tj|�}|dkr0tt|���n|d�jd�j�}tj|�}|dkr�|tj	kr�tj|d �}n|dk	r�|St
jdj||�t
dd�t|�S(s� 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.
    s-0.1t<i
sVSignature {} for {} does not match any known type: falling back to type probe functiont
stackleveliN(R&tgettNonet
ValueErrortreprtnewbyteorderttobytest_KNOWN_TYPEStntypest
longdoubletwarningstwarntformattUserWarningt_discovered_machar(RR tkeytma_like((sG/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/getlimits.pyt_get_machar�s	
c`sKt��t�fd��fd��fd���fd��d�S(sB Create MachAr instance with found information on float types
    c`st|g��S(N(R(R(R(sG/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/getlimits.pyR*Rc`st|j�d��dS(NRi(Rtastype(R(R (sG/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/getlimits.pyR+Rc`stt|�d��S(Ni(RR(R(R(sG/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/getlimits.pyR,Rc`s�dtt|�d��S(NRi(RR(R(RR (sG/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/getlimits.pyR-RR(R&R(R((RR sG/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/getlimits.pyRX&s
cB`s8eZdZiZd�Zd�Zd�Zd�ZRS(sn	
    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.

    cC`s�ytj|�}Wn&tk
r;tjt|��}nX|jj|d�}|dk	ra|S|g}tj|�}||k	r�|j|�|}nt	|tj
�s�td|��n|jj|d�}|dk	r�|St	|tj�s&t
|}||k	r&|j|�|}q&n|jj|d�}|dk	rK|Stj|�j|�}x|D]}||j|<qjW|S(Nsdata type %r not inexact(Rtdtypet	TypeErrorttypet_finfo_cacheRKRLt
obj2sctypetappendt
issubclasstinexactRMtfloatingt_convert_to_floattobjectt__new__t_init(tclsR]tobjtdtypestnewdtypetdt((sG/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/getlimits.pyRhxs:
	
	


cC`sYtj|�|_t|�}x9ddddddgD]}t||t||��q7Wx7ddd	gD]&}t||t||�jd
�qjW|jjd|_|jjd
|_	|j	|_
|jjd
|_|j|_
|j|_||_|jj�|_|jj�|_|jj�|_|jj�|_|jj�|_|S(NR/RCRAR@R?R>R$R0R"ii(RR]R[tsetattrtgetattrtflattitemsizetbitsR#tmaxtminR!RCtnexpRBtnmanttmacharR7tstript	_str_tinyR8t_str_maxR6R5R9(R1R]Rxtword((sG/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/getlimits.pyRi�s*		
$
	cC`sd}||jS(Ns�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
---------------------------------------------------------------
(R,(R1R((sG/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/getlimits.pyt__str__�s
cC`s-|jj}|jj�}||d<d|S(NtklasssZ%(klass)s(resolution=%(resolution)s, min=-%(_str_max)s, max=%(_str_max)s, dtype=%(dtype)s)(t	__class__R:R,R(R1tctd((sG/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/getlimits.pyt__repr__�s

(R:R;R<R`RhRiR}R�(((sG/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/getlimits.pyR1sC	!		cB`s_eZdZiZiZd�Zd�Zee�Zd�Zee�Zd�Z	d�Z
RS(sl
    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

    cC`s�ytj|�|_Wn)tk
rAtjt|��|_nX|jj|_|jjd|_d|j|jf|_|jdkr�td��ndS(Nis%s%dtiusInvalid integer data type.(	RR]R^R_tkindRrRsRYRM(R1tint_type((sG/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/getlimits.pyR4�s
cC`sk|jdkrdSytj|j}Wn9tk
rbtd|jd>�}|tj|j<nX|SdS(sMinimum value of given dtype.tuiiN(R�Rt	_min_valsRYtKeyErrorR.Rs(R1tval((sG/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/getlimits.pyRus
cC`s�ytj|j}Wnetk
r{|jdkrMtd|j>d�}ntd|jd>d�}|tj|j<nX|S(sMaximum value of given dtype.R�i(Rt	_max_valsRYR�R�R.Rs(R1R�((sG/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/getlimits.pyRts
cC`s,d}|i|jd6|jd6|jd6S(sString representation.s�Machine parameters for %(dtype)s
---------------------------------------------------------------
min = %(min)s
max = %(max)s
---------------------------------------------------------------
R]RuRt(R]RuRt(R1R((sG/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/getlimits.pyR}"scC`s#d|jj|j|j|jfS(Ns%s(min=%s, max=%s, dtype=%s)(RR:RuRtR](R1((sG/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/getlimits.pyR�-s(R:R;R<R�R�R4RuR=RtR}R�(((sG/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/getlimits.pyR�s/				g?gp>l	g�<gg�<(GR<t
__future__RRRt__all__RTRxRRRRRRRR	RR
RRRRtcsingletfloat_tcomplex_t	longfloatt
clongfloatRft
_title_fmttdicttint64RVRtint32tlonglongRStint16RR&RgRtfloat16t_f16t_float16_matfloat32t_f32t_float32_matfloat64t_f64t_epsneg_f64t	_tiny_f64t_float64_mat_ldt_epsneg_f128t
_tiny_f128terrstatet
_huge_f128t_float128_mat_epsneg_f80t	_tiny_f80t	_huge_f80t_float80_mathasattrRHR#t_huge_ddt_float_dd_maRQR[RXRR(((sG/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/getlimits.pyt<module>s$		

				1								$		$		-		
	+	�