예제 #1
0
int compute_root_count ( int *r )
{
   int fail,inout;

   fail = syscon_read_standard_system();
   printf("\nThe system in the container : \n");
   fail = syscon_write_standard_system();
   fail = supporting_set_structure();
   printf("\nA supporting set structure : \n");
   fail = write_set_structure();
   {
      int nc;
      char ss[200];
      fail = set_structure_string(&nc,ss);
      printf("\nthe set structure string : \n%s\n",ss);
      printf("clearing the set structure ...\n");
      clear_set_structure();     
      printf("parsing the set structure string ...\n");
      parse_set_structure(nc,ss);
      printf("after parsing the set structure string :\n");
      fail = write_set_structure();
   }
   inout = 1;
   fail = is_set_structure_supporting(&inout);
   if(inout == 1)
      printf("The set structure supports the polynomial system.\n");
   else
      printf("The set structure does not support the polynomial system.\n");
   fail = linear_product_root_count(r);
   printf("\nThe linear-product root count : %d\n",*r);

   return fail;
}
예제 #2
0
int compute_m_homogeneous_Bezout_number ( int *b )
{
   int fail,mbz,ncp,nbsols;
   int size=256;
   char partition[size];
   char answer;

   fail = syscon_read_standard_system();
   printf("\nThe system in the container : \n");
   fail = syscon_write_standard_system();

   fail = m_homogeneous_Bezout_number(&mbz,&ncp,partition);
   printf("\nA m-homogeneous Bezout number : %d\n",mbz);
   printf("with partition %s.\n",partition);

   printf("\nDo you wnat to give a partition ? (y/n) ");
   scanf("%c",&answer);
   if(answer == 'y')
   {
      scanf("%c",&answer); /* skip newline */
      printf("\nReading a partition ...\nEnter a string : ");
      {
         int c,i;
         for(i=0; (c=getchar()) != EOF && c != '\n' && i < size; ++i)
            partition[i] = c;
         partition[i] = '\0';
         ncp = i+1;
      }
      printf("-> your partition : %s\n",partition);
      fail = m_partition_Bezout_number(&mbz,ncp,partition);
      printf("the m-homogeneous Bezout number : %d\n",mbz);
   }
   printf("\nConstructing a m-homogeneous start system ...\n");
   fail = m_homogeneous_start_system(ncp,partition);
   printf("An m-homogeneous linear-product start system :\n");
   fail = syscon_write_standard_system();

   fail = solve_linear_product_system();
   printf("\nThe solutions : \n");
   fail = solcon_write_standard_solutions();
   fail = solcon_number_of_standard_solutions(&nbsols);
   if(mbz == nbsols)
      printf("\nComputed %d solutions, as many as the root count.\n",nbsols);
   else
      printf("\nNumber of solutions computed %d /= %d, the root count ?!!\n",
             nbsols,mbz);

   return fail;
}
예제 #3
0
int compute_mixed_volume( void )
{
   int fail,mv,len,dim,r;

   fail = syscon_read_standard_system();
   printf("\nThe system in the container : \n");
   fail = syscon_write_standard_system();
   fail = mixed_volume(&mv);
   printf("\nThe mixed volume : %d\n",mv);
   fail = celcon_number_of_cells(&len);
   printf("\nnumber of mixed cells : %d\n",len);
   fail = celcon_dimension_of_points(&dim);
   printf("dimension of the lifted points : %d\n",dim);
   fail = show_mixture(dim,&r);
}
예제 #4
0
int standard_polysys_solver ( void )
{
   int fail,nbq,nbtasks,topdim,filter,factor,verbose;

   fail = syscon_read_standard_system();
   fail = syscon_number_of_standard_polynomials(&nbq);
   printf("-> read %d polynomials\n", nbq);
   printf("\n");
   read_solver_options(&nbtasks,&topdim,&filter,&factor,&verbose);

   printf("\nCalling the solver ...\n\n");
   fail = standard_polysys_solve(nbtasks,topdim,filter,factor,verbose);
   fail = standard_polysys_write(topdim);

   return fail;
}
예제 #5
0
int input_output_on_files ( int precision )
{
   int fail,rc,nbtasks;

   if(precision == 0)
   {
      fail = syscon_read_standard_system();
      printf("\nThe system in the container : \n");
      fail = syscon_write_standard_system();
      printf("\nGive the number of tasks : "); scanf("%d",&nbtasks);
      fail = solve_system(&rc,nbtasks);
      printf("\nThe root count : %d\n",rc);
      printf("\nThe solutions :\n");
      fail = solcon_write_standard_solutions();
   }
   else if(precision == 1)
   {
      fail = syscon_read_dobldobl_system();
      printf("\nThe system in the container : \n");
      fail = syscon_write_dobldobl_system();
      printf("\nGive the number of tasks : "); scanf("%d",&nbtasks);
      fail = solve_dobldobl_system(&rc,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_system();
      printf("\nThe system in the container : \n");
      fail = syscon_write_quaddobl_system();
      printf("\nGive the number of tasks : "); scanf("%d",&nbtasks);
      fail = solve_quaddobl_system(&rc,nbtasks);
      printf("\nThe root count : %d\n",rc);
      printf("\nThe solutions :\n");
      fail = solcon_write_quaddobl_solutions();
   }

   return fail;
}