std::vector push_back cannot guarantee the correct behavior when calling at the same time as it is now (there is no thread safety).
, , resize :
output.resize(input.rows);
int k = 0;
#pragma omp parallel for shared(k, input)
for( int i = 0; i < input.rows; i++ )
{
if(IsGoodMatch(input[I])
{
Newvalues newValues;
...
output[k] = newValues;
k++;
}
}
output.resize(k);
operator[] std::vector, . (.. , mutex), k.
" , ?"
. ( ). , , , .