Commit 4dcc4063 authored by Davis King's avatar Davis King

Fixed the dictionary_size() member functions in the kcentroid overloads so

that they always return the correct numbers.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%402960
parent 6bb0f8d0
......@@ -537,7 +537,12 @@ namespace dlib
) const
{
if (samples_seen > 0)
return 1;
{
if (std::abs(w_extra) > std::numeric_limits<scalar_type>::epsilon())
return 1;
else
return 2;
}
else
return 0;
}
......@@ -1155,9 +1160,16 @@ namespace dlib
) const
{
if (samples_seen > 0)
return 1;
{
if (std::abs(w_extra) > std::numeric_limits<scalar_type>::epsilon())
return 1;
else
return 2;
}
else
{
return 0;
}
}
friend void serialize(const kcentroid& item, std::ostream& out)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment