fork download
  1. vector<bool> changedArray(src.size()*chn.size()-1);
  2. size_t srcSize=src.size();
  3. size_t chnSize=chn.size();
  4. size_t exeTime=0;
  5. for(size_t i=0;i<srcSize;++i)
  6. {
  7. for(size_t j=0;j<chnSize-1;++j)
  8. {
  9. changedArray.at(exeTime)=src.at(i)->at(seq.at(j)) ^ src.at(i)->at(seq.at(j+1));
  10. exeTime++;
  11. }
  12. if(i!=srcSize-1)
  13. {
  14. changedArray.at(exeTime)=src.at(i)->at(seq.at(chnSize-1)) ^ src.at(i+1)->at(seq[0]);
  15. exeTime++;
  16. }
  17. }
  18. vector<TestCase*>* cases=new vector<TestCase*>(changedArray.size()-chnSize+1,NULL);
  19. #pragma omp parallel for
  20. for(int i=0;i<changedArray.size()-chnSize+1;i++)
  21. {
  22. double peakPower=0;
  23. for(size_t j=0;j<chnSize;j++)
  24. {
  25. if(changedArray.at(i+j))
  26. peakPower+=chn.at(chnSize-j-1).Power();
  27. }
  28. cases->at(i)=new TestCase(peakPower,i);
  29. }
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty