int main ( int argc, char *argv[] ) { int choice,fail,prec; adainit(); greetings(); prec = prompt_for_precision(); printf("\nWelcome to the blackbox solver in PHCpack :\n"); printf(" 1. the input polynomial system will be typed in; or\n"); printf(" 2. the system typed in is a Laurent polynomial system; or\n"); printf(" 3. an input file contains the input polynomial system; or\n"); printf(" 4. the input Laurent system is on an input file.\n"); printf("Type 1, 2, 3, or 4 to make your choice : "); scanf("%d",&choice); if(choice == 1) fail = interactive_input_output(prec); else if (choice == 2) fail = interactive_Laurent_input_output(prec); else if (choice == 3) fail = input_output_on_files(prec); else fail = Laurent_input_output_on_files(prec); adafinal(); return 0; }
int main ( int argc, char *argv[] ) { const int verbose = 0; // set to 1 for more info int myid,numprocs,precision,fail,ns; char* filename; adainit(); MPI_Init(&argc,&argv); MPI_Comm_size(MPI_COMM_WORLD,&numprocs); MPI_Comm_rank(MPI_COMM_WORLD,&myid); if(verbose > 0) { printf("\nHello from process %d!\n", myid); MPI_Barrier(MPI_COMM_WORLD); } if(myid == 0) precision = prompt_for_precision(); MPI_Bcast(&precision,1,MPI_INT,0,MPI_COMM_WORLD); if(verbose > 0) printf("\nProcess %d has %d as precision.\n", myid, precision); MPI_Barrier(MPI_COMM_WORLD); filename = (char*)calloc(80,sizeof(char)); if(myid == 0) { char nl; printf("\nReading the name of the output file ..."); printf("\nGive a string of characters : "); scanf("%s",filename); scanf("%c",&nl); /* skip newline symbol for next reading ...*/ if(verbose > 0) printf("\nThe output file is \"%s\".\n", filename); ns = strlen(filename); fail = define_output_file_with_string(ns,filename); } MPI_Bcast(&ns,1,MPI_INT,0,MPI_COMM_WORLD); MPI_Bcast(filename,ns,MPI_CHAR,0,MPI_COMM_WORLD); if(verbose > 0) printf("\nNode %d has filename \"%s\".\n", myid, filename); MPI_Barrier(MPI_COMM_WORLD); switch(precision) { case 0: fail = standard_run(myid,numprocs,ns,filename,verbose); break; case 1: fail = dobldobl_run(myid,numprocs,ns,filename,verbose); break; case 2: fail = quaddobl_run(myid,numprocs,ns,filename,verbose); break; default: printf("Invalid choice of precision.\n"); } MPI_Finalize(); adafinal(); return 0; }
int main ( int argc, char *argv[] ) { int fail,nbsol; adainit(); int level = prompt_for_precision(); if(level == 0) { fail = call_initialize_standard_homotopy(&nbsol); fail = call_standard_path_tracker(nbsol); fail = clear_standard_tracker(); } else if(level == 1) { fail = call_initialize_dobldobl_homotopy(&nbsol); fail = call_dobldobl_path_tracker(nbsol); fail = clear_dobldobl_tracker(); } else if(level == 2) { fail = call_initialize_quaddobl_homotopy(&nbsol); fail = call_quaddobl_path_tracker(nbsol); fail = clear_quaddobl_tracker(); } else if(level == 3) { fail = call_initialize_multprec_homotopy(&nbsol); fail = call_multprec_path_tracker(nbsol); fail = clear_multprec_tracker(); } else { fail = call_initialize_varbprec_homotopy(&nbsol); fail = call_varbprec_path_tracker(); fail = clear_varbprec_tracker(); } adafinal(); return 0; }
void read_cells_and_solve_start_system ( void ) { int fail,dim,r,len,prcs; fail = celcon_read_mixed_cell_configuration(); printf("\nReading a system to initialize the symbol table..."); fail = read_standard_target_system(); fail = define_output_file(); fail = celcon_dimension_of_points(&dim); printf("dimension of the lifted points : %d\n",dim); fail = show_mixture(dim,&r); fail = celcon_number_of_cells(&len); printf("number of cells in the configuration : %d\n",len); prcs = prompt_for_precision(); if(prcs == 0) solve_standard_start_system(len); else if(prcs == 1) solve_dobldobl_start_system(len); else if(prcs == 2) solve_quaddobl_start_system(len); else printf("invalid precision level\n"); }