Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我最近开始使用犰狳,虽然我很喜欢它,但如果它有存储 4D 矩阵的方法会很有用。有什么我遗漏的东西,或者解决方法吗?
最后一个维度只有三个大小,所以理论上我可以有类似的东西:
std::vector<arma::cube> 4Dmatrix(3); for (int index=0; index<3; index++) 4Dmatrix[index] = cube(size1, size2, size3);
但是,感觉必须有更好的方法。
提前致谢!
您可能会使用field将任意对象存储为向量、矩阵或立方体结构中的元素的类。例如(来自文档)创建field包含vec向量:
field
vec
// create a field containing vectors field<vec> F(3,2);
不,没有内置方法。如果您查看源代码,您会看到向量、矩阵和立方体有单独的实现。
也许Boost 多阵列可能对您有用。