Optimizar bucle q consume mucho tiempo
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];
}
}
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];
}
}
