From: Tzu-Ming Kuo Date: Fri, 6 Jun 2014 15:42:35 +0000 (+0800) Subject: modify matlab/train.c to check if the label vector is in dense format. X-Git-Tag: v195~14^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3da54042a9f0039f589b9872b4635d843e58258c;p=liblinear modify matlab/train.c to check if the label vector is in dense format. --- diff --git a/matlab/train.c b/matlab/train.c index 1301ed5..7c29280 100644 --- a/matlab/train.c +++ b/matlab/train.c @@ -356,12 +356,20 @@ void mexFunction( int nlhs, mxArray *plhs[], { int err=0; - if(!mxIsDouble(prhs[0]) || !mxIsDouble(prhs[1])) { + if(!mxIsDouble(prhs[0]) || !mxIsDouble(prhs[1])) + { mexPrintf("Error: label vector and instance matrix must be double\n"); fake_answer(nlhs, plhs); return; } + if(mxIsSparse(prhs[0])) + { + mexPrintf("Error: label vector should not be in sparse format"); + fake_answer(nlhs, plhs); + return; + } + if(parse_command_line(nrhs, prhs, NULL)) { exit_with_help();