Hi ,professors,
When i use parallel_for on my defining struct ,It can not work.
The part of my code is :
struct Result //This is my defining struct.
{
int Path;
double Amp;
double Phase;
};
void apfft(Result* T); //This is my defining function.
Result FFTResult[L]; // This is my defining array.
for(int i=0;i{
FFTResult[i].Path=i;
FFTResult[i].Amp=0;
FFTResult[i].Phase=0;
apfft(&FFTResult[i]);
}
The following is my parallel code , but it does not work.
class ParaFFT
{
void operator()(const blocked_range&range)const
{
for(int i=range.begin();i!=range.end();++i)
{
FFTResult[i].Path=i;
FFTResult[i].Amp=0;
FFTResult[i].Phase=0;
apfft(&FFTResult[i]);
}
}
};
parallel_for(blocked_range(0,L-1,1),FFTResult[i]);
I try it many days,but i found i can not translate my own defining struct .
Please help me or instruct me . Many thanks.



