Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get max/min element from a boost multiarray

I'm wondering a simple way to find the maximum/minimum element of a boost multiarray, an object of 3 indices as the following:

int iDepth=10,iWidth=10,iHeight=10;
boost::multi_array<GLfloat, 3> image(boost::extents[iDepth][iWidth][iHeight]);
like image 242
linello Avatar asked Jun 20 '13 07:06

linello


1 Answers

This should work :

std::max_element( image.origin(), image.origin() + image.num_elements());
like image 77
tunc Avatar answered Nov 09 '22 11:11

tunc