Your IP : 216.73.216.213


Current Path : /opt/alt/python37/lib64/python3.7/site-packages/Cython/Compiler/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib64/python3.7/site-packages/Cython/Compiler/__pycache__/Pythran.cpython-37.pyc

B

Z��ZN�@s�ddlmZddlmZmZmZddlZdd�Zejdd��Z	d.d
d�Z
ejdd
��Zdd�Z
dd�Zejdd��Zdd�Zdd�Zdd�Zdd�Zdd�Zejd/dd��Zejd d!��Zd"d#�Zejd$d%��Zd&d'�Zejd(d)��Zd*d+�Zd,d-�ZdS)0�)�absolute_import�)�CType�CTypedefType�CStructOrUnionTypeNcCs:x4|dk	r4t|dd�}|r,|j�dd�r,dS|j}qWdS)N�
directivesZ
np_pythranFT)�getattrr�getZouter_scope)�envr�r�J/opt/alt/python37/lib64/python3.7/site-packages/Cython/Compiler/Pythran.py�has_np_pythrans

r
cCst|t�rt|j�S|jS)N)�
isinstancer�is_pythran_supported_typeZtypedef_base_type�
is_numeric)�type_rrr�is_pythran_supported_dtypes

r�ndarraycCs�|jrf|j|j}}t|t�r&|j}n2t|t�r:|��}nt|t�rL|j	}nt
d|��d|||fS|jrr|jS|j
r�|��St
d|t|�f��dS)Nzunsupported type %s!zpythonic::types::%s<%s,%d>z unsupported pythran type %s (%s))Z	is_buffer�ndim�dtyperrZcnamer�
sign_and_namerZ
typedef_cname�
ValueError�is_pythran_expr�pythran_typer�type)ZTy�ptyperr�ctyperrrrs



rcCsd|S)Nz(typename std::remove_reference<%s>::typer)�tyrrr�type_remove_ref0srcCsdt|�|t|�fS)Nz2decltype(std::declval<%s>() %s std::declval<%s>()))r)�opZtAZtBrrr�pythran_binop_type5sr cCsd|t|�fS)Nzdecltype(%sstd::declval<%s>()))r)rrrrr�pythran_unaryop_type:sr!cs0d��fdd�|D��}t|�dkr(dnd|S)N�,csg|]}�|��qSrr)�.0�idx)�
index_coderr�
<listcomp>Asz!_index_access.<locals>.<listcomp>rz[%s]z(%s))�join�len)r%�indicesZindexingr)r%r�
_index_access?sr*cCsr|\}}|jr@|jjr d}d}nd}d}d|d�dg|�fS|jrRd|��S|jrbd|jStd	|��dS)
N�contiguous_slice��slice�zpythonic::types::%s(%s)r"�0zstd::declval<%s>()zunsupported indexing type %s!)	�is_slice�step�is_noner'�is_intrrrr)Zindex_with_typer$�
index_type�func�nrrr�_index_type_codeEs
r7cCs�|jrP|j|j|jf}|jjr0d}|dd�}nd}d|d�dd�|D��fS|jjr`t|�S|jj	rp|�
�Std|j��dS)	Nr+r,r-zpythonic::types::%s(%s)r"css|]}|��VqdS)N)�pythran_result)r#�vrrr�	<genexpr>`sz_index_code.<locals>.<genexpr>zunsupported indexing type %s)r0�start�stopr1r2r'rr3�
to_pythranrr8r)r$�valuesr5rrr�_index_codeWsr?cCstdt|�tt|�f�S)Nzdecltype(std::declval<%s>()%s))rrr*r7)rr)rrr�pythran_indexing_typehsr@cCs
tt|�S)N)r*r?)r)rrr�pythran_indexing_codeosrAcCs d�dd�|D��}d||fS)Nr"css|]}dt|j�VqdS)zstd::declval<%s>()N)rr)r#�arrrr:tsz$pythran_func_type.<locals>.<genexpr>z,decltype(pythonic::numpy::functor::%s{}(%s)))r')r5�argsrrr�pythran_func_typessrDcCsj|j}|jr|�|���St|ddddg�r4|��S|jr>dS|dkrNt|�}|jjsZt�d||�	�fS)Nrr�is_float�
is_complexzpythonic::__builtin__::Nonezfrom_python<%s>(%s))
rr3Z	cast_code�result�is_typer2rZis_pyobject�AssertionErrorZ	py_result)rrZop_typerrrr=xsr=cCs"x|D]}t||d�rdSqWdS)NFT)r)r�types�attrrrrrH�s
rHcCs|jpt|j�S)N)r2rr)�noderrr�!is_pythran_supported_node_or_none�srMcCsd}t||�pt|�S)N)rr3rrEr2rF)rHr)r�pythran_supportedrrrr�srcCsd}t||�pt|�S)N)rr3rrErF)rHr)rrNrrr�#is_pythran_supported_operation_type�srOcCs|jS)N)r)rrrrr�srcCs"|jo t|j�o |jdko |jS)N)�cZstrided)Zis_numpy_bufferrr�mode�cast)rrrr�is_pythran_buffer�srScCs||�d�|�d�|�d�|�d�|�d�x(dD] }|�d|�|�d|�q8Wxd	D]}|�d
|�qbWdS)Nzpythonic/core.hppzpythonic/python/core.hppzpythonic/types/bool.hppzpythonic/types/ndarray.hppz<new>)��� �@zpythonic/types/uint%d.hppzpythonic/types/int%d.hpp)�floatZfloat32Zfloat64�setr-�tuple�int�long�complexZ	complex64Z
complex128zpythonic/types/%s.hpp)Zadd_include_file)r
�i�trrr�include_pythran_generic�s






r`)r)N)�
__future__rZ
PyrexTypesrrr�cythonr
�ccallrr�cfuncrr r!r*r7r?r@rArDr=rHrMrrOrrSr`rrrr�<module>s.