Hi everyone, this is my first post. I'm writing a value-iteration algorithm to solve a MDP problem for my research. In my algorithm, I have to change the parameters when I search for the optimal solution. Therefore, I had to use variable size multi-dimensional array and resize the arrays at the beginning of each iteration. I used new[] to construct my arrays. I have one 3D array, a few 2D arrays and a few 1D arrays. I'm using delete[] with loop to delete the arrays at the end of each iteration. However, since the size of my arrays are pretty big, (the 3D array is around [10000 * 10000 * 3] and some of my 2D arrays are around [20000 * 10000] ), when I delete the arrays, it takes around 20 to 30 min. (my desktop is i7 with 6G of 1600 DDR3 ram). I've used visual studio 2010 ultimate with 64bit complier to utilize my RAM. Since I might need to run 10K iterations , the program will take forever to run. Is there any way to speed up the array deletion process? Should I be using vectors instead of new[] to create multidimensional arrays?
Thanks in advance!
William
Thanks in advance!
William