+ if( !local_alloc )
+ cvFree( &buffer );
+
+ return result;
+}
+
+float CvSVM::predict( const CvMat* sample, bool returnDFVal ) const
+{
+ float result = 0;
+ float* row_sample = 0;
+
+ CV_FUNCNAME( "CvSVM::predict" );
+
+ __BEGIN__;
+
+ int class_count;
+
+ if( !kernel )
+ CV_ERROR( CV_StsBadArg, "The SVM should be trained first" );
+
+ class_count = class_labels ? class_labels->cols :
+ params.svm_type == ONE_CLASS ? 1 : 0;
+
+ CV_CALL( cvPreparePredictData( sample, var_all, var_idx,
+ class_count, 0, &row_sample ));
+ result = predict( row_sample, get_var_count(), returnDFVal );