S
star
Hi,
I have problem with optimizing loop in java.
My code looks like this
for (k = m; --k >=0{
for (j = m; --j >= 0
{
Array[j] += Math.exp(-0.5 * (Math.pow (((b[k]-b[j])/d),2))) / c;
}
}
The problem is that m depends from some input data in the application
and it can be very big, for example 150000. In that case the loops take
2 hours, which is unacceptable for the situation.
I also can't use native codes.
If any one have any suggestions please write.
Thanks in advance
I have problem with optimizing loop in java.
My code looks like this
for (k = m; --k >=0{
for (j = m; --j >= 0
{
Array[j] += Math.exp(-0.5 * (Math.pow (((b[k]-b[j])/d),2))) / c;
}
}
The problem is that m depends from some input data in the application
and it can be very big, for example 150000. In that case the loops take
2 hours, which is unacceptable for the situation.
I also can't use native codes.
If any one have any suggestions please write.
Thanks in advance