Skip to content
Snippets Groups Projects
Commit 77534adc authored by Ludovic Hussonnois's avatar Ludovic Hussonnois
Browse files

ENH: throw exception if labels iterators do not end at the same time.

parent 9bd55905
No related branches found
No related tags found
No related merge requests found
......@@ -22,6 +22,7 @@
#define otbContingencyTableCalculator_txx
#include "otbContingencyTableCalculator.h"
#include "itkMacro.h"
#include "itkVariableLengthVector.h"
#include "itkListSample.h"
......@@ -59,6 +60,9 @@ ContingencyTableCalculator<TClassLabel>
++prodBegin;
++m_NumberOfSamples;
}
if( refBegin != refEnd || prodBegin != prodEnd )
itkExceptionMacro(<< "The references and produced labels did not end simultaneously.");
}
template<class TClassLabel>
......@@ -79,6 +83,10 @@ ContingencyTableCalculator<TClassLabel>
++itRef;
++itProd;
}
if( !itRef.IsAtEnd() || !itProd.IsAtEnd() )
itkExceptionMacro(<< "The references and produced labels did not end simultaneously.");
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment