mirror of
https://github.com/davisking/dlib.git
synced 2024-11-01 10:14:53 +08:00
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:
parent
6bb0f8d05d
commit
4dcc40634a
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user