示例#1
0
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;
}
示例#2
0
int standard_interactive_Laurent_input_output ( void )
{
   int n,fail,k,nc,i,rc,len,nbtasks;
   char ch,p[800];

   printf("\nGive the number of polynomials in the system : ");
   scanf("%d",&n);

   fail = syscon_initialize_number_of_standard_Laurentials(n);
   printf("\nReading %d polynomials, ",n);
   printf("terminate each with ; (semicolon)...\n");
   for(k=1; k<=n; k++)
   { 
      printf("-> polynomial %d : ",k);
      ch = getchar();    /* skip previous newline symbol */
      read_poly(&nc,p);
     /* printf("  p[%d] = ",k); 
        for(i=0; i<nc; i++) printf("%c",p[i]);
        printf("\n"); */
      fail = syscon_store_standard_Laurential(nc,n,k,p);
   }
   printf("The system in the container : \n");
   syscon_write_standard_Laurent_system();
   printf("\nGive the number of tasks : "); scanf("%d",&nbtasks);
   fail = solve_Laurent_system(&rc,0,nbtasks); /* not silent by default */
   printf("\nThe root count : %d\n",rc);
   /* printf("\nThe solutions :\n");
   fail = solcon_write_standard_solutions(); */
   printf("interactive selection of solutions... \n");
   do
   {
      printf("\nGive an index to a solution (-1 to exit) : ");
      scanf("%d",&k);
      if(k < 0) break;
      fail = solcon_length_standard_solution_string(k,&len);
      {
         char s[len];
         fail = solcon_write_standard_solution_string(k,len,s);
         printf("\nSolution %d : \n%s",k,s);
      } 
   } while (k >= 0);

   return fail;
}
示例#3
0
int Laurent_input_output_on_files ( int precision )
{
   int fail,rc,nbtasks;

   if(precision == 0)
   {
      fail = syscon_read_standard_Laurent_system();
      printf("\nThe system in the container : \n");
      fail = syscon_write_standard_Laurent_system();
      printf("\nGive the number of tasks : "); scanf("%d",&nbtasks);
      fail = solve_Laurent_system(&rc,0,nbtasks); /* not silent by default */
      printf("\nThe root count : %d\n",rc);
      printf("\nThe solutions :\n");
      fail = solcon_write_standard_solutions();
   }
   else if(precision == 1)
   {
      fail = syscon_read_dobldobl_Laurent_system();
      printf("\nThe system in the container : \n");
      fail = syscon_write_dobldobl_Laurent_system();
      printf("\nGive the number of tasks : "); scanf("%d",&nbtasks);
      fail = solve_dobldobl_Laurent_system(&rc,0,nbtasks);
      printf("\nThe root count : %d\n",rc);
      printf("\nThe solutions :\n");
      fail = solcon_write_dobldobl_solutions();
   }
   else if(precision == 2)
   {
      fail = syscon_read_quaddobl_Laurent_system();
      printf("\nThe system in the container : \n");
      fail = syscon_write_quaddobl_Laurent_system();
      printf("\nGive the number of tasks : "); scanf("%d",&nbtasks);
      fail = solve_quaddobl_Laurent_system(&rc,0,nbtasks);
      printf("\nThe root count : %d\n",rc);
      printf("\nThe solutions :\n");
      fail = solcon_write_quaddobl_solutions();
   }
   return fail;
}