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

REFAC: Change internal computation and use of LabelList for contingency.

parent 4e4c2fed
No related branches found
No related tags found
No related merge requests found
......@@ -51,7 +51,7 @@ public:
MatrixType matrix;
void SetLabels(LabelList referenceLabels, LabelList producedLabels)
void SetLabels(const LabelList &referenceLabels, const LabelList &producedLabels)
{
m_RefLabels = referenceLabels;
m_ProdLabels = producedLabels;
......
......@@ -107,11 +107,8 @@ ContingencyTableCalculator<TClassLabel>
unsigned int rows = static_cast<unsigned int>(m_NumberOfRefClasses);
unsigned int cols = static_cast<unsigned int>(m_NumberOfProdClasses);
std::vector<TClassLabel> referenceLabels;
std::vector<TClassLabel> producedLabels;
std::copy(refLabels.begin(), refLabels.end(), std::back_inserter(referenceLabels));
std::copy(prodLabels.begin(), prodLabels.end(), std::back_inserter(producedLabels));
std::vector<TClassLabel> referenceLabels(refLabels.begin(), refLabels.end());
std::vector<TClassLabel> producedLabels(prodLabels.begin(), prodLabels.end());
ContingencyTablePointerType contingencyTable = ContingencyTableType::New();
contingencyTable->SetLabels(referenceLabels, producedLabels);
......
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