Boost runtime error trying to access multi arrays

Hi all,

I am trying to create a magnetic field AR game application. The magnetic field data is fed into a 3D array from a file and I try to manipulate the 3D array to create my points for drawing the magnetic field lines. But for whatever reason, I am getting a strange run time error from MSVC both 2008 and 2010, stating

Assertion failed : size_type(idx - index_bases[0] >=0) <extents[0], file c:\boost\multi_array.hpp

Here is a simplified version of my code since the real version is too large to post here,

int numberOfMagneticLines = 14;
int numberOfSteps = 90;

class myClass {

typedef boost::multi_array<double, 3> array_type3;
array_type3 myMagneticField;
array_type3 myRenderField;

myClass() : myMagneticField(boost::extents[100][100][2]), myRenderField(boost::extents[numberOfMagneticLines][numberOfSteps][2]) {}

....

inline readField(array_type3 &field, array_type3 &rfield) {....}

// Here is where I populate the rfield for rendering but if I make the number of steps to populate the field more than 90 it crashes with that error.

If it's 90 or less, it compiles but I still can't render it and I can't even cout. The error stating

Assertion failed : size_type(idx - index_bases[0] >=0) <extents[0], file c:\boost\multi_array.hpp

appears everytime. I apologize if this message is too vague. I would be grateful if someone can help me, since I have never used boost before this project.

Thanks in advance
Sorcus
Topic archived. No new replies allowed.