c++ - 如何从 boost 多数组中获取最大/最小元素

标签 c++ boost boost-multi-array

我想知道一种简单的方法来查找 boost 多数组的最大/最小元素,一个包含 3 个索引的对象,如下所示:

int iDepth=10,iWidth=10,iHeight=10;
boost::multi_array<GLfloat, 3> image(boost::extents[iDepth][iWidth][iHeight]);

最佳答案

这应该有效:

std::max_element( image.origin(), image.origin() + image.num_elements());

关于c++ - 如何从 boost 多数组中获取最大/最小元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17207777/

相关文章:

C++ 函数模板的奇怪类型转换错误

c++ - 如何继承boost::geometry::model::point?

c++ - 访问另一个程序的值

c++ - 如何在只读期间在 QLineEdit 中显示闪烁的光标

c++ - 使用 SFINAE 根据类模板参数的类型更改类中调用的函数

c++ - 如何使用 boost::filesystem 检查文件是常规文件还是符号链接(symbolic link)?

c++ - 如何启动运行类函数的 boost 线程?

c++ - 遍历 Boost multi_array View

c++ - Boost C++ - 动态迭代多数组

c++ - 在 Boost MultiArray 中访问元素的最快方法