Added missing assert

This commit is contained in:
Davis King 2014-05-04 21:32:50 -04:00
parent 9980013cb9
commit 461abe65db
1 changed files with 11 additions and 0 deletions

View File

@ -628,6 +628,17 @@ namespace dlib
if (has_prior()) if (has_prior())
{ {
if (is_matrix<sample_type>::value)
{
// make sure requires clause is not broken
DLIB_CASSERT(num_dims+1 == (unsigned long)prior.size(),
"\t decision_function svm_c_linear_trainer::train(x,y)"
<< "\n\t The dimension of the training vectors must match the dimension of\n"
<< "\n\t those used to create the prior."
<< "\n\t num_dims: " << num_dims
<< "\n\t prior.size(): " << prior.size()
);
}
svm_objective = solver( svm_objective = solver(
make_oca_problem_c_svm<w_type>(Cpos, Cneg, x, y, verbose, eps, max_iterations), make_oca_problem_c_svm<w_type>(Cpos, Cneg, x, y, verbose, eps, max_iterations),
w, w,