summaryrefslogtreecommitdiffstats
path: root/src/cython/_common_decl.pyx
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 11:57:42 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 11:57:42 +0000
commit61f3ab8f23f4c924d455757bf3e65f8487521b5a (patch)
tree885599a36a308f422af98616bc733a0494fe149a /src/cython/_common_decl.pyx
parentInitial commit. (diff)
downloadlib2geom-61f3ab8f23f4c924d455757bf3e65f8487521b5a.tar.xz
lib2geom-61f3ab8f23f4c924d455757bf3e65f8487521b5a.zip
Adding upstream version 1.3.upstream/1.3upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/cython/_common_decl.pyx')
-rw-r--r--src/cython/_common_decl.pyx12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/cython/_common_decl.pyx b/src/cython/_common_decl.pyx
new file mode 100644
index 0000000..1f1544e
--- /dev/null
+++ b/src/cython/_common_decl.pyx
@@ -0,0 +1,12 @@
+cdef object wrap_vector_double(vector[double] v):
+ r = []
+ cdef unsigned int i
+ for i in range(v.size()):
+ r.append(v[i])
+ return r
+
+cdef vector[double] make_vector_double(object l):
+ cdef vector[double] ret
+ for i in l:
+ ret.push_back( float(i) )
+ return ret