| 767 | } |
| 768 | |
| 769 | result_type operator() ( |
| 770 | const sample_type& x |
| 771 | ) const |
| 772 | { |
| 773 | // make sure requires clause is not broken |
| 774 | DLIB_ASSERT(weights.size() > 0 && |
| 775 | weights.nr() == (long)number_of_classes() && |
| 776 | weights.nr() == b.size(), |
| 777 | "\t result_type multiclass_linear_decision_function::operator()(x)" |
| 778 | << "\n\t This object must be properly initialized before you can use it." |
| 779 | << "\n\t weights.size(): " << weights.size() |
| 780 | << "\n\t weights.nr(): " << weights.nr() |
| 781 | << "\n\t number_of_classes(): " << number_of_classes() |
| 782 | ); |
| 783 | |
| 784 | return predict(x).first; |
| 785 | } |
| 786 | }; |
| 787 | |
| 788 | template < |