vector<bool> changedArray(src.size()*chn.size()-1);
size_t srcSize=src.size();
size_t chnSize=chn.size();
size_t exeTime=0;
for(size_t i=0;i<srcSize;++i)
{
for(size_t j=0;j<chnSize-1;++j)
{
changedArray.at(exeTime)=src.at(i)->at(seq.at(j)) ^ src.at(i)->at(seq.at(j+1));
exeTime++;
}
if(i!=srcSize-1)
{
changedArray.at(exeTime)=src.at(i)->at(seq.at(chnSize-1)) ^ src.at(i+1)->at(seq[0]);
exeTime++;
}
}
vector<TestCase*>* cases=new vector<TestCase*>(changedArray.size()-chnSize+1,NULL);
#pragma omp parallel for
for(int i=0;i<changedArray.size()-chnSize+1;i++)
{
double peakPower=0;
for(size_t j=0;j<chnSize;j++)
{
if(changedArray.at(i+j))
peakPower+=chn.at(chnSize-j-1).Power();
}
cases->at(i)=new TestCase(peakPower,i);
}
ICAgIHZlY3Rvcjxib29sPiBjaGFuZ2VkQXJyYXkoc3JjLnNpemUoKSpjaG4uc2l6ZSgpLTEpOwogICAgc2l6ZV90IHNyY1NpemU9c3JjLnNpemUoKTsKCXNpemVfdCBjaG5TaXplPWNobi5zaXplKCk7CglzaXplX3QgZXhlVGltZT0wOwoJZm9yKHNpemVfdCBpPTA7aTxzcmNTaXplOysraSkKCXsKCQlmb3Ioc2l6ZV90IGo9MDtqPGNoblNpemUtMTsrK2opCgkJewoJCQljaGFuZ2VkQXJyYXkuYXQoZXhlVGltZSk9c3JjLmF0KGkpLT5hdChzZXEuYXQoaikpIF4gc3JjLmF0KGkpLT5hdChzZXEuYXQoaisxKSk7CgkJCWV4ZVRpbWUrKzsKCQl9CgkJaWYoaSE9c3JjU2l6ZS0xKQoJCXsKCQkJY2hhbmdlZEFycmF5LmF0KGV4ZVRpbWUpPXNyYy5hdChpKS0+YXQoc2VxLmF0KGNoblNpemUtMSkpIF4gc3JjLmF0KGkrMSktPmF0KHNlcVswXSk7CgkJCWV4ZVRpbWUrKzsKCQl9Cgl9Cgl2ZWN0b3I8VGVzdENhc2UqPiogY2Fz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