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
Stack Of Tasks
eigenpy
Commits
53563e52
Verified
Commit
53563e52
authored
5 years ago
by
Justin Carpentier
Browse files
Options
Downloads
Patches
Plain Diff
core: full templatization of Eigen::Map
parent
9872bfb9
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
include/eigenpy/eigen-allocator.hpp
+5
-5
5 additions, 5 deletions
include/eigenpy/eigen-allocator.hpp
include/eigenpy/eigen-from-python.hpp
+13
-13
13 additions, 13 deletions
include/eigenpy/eigen-from-python.hpp
include/eigenpy/numpy-allocator.hpp
+4
-4
4 additions, 4 deletions
include/eigenpy/numpy-allocator.hpp
with
22 additions
and
22 deletions
include/eigenpy/eigen-allocator.hpp
+
5
−
5
View file @
53563e52
...
@@ -204,10 +204,10 @@ namespace eigenpy
...
@@ -204,10 +204,10 @@ namespace eigenpy
};
};
#if EIGEN_VERSION_AT_LEAST(3,2,0)
#if EIGEN_VERSION_AT_LEAST(3,2,0)
template
<
typename
MatType
>
template
<
typename
MatType
,
int
Options
,
typename
Stride
>
struct
EigenAllocator
<
Eigen
::
Ref
<
MatType
>
>
struct
EigenAllocator
<
Eigen
::
Ref
<
MatType
,
Options
,
Stride
>
>
{
{
typedef
Eigen
::
Ref
<
MatType
>
RefType
;
typedef
Eigen
::
Ref
<
MatType
,
Options
,
Stride
>
RefType
;
typedef
typename
MatType
::
Scalar
Scalar
;
typedef
typename
MatType
::
Scalar
Scalar
;
typedef
typename
::
boost
::
python
::
detail
::
referent_storage
<
RefType
&>::
StorageType
StorageType
;
typedef
typename
::
boost
::
python
::
detail
::
referent_storage
<
RefType
&>::
StorageType
StorageType
;
...
@@ -215,7 +215,7 @@ namespace eigenpy
...
@@ -215,7 +215,7 @@ namespace eigenpy
static
void
allocate
(
PyArrayObject
*
pyArray
,
static
void
allocate
(
PyArrayObject
*
pyArray
,
bp
::
converter
::
rvalue_from_python_storage
<
RefType
>
*
storage
)
bp
::
converter
::
rvalue_from_python_storage
<
RefType
>
*
storage
)
{
{
typedef
typename
StrideType
<
MatType
,
Eigen
::
internal
::
traits
<
RefType
>::
StrideType
::
InnerStrideAtCompileTime
,
Eigen
::
internal
::
traits
<
RefType
>::
StrideType
::
OuterStrideAtCompileTime
>::
type
Stride
;
typedef
typename
StrideType
<
MatType
,
Eigen
::
internal
::
traits
<
RefType
>::
StrideType
::
InnerStrideAtCompileTime
,
Eigen
::
internal
::
traits
<
RefType
>::
StrideType
::
OuterStrideAtCompileTime
>::
type
NumpyMap
Stride
;
bool
need_to_allocate
=
false
;
bool
need_to_allocate
=
false
;
const
int
pyArray_Type
=
EIGENPY_GET_PY_ARRAY_TYPE
(
pyArray
);
const
int
pyArray_Type
=
EIGENPY_GET_PY_ARRAY_TYPE
(
pyArray
);
...
@@ -278,7 +278,7 @@ namespace eigenpy
...
@@ -278,7 +278,7 @@ namespace eigenpy
else
else
{
{
assert
(
pyArray_Type
==
NumpyEquivalentType
<
Scalar
>::
type_code
);
assert
(
pyArray_Type
==
NumpyEquivalentType
<
Scalar
>::
type_code
);
typename
MapNumpy
<
MatType
,
Scalar
,
Stride
>::
EigenMap
numpyMap
=
MapNumpy
<
MatType
,
Scalar
,
Stride
>::
map
(
pyArray
);
typename
MapNumpy
<
MatType
,
Scalar
,
NumpyMap
Stride
>::
EigenMap
numpyMap
=
MapNumpy
<
MatType
,
Scalar
,
NumpyMap
Stride
>::
map
(
pyArray
);
RefType
mat_ref
(
numpyMap
);
RefType
mat_ref
(
numpyMap
);
new
(
raw_ptr
)
StorageType
(
mat_ref
,
pyArray
);
new
(
raw_ptr
)
StorageType
(
mat_ref
,
pyArray
);
}
}
...
...
This diff is collapsed.
Click to expand it.
include/eigenpy/eigen-from-python.hpp
+
13
−
13
View file @
53563e52
...
@@ -35,12 +35,12 @@ namespace eigenpy
...
@@ -35,12 +35,12 @@ namespace eigenpy
};
};
#if EIGEN_VERSION_AT_LEAST(3,2,0)
#if EIGEN_VERSION_AT_LEAST(3,2,0)
template
<
typename
MatType
>
struct
referent_storage_eigen_ref
;
template
<
typename
MatType
,
int
Options
,
typename
Stride
>
struct
referent_storage_eigen_ref
;
template
<
typename
MatType
>
template
<
typename
MatType
,
int
Options
,
typename
Stride
>
struct
referent_storage_eigen_ref
struct
referent_storage_eigen_ref
{
{
typedef
Eigen
::
Ref
<
MatType
>
RefType
;
typedef
Eigen
::
Ref
<
MatType
,
Options
,
Stride
>
RefType
;
typedef
::
boost
::
python
::
detail
::
aligned_storage
<
typedef
::
boost
::
python
::
detail
::
aligned_storage
<
::
boost
::
python
::
detail
::
referent_size
<
RefType
&>::
value
::
boost
::
python
::
detail
::
referent_size
<
RefType
&>::
value
...
@@ -89,10 +89,10 @@ namespace eigenpy
...
@@ -89,10 +89,10 @@ namespace eigenpy
namespace
boost
{
namespace
python
{
namespace
detail
{
namespace
boost
{
namespace
python
{
namespace
detail
{
#if EIGEN_VERSION_AT_LEAST(3,2,0)
#if EIGEN_VERSION_AT_LEAST(3,2,0)
template
<
typename
MatType
>
template
<
typename
MatType
,
int
Options
,
typename
Stride
>
struct
referent_storage
<
Eigen
::
Ref
<
MatType
>
&>
struct
referent_storage
<
Eigen
::
Ref
<
MatType
,
Options
,
Stride
>
&>
{
{
typedef
::
eigenpy
::
details
::
referent_storage_eigen_ref
<
MatType
>
StorageType
;
typedef
::
eigenpy
::
details
::
referent_storage_eigen_ref
<
MatType
,
Options
,
Stride
>
StorageType
;
typedef
aligned_storage
<
typedef
aligned_storage
<
::
boost
::
python
::
detail
::
referent_size
<
StorageType
&>::
value
::
boost
::
python
::
detail
::
referent_size
<
StorageType
&>::
value
>
type
;
>
type
;
...
@@ -166,10 +166,10 @@ namespace boost { namespace python { namespace converter {
...
@@ -166,10 +166,10 @@ namespace boost { namespace python { namespace converter {
#undef RVALUE_FROM_PYTHON_DATA_INIT
#undef RVALUE_FROM_PYTHON_DATA_INIT
template
<
typename
MatType
>
template
<
typename
MatType
,
int
Options
,
typename
Stride
>
struct
rvalue_from_python_data
<
Eigen
::
Ref
<
MatType
>
&>
:
rvalue_from_python_storage
<
Eigen
::
Ref
<
MatType
>
&>
struct
rvalue_from_python_data
<
Eigen
::
Ref
<
MatType
,
Options
,
Stride
>
&>
:
rvalue_from_python_storage
<
Eigen
::
Ref
<
MatType
,
Options
,
Stride
>
&>
{
{
typedef
Eigen
::
Ref
<
MatType
>
T
;
typedef
Eigen
::
Ref
<
MatType
,
Options
,
Stride
>
T
;
# if (!defined(__MWERKS__) || __MWERKS__ >= 0x3000) \
# if (!defined(__MWERKS__) || __MWERKS__ >= 0x3000) \
&& (!defined(__EDG_VERSION__) || __EDG_VERSION__ >= 245) \
&& (!defined(__EDG_VERSION__) || __EDG_VERSION__ >= 245) \
...
@@ -196,7 +196,7 @@ namespace boost { namespace python { namespace converter {
...
@@ -196,7 +196,7 @@ namespace boost { namespace python { namespace converter {
// Destroys any object constructed in the storage.
// Destroys any object constructed in the storage.
~
rvalue_from_python_data
()
~
rvalue_from_python_data
()
{
{
typedef
::
eigenpy
::
details
::
referent_storage_eigen_ref
<
MatType
>
StorageType
;
typedef
::
eigenpy
::
details
::
referent_storage_eigen_ref
<
MatType
,
Options
,
Stride
>
StorageType
;
if
(
this
->
stage1
.
convertible
==
this
->
storage
.
bytes
)
if
(
this
->
stage1
.
convertible
==
this
->
storage
.
bytes
)
static_cast
<
StorageType
*>
((
void
*
)
this
->
storage
.
bytes
)
->~
StorageType
();
static_cast
<
StorageType
*>
((
void
*
)
this
->
storage
.
bytes
)
->~
StorageType
();
}
}
...
@@ -418,10 +418,10 @@ namespace eigenpy
...
@@ -418,10 +418,10 @@ namespace eigenpy
#if EIGEN_VERSION_AT_LEAST(3,2,0)
#if EIGEN_VERSION_AT_LEAST(3,2,0)
template
<
typename
MatType
,
int
Options
,
typename
Stride
Type
>
template
<
typename
MatType
,
int
Options
,
typename
Stride
>
struct
EigenFromPy
<
Eigen
::
Ref
<
MatType
,
Options
,
Stride
Type
>
>
struct
EigenFromPy
<
Eigen
::
Ref
<
MatType
,
Options
,
Stride
>
>
{
{
typedef
Eigen
::
Ref
<
MatType
,
Options
,
Stride
Type
>
RefType
;
typedef
Eigen
::
Ref
<
MatType
,
Options
,
Stride
>
RefType
;
typedef
typename
MatType
::
Scalar
Scalar
;
typedef
typename
MatType
::
Scalar
Scalar
;
/// \brief Determine if pyObj can be converted into a MatType object
/// \brief Determine if pyObj can be converted into a MatType object
...
...
This diff is collapsed.
Click to expand it.
include/eigenpy/numpy-allocator.hpp
+
4
−
4
View file @
53563e52
...
@@ -52,8 +52,8 @@ namespace eigenpy
...
@@ -52,8 +52,8 @@ namespace eigenpy
#if EIGEN_VERSION_AT_LEAST(3,2,0)
#if EIGEN_VERSION_AT_LEAST(3,2,0)
template
<
typename
MatType
>
template
<
typename
MatType
,
int
Options
,
typename
Stride
>
struct
NumpyAllocator
<
Eigen
::
Ref
<
MatType
>
>
:
NumpyAllocator
<
MatType
&>
struct
NumpyAllocator
<
Eigen
::
Ref
<
MatType
,
Options
,
Stride
>
>
:
NumpyAllocator
<
MatType
&>
{
{
};
};
...
@@ -81,8 +81,8 @@ namespace eigenpy
...
@@ -81,8 +81,8 @@ namespace eigenpy
#if EIGEN_VERSION_AT_LEAST(3,2,0)
#if EIGEN_VERSION_AT_LEAST(3,2,0)
template
<
typename
MatType
>
template
<
typename
MatType
,
int
Options
,
typename
Stride
>
struct
NumpyAllocator
<
const
Eigen
::
Ref
<
const
MatType
>
>
:
NumpyAllocator
<
const
MatType
&>
struct
NumpyAllocator
<
const
Eigen
::
Ref
<
const
MatType
,
Options
,
Stride
>
>
:
NumpyAllocator
<
const
MatType
&>
{
{
};
};
...
...
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