<commit_before>/*
 * Last Change: Wed Aug 01 07:00 PM 2007 J
 *
 * FFTW3 implementation
 *
 * Original code by <NAME>.
 */

GEN_CACHE(drfftw3, (int n, int d, int flags)
	  , int direction;
	  int flags;
	  fftw_plan plan;
	  double *ptr;, ((caches_drfftw3[i].n == n) &&
			 (caches_drfftw3[i].direction == d) &&
			 (caches_drfftw3[i].flags == flags))
	  , caches_drfftw3[id].direction = d;
	  caches_drfftw3[id].flags = flags;
	  caches_drfftw3[id].ptr =
	  (double *) fftw_malloc(sizeof(double) * (n));
	  caches_drfftw3[id].plan =
	  fftw_plan_r2r_1d(n, caches_drfftw3[id].ptr, caches_drfftw3[id].ptr,
			   (d > 0 ? FFTW_R2HC : FFTW_HC2R), flags);,
	  fftw_destroy_plan(caches_drfftw3[id].plan);
	  fftw_free(caches_drfftw3[id].ptr);, 10)

static void drfft_fftw3(double *inout, int n, int direction, int
			howmany, int normalize)
{
    int i;
    double *ptr = inout;

    double *ptrc = NULL;
    fftw_plan plan = NULL;

    i = get_cache_id_drfftw3(n, direction, (1U << 6));
    plan = caches_drfftw3[i].plan;
    ptrc = caches_drfftw3[i].ptr;
    switch (direction) {
    case 1:
        for (i = 0; i < howmany; ++i, ptr += n) {
            memcpy(ptrc, ptr, sizeof(double) * n);
            fftw_execute(plan);
            COPYRFFTW2STD(ptrc, ptr, n);
        }
        break;

    case -1:
        for (i = 0; i < howmany; ++i, ptr += n) {
            COPYINVRFFTW2STD(ptr, ptrc, n);
            fftw_execute(plan);
            memcpy(ptr, ptrc, sizeof(double) * n);
        }
        break;
    default:
        fprintf(stderr, "drfft: invalid direction=%d\n", direction);
    }

    if (normalize) {
        double d = 1.0 / n;
        ptr = inout;
        for (i = n * howmany - 1; i >= 0; --i) {
            (*(ptr++)) *= d;
        }
    }
}<commit_msg>Set correct enum value instead of generated value by the preprocessor for FFTW3 real wrapper<commit_after>/*
 * Last Change: Wed Aug 01 07:00 PM 2007 J
 *
 * FFTW3 implementation
 *
 * Original code by <NAME>.
 */

GEN_CACHE(drfftw3, (int n, int d, int flags)
	  , int direction;
	  int flags;
	  fftw_plan plan;
	  double *ptr;, ((caches_drfftw3[i].n == n) &&
			 (caches_drfftw3[i].direction == d) &&
			 (caches_drfftw3[i].flags == flags))
	  , caches_drfftw3[id].direction = d;
	  caches_drfftw3[id].flags = flags;
	  caches_drfftw3[id].ptr =
	  (double *) fftw_malloc(sizeof(double) * (n));
	  caches_drfftw3[id].plan =
	  fftw_plan_r2r_1d(n, caches_drfftw3[id].ptr, caches_drfftw3[id].ptr,
			   (d > 0 ? FFTW_R2HC : FFTW_HC2R), flags);,
	  fftw_destroy_plan(caches_drfftw3[id].plan);
	  fftw_free(caches_drfftw3[id].ptr);, 10)

static void drfft_fftw3(double *inout, int n, int direction, int
			howmany, int normalize)
{
    int i;
    double *ptr = inout;

    double *ptrc = NULL;
    fftw_plan plan = NULL;

    i = get_cache_id_drfftw3(n, direction, FFTW_ESTIMATE);
    plan = caches_drfftw3[i].plan;
    ptrc = caches_drfftw3[i].ptr;
    switch (direction) {
    case 1:
        for (i = 0; i < howmany; ++i, ptr += n) {
            memcpy(ptrc, ptr, sizeof(double) * n);
            fftw_execute(plan);
            COPYRFFTW2STD(ptrc, ptr, n);
        }
        break;

    case -1:
        for (i = 0; i < howmany; ++i, ptr += n) {
            COPYINVRFFTW2STD(ptr, ptrc, n);
            fftw_execute(plan);
            memcpy(ptr, ptrc, sizeof(double) * n);
        }
        break;
    default:
        fprintf(stderr, "drfft: invalid direction=%d\n", direction);
    }

    if (normalize) {
        double d = 1.0 / n;
        ptr = inout;
        for (i = n * howmany - 1; i >= 0; --i) {
            (*(ptr++)) *= d;
        }
    }
}
{'fraction_non_alphanumeric': 0.14794369307203975, 'fraction_numerical': 0.025117306099917195, 'mean_word_length': 2.409219190968956, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4526963', 'n_tokens_mistral': 1542, 'n_tokens_neox': 1425, 'n_words': 319}