Sign in to follow this  
fnm

using boost multi array

Recommended Posts

fnm    495
In one of my project I need to handle a 3d array of 3d points and I'm using boost multi array to store it. The problem is that when I allocate a large array, say 1000x500x500 a bad_alloc exception is thrown. With smaller array all goes ok.
Here's the declaration:

boost::multi_array<Point3d, 3> m_array3d;
m_array3d(boost::extents[1000][500][500]),

Am I hitting some maximum allocation limit of multi_array? Or am I using it wrong?
Any suggestions?

Share this post


Link to post
Share on other sites
the_edd    2109
That is indeed a whopping amount of memory. If your data set is sparse, you might be better off using something like a hash-table underneath e.g. boost::unordered_map.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this