Commit 4ef91280 authored by Davis King's avatar Davis King

Fixed a bug in the sparse decision functions. The input validation rejected

most vectors
parent 1513c94f
...@@ -20,11 +20,12 @@ double predict ( ...@@ -20,11 +20,12 @@ double predict (
const typename decision_function::kernel_type::sample_type& samp const typename decision_function::kernel_type::sample_type& samp
) )
{ {
typedef typename decision_function::kernel_type::sample_type T;
if (df.basis_vectors.size() == 0) if (df.basis_vectors.size() == 0)
{ {
return 0; return 0;
} }
else if (df.basis_vectors(0).size() != samp.size()) else if (is_matrix<T>::value && df.basis_vectors(0).size() != samp.size())
{ {
std::ostringstream sout; std::ostringstream sout;
sout << "Input vector should have " << df.basis_vectors(0).size() sout << "Input vector should have " << df.basis_vectors(0).size()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment