Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

cython stl class

sage complains about importing the following spyx file:

from libcpp cimport vector as vec

cdef test_vector(): 
cdef vec[int] vect 
cdef int i 
for i in range(10): 
    vect.push_back(i) 
for i in range(10): 
    print vect[i]

I have no problem translating a pyx file with the same contents with cython and generating a module with test_vector ... . What is the right way to access the stl cpp vector class in a pyx file?

cython stl class

sage complains about importing the following spyx file:

from libcpp cimport vector as vec

vec
cdef test_vector(): 
cdef vec[int] vect 
cdef int i 
for i in range(10): 
    vect.push_back(i) 
for i in range(10): 
    print vect[i]

I have no problem translating a pyx file with the same contents with cython and generating a module with test_vector ... . What is the right way to access the stl cpp vector class in a pyx file?

cython stl class

sage complains about importing the following spyx file:

from libcpp libcpp.vector cimport vector as vec

cdef test_vector(): 
cdef vec[int] vect 
cdef int i 
for i in range(10): 
    vect.push_back(i) 
for i in range(10): 
    print vect[i]

I have no problem translating a pyx file with the same contents with cython and generating a module with test_vector ... . What is the right way to access the stl cpp vector class in a pyx file?

cython stl class

sage complains about importing the following spyx file:

from libcpp.vector cimport vector as vec

cdef test_vector(): 
 cdef vec[int] vect 
 cdef int i 
 for i in range(10): 
     vect.push_back(i) 
 for i in range(10): 
     print vect[i]

I have no problem translating a pyx file with the same contents with cython and generating a module with test_vector ... . What is the right way to access the stl cpp vector class in a pyx file?