int Laurent_input_output_on_files ( void ) { int fail,rc; fail = syscon_read_Laurent_system(); printf("\nThe system in the container : \n"); fail = syscon_write_Laurent_system(); fail = solve_Laurent_system(&rc,0); /* not silent by default */ printf("\nThe root count : %d\n",rc); printf("\nThe solutions :\n"); fail = solcon_write_solutions(); return fail; }
int input_output_on_files ( void ) { int fail,rc; fail = syscon_read_system(); printf("\nThe system in the container : \n"); fail = syscon_write_system(); fail = solve_system(&rc); printf("\nThe root count : %d\n",rc); printf("\nThe solutions :\n"); fail = solcon_write_solutions(); return fail; }
void test_deflate ( void ) { int fail,dim,len; printf("\nRunning deflation ...\n"); fail = read_standard_start_system(); fail = copy_start_system_to_container(); fail = copy_start_solutions_to_container(); fail = syscon_number_of_polynomials(&dim); printf("The system container has %d polynomials.\n",dim); fail = solcon_number_of_solutions(&len); printf("The solution container has size %d.\n",len); fail = standard_deflate(); printf("The solutions after deflation :\n"); fail = solcon_write_solutions(); }
void standard_test ( void ) { int fail,max,nit; const double eps = 1.0e-12; fail = syscon_read_system(); fail = syscon_write_system(); printf("\nGive the maximum number of iterations : "); scanf("%d",&max); fail = solve_with_standard_doubles(max,eps,&nit); printf("\nNumber of iterations : %d\n",nit); fail = solcon_write_solutions(); }
void test_standard_Newton_Laurent_step ( void ) { int fail,dim,len; printf("\nRunning Newton step with standard arithmetic ...\n"); fail = syscon_read_Laurent_system(); fail = syscon_number_of_Laurentials(&dim); printf("The system container has %d Laurent polynomials.\n",dim); fail = solcon_read_solutions(); fail = solcon_number_of_solutions(&len); printf("The solution container has size %d.\n",len); fail = solcon_dimension_of_solutions(&dim); printf("The solutions in the container have dimension %d.\n",dim); fail = standard_Newton_Laurent_step(); printf("The solutions after the Newton step :\n"); fail = solcon_write_solutions(); }
void solutions_collect ( int myid, int nbsols, int n, int numprocs, int mysolnum ) { int k,m,fail,dest; double sol[2*n+6]; /* very important to send "m" along with "sol" */ MPI_Status status; if(myid == 0) fail = solcon_clear_standard_solutions(); if(myid != 0) { for(k=1; k<=mysolnum; k++) { fail = solcon_retrieve_standard_solution(n,k,&m,sol); sol[2*n+5] = (double) m; /* m is last entry of array sol */ MPI_Send(sol,2*n+6,MPI_DOUBLE,0,SEND_TSOL,MPI_COMM_WORLD); } } else { for(k=1; k<=nbsols; k++) { MPI_Recv(sol,2*n+6,MPI_DOUBLE,MPI_ANY_SOURCE,SEND_TSOL, MPI_COMM_WORLD,&status); m = (int) sol[2*n+5]; fail = solcon_append_standard_solution(n,m,sol); } } if(v>1) { printf("After collect, node %d has in its container:\n",myid); fail = solcon_write_solutions(); } if(myid != 0) fail = solcon_clear_standard_solutions(); }