mirror of
https://github.com/davisking/dlib.git
synced 2024-11-01 10:14:53 +08:00
Added a requires clause to the set_tolerance() member function and
renamed clear() to clear_dictionary(). --HG-- extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%402249
This commit is contained in:
parent
8e51330251
commit
13ed137cb2
@ -36,11 +36,18 @@ namespace dlib
|
||||
kernel(kernel_),
|
||||
tolerance(tolerance_)
|
||||
{
|
||||
clear();
|
||||
clear_dictionary();
|
||||
}
|
||||
|
||||
void set_tolerance (scalar_type tolerance_)
|
||||
{
|
||||
// make sure requires clause is not broken
|
||||
DLIB_ASSERT(tolerance_ >= 0,
|
||||
"\tvoid krls::set_tolerance"
|
||||
<< "\n\tinvalid tolerance value"
|
||||
<< "\n\ttolerance: " << tolerance_
|
||||
<< "\n\tthis: " << this
|
||||
);
|
||||
tolerance = tolerance_;
|
||||
}
|
||||
|
||||
@ -49,7 +56,7 @@ namespace dlib
|
||||
return tolerance;
|
||||
}
|
||||
|
||||
void clear ()
|
||||
void clear_dictionary ()
|
||||
{
|
||||
dictionary.clear();
|
||||
alpha.clear();
|
||||
|
@ -56,6 +56,8 @@ namespace dlib
|
||||
scalar_type tolerance_
|
||||
);
|
||||
/*!
|
||||
requires
|
||||
- tolerance_ >= 0
|
||||
ensures
|
||||
- #get_tolerance() == tolerance_
|
||||
!*/
|
||||
@ -73,15 +75,12 @@ namespace dlib
|
||||
less accurate decision function but also in less support vectors.
|
||||
!*/
|
||||
|
||||
void clear (
|
||||
void clear_dictionary (
|
||||
);
|
||||
/*!
|
||||
ensures
|
||||
- clears out all learned data and puts this object back to its
|
||||
initial state.
|
||||
- clears out all learned data
|
||||
(e.g. #get_decision_function().support_vectors.size() == 0)
|
||||
- #get_tolerance() == get_tolerance()
|
||||
(i.e. doesn't change the value of the tolerance)
|
||||
!*/
|
||||
|
||||
scalar_type operator() (
|
||||
|
Loading…
Reference in New Issue
Block a user