Drake
eigen_stl_types.h
Go to the documentation of this file.
1 #pragma once
2 
3 /// @file
4 /// This file contains definitions for using Eigen with the STL.
5 /// See http://eigen.tuxfamily.org/dox-devel/group__TopicStlContainers.html.
6 /// @see eigen_types.h
7 
8 #include <functional>
9 #include <map>
10 #include <unordered_map>
11 #include <utility>
12 #include <vector>
13 
14 #include <Eigen/Core>
15 #include <Eigen/StdVector>
16 
17 namespace drake {
18 
19 /// A std::map that uses Eigen::aligned_allocator so that the
20 /// contained types may be fixed-size Eigen values.
21 template <typename Key, typename T>
23  std::map<Key, T, std::less<Key>,
24  Eigen::aligned_allocator<std::pair<Key const, T>>>;
25 
26 /// A std::unordered_map that uses Eigen::aligned_allocator so that the
27 /// contained types may be fixed-size Eigen values.
28 template <typename Key, typename T>
30  std::unordered_map<Key, T, std::hash<Key>, std::equal_to<Key>,
31  Eigen::aligned_allocator<std::pair<Key const, T>>>;
32 
33 /// A std::vector that uses Eigen::aligned_allocator so that the contained
34 /// types may be fixed-size Eigen values.
35 template <typename T>
36 using eigen_aligned_std_vector = std::vector<T, Eigen::aligned_allocator<T>>;
37 
38 } // namespace drake
std::map< Key, T, std::less< Key >, Eigen::aligned_allocator< std::pair< Key const, T >>> eigen_aligned_std_map
A std::map that uses Eigen::aligned_allocator so that the contained types may be fixed-size Eigen val...
Definition: eigen_stl_types.h:24
Definition: automotive_demo.cc:88
std::vector< T, Eigen::aligned_allocator< T >> eigen_aligned_std_vector
A std::vector that uses Eigen::aligned_allocator so that the contained types may be fixed-size Eigen ...
Definition: eigen_stl_types.h:36
std::unordered_map< Key, T, std::hash< Key >, std::equal_to< Key >, Eigen::aligned_allocator< std::pair< Key const, T >>> eigen_aligned_std_unordered_map
A std::unordered_map that uses Eigen::aligned_allocator so that the contained types may be fixed-size...
Definition: eigen_stl_types.h:31