Skip to content

Commit aacde16

Browse files
committed
[Core] Move stride to a dedicated file
1 parent 1054dce commit aacde16

File tree

4 files changed

+41
-12
lines changed

4 files changed

+41
-12
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ SET(HEADERS
9898
registration.hpp
9999
angle-axis.hpp
100100
quaternion.hpp
101+
stride.hpp
101102
ref.hpp
102103
)
103104

src/map.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "eigenpy/fwd.hpp"
1818
#include <numpy/arrayobject.h>
1919
#include "eigenpy/exception.hpp"
20+
#include "eigenpy/stride.hpp"
2021

2122
namespace eigenpy
2223
{

src/ref.hpp

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#define __eigenpy_ref_hpp__
1919

2020
#include "eigenpy/fwd.hpp"
21+
#include "eigenpy/stride.hpp"
2122

2223
// For old Eigen versions, EIGEN_DEVICE_FUNC is not defined.
2324
// We must define it just in the scope of this file.
@@ -27,18 +28,7 @@
2728

2829
namespace eigenpy
2930
{
30-
template<typename MatType, int IsVectorAtCompileTime = MatType::IsVectorAtCompileTime>
31-
struct StrideType
32-
{
33-
typedef Eigen::Stride<Eigen::Dynamic,Eigen::Dynamic> type;
34-
};
35-
36-
template<typename MatType>
37-
struct StrideType<MatType,1>
38-
{
39-
typedef Eigen::InnerStride<Eigen::Dynamic> type;
40-
};
41-
31+
4232
template<typename PlainObjectType>
4333
struct Ref : Eigen::Ref<PlainObjectType,EIGENPY_DEFAULT_ALIGNMENT_VALUE,typename StrideType<PlainObjectType>::type>
4434
{

src/stride.hpp

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* Copyright 2018, Justin Carpentier <[email protected]>, LAAS-CNRS
3+
*
4+
* This file is part of eigenpy.
5+
* eigenpy is free software: you can redistribute it and/or
6+
* modify it under the terms of the GNU Lesser General Public License
7+
* as published by the Free Software Foundation, either version 3 of
8+
* the License, or (at your option) any later version.
9+
* eigenpy is distributed in the hope that it will be
10+
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
11+
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU Lesser General Public License for more details. You should
13+
* have received a copy of the GNU Lesser General Public License along
14+
* with eigenpy. If not, see <http://www.gnu.org/licenses/>.
15+
*/
16+
17+
#ifndef __eigenpy_stride_hpp__
18+
#define __eigenpy_stride_hpp__
19+
20+
#include <Eigen/Core>
21+
22+
namespace eigenpy
23+
{
24+
template<typename MatType, int IsVectorAtCompileTime = MatType::IsVectorAtCompileTime>
25+
struct StrideType
26+
{
27+
typedef Eigen::Stride<Eigen::Dynamic,Eigen::Dynamic> type;
28+
};
29+
30+
template<typename MatType>
31+
struct StrideType<MatType,1>
32+
{
33+
typedef Eigen::InnerStride<Eigen::Dynamic> type;
34+
};
35+
}
36+
37+
#endif // ifndef __eigenpy_stride_hpp__

0 commit comments

Comments
 (0)