pull/13383/head
Maria Dimashova 14 years ago
parent 9ce792fb3a
commit 2f81eb22f6
  1. 5
      modules/ml/src/svm.cpp

@ -1736,7 +1736,7 @@ bool CvSVM::train_auto( const CvMat* _train_data, const CvMat* _responses,
block_size = MAX( block_size, sample_count*2*(int)sizeof(double) + 1024 ); block_size = MAX( block_size, sample_count*2*(int)sizeof(double) + 1024 );
block_size = MAX( block_size, sample_size*2 + 1024 ); block_size = MAX( block_size, sample_size*2 + 1024 );
CV_CALL(storage = cvCreateMemStorage(block_size)); CV_CALL( storage = cvCreateMemStorage(block_size + sizeof(CvMemBlock) + sizeof(CvSeqBlock)));
CV_CALL(temp_storage = cvCreateChildMemStorage(storage)); CV_CALL(temp_storage = cvCreateChildMemStorage(storage));
CV_CALL(alpha = (double*)cvMemStorageAlloc(temp_storage, sample_count*sizeof(double))); CV_CALL(alpha = (double*)cvMemStorageAlloc(temp_storage, sample_count*sizeof(double)));
@ -2444,7 +2444,8 @@ void CvSVM::read( CvFileStorage* fs, CvFileNode* svm_node )
block_size = MAX( block_size, sv_total*(int)sizeof(CvSVMKernelRow)); block_size = MAX( block_size, sv_total*(int)sizeof(CvSVMKernelRow));
block_size = MAX( block_size, sv_total*2*(int)sizeof(double)); block_size = MAX( block_size, sv_total*2*(int)sizeof(double));
block_size = MAX( block_size, var_all*(int)sizeof(double)); block_size = MAX( block_size, var_all*(int)sizeof(double));
CV_CALL( storage = cvCreateMemStorage( block_size ));
CV_CALL( storage = cvCreateMemStorage(block_size + sizeof(CvMemBlock) + sizeof(CvSeqBlock)));
CV_CALL( sv = (float**)cvMemStorageAlloc( storage, CV_CALL( sv = (float**)cvMemStorageAlloc( storage,
sv_total*sizeof(sv[0]) )); sv_total*sizeof(sv[0]) ));

Loading…
Cancel
Save