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
37d7fac5
Unverified
Commit
37d7fac5
authored
May 06, 2022
by
Justin Carpentier
Committed by
GitHub
May 06, 2022
Browse files
Merge pull request #283 from jcarpent/devel
Fix RowMajor case for Eigen::Ref
parents
a9653f10
471b8d65
Pipeline
#18563
passed with stage
in 1 minute and 56 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
include/eigenpy/numpy-allocator.hpp
View file @
37d7fac5
...
...
@@ -70,8 +70,11 @@ struct NumpyAllocator<Eigen::Ref<MatType, Options, Stride> > {
if
(
NumpyType
::
sharedMemory
())
{
const
int
Scalar_type_code
=
Register
::
getTypeCode
<
Scalar
>
();
Eigen
::
DenseIndex
inner_stride
=
mat
.
innerStride
(),
outer_stride
=
mat
.
outerStride
();
Eigen
::
DenseIndex
inner_stride
=
MatType
::
IsRowMajor
?
mat
.
outerStride
()
:
mat
.
innerStride
(),
outer_stride
=
MatType
::
IsRowMajor
?
mat
.
innerStride
()
:
mat
.
outerStride
();
const
int
elsize
=
call_PyArray_DescrFromType
(
Scalar_type_code
)
->
elsize
;
npy_intp
strides
[
2
]
=
{
elsize
*
inner_stride
,
elsize
*
outer_stride
};
...
...
@@ -131,8 +134,11 @@ struct NumpyAllocator<const Eigen::Ref<const MatType, Options, Stride> > {
if
(
NumpyType
::
sharedMemory
())
{
const
int
Scalar_type_code
=
Register
::
getTypeCode
<
Scalar
>
();
Eigen
::
DenseIndex
inner_stride
=
mat
.
innerStride
(),
outer_stride
=
mat
.
outerStride
();
Eigen
::
DenseIndex
inner_stride
=
MatType
::
IsRowMajor
?
mat
.
outerStride
()
:
mat
.
innerStride
(),
outer_stride
=
MatType
::
IsRowMajor
?
mat
.
innerStride
()
:
mat
.
outerStride
();
const
int
elsize
=
call_PyArray_DescrFromType
(
Scalar_type_code
)
->
elsize
;
npy_intp
strides
[
2
]
=
{
elsize
*
inner_stride
,
elsize
*
outer_stride
};
...
...
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