void findLargest( uint64_t size, uint64_t N, const double complex *list, uint64_t *listN ){ uint64_t i; double temp; double *mag_list = (double *)calloc( N, sizeof(double) ); for( i = 0; i < N; i++ ){ addLarger( i, N, cabs( list[i] ), listN, mag_list ); } for( i = N; i < size; i++ ){ temp = cabs( list[i] ); if( temp > *mag_list ){ addLarger( i, N, temp, listN, mag_list ); } } free( mag_list ); }
void findLargest( uint64_t *listN, const fftw_complex *list, const uint64_t size, const uint64_t N ){ uint64_t i; double temp; double *mag_list = (double *)calloc( N, sizeof(double) ); for( i = 0; i < N; i++ ){ //mag_list[i] = cabs( list[i] ); addLarger( cabs( list[i] ), i, listN, mag_list, N ); } for( i = N; i < size; i++ ){ temp = cabs( list[i] ); if( temp > *mag_list ){ addLarger( temp, i, listN, mag_list, N ); } } //dumpArray(listNth, nLargest); free( mag_list ); }