From 3da54042a9f0039f589b9872b4635d843e58258c Mon Sep 17 00:00:00 2001 From: Tzu-Ming Kuo Date: Fri, 6 Jun 2014 23:42:35 +0800 Subject: [PATCH] modify matlab/train.c to check if the label vector is in dense format. --- matlab/train.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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(); -- 2.50.1