File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -346,6 +346,27 @@ namespace eigenpy
346346 template <typename MatType>
347347 struct EigenFromPy
348348 {
349+
350+ static bool isScalarConvertible (const int np_type)
351+ {
352+ if (NumpyEquivalentType<typename MatType::Scalar>::type_code == np_type)
353+ return true ;
354+
355+ switch (np_type)
356+ {
357+ case NPY_INT:
358+ return FromTypeToType<int ,typename MatType::Scalar>::value;
359+ case NPY_LONG:
360+ return FromTypeToType<long ,typename MatType::Scalar>::value;
361+ case NPY_FLOAT:
362+ return FromTypeToType<float ,typename MatType::Scalar>::value;
363+ case NPY_DOUBLE:
364+ return FromTypeToType<double ,typename MatType::Scalar>::value;
365+ default :
366+ return false ;
367+ }
368+ }
369+
349370 // / \brief Determine if pyObj can be converted into a MatType object
350371 static void * convertible (PyArrayObject* pyArray)
351372 {
You can’t perform that action at this time.
0 commit comments