An error ocurrs when none of the entries have a match.
The following test code produces the error:
CMatrixDouble y, y\_cov, z;
y.setSize\(1,1\);
y\_cov.setSize\(1,1\);
z.setSize\(1,1\);
y\(0,0\) = 0.0;
y\_cov\(0,0\) = 1.0;
z\(0,0\) = 10.0;
TDataAssociationResults DAresults;
data\_association\_independent\_predictions\(z, y, y\_cov, DAresults, assocJCBB, metricMaha, 0.99, true, std::vector<prediction\_index\_t>\(\), metricMaha, 0.0\);
Added the following code to line 444 in data_association.cpp seems to fix the problem:
if(std::accumulate( results.indiv_compatibility_counts.begin(), results.indiv_compatibility_counts.end(),0 )==0)
return;
If all indiv_compatibility_counts are zero then return.
Hi Mauricio, and thanks for the test code!
Unfortunately (or luckly?), I've been unable to replicate the failure... See the new unit test that I just created to put your code at test:
http://code.google.com/p/mrpt/source/detail?r=2985
and which doesn't complain: it seems there're no errors raised and the function correctly returns 0 correspondences.
Please, let me know if the error was somewhere else and I overlooked it.
(marking as open)