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

most vectors
This commit is contained in:
Davis King 2013-06-08 00:38:49 -04:00
parent 1513c94fb9
commit 4ef91280e4
1 changed files with 2 additions and 1 deletions

View File

@ -20,11 +20,12 @@ double predict (
const typename decision_function::kernel_type::sample_type& samp
)
{
typedef typename decision_function::kernel_type::sample_type T;
if (df.basis_vectors.size() == 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;
sout << "Input vector should have " << df.basis_vectors(0).size()