标题基本上说明了一切。是否有 Eigen::Matrix 的某些成员在编译时公开存储顺序(列专业或行专业)?我知道 Options
模板参数用于指定存储顺序,但之后我还没有找到提取它的方法。使用场景类似于
template<class Mat>
class C {
static_assert(/* Mat has column major format */, "column major required");
// ...
};
最佳答案
您可以使用 Mat::IsRowMajor
:
static_assert(!Mat::IsRowMajor, "column major required");
这适用于 Mat
的任何 Eigen 类矩阵类型,例如 Matrix
、Block
、Map
, Ref
等
关于c++ - 在编译时确定 Eigen3 矩阵的存储顺序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47154134/