| 94 | |
| 95 | template <typename decision_function> |
| 96 | double normalized_predict ( |
| 97 | const normalized_function<decision_function>& df, |
| 98 | const typename decision_function::kernel_type::sample_type& samp |
| 99 | ) |
| 100 | { |
| 101 | typedef typename decision_function::kernel_type::sample_type T; |
| 102 | if (df.function.basis_vectors.size() == 0) |
| 103 | { |
| 104 | return 0; |
| 105 | } |
| 106 | else if (is_matrix<T>::value && df.function.basis_vectors(0).size() != samp.size()) |
| 107 | { |
| 108 | std::ostringstream sout; |
| 109 | sout << "Input vector should have " << df.function.basis_vectors(0).size() |
| 110 | << " dimensions, not " << samp.size() << "."; |
| 111 | PyErr_SetString( PyExc_ValueError, sout.str().c_str() ); |
| 112 | throw py::error_already_set(); |
| 113 | } |
| 114 | return df(samp); |
| 115 | } |
| 116 | |
| 117 | template <typename decision_function> |
| 118 | std::vector<double> normalized_predict_vec ( |
no test coverage detected