Skip to content

Commit d2d4a49

Browse files
committed
map: change template type
1 parent 4b84fb7 commit d2d4a49

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

include/eigenpy/map.hpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Copyright 2014-2019, CNRS
3-
* Copyright 2018-2019, INRIA
3+
* Copyright 2018-2020, INRIA
44
*/
55

66
#include "eigenpy/fwd.hpp"
@@ -10,7 +10,7 @@
1010

1111
namespace eigenpy
1212
{
13-
template<typename MatType, typename InputScalar, int IsVector>
13+
template<typename MatType, typename InputScalar, bool IsVector>
1414
struct MapNumpyTraits {};
1515

1616
/* Wrap a numpy::array with an Eigen::Map. No memory copy. */
@@ -33,7 +33,7 @@ namespace eigenpy
3333
namespace eigenpy
3434
{
3535
template<typename MatType, typename InputScalar>
36-
struct MapNumpyTraits<MatType,InputScalar,0>
36+
struct MapNumpyTraits<MatType,InputScalar,false>
3737
{
3838
typedef typename StrideType<MatType>::type Stride;
3939
typedef Eigen::Matrix<InputScalar,MatType::RowsAtCompileTime,MatType::ColsAtCompileTime> EquivalentInputMatrixType;
@@ -43,10 +43,10 @@ namespace eigenpy
4343
{
4444
assert( PyArray_NDIM(pyArray) == 2 );
4545

46-
assert( (PyArray_DIMS(pyArray)[0]<INT_MAX)
47-
&& (PyArray_DIMS(pyArray)[1]<INT_MAX)
48-
&& (PyArray_STRIDE(pyArray, 0)<INT_MAX)
49-
&& (PyArray_STRIDE(pyArray, 1)<INT_MAX) );
46+
assert( (PyArray_DIMS(pyArray)[0] < INT_MAX)
47+
&& (PyArray_DIMS(pyArray)[1] < INT_MAX)
48+
&& (PyArray_STRIDE(pyArray,0) < INT_MAX)
49+
&& (PyArray_STRIDE(pyArray,1) < INT_MAX) );
5050

5151
const int R = (int)PyArray_DIMS(pyArray)[0];
5252
const int C = (int)PyArray_DIMS(pyArray)[1];
@@ -69,7 +69,7 @@ namespace eigenpy
6969
};
7070

7171
template<typename MatType, typename InputScalar>
72-
struct MapNumpyTraits<MatType,InputScalar,1>
72+
struct MapNumpyTraits<MatType,InputScalar,true>
7373
{
7474
typedef typename StrideType<MatType>::type Stride;
7575
typedef Eigen::Matrix<InputScalar,MatType::RowsAtCompileTime,MatType::ColsAtCompileTime> EquivalentInputMatrixType;

0 commit comments

Comments
 (0)