本文整理汇总了C++中ProgressBar::advance方法的典型用法代码示例。如果您正苦于以下问题:C++ ProgressBar::advance方法的具体用法?C++ ProgressBar::advance怎么用?C++ ProgressBar::advance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProgressBar
的用法示例。
在下文中一共展示了ProgressBar::advance方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
// Init arrays
rawData = new short[nRecords]; // Buffer for all data (all channels)
mean = new double* [arguments.nChannels]; // means init
sum = new double* [arguments.nChannels]; // sums init
if(arguments.isExtraFeaturesProvided)
peakVal = new short* [arguments.nChannels]; // peak values init&
if(!arguments.isCenteredData)
datSpkChan = new gsl_matrix* [arguments.nChannels];
datSpkChanCenter = new gsl_matrix* [arguments.nChannels];
reducedData = new gsl_matrix* [arguments.nChannels];
varcov = new gsl_matrix* [arguments.nChannels];
progress->start(); // Start progress bar
///progress->message("Extracting data");
// Get data
if ( arguments.isInputFileProvided )
{
rewind(inputFile); // put the position indicator at the beginning of the stream
nRecordsRead = fread(rawData,sizeof(short),nRecords,inputFile);
fclose(inputFile);
}
else
{
nRecordsRead = fread(rawData,sizeof(short),nRecords,stdin);
} // else
if ( nRecordsRead != nRecords )
{
cerr << "error: insufficient number of records in the file (" << nRecordsRead
<< ", expecting " << nRecords << ")" << endl;
exit(1);
}
progress->advance(); // Complete data importation
// Fill arrays with rec values & compute means
///progress->message("Preparing data for PCA");
for ( int i = 0 ; i < arguments.nChannels ; ++i )
{
mean[i] = new double[data2use];
sum[i] = new double[data2use];
datSpkChanCenter[i] = gsl_matrix_alloc(data2use,nSpikes);
if(!arguments.isCenteredData)
datSpkChan[i] = gsl_matrix_alloc(data2use,nSpikes);
if(arguments.isExtraFeaturesProvided)
peakVal[i] = new short[nSpikes];
varcov[i] = gsl_matrix_alloc(data2use,data2use);
reducedData[i] = gsl_matrix_alloc(arguments.nComponents,nSpikes);
for ( int j = 0 ; j < data2use ; ++j )
{
mean[i][j] = -1;
sum[i][j] = 0;
for ( unsigned int k = 0 ; k < nSpikes ; ++k )
{
double v = rawData[(arguments.nChannels*arguments.spikeLength)*k+((j+recShift)*arguments.nChannels)+i];
gsl_matrix_set(datSpkChanCenter[i],j,k,v);
if(!arguments.isCenteredData)
gsl_matrix_set(datSpkChan[i],j,k,v);
sum[i][j] += v;
if(arguments.isExtraFeaturesProvided && (j+recShift)==arguments.peakPosition)
peakVal[i][k] = v; // if this is the peak, store it !
} // for k
mean[i][j] = sum[i][j]/nSpikes; // mean computation
for ( unsigned int k = 0 ; k < nSpikes ; ++k )
{