Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
E
eigenpy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Guilhem Saurel
eigenpy
Commits
c3e322eb
Verified
Commit
c3e322eb
authored
3 years ago
by
Justin Carpentier
Browse files
Options
Downloads
Patches
Plain Diff
core: fix user declaration according to new NumPy API 1.20
parent
4879a795
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
include/eigenpy/numpy.hpp
+9
-3
9 additions, 3 deletions
include/eigenpy/numpy.hpp
include/eigenpy/user-type.hpp
+3
-0
3 additions, 0 deletions
include/eigenpy/user-type.hpp
src/numpy.cpp
+10
-0
10 additions, 0 deletions
src/numpy.cpp
with
22 additions
and
3 deletions
include/eigenpy/numpy.hpp
+
9
−
3
View file @
c3e322eb
...
@@ -21,10 +21,10 @@
...
@@ -21,10 +21,10 @@
#if defined _WIN32 || defined __CYGWIN__
#if defined _WIN32 || defined __CYGWIN__
#define EIGENPY_GET_PY_ARRAY_TYPE(array) \
#define EIGENPY_GET_PY_ARRAY_TYPE(array) \
call_PyArray_
ObjectType(reinterpret_cast<PyObject *>(array), 0)
call_PyArray_
MinScalarType(array)->type_num
#else
#else
#define EIGENPY_GET_PY_ARRAY_TYPE(array) \
#define EIGENPY_GET_PY_ARRAY_TYPE(array) \
PyArray_
ObjectType(reinterpret_cast<PyObject *>(array), 0)
PyArray_
MinScalarType(array)->type_num
#endif
#endif
namespace
eigenpy
namespace
eigenpy
...
@@ -51,6 +51,10 @@ namespace eigenpy
...
@@ -51,6 +51,10 @@ namespace eigenpy
EIGENPY_DLLAPI
void
call_PyArray_InitArrFuncs
(
PyArray_ArrFuncs
*
funcs
);
EIGENPY_DLLAPI
void
call_PyArray_InitArrFuncs
(
PyArray_ArrFuncs
*
funcs
);
EIGENPY_DLLAPI
int
call_PyArray_RegisterDataType
(
PyArray_Descr
*
dtype
);
EIGENPY_DLLAPI
int
call_PyArray_RegisterDataType
(
PyArray_Descr
*
dtype
);
EIGENPY_DLLAPI
int
call_PyArray_RegisterCanCast
(
PyArray_Descr
*
descr
,
int
totype
,
NPY_SCALARKIND
scalar
);
EIGENPY_DLLAPI
PyArray_Descr
*
call_PyArray_MinScalarType
(
PyArrayObject
*
arr
);
}
}
#else
#else
#define call_PyArray_Check(py_obj) PyArray_Check(py_obj)
#define call_PyArray_Check(py_obj) PyArray_Check(py_obj)
...
@@ -59,8 +63,10 @@ namespace eigenpy
...
@@ -59,8 +63,10 @@ namespace eigenpy
PyArray_New(py_type_ptr,nd,shape,np_type,NULL,data_ptr,0,options,NULL)
PyArray_New(py_type_ptr,nd,shape,np_type,NULL,data_ptr,0,options,NULL)
#define getPyArrayType() &PyArray_Type
#define getPyArrayType() &PyArray_Type
#define call_PyArray_DescrFromType(typenum) PyArray_DescrFromType(typenum)
#define call_PyArray_DescrFromType(typenum) PyArray_DescrFromType(typenum)
#define call_PyArray_MinScalarType(py_arr) PyArray_MinScalarType(py_arr)
#define call_PyArray_InitArrFuncs(funcs) PyArray_InitArrFuncs(funcs)
#define call_PyArray_InitArrFuncs(funcs) PyArray_InitArrFuncs(funcs)
#define call_PyArray_RegisterDataType(dtype) PyArray_RegisterDataType(dtype)
#define call_PyArray_RegisterDataType(dtype) PyArray_RegisterDataType(dtype)
#define call_PyArray_RegisterCanCast(descr,totype,scalar) PyArray_RegisterCanCast(descr,totype,scalar)
#endif
#endif
#endif // ifndef __eigenpy_numpy_hpp__
#endif // ifndef __eigenpy_numpy_hpp__
This diff is collapsed.
Click to expand it.
include/eigenpy/user-type.hpp
+
3
−
0
View file @
c3e322eb
...
@@ -198,6 +198,9 @@ namespace eigenpy
...
@@ -198,6 +198,9 @@ namespace eigenpy
copyswap
,
copyswapn
,
copyswap
,
copyswapn
,
dotfunc
);
dotfunc
);
call_PyArray_RegisterCanCast
(
call_PyArray_DescrFromType
(
NPY_OBJECT
),
code
,
NPY_NOSCALAR
);
return
code
;
return
code
;
}
}
...
...
This diff is collapsed.
Click to expand it.
src/numpy.cpp
+
10
−
0
View file @
c3e322eb
...
@@ -58,6 +58,16 @@ namespace eigenpy
...
@@ -58,6 +58,16 @@ namespace eigenpy
{
{
return
PyArray_RegisterDataType
(
dtype
);
return
PyArray_RegisterDataType
(
dtype
);
}
}
PyArray_Descr
*
call_PyArray_MinScalarType
(
PyArrayObject
*
arr
)
{
return
PyArray_MinScalarType
(
arr
);
}
int
call_PyArray_RegisterCanCast
(
PyArray_Descr
*
descr
,
int
totype
,
NPY_SCALARKIND
scalar
)
{
return
PyArray_RegisterCanCast
(
descr
,
totype
,
scalar
);
}
#endif
#endif
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment