Aikido
SplineFwd.hpp
Go to the documentation of this file.
1 // This file is part of Eigen, a lightweight C++ template library
2 // for linear algebra.
3 //
4 // Copyright (C) 20010-2011 Hauke Heibel <hauke.heibel@gmail.com>
5 //
6 // This Source Code Form is subject to the terms of the Mozilla
7 // Public License v. 2.0. If a copy of the MPL was not distributed
8 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 
10 #ifndef AIKIDO_COMMON_SPLINEFWD_HPP_
11 #define AIKIDO_COMMON_SPLINEFWD_HPP_
12 
13 #include <Eigen/Core>
14 
15 namespace aikido {
16 namespace common {
17 
18 template <typename Scalar, int Dim, int Degree = Eigen::Dynamic>
19 class BSpline;
20 
21 template <typename SplineType, int DerivativeOrder = Eigen::Dynamic>
23 {
24 };
25 
30 template <typename _Scalar, int _Dim, int _Degree>
31 struct SplineTraits<BSpline<_Scalar, _Dim, _Degree>, Eigen::Dynamic>
32 {
33  typedef _Scalar Scalar;
34  enum
35  {
36  Dimension = _Dim
37  };
38  enum
39  {
40  Degree = _Degree
41  };
42 
43  enum
44  {
45  OrderAtCompileTime
46  = _Degree == Eigen::Dynamic
47  ? Eigen::Dynamic
48  : _Degree + 1
49  };
50  enum
51  {
52  NumOfDerivativesAtCompileTime = OrderAtCompileTime
56  };
57 
58  enum
59  {
60  DerivativeMemoryLayout
61  = Dimension == 1
62  ? Eigen::RowMajor
63  : Eigen::ColMajor
64  };
65 
67  typedef Eigen::Array<Scalar, 1, OrderAtCompileTime> BasisVectorType;
68 
71  typedef Eigen::Array<
72  Scalar,
73  Eigen::Dynamic,
74  Eigen::Dynamic,
75  Eigen::RowMajor,
76  NumOfDerivativesAtCompileTime,
77  OrderAtCompileTime>
79 
81  typedef Eigen::Array<
82  Scalar,
83  Dimension,
84  Eigen::Dynamic,
85  DerivativeMemoryLayout,
86  Dimension,
87  NumOfDerivativesAtCompileTime>
89 
91  typedef Eigen::Array<Scalar, Dimension, 1> PointType;
92 
94  typedef Eigen::Array<Scalar, 1, Eigen::Dynamic> KnotVectorType;
95 
97  typedef Eigen::Array<Scalar, 1, Eigen::Dynamic> ParameterVectorType;
98 
100  typedef Eigen::Array<Scalar, Dimension, Eigen::Dynamic>
102 };
103 
111 template <typename _Scalar, int _Dim, int _Degree, int _DerivativeOrder>
112 struct SplineTraits<BSpline<_Scalar, _Dim, _Degree>, _DerivativeOrder>
113  : public SplineTraits<BSpline<_Scalar, _Dim, _Degree> >
114 {
115  enum
116  {
117  OrderAtCompileTime
118  = _Degree == Eigen::Dynamic
119  ? Eigen::Dynamic
120  : _Degree + 1
121  };
122  enum
123  {
124  NumOfDerivativesAtCompileTime
125  = _DerivativeOrder == Eigen::Dynamic
126  ? Eigen::Dynamic
127  : _DerivativeOrder + 1
130  };
131 
132  enum
133  {
134  DerivativeMemoryLayout
135  = _Dim == 1 ? Eigen::RowMajor
136  : Eigen::ColMajor
137  };
138 
141  typedef Eigen::Array<
142  _Scalar,
143  Eigen::Dynamic,
144  Eigen::Dynamic,
145  Eigen::RowMajor,
146  NumOfDerivativesAtCompileTime,
147  OrderAtCompileTime>
149 
151  typedef Eigen::Array<
152  _Scalar,
153  _Dim,
154  Eigen::Dynamic,
155  DerivativeMemoryLayout,
156  _Dim,
157  NumOfDerivativesAtCompileTime>
159 };
160 
163 
166 
169 
172 
173 } // namespace common
174 } // namespace aikido
175 
176 #endif // AIKIDO_COMMON_SPLINEFWD_HPP_
aikido
Format of serialized trajectory in YAML.
Definition: algorithm.hpp:4
aikido::common::SplineTraits< BSpline< _Scalar, _Dim, _Degree >, Eigen::Dynamic >::DerivativeType
Eigen::Array< Scalar, Dimension, Eigen::Dynamic, DerivativeMemoryLayout, Dimension, NumOfDerivativesAtCompileTime > DerivativeType
The data type used to store the spline's derivative values.
Definition: SplineFwd.hpp:88
aikido::common::SplineTraits< BSpline< _Scalar, _Dim, _Degree >, Eigen::Dynamic >::ParameterVectorType
Eigen::Array< Scalar, 1, Eigen::Dynamic > ParameterVectorType
The data type used to store parameter vectors.
Definition: SplineFwd.hpp:97
aikido::common::SplineTraits< BSpline< _Scalar, _Dim, _Degree >, Eigen::Dynamic >::KnotVectorType
Eigen::Array< Scalar, 1, Eigen::Dynamic > KnotVectorType
The data type used to store knot vectors.
Definition: SplineFwd.hpp:94
aikido::common::BSpline2d
BSpline< double, 2 > BSpline2d
2D double B-spline with dynamic degree.
Definition: SplineFwd.hpp:168
aikido::common::SplineTraits< BSpline< _Scalar, _Dim, _Degree >, Eigen::Dynamic >::Scalar
_Scalar Scalar
Definition: SplineFwd.hpp:33
aikido::common::SplineTraits< BSpline< _Scalar, _Dim, _Degree >, _DerivativeOrder >::BasisDerivativeType
Eigen::Array< _Scalar, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor, NumOfDerivativesAtCompileTime, OrderAtCompileTime > BasisDerivativeType
The data type used to store the values of the basis function derivatives.
Definition: SplineFwd.hpp:148
aikido::common::SplineTraits< BSpline< _Scalar, _Dim, _Degree >, Eigen::Dynamic >::BasisDerivativeType
Eigen::Array< Scalar, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor, NumOfDerivativesAtCompileTime, OrderAtCompileTime > BasisDerivativeType
The data type used to store the values of the basis function derivatives.
Definition: SplineFwd.hpp:78
aikido::common::SplineTraits
Definition: SplineFwd.hpp:22
aikido::common::SplineTraits< BSpline< _Scalar, _Dim, _Degree >, Eigen::Dynamic >::BasisVectorType
Eigen::Array< Scalar, 1, OrderAtCompileTime > BasisVectorType
The data type used to store non-zero basis functions.
Definition: SplineFwd.hpp:67
aikido::common::BSpline
Definition: BSpline.hpp:39
aikido::common::SplineTraits< BSpline< _Scalar, _Dim, _Degree >, Eigen::Dynamic >::ControlPointVectorType
Eigen::Array< Scalar, Dimension, Eigen::Dynamic > ControlPointVectorType
The data type representing the spline's control points.
Definition: SplineFwd.hpp:101
aikido::common::BSpline3f
BSpline< float, 3 > BSpline3f
3D float B-spline with dynamic degree.
Definition: SplineFwd.hpp:165
aikido::common::BSpline3d
BSpline< double, 3 > BSpline3d
3D double B-spline with dynamic degree.
Definition: SplineFwd.hpp:171
aikido::common::SplineTraits< BSpline< _Scalar, _Dim, _Degree >, _DerivativeOrder >::DerivativeType
Eigen::Array< _Scalar, _Dim, Eigen::Dynamic, DerivativeMemoryLayout, _Dim, NumOfDerivativesAtCompileTime > DerivativeType
The data type used to store the spline's derivative values.
Definition: SplineFwd.hpp:158
aikido::common::SplineTraits< BSpline< _Scalar, _Dim, _Degree >, Eigen::Dynamic >::PointType
Eigen::Array< Scalar, Dimension, 1 > PointType
The point type the spline is representing.
Definition: SplineFwd.hpp:91
aikido::common::BSpline2f
BSpline< float, 2 > BSpline2f
2D float B-spline with dynamic degree.
Definition: SplineFwd.hpp:162