https://eigen.tuxfamily.org/dox/classEigen_1_1aligned__allocator.html
Eigen::aligned_allocator< T > Class Template Reference
Detailed Description
template<class T>
class Eigen::aligned_allocator< T >
STL compatible allocator to use with types requiring a non standrad alignment.
The memory is aligned as for dynamically aligned matrix/array types such as MatrixXd. By default, it will thus provide at least 16 bytes alignment and more in following cases:
- 32 bytes alignment if AVX is enabled.
- 64 bytes alignment if AVX512 is enabled.
This can be controled using the EIGEN_MAX_ALIGN_BYTES macro as documented there .
Example:
// Matrix4f requires 16 bytes alignment:
std::map< int, Matrix4f, std::less<int>,
aligned_allocator<std::pair<const int, Matrix4f> > > my_map_mat4;
// Vector3f does not require 16 bytes alignment, no need to use Eigen's allocator:
std::map< int, Vector3f > my_map_vec3;
See also
Using STL Containers with Eigen.
Inherits allocator< T >.
The documentation for this class was generated from the following file:
本文详细介绍了Eigen库中STL兼容的aligned_allocator模板类,用于处理需要非标准对齐的数据类型,如MatrixXd。提供了不同对齐需求的例子,并解释了如何控制对齐字节数。

1012

被折叠的 条评论
为什么被折叠?



