void CompressInterface::execute() { if( _verbose >= 1 ) { cout << "Called " << name() << " execute method..."; } if (_verbose >= 3) { cout << endl; } double tic = toc(); init(); while(!hasConverged()) { iterate(); _iters++; if( _verbose >= 3 ) { cout << name() << "::execute: #varClusters " << _varClustering.size() << ", #facClusters " << _facClustering.size() << " after " << _iters << " passes (" << toc() - tic << " secs.)" << endl; } } if( _verbose >= 1 ) { cout << "Finished in " << _iters << " iterations (" << toc() - tic << " secs.)" << endl; } }
void RandomGlobalPoll::doFunctionComputed ( const std::vector<double>& point, double value ) { if(hasConverged()) return; if ( population.size() < dimPopul ) { population.push_back ( make_pair ( point, value ) ); if ( population.size() == dimPopul ) prepareForFamily(); } else computedFamilyStepFunction ( point, value ); }
std::vector<double> RandomGlobalPoll::nextPoint() { if(hasConverged()) return min_element ( population.begin(),population.end() )->point(); if ( population.size() < dimPopul ) { ++timesInitialPopulation; return randomPoint(); } return computeFamilyStepPoint ( std::min ( bounds.size()+1,population.size()-1 ) ); }