← Foro de C / C++

Optimizar bucle q consume mucho tiempo

Hilo en el foro de C / C++ · 15 de Mayo del 2006 · 0 respuestas
katuchi15 de Mayo del 2006
Pregunta
Hola necesito optimizar este bucle q emplea muchisimo tiempo si alguien puede ayudar!! muchas gracias

h = (double*)malloc((aux1+1)* sizeof(double));


TAM = pow((2*N +1),3); //Size of the vector

i=l=p=0;

//With this doble-loop we asociate the time with the value of the echos

for (i=0; i<aux1+1; i++)
{
//Initialice to 0
h[i]=0;
for (j=0; j<TAM; j++)
{
if (i == time1[j])
h[i]=h[i]+ echo1[j];
}
}
¿Buscas más hilos como este? Mira el foro de C / C++ o usa el buscador.