Skip to content
Snippets Groups Projects
Commit aacde161 authored by jcarpent's avatar jcarpent
Browse files

[Core] Move stride to a dedicated file

parent 1054dce9
No related branches found
No related tags found
No related merge requests found
......@@ -98,6 +98,7 @@ SET(HEADERS
registration.hpp
angle-axis.hpp
quaternion.hpp
stride.hpp
ref.hpp
)
......
......@@ -17,6 +17,7 @@
#include "eigenpy/fwd.hpp"
#include <numpy/arrayobject.h>
#include "eigenpy/exception.hpp"
#include "eigenpy/stride.hpp"
namespace eigenpy
{
......
......@@ -18,6 +18,7 @@
#define __eigenpy_ref_hpp__
#include "eigenpy/fwd.hpp"
#include "eigenpy/stride.hpp"
// For old Eigen versions, EIGEN_DEVICE_FUNC is not defined.
// We must define it just in the scope of this file.
......@@ -27,18 +28,7 @@
namespace eigenpy
{
template<typename MatType, int IsVectorAtCompileTime = MatType::IsVectorAtCompileTime>
struct StrideType
{
typedef Eigen::Stride<Eigen::Dynamic,Eigen::Dynamic> type;
};
template<typename MatType>
struct StrideType<MatType,1>
{
typedef Eigen::InnerStride<Eigen::Dynamic> type;
};
template<typename PlainObjectType>
struct Ref : Eigen::Ref<PlainObjectType,EIGENPY_DEFAULT_ALIGNMENT_VALUE,typename StrideType<PlainObjectType>::type>
{
......
/*
* Copyright 2018, Justin Carpentier <jcarpent@laas.fr>, LAAS-CNRS
*
* This file is part of eigenpy.
* eigenpy is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation, either version 3 of
* the License, or (at your option) any later version.
* eigenpy is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details. You should
* have received a copy of the GNU Lesser General Public License along
* with eigenpy. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __eigenpy_stride_hpp__
#define __eigenpy_stride_hpp__
#include <Eigen/Core>
namespace eigenpy
{
template<typename MatType, int IsVectorAtCompileTime = MatType::IsVectorAtCompileTime>
struct StrideType
{
typedef Eigen::Stride<Eigen::Dynamic,Eigen::Dynamic> type;
};
template<typename MatType>
struct StrideType<MatType,1>
{
typedef Eigen::InnerStride<Eigen::Dynamic> type;
};
}
#endif // ifndef __eigenpy_stride_hpp__
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment