3
0
mirror of https://github.com/triqs/dft_tools synced 2024-12-27 14:53:39 +01:00
dft_tools/test/pytriqs/arrays/array_cython.pyx
Olivier Parcollet f2c7d449cc First commit : triqs libs version 1.0 alpha1
for earlier commits, see TRIQS0.x repository.
2013-07-17 19:24:07 +02:00

29 lines
748 B
Cython

#!python
#cython: embedsignature=True
from cython.operator cimport dereference as deref, preincrement as inc #dereference and increment operators
cimport cython
import numpy
import string
import warnings
from dcomplex cimport *
from arrays cimport *
#from libcpp.vector cimport vector
#from libcpp.string cimport string as std_string
#from extractor cimport *
cdef extern from "./f.hpp" :
cdef void f_c2 "f2" ( array_view[long,TWO] & )
cdef void f_c "f" ( array_view[long,THREE] & )
def f(A) :
print "---- calling f-------------"
print " A[:,:,0] = \n", A[:,:,0]
print " A[:,:,1] = \n", A[:,:,1]
f_c(array_view[long,THREE](A))
#f_c(array_view[long,TWO](A))
print "---- END calling f-------------"