Verified Commit b365f4ca authored by Justin Carpentier's avatar Justin Carpentier
Browse files

core: handle RowMajor types

parent 53563e52
......@@ -61,8 +61,16 @@ namespace eigenpy
rows = (int)PyArray_DIMS(pyArray)[0];
cols = (int)PyArray_DIMS(pyArray)[1];
inner_stride = (int)PyArray_STRIDE(pyArray, 0) / (int)itemsize;
outer_stride = (int)PyArray_STRIDE(pyArray, 1) / (int)itemsize;
if(EquivalentInputMatrixType::IsRowMajor)
{
inner_stride = (int)PyArray_STRIDE(pyArray, 1) / (int)itemsize;
outer_stride = (int)PyArray_STRIDE(pyArray, 0) / (int)itemsize;
}
else
{
inner_stride = (int)PyArray_STRIDE(pyArray, 0) / (int)itemsize;
outer_stride = (int)PyArray_STRIDE(pyArray, 1) / (int)itemsize;
}
}
else if(PyArray_NDIM(pyArray) == 1)
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment