E
ertis6
Hi all,
I need to calculate a value inside 8 nested for loops. 2 additional
for loops are used during calculation. It was working fine with 4
loops. My code is like this:
...
for(int i1=0; i1<x1; i1 = i1++){
...
for(int i2=0; i2<x2; i2 = i2++){
...
for(int i3=0; i3<x3; i3 = i3++){
...
for(int i4=0; i4<x4; i4++){
calculate(i1, i2, i3, i4);
...
}
...
}
...
}
...
}
...
And the 'calculate' function is like this (I've simplified the code
for demonstration, the syntax is different):
for (int i=0; i<x; i++){
for (int j=0; j<y; j++){
array[2*i+j] = (float)exp( (-x1^2) / (x2^2) );
}
}
x1 are x2 are also float values.
The code throws OutOfMemoryException when using the exp() function.
I'm using VC++ 2005.
I've tried to increase virtual memory of my windows system to max. 4GB
but it didn't work
Any ideas about how I can I prevent memory overflow for this
calculation?
Any help would be appreciated, this is a little urgent.
Thanks
I need to calculate a value inside 8 nested for loops. 2 additional
for loops are used during calculation. It was working fine with 4
loops. My code is like this:
...
for(int i1=0; i1<x1; i1 = i1++){
...
for(int i2=0; i2<x2; i2 = i2++){
...
for(int i3=0; i3<x3; i3 = i3++){
...
for(int i4=0; i4<x4; i4++){
calculate(i1, i2, i3, i4);
...
}
...
}
...
}
...
}
...
And the 'calculate' function is like this (I've simplified the code
for demonstration, the syntax is different):
for (int i=0; i<x; i++){
for (int j=0; j<y; j++){
array[2*i+j] = (float)exp( (-x1^2) / (x2^2) );
}
}
x1 are x2 are also float values.
The code throws OutOfMemoryException when using the exp() function.
I'm using VC++ 2005.
I've tried to increase virtual memory of my windows system to max. 4GB
but it didn't work
Any ideas about how I can I prevent memory overflow for this
calculation?
Any help would be appreciated, this is a little urgent.
Thanks