mirror of
https://github.com/davisking/dlib.git
synced 2024-11-01 10:14:53 +08:00
Added a missing requires clause to the kkmeans object.
--HG-- extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%402367
This commit is contained in:
parent
3946767f6e
commit
828f7bbb87
@ -58,6 +58,15 @@ namespace dlib
|
||||
unsigned long i
|
||||
) const
|
||||
{
|
||||
// make sure requires clause is not broken
|
||||
DLIB_ASSERT(i < number_of_centers(),
|
||||
"\tkcentroid kkmeans::get_kcentroid(i)"
|
||||
<< "\n\tYou have given an invalid value for i"
|
||||
<< "\n\ti: " << i
|
||||
<< "\n\tnumber_of_centers(): " << number_of_centers()
|
||||
<< "\n\tthis: " << this
|
||||
);
|
||||
|
||||
return *centers[i];
|
||||
}
|
||||
|
||||
|
@ -65,6 +65,8 @@ namespace dlib
|
||||
unsigned long i
|
||||
) const;
|
||||
/*!
|
||||
requires
|
||||
- i < number_of_centers()
|
||||
ensures
|
||||
- returns a const reference to the ith kcentroid object contained in
|
||||
this object. Each kcentroid represents one of the centers found
|
||||
|
Loading…
Reference in New Issue
Block a user