[問題] FFTW_excute 錯誤

看板C_and_CPP (C/C++)作者 (灰狼)時間16年前 (2009/08/03 10:25), 編輯推噓0(002)
留言2則, 1人參與, 最新討論串1/1
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
歐毆毆 最後在剛剛Meeting前忽然頓悟
08/03 13:01, 1F

08/03 13:01, , 2F
沒問題了= =
08/03 13:01, 2F
文章代碼(AID): #1ATagEh6 (C_and_CPP)
文章代碼(AID): #1ATagEh6 (C_and_CPP)