void combination::OnButton2() { // TODO: Add your control notification handler code here m_progress.SetPos(0); m_progress.SetRange(0,100); combination a; a.make_combinations(0); } void combination:: make_combinations(int lo_val) { srand(time(0)); m_progress.StepIt(); ofstream fout("combination.txt",ios::app); ofstream fout2("time.txt",ios::app); for(int i=0; i<theApp.no_of_process; i++) { //m_progress.OffsetPos(100/4); //m_progress.SetStep(200); clock_t begin=clock(); arr[lo_val] = i; if(lo_val==(theApp.no_of_tasks)-1) { for( int j=0; j<theApp.no_of_tasks; j++) { int number = arr[j]; fout<<Matrix[j][number]; } fout<<endl; } else { //Sleep(2); make_combinations(lo_val+1); clock_t end=clock(); theApp.combination_time[i][0]=(diffclock(end,begin))/1000; fout2<<theApp.combination_time[i][0]<<endl; } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)