Skip to content

Commit ead61d9

Browse files
committed
core: fix allocate for const Eigen::Ref<const ...
1 parent 80b1fd7 commit ead61d9

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

include/eigenpy/numpy-allocator.hpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2020 INRIA
2+
* Copyright 2020-2022 INRIA
33
*/
44

55
#ifndef __eigenpy_numpy_allocator_hpp__
@@ -116,13 +116,11 @@ template <typename MatType, int Options, typename Stride>
116116
struct NumpyAllocator<const Eigen::Ref<const MatType, Options, Stride> > {
117117
typedef const Eigen::Ref<const MatType, Options, Stride> RefType;
118118

119-
template <typename SimilarMatrixType>
120119
static PyArrayObject *allocate(RefType &mat, npy_intp nd, npy_intp *shape) {
121-
typedef typename SimilarMatrixType::Scalar Scalar;
120+
typedef typename RefType::Scalar Scalar;
122121
enum {
123-
NPY_ARRAY_MEMORY_CONTIGUOUS_RO = SimilarMatrixType::IsRowMajor
124-
? NPY_ARRAY_CARRAY_RO
125-
: NPY_ARRAY_FARRAY_RO
122+
NPY_ARRAY_MEMORY_CONTIGUOUS_RO =
123+
RefType::IsRowMajor ? NPY_ARRAY_CARRAY_RO : NPY_ARRAY_FARRAY_RO
126124
};
127125

128126
if (NumpyType::sharedMemory()) {

0 commit comments

Comments
 (0)