CatActionList::CatActionList(QWidget *parent) : QDialog(parent) { ui.setupUi(this); initialList(); }
int main(int argc, char *argv[]) { cout << "Enter dimension" << endl; cin >> dim; //dim = 4; cout << "Enter number to generate partitions" << endl; cin >> num; //num = 20; //Initializing the array p[0] = node(dim); p[1] = node(dim); p[2] = node(dim); possible[0] = node(dim); possible[1] = node(dim); //Initializing possible with initial possible nodes int l=0; //Iterator for(int j=dim-1;j>=0;j--) { int *x = node(dim); x[j] = 1; delete [] possible[l]; possible[l] = x; l++; } //Creating List object shared_ptr<List> initialList(new List()); //Inserting 0 node initialList->insert_tail(node(dim)); //pointer initialization d = NULL; a = NULL; //Initilization of results res[0] = 1; res[1] = 1; sum[0] = 0; sum[1] = 1; int start_s = clock(); //The main call addpart(1,0,dim-1,initialList); int stop_s = clock(); //Printing time cout << "Time : " << (stop_s - start_s)/(double)(CLOCKS_PER_SEC)*1000 << endl; //Deleting pointer a if(a!=NULL) { delete [] a; } //Deleting pointer d if(d!=NULL) { delete [] d; } //Result /*cout << "Result : " << endl; for(int j=0;j<=num;j++) { cout << "res["<<j<<"]" << ": " << res[j] << endl; }*/ //Sum cout << "Sum : " << endl; for(int j=0;j<2000;j++) { if(j<=num) { cout << fixed << setprecision(0) << "sum["<<j<<"]" << ": " << sum[j] << endl; } //Deleting objects from the arrays if(p[j]!=NULL) { delete [] p[j]; } if(possible[j]!=NULL) { delete [] possible[j]; } } //Deleting List instance //delete initialList; }