| 18 | |
| 19 | template <typename kernel_type, typename EXP> |
| 20 | const decision_function<kernel_type> convert_to_decision_function ( |
| 21 | const projection_function<kernel_type>& project_funct, |
| 22 | const matrix_exp<EXP>& vect |
| 23 | ) |
| 24 | { |
| 25 | // make sure requires clause is not broken |
| 26 | DLIB_ASSERT(project_funct.out_vector_size() > 0 && is_vector(vect) && |
| 27 | project_funct.out_vector_size() == vect.size() && project_funct.weights.nc() == project_funct.basis_vectors.size(), |
| 28 | "\t const decision_function convert_to_decision_function()" |
| 29 | << "\n\t Invalid inputs to this function." |
| 30 | << "\n\t project_funct.out_vector_size(): " << project_funct.out_vector_size() |
| 31 | << "\n\t project_funct.weights.nc(): " << project_funct.weights.nc() |
| 32 | << "\n\t project_funct.basis_vectors.size(): " << project_funct.basis_vectors.size() |
| 33 | << "\n\t is_vector(vect): " << is_vector(vect) |
| 34 | << "\n\t vect.size(): " << vect.size() |
| 35 | ); |
| 36 | |
| 37 | return decision_function<kernel_type>(trans(project_funct.weights)*vect, |
| 38 | 0, |
| 39 | project_funct.kernel_function, |
| 40 | project_funct.basis_vectors); |
| 41 | } |
| 42 | |
| 43 | // ---------------------------------------------------------------------------------------- |
| 44 | |