Your IP : 216.73.216.213


Current Path : /opt/alt/python35/lib64/python3.5/site-packages/Cython/Compiler/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib64/python3.5/site-packages/Cython/Compiler/__pycache__/Pythran.cpython-35.pyc



Z��ZN�@sqddlmZddlmZmZmZddlZdd�Zejdd��Z	d	d
d�Z
ejdd
��Zdd�Z
dd�Zejdd��Zdd�Zdd�Zdd�Zdd�Zdd�Zejddd��Zejd d!��Zd"d#�Zejd$d%��Zd&d'�Zejd(d)��Zd*d+�Zd,d-�ZdS).�)�absolute_import�)�CType�CTypedefType�CStructOrUnionTypeNcCsQxJ|dk	rLt|dd�}|r@|jjdd�r@dS|j}qWdS)N�
directivesZ
np_pythranFT)�getattrr�getZouter_scope)�envr�r�J/opt/alt/python35/lib64/python3.5/site-packages/Cython/Compiler/Pythran.py�has_np_pythrans
r
cCs#t|t�rt|j�S|jS)N)�
isinstancer�is_pythran_supported_typeZtypedef_base_type�
is_numeric)�type_rrr�is_pythran_supported_dtypes
rZndarraycCs�|jr�|j|j}}t|t�r7|j}nIt|t�rU|j�}n+t|t�rp|j	}nt
d|��d|||fS|jr�|jS|j
r�|j�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_type5srcCsd|t|�fS)Nzdecltype(%sstd::declval<%s>()))r)rrrrr�pythran_unaryop_type:sr csBdj�fdd�|D��}t|�dkr:dnd|S)N�,csg|]}�|��qSrr)�.0�idx)�
index_coderr�
<listcomp>As	z!_index_access.<locals>.<listcomp>rz[%s]z(%s))�join�len)r$�indicesZindexingr)r$r�
_index_access?s"r)cCs�|\}}|jrZ|jjr0d}d}nd}d}d|djdg|�fS|jrqd|j�S|jr�d|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				r6cCs�|jrp|j|j|jf}|jjrFd}|dd�}nd}d|djdd�|D��fS|jjr�t|�S|jj	r�|j
�Std|j��dS)	Nr*r+r,zpythonic::types::%s(%s)r!css|]}|j�VqdS)N)�pythran_result)r"�vrrr�	<genexpr>`sz_index_code.<locals>.<genexpr>zunsupported indexing type %s)r/�start�stopr0r1r&rr2�
to_pythranrr7r)r#�valuesr4rrr�_index_codeWs	!

r>cCs#tdt|�tt|�f�S)Nzdecltype(std::declval<%s>()%s))rrr)r6)rr(rrr�pythran_indexing_typehs	r?cCs
tt|�S)N)r)r>)r(rrr�pythran_indexing_codeosr@cCs*djdd�|D��}d||fS)Nr!css"|]}dt|j�VqdS)zstd::declval<%s>()N)rr)r"�arrrr9tsz$pythran_func_type.<locals>.<genexpr>z,decltype(pythonic::numpy::functor::%s{}(%s)))r&)r4�argsrrr�pythran_func_typessrCcCs�|j}|jr%|j|j��St|ddddg�rJ|j�S|jrWdS|dkrot|�}|jjs�t�d||j	�fS)Nrr�is_float�
is_complexzpythonic::__builtin__::Nonezfrom_python<%s>(%s))
rr2Z	cast_code�result�is_typer1rZis_pyobject�AssertionErrorZ	py_result)rrZop_typerrrr<xs		
	r<cCs+x$|D]}t||d�rdSqWdS)NFT)r)r�types�attrrrrrG�s
rGcCs|jpt|j�S)N)r1rr)�noderrr�!is_pythran_supported_node_or_none�srLcCsd}t||�pt|�S)Nrr2rrDr1rE)rr2rrDr1rE)rGr)r�pythran_supportedrrrr�srcCsd}t||�pt|�S)Nrr2rrDrE)rr2rrDrE)rGr)rrMrrr�#is_pythran_supported_operation_type�srNcCs|jS)N)r)rrrrr�srcCs/|jo.t|j�o.|jdko.|jS)N�c�strided)rOrP)Zis_numpy_bufferrr�mode�cast)rrrr�is_pythran_buffer�srScCs�|jd�|jd�|jd�|jd�|jd�x0dD](}|jd
|�|jd|�qHWxdD]}|jd|�q{WdS)Nzpythonic/core.hppzpythonic/python/core.hppzpythonic/types/bool.hppzpythonic/types/ndarray.hppz<new>��� �@zpythonic/types/uint%d.hppzpythonic/types/int%d.hpp�float�float32�float64�setr,�tuple�int�long�complex�	complex64�
complex128zpythonic/types/%s.hpp)rTrUrVrW)rXrYrZr[r,r\r]r^r_r`ra)Zadd_include_file)r
�i�trrr�include_pythran_generic�s






rd)�
__future__rZ
PyrexTypesrrr�cythonr
�ccallrr�cfuncrrr r)r6r>r?r@rCr<rGrLrrNrrSrdrrrr�<module>s.