|
7 | 7 | #include "eigenpy/eigen-from-python.hpp" |
8 | 8 | #include "eigenpy/std-vector.hpp" |
9 | 9 |
|
10 | | -template <typename MatType> |
11 | | -void printVectorOfMatrix(const std::vector<MatType> &Ms) { |
| 10 | +template <typename MatType, |
| 11 | + typename Allocator = Eigen::aligned_allocator<MatType> > |
| 12 | +void printVectorOfMatrix(const std::vector<MatType, Allocator> &Ms) { |
12 | 13 | const std::size_t n = Ms.size(); |
13 | 14 | for (std::size_t i = 0; i < n; i++) { |
14 | 15 | std::cout << "el[" << i << "] =\n" << Ms[i] << '\n'; |
15 | 16 | } |
16 | 17 | } |
17 | 18 |
|
18 | | -template <typename MatType> |
19 | | -std::vector<MatType> copy(const std::vector<MatType> &Ms) { |
20 | | - std::vector<MatType> out = Ms; |
| 19 | +template <typename MatType, |
| 20 | + typename Allocator = Eigen::aligned_allocator<MatType> > |
| 21 | +std::vector<MatType, Allocator> copy( |
| 22 | + const std::vector<MatType, Allocator> &Ms) { |
| 23 | + std::vector<MatType, Allocator> out = Ms; |
21 | 24 | return out; |
22 | 25 | } |
23 | 26 |
|
24 | | -template <typename MatType> |
25 | | -void setZero(std::vector<MatType> &Ms) { |
| 27 | +template <typename MatType, |
| 28 | + typename Allocator = Eigen::aligned_allocator<MatType> > |
| 29 | +void setZero(std::vector<MatType, Allocator> &Ms) { |
26 | 30 | for (std::size_t i = 0; i < Ms.size(); i++) { |
27 | 31 | Ms[i].setZero(); |
28 | 32 | } |
|
0 commit comments