diff --git a/dlib/svm/kcentroid.h b/dlib/svm/kcentroid.h index c569beef6..70dcafcd4 100644 --- a/dlib/svm/kcentroid.h +++ b/dlib/svm/kcentroid.h @@ -56,6 +56,12 @@ namespace dlib return my_max_dictionary_size; } + const kernel_type& get_kernel ( + ) const + { + return kernel; + } + void clear_dictionary () { dictionary.clear(); diff --git a/dlib/svm/kcentroid_abstract.h b/dlib/svm/kcentroid_abstract.h index 5df70cc19..517c651c1 100644 --- a/dlib/svm/kcentroid_abstract.h +++ b/dlib/svm/kcentroid_abstract.h @@ -58,11 +58,17 @@ namespace dlib ensures - this object is properly initialized - #tolerance() == tolerance_ - - #get_decision_function().kernel_function == kernel_ - (i.e. this object will use the given kernel function) + - #get_kernel() == kernel_ - #max_dictionary_size() == max_dictionary_size_ !*/ + const kernel_type& get_kernel ( + ) const; + /*! + ensures + - returns a const reference to the kernel used by this object + !*/ + unsigned long max_dictionary_size( ) const; /*! diff --git a/dlib/svm/kkmeans.h b/dlib/svm/kkmeans.h index c0678ab45..325c8115b 100644 --- a/dlib/svm/kkmeans.h +++ b/dlib/svm/kkmeans.h @@ -39,6 +39,12 @@ namespace dlib { } + const kernel_type& get_kernel ( + ) const + { + return kc.get_kernel(); + } + void set_kcentroid ( const kcentroid& kc_ ) @@ -92,7 +98,7 @@ namespace dlib // make sure requires clause is not broken DLIB_ASSERT(samples.nc() == 1 && initial_centers.nc() == 1 && - initial_centers.nr() == number_of_centers(), + initial_centers.nr() == static_cast(number_of_centers()), "\tvoid kkmeans::train()" << "\n\tInvalid arguments to this function" << "\n\tthis: " << this diff --git a/dlib/svm/kkmeans_abstract.h b/dlib/svm/kkmeans_abstract.h index 0383db6a2..a8adde00b 100644 --- a/dlib/svm/kkmeans_abstract.h +++ b/dlib/svm/kkmeans_abstract.h @@ -71,6 +71,13 @@ namespace dlib by the k-means clustering algorithm. !*/ + const kernel_type& get_kernel ( + ) const; + /*! + ensures + - returns a const reference to the kernel used by this object + !*/ + void set_number_of_centers ( unsigned long num ); diff --git a/dlib/svm/krls.h b/dlib/svm/krls.h index e6274248b..4f158505e 100644 --- a/dlib/svm/krls.h +++ b/dlib/svm/krls.h @@ -51,6 +51,12 @@ namespace dlib return my_max_dictionary_size; } + const kernel_type& get_kernel ( + ) const + { + return kernel; + } + void clear_dictionary () { dictionary.clear(); diff --git a/dlib/svm/krls_abstract.h b/dlib/svm/krls_abstract.h index ca5df27cc..ae0c95e6a 100644 --- a/dlib/svm/krls_abstract.h +++ b/dlib/svm/krls_abstract.h @@ -58,6 +58,7 @@ namespace dlib - #tolerance() == tolerance_ - #get_decision_function().kernel_function == kernel_ (i.e. this object will use the given kernel function) + - #get_kernel() == kernel_ - #max_dictionary_size() == max_dictionary_size_ !*/ @@ -74,6 +75,13 @@ namespace dlib less accurate decision function but also in less support vectors. !*/ + const kernel_type& get_kernel ( + ) const; + /*! + ensures + - returns a const reference to the kernel used by this object + !*/ + unsigned long max_dictionary_size( ) const; /*!