Skip to content

Commit 19f4140

Browse files
committed
core: add new signature for call_PyArray_New
1 parent ee3370b commit 19f4140

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

include/eigenpy/numpy.hpp

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2020-2021 INRIA
2+
* Copyright 2020-2022 INRIA
33
*/
44

55
#ifndef __eigenpy_numpy_hpp__
@@ -109,6 +109,11 @@ EIGENPY_DLLAPI PyObject* call_PyArray_New(PyTypeObject* py_type_ptr, int nd,
109109
npy_intp* shape, int np_type,
110110
void* data_ptr, int options);
111111

112+
EIGENPY_DLLAPI PyObject* call_PyArray_New(PyTypeObject* py_type_ptr, int nd,
113+
npy_intp* shape, int np_type,
114+
npy_intp const* strides,
115+
void* data_ptr, int options);
116+
112117
EIGENPY_DLLAPI int call_PyArray_ObjectType(PyObject*, int);
113118

114119
EIGENPY_DLLAPI PyTypeObject* getPyArrayType();
@@ -143,6 +148,14 @@ inline PyObject* call_PyArray_New(PyTypeObject* py_type_ptr, int nd,
143148
options, NULL);
144149
}
145150

151+
inline PyObject* call_PyArray_New(PyTypeObject* py_type_ptr, int nd,
152+
npy_intp* shape, int np_type,
153+
npy_intp const* strides, void* data_ptr,
154+
int options) {
155+
return PyArray_New(py_type_ptr, nd, shape, np_type, strides, data_ptr, 0,
156+
options, NULL);
157+
}
158+
146159
inline int call_PyArray_ObjectType(PyObject* obj, int val) {
147160
return PyArray_ObjectType(obj, val);
148161
}

src/numpy.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2020-2021 INRIA
2+
* Copyright 2020-2022 INRIA
33
*/
44

55
#include "eigenpy/numpy.hpp"
@@ -31,6 +31,13 @@ PyObject* call_PyArray_New(PyTypeObject* py_type_ptr, int nd, npy_intp* shape,
3131
options, NULL);
3232
}
3333

34+
PyObject* call_PyArray_New(PyTypeObject* py_type_ptr, int nd, npy_intp* shape,
35+
int np_type, npy_intp const* strides, void* data_ptr,
36+
int options) {
37+
return PyArray_New(py_type_ptr, nd, shape, np_type, strides, data_ptr, 0,
38+
options, NULL);
39+
}
40+
3441
int call_PyArray_ObjectType(PyObject* obj, int val) {
3542
return PyArray_ObjectType(obj, val);
3643
}

0 commit comments

Comments
 (0)