Exemple #1
0
int input_argument_free ( void )
{
   int fail,n;
   char outfile[80],ch;

   printf("\nReading and writing a polynomial system ...\n");

   fail = read_standard_target_system();
   if(v==1) printf("-> read_target_system returns %d\n",fail);
   fail = copy_target_system_to_container();
   if(v==1) printf("-> copy_target_system_to_container returns %d\n",fail);
   printf("\nThe system read :\n");
   fail = print_system();
   if(v==1) printf("-> print_system returns %d\n",fail);

   printf("\nGive name of the output file : ");
   scanf("%s",outfile);
   n = (int) strlen(outfile);
   fail = define_output_file_with_string(n,outfile);
   if(v==1) printf("-> define_output_file_with_string returns %d\n",fail);
   fail = print_system();
   if(v==1) printf("-> print_system returns %d\n",fail);
   fail = write_string_to_defined_output_file(21,"\nTITLE : some system\n");
   if(v==1) printf("-> write_string_to_defined_output_file returns %d\n",fail);
   fail = close_output_file();
   if(v==1) printf("-> close_output_file returns %d\n",fail);

   return 0;
}
Exemple #2
0
void read_cells_and_create_start_system ( void )
{
   int dim,n,fail,*d,r,len,k,nbsols,mv;
   double *c;
   char ans = 'y';

   fail = celcon_read_mixed_cell_configuration();
   printf("\nReading a system to initialize the symbol table...");
   fail = read_standard_target_system();
   fail = celcon_dimension_of_points(&dim);
   printf("dimension of the lifted points : %d\n",dim);
   fail = show_mixture(dim,&r);
   fail = celcon_standard_random_coefficient_system();
   printf("The random coefficient start system :\n");
   fail = celcon_write_standard_random_coefficient_system();
   fail = celcon_standard_polyhedral_homotopy();

   fail = celcon_number_of_cells(&len);
   while (ans == 'y')
   {
      printf("Give a number to a mixed cell (<= %d) : ", len);
      scanf("%d",&k);
      fail = celcon_solve_standard_start_system(k,&nbsols);
      printf(" -> found %d start solutions from cell %d\n",nbsols,k);
      fail = celcon_mixed_volume(k,&mv);
      if (nbsols == mv)
         printf("#start solutions equals mixed volume %d, ok\n",mv);
      else
         printf("#start solutions does not equal mixed volume %d!!!\n",mv);
      printf("Do you wish to test another cell (y/n) ");
      scanf("%c",&ans); /* skip new line symbol */
      ans = getchar();
   }
}
void retrieve_dimensions ( int myid, int *nspt, int *dim )
{
   int fail, *mix;
   
   if(myid == 0)
   {  
      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);
      mix = (int*)calloc((*dim-1), sizeof(int));
      fail = celcon_type_of_mixture(nspt,mix);
      if(v>0) printf("\nThe number of different support is %d\n",*nspt);
      if(v>0) printf("The dimension of lifted points is %d\n",*dim);
   }
   
   MPI_Bcast(nspt,1,MPI_INT,0,MPI_COMM_WORLD);
   MPI_Bcast(dim,1,MPI_INT,0,MPI_COMM_WORLD);   
}
Exemple #4
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");
}