Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Stack Of Tasks
eigenpy
Commits
584dbe32
Unverified
Commit
584dbe32
authored
Dec 09, 2019
by
Justin Carpentier
Committed by
GitHub
Dec 09, 2019
Browse files
Merge pull request #137 from jcarpent/devel
Fix important bug in 1.6.10
parents
7233fade
7631a42f
Changes
2
Hide whitespace changes
Inline
Side-by-side
include/eigenpy/details.hpp
View file @
584dbe32
...
...
@@ -16,6 +16,41 @@
#include
"eigenpy/registration.hpp"
#include
"eigenpy/map.hpp"
namespace
boost
{
namespace
python
{
namespace
converter
{
template
<
class
MatType
>
struct
implicit
<
Eigen
::
MatrixBase
<
MatType
>
,
MatType
>
{
typedef
Eigen
::
MatrixBase
<
MatType
>
Source
;
typedef
MatType
Target
;
static
void
*
convertible
(
PyObject
*
obj
)
{
// Find a converter which can produce a Source instance from
// obj. The user has told us that Source can be converted to
// Target, and instantiating construct() below, ensures that
// at compile-time.
return
implicit_rvalue_convertible_from_python
(
obj
,
registered
<
Source
>::
converters
)
?
obj
:
0
;
}
static
void
construct
(
PyObject
*
obj
,
rvalue_from_python_stage1_data
*
data
)
{
void
*
storage
=
((
rvalue_from_python_storage
<
Target
>*
)
data
)
->
storage
.
bytes
;
arg_from_python
<
Source
>
get_source
(
obj
);
bool
convertible
=
get_source
.
convertible
();
BOOST_VERIFY
(
convertible
);
new
(
storage
)
Target
(
get_source
().
derived
());
// record successful construction
data
->
convertible
=
storage
;
}
};
}}}
// namespace boost::python::converter
#define GET_PY_ARRAY_TYPE(array) PyArray_ObjectType(reinterpret_cast<PyObject *>(array), 0)
namespace
eigenpy
...
...
@@ -531,13 +566,13 @@ namespace eigenpy
// Add also conversion to Eigen::MatrixBase<MatType>
typedef
Eigen
::
MatrixBase
<
MatType
>
MatTypeBase
;
// bp::implicitly_convertible<MatTypeBase,MatType>();
bp
::
implicitly_convertible
<
MatType
,
MatTypeBase
>
();
bp
::
implicitly_convertible
<
MatTypeBase
,
MatType
>
();
}
};
#if EIGEN_VERSION_AT_LEAST(3,2,0)
//
/
Template specialization for Eigen::Ref
// Template specialization for Eigen::Ref
template
<
typename
MatType
>
struct
EigenFromPyConverter
<
eigenpy
::
Ref
<
MatType
>
>
{
...
...
python/CMakeLists.txt
View file @
584dbe32
...
...
@@ -55,7 +55,9 @@ SET(PYTHON_FILES
)
FOREACH
(
python
${
PYTHON_FILES
}
)
PYTHON_BUILD
(
${
PROJECT_NAME
}
${
python
}
)
IF
(
NOT WIN32
)
PYTHON_BUILD
(
${
PROJECT_NAME
}
${
python
}
)
ENDIF
()
INSTALL
(
FILES
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/eigenpy/
${
python
}
"
DESTINATION
${${
PYWRAP
}
_INSTALL_DIR
}
)
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment