Skip to content

Commit 6ce85a2

Browse files
committed
sorting out max types
1 parent d5b8f89 commit 6ce85a2

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

source/projects/rapid.classification/rapid.classification.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,11 @@ class rapid_classification : public object<rapid_classification>
3131
attribute<int> k { this, "k", 1,
3232
description {"Number of neighbours to consider when classiftying"},
3333
setter { MIN_FUNCTION {
34-
std::vector<int> current { classificationModels.getK() };
35-
if (current.size() > 0 && args[0] != current[0])
34+
const std::vector<int> current { classificationModels.getK() };
35+
const int newK { static_cast<int>(atom_getlong(&args[0])) };
36+
if (current.size() > 0 && newK != current[0])
3637
{
37-
classificationModels.setK(0, args[0]);
38+
classificationModels.setK(0, newK);
3839
}
3940
return args;
4041
}}

0 commit comments

Comments
 (0)