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
This commit is contained in:
Davis King 2009-03-20 02:08:34 +00:00
parent 6bb0f8d05d
commit 4dcc40634a

View File

@ -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)