[問題] FFTW_excute 錯誤
in = (fftw_complex**) fftw_malloc(image->height* sizeof(fftw_complex));
inrow = (fftw_complex*) fftw_malloc(image->width*image->height*
sizeof(fftw_complex));
for(int i=0; i<image->height; ++i)
in[i] = &inrow[i*image->width];
cout << "in set" << endl;
out = (fftw_complex**) fftw_malloc(image->height* sizeof(fftw_complex));
outrow = (fftw_complex*) fftw_malloc(image->width*image->height*
sizeof(fftw_complex));
for(int i=0; i<image->height; ++i)
out[i] = &outrow[i*image->width];
cout << "out set" << endl;
for(int i=0;i<image->height;i++){
for(int j=0;j<image->width;j++){
in[i][j][0] = (float)B[i][j]; // 實部
in[i][j][1] = 0.0; // 虛部
}
}
cout << "value set" << endl;
p = fftw_plan_dft_2d(image->height,image->width,
&in[0][0],&out[0][0],FFTW_FORWARD,FFTW_ESTIMATE);
cout << "plan set" << endl;
fftw_execute(p); /* repeat as needed */
cout << "execute" << endl;
動態陣列應該是OK吧? 目前起碼不會碰到爆stack
上網查的結果 是因為global以及point會被存在heap
heap就不用擔心會爆炸!!!
但是現在我的問題是 excute就會爆炸
就是程式跑出 plan set以後 就Error了!!
但是也不是每一次...Orz||| 時好時壞
可以請問有寫過FFTW的大大 這大概是什麼問題嗎?
抱歉最近一直在版上發問了...Orz|||
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.113.139.4
※ 編輯: grayyoung 來自: 140.113.139.4 (08/03 10:36)
→
08/03 13:01, , 1F
08/03 13:01, 1F
→
08/03 13:01, , 2F
08/03 13:01, 2F
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章