Skip to content

Commit 7d28bd5

Browse files
committed
core: fix issue with Vector types
a vector should be either C or F continuous
1 parent 15b701a commit 7d28bd5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

include/eigenpy/eigen-allocator.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,8 @@ inline bool is_arr_layout_compatible_with_mat_type(PyArrayObject *pyArray) {
245245
bool is_array_F_cont = PyArray_IS_F_CONTIGUOUS(pyArray);
246246
return (MatType::IsRowMajor && is_array_C_cont) ||
247247
(!MatType::IsRowMajor && is_array_F_cont) ||
248-
MatType::IsVectorAtCompileTime;
248+
(MatType::IsVectorAtCompileTime &&
249+
(is_array_C_cont || is_array_F_cont));
249250
}
250251

251252
template <typename MatType, int Options, typename Stride>

0 commit comments

Comments
 (0)