DART  6.7.3
MathTypes.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011-2019, The DART development contributors
3  * All rights reserved.
4  *
5  * The list of contributors can be found at:
6  * https://github.com/dartsim/dart/blob/master/LICENSE
7  *
8  * This file is provided under the following "BSD-style" License:
9  * Redistribution and use in source and binary forms, with or
10  * without modification, are permitted provided that the following
11  * conditions are met:
12  * * Redistributions of source code must retain the above copyright
13  * notice, this list of conditions and the following disclaimer.
14  * * Redistributions in binary form must reproduce the above
15  * copyright notice, this list of conditions and the following
16  * disclaimer in the documentation and/or other materials provided
17  * with the distribution.
18  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
19  * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
20  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
21  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
23  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
26  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
27  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
29  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30  * POSSIBILITY OF SUCH DAMAGE.
31  */
32 
33 #ifndef DART_MATH_MATHTYPES_HPP_
34 #define DART_MATH_MATHTYPES_HPP_
35 
36 #include <map>
37 #include <vector>
38 
39 #include <Eigen/Dense>
40 
42 #include "dart/common/Memory.hpp"
43 
44 //------------------------------------------------------------------------------
45 // Types
46 //------------------------------------------------------------------------------
47 namespace Eigen {
48 
49 using Vector6d = Matrix<double, 6, 1>;
50 using Matrix6d = Matrix<double, 6, 6>;
51 
52 inline Vector6d compose(const Eigen::Vector3d& _angular,
53  const Eigen::Vector3d& _linear)
54 {
55  Vector6d composition;
56  composition << _angular, _linear;
57  return composition;
58 }
59 
60 // Deprecated
61 using EIGEN_V_VEC3D = std::vector<Eigen::Vector3d>;
62 
63 // Deprecated
64 using EIGEN_VV_VEC3D = std::vector<std::vector<Eigen::Vector3d>>;
65 
66 #if EIGEN_VERSION_AT_LEAST(3,2,1) && EIGEN_VERSION_AT_MOST(3,2,8)
67 
68 // Deprecated in favor of dart::common::aligned_vector
69 template <typename _Tp>
70 using aligned_vector = std::vector<_Tp,
71  dart::common::detail::aligned_allocator_cpp11<_Tp>>;
72 
73 // Deprecated in favor of dart::common::aligned_map
74 template <typename _Key, typename _Tp, typename _Compare = std::less<_Key>>
75 using aligned_map = std::map<_Key, _Tp, _Compare,
76  dart::common::detail::aligned_allocator_cpp11<std::pair<const _Key, _Tp>>>;
77 
78 #else
79 
80 // Deprecated in favor of dart::common::aligned_vector
81 template <typename _Tp>
82 using aligned_vector = std::vector<_Tp, Eigen::aligned_allocator<_Tp>>;
83 
84 // Deprecated in favor of dart::common::aligned_map
85 template <typename _Key, typename _Tp, typename _Compare = std::less<_Key>>
86 using aligned_map = std::map<_Key, _Tp, _Compare,
87  Eigen::aligned_allocator<std::pair<const _Key, _Tp>>>;
88 
89 #endif
90 
91 // Deprecated in favor of dart::common::make_aligned_shared
92 template <typename _Tp, typename... _Args>
93 DART_DEPRECATED(6.2)
94 std::shared_ptr<_Tp> make_aligned_shared(_Args&&... __args)
95 {
97  std::forward<_Args>(__args)...);
98 }
99 
100 } // namespace Eigen
101 
102 namespace dart {
103 namespace math {
104 
106 using LinearJacobian = Eigen::Matrix<double, 3, Eigen::Dynamic>;
107 using AngularJacobian = Eigen::Matrix<double, 3, Eigen::Dynamic>;
108 using Jacobian = Eigen::Matrix<double, 6, Eigen::Dynamic>;
109 
110 } // namespace math
111 } // namespace dart
112 
113 #endif // DART_MATH_MATHTYPES_HPP_
#define DART_DEPRECATED(version)
Definition: Deprecated.hpp:51
Definition: Random-impl.hpp:92
std::shared_ptr< _Tp > make_aligned_shared(_Args &&... __args)
Definition: MathTypes.hpp:94
Matrix< double, 6, 1 > Vector6d
Definition: MathTypes.hpp:49
std::vector< _Tp, Eigen::aligned_allocator< _Tp > > aligned_vector
Definition: MathTypes.hpp:82
Vector6d compose(const Eigen::Vector3d &_angular, const Eigen::Vector3d &_linear)
Definition: MathTypes.hpp:52
std::vector< Eigen::Vector3d > EIGEN_V_VEC3D
Definition: MathTypes.hpp:61
std::map< _Key, _Tp, _Compare, Eigen::aligned_allocator< std::pair< const _Key, _Tp > >> aligned_map
Definition: MathTypes.hpp:87
std::vector< std::vector< Eigen::Vector3d > > EIGEN_VV_VEC3D
Definition: MathTypes.hpp:64
Matrix< double, 6, 6 > Matrix6d
Definition: MathTypes.hpp:50
Eigen::Matrix< double, 6, Eigen::Dynamic > Jacobian
Definition: MathTypes.hpp:108
Eigen::Matrix< double, 3, Eigen::Dynamic > AngularJacobian
Definition: MathTypes.hpp:107
Eigen::Matrix< double, 3, Eigen::Dynamic > LinearJacobian
Definition: MathTypes.hpp:106
Eigen::Matrix6d Inertia
Definition: MathTypes.hpp:105
Definition: BulletCollisionDetector.cpp:63
Definition: SharedLibraryManager.hpp:43