Пример #1
0
void monomials_broadcast ( int myid, int n )
{
   double cff[2];
   int i,j,exp[n],m[3],mm,fail;

   for(i=1; i<=n; i++)
   {
      m[1] = i;
      if(myid == 0)
      {
         fail = _ada_use_c2phc(24,m,exp,cff);    /* get #monomials */
         mm = m[0];
        /* printf("Polynomial %d has %d monomials.\n",i,mm); */
      }

      MPI_Bcast(&mm, 1, MPI_INT, 0, MPI_COMM_WORLD);

      m[0] = n;
      for(j=1; j<=mm; j++)    /* broadcast j-th term of i-th polynomial */
      {
         m[2] = j;
         if(myid == 0) fail = _ada_use_c2phc(25,m,exp,cff); 
         MPI_Bcast(cff,2,MPI_DOUBLE,0,MPI_COMM_WORLD); 
         MPI_Bcast(exp,n,MPI_INT,0,MPI_COMM_WORLD); 
         if(myid != 0) fail = _ada_use_c2phc(26,m,exp,cff); 
      }
   }
}
Пример #2
0
char *next_varbprec_solution
 ( int want, int maxprc, int maxitr, int verbose, int *nc, int *fail )
{
   int a[4],len;
   double *c;
   char *sol;

   a[0] = want;
   a[1] = maxprc;
   a[2] = maxitr;
   a[3] = verbose;

   *fail = _ada_use_c2phc(518,a,&len,c);
   {
      int i,b[len];
      *fail = _ada_use_c2phc(520,a,b,c);
      if(len != a[0])
         *fail = 518;
      else
      {
         sol = (char*) calloc(len,sizeof(char));
         for(i=0; i<a[0]; i++) sol[i] = ' ';
         for(i=0; i<a[0]; i++) sol[i] = (char) b[i];
         for(i=0; i<a[0]; i++) printf("%c",sol[i]);
      }
   }
   return sol;
}
Пример #3
0
void print_monomials ( void ) 
{
   int *d,i,j,k,n,m[3],mm,fail;
   double c[2];

   fail = _ada_use_c2phc(22,&n,d,c);

   d = (int*)calloc(n,sizeof(int));

   for(i=1; i<=n; i++)
   {
      m[1] = i;
      fail = _ada_use_c2phc(24,m,d,c);
      mm = m[0];
      m[0] = n;
      printf("Polynomial %d has %d monomials :\n",i,mm);
      for(j=1; j<=mm; j++)
      {
         m[2] = j;
         fail = _ada_use_c2phc(25,m,d,c);
         printf(" %.15e  %.15e",c[0],c[1]);
         for(k=0; k<n; k++) printf(" %d",d[k]);
         printf("\n");
      }
   }
}
Пример #4
0
void dimension_broadcast ( int myid, int *n )
{
   int *d,fail,m;
   double *c;

   if(myid == 0)
   {
      fail = _ada_use_c2phc(11,n,d,c);    /* read target system */
     /* fail = _ada_use_c2phc(12,n,d,c); */   /* write target system */
      fail = _ada_use_c2phc(1,n,d,c);     /* copy target to container */
     /* fail = _ada_use_c2phc(21,n,d,c); */   /* write system in container */
      fail = _ada_use_c2phc(22,n,d,c);    /* get dimension */
     /* printf("The dimension is %d.\n", *n); */
   }
 
   MPI_Bcast(n, 1, MPI_INT, 0, MPI_COMM_WORLD);  

   if(myid != 0)
   {
     /* printf("Node %d knowns that the dimension is %d\n", myid, *n); */
      fail = _ada_use_c2phc(23,n,d,c);    /* initialize container */
     /* fail = _ada_use_c2phc(22,&m,d,c); */  /* get dimension as test */
     /* printf("  and initialized container with dimension %d.\n", m); */
   }
}
Пример #5
0
void print_homotopy ( void )
{
   int *a,*b,fail;
   double *c;

   printf("\n");
   fail = _ada_use_c2phc(12,a,b,c);
   fail = _ada_use_c2phc(14,a,b,c);
   printf("The start solutions :\n");
   fail = _ada_use_c2phc(15,a,b,c);
}
Пример #6
0
int update_decomposition ( int d, int *permutation, int *nf, int *done )
{
   int fail;
   int *b;
   double *c;

   nf[0] = d; nf[1] = 0;
   fail = _ada_use_c2phc(53,nf,permutation,c);
   fail = _ada_use_c2phc(55,done,b,c);

   return fail;
}
Пример #7
0
int track_paths ( void )
{
   int *a,*b,fail;
   double *c;

   fail = _ada_use_c2phc(45,a,b,c);          /* do path tracking */
   if(v>0) printf("Done tracking.\n");
   if(v>1) printf("Solutions computed :\n");
   if(v>1) fail = _ada_use_c2phc(31,a,b,c);  /* write solutions container */
   fail = _ada_use_c2phc(46,a,b,c);          /* swap start with new slices */
   fail = _ada_use_c2phc(47,a,b,c);          /* copy target system */
   fail = _ada_use_c2phc(9,a,b,c);           /* validate the solutions */

   return fail;
}
Пример #8
0
int store_new_hyperplane_sections ( int m, int k, int n, double *c )
{
   int a[3],*b,fail;
   a[0] = m; a[1] = k; a[2] = n;
   fail = _ada_use_c2phc(60,a,b,c);
   return fail;
}
Пример #9
0
int mapcon_write_maps ( void )
{
   int *a,*b,fail;
   double *c;
   fail = _ada_use_c2phc(431,a,b,c);
   return fail;
}
Пример #10
0
int start_diagonal_cascade_solutions ( int a, int b )
{
   int fail;
   double *c;
   fail = _ada_use_c2phc(271,&a,&b,c);
   return fail;
}
Пример #11
0
int mapcon_top_dimension ( int *dim )
{
   int *b,fail;
   double *c;
   fail = _ada_use_c2phc(433,dim,b,c);
   return fail;
}
Пример #12
0
int restore_solutions ( void )
{
   int *a,*b,fail;
   double *c;
   fail = _ada_use_c2phc(48,a,b,c);   /* first solutions to container */ 
   return fail;
}
Пример #13
0
int swap_slices ( void )
{
   double *c;
   int fail,*a,*b;
   fail = _ada_use_c2phc(46,a,b,c); /* swap start with new slices */
   return fail;
}
Пример #14
0
void print_system ( void ) 
{
   int *a,*b,fail;
   double *c;

   fail = _ada_use_c2phc(21,a,b,c);
}
Пример #15
0
int mapcon_solve_system ( int puretopdim )
{
   int *b,fail;
   double *c;
   fail = _ada_use_c2phc(430,&puretopdim,b,c);
   return fail;
}
Пример #16
0
int mapcon_number_of_maps ( int dim, int *nbmaps )
{
   int fail;
   double *c;
   fail = _ada_use_c2phc(434,&dim,nbmaps,c);
   return fail;
}
Пример #17
0
int retrieve_hyperplane_sections ( int m, int k, int n, int i, double *c )
{
   int a[3],fail;
   a[0] = m; a[1] = k; a[2] = n;
   fail = _ada_use_c2phc(61,a,&i,c);
   return fail;
}
Пример #18
0
int set_target_hyperplane_sections ( int i )
{
   int *b,fail;
   double *c;
   fail = _ada_use_c2phc(62,&i,b,c);
   return fail;
}
Пример #19
0
int sample_to_new_slices ( void )
{
   int *a,*b,fail;
   double *c;
   fail = _ada_use_c2phc(45,a,b,c);   /* track paths */
   return fail;
}
Пример #20
0
int store_solutions ( void )
{
   int *a,*b,fail;
   double *c;
   fail = _ada_use_c2phc(51,a,b,c);   /* move solutions to permutations */
   return fail;
}
Пример #21
0
int create_diagonal_homotopy ( int a, int b )
{
   int fail;
   double *c;
   fail = _ada_use_c2phc(165,&a,&b,c);
   return fail;
}
Пример #22
0
int retrieve_solutions_on_grid ( int i )
{
   int *b,fail;
   double *c;
   fail = _ada_use_c2phc(49,&i,b,c);
   return fail;
}
Пример #23
0
int mapcon_clear_maps ( void )
{
   int *a,*b,fail;
   double *c;
   fail = _ada_use_c2phc(432,a,b,c);
   return fail;
}
Пример #24
0
int create_cascade_homotopy ( void )
{
   int *a,*b,fail;
   double *c;
   fail = _ada_use_c2phc(164,a,b,c);
   return fail;
}
Пример #25
0
int initialize_hyperplane_sections ( int m )
{
   int *b,fail;
   double *c;
   fail = _ada_use_c2phc(59,&m,b,c);
   return fail;
}
Пример #26
0
int witness_set_to_system_container ( void )
{
   int *a,*b,fail;
   double *c;
   fail = _ada_use_c2phc(47,a,b,c);   /* copy system to container */
   return fail;
}
Пример #27
0
void start_system_broadcast ( int myid, int n, int *nbsols )
{
   int *a,*b,fail;
   double *c;

   if(myid == 0)
   {
      fail = _ada_use_c2phc(13,a,b,c);    /* read start system */
     /* fail = _ada_use_c2phc(14,a,b,c); */  /* write start system */
      fail = _ada_use_c2phc(3,a,b,c);     /* copy start to container */
     /* fail = _ada_use_c2phc(21,a,b,c); */  /* write system in container */
      fail = _ada_use_c2phc(7,a,b,c);     /* copy start sols to container */
     /* fail = _ada_use_c2phc(15,a,b,c); */  /* write start solutions */
   }
   if(myid != 0)
      fail = _ada_use_c2phc(23,&n,b,c);   /* initialize container */

   monomials_broadcast(myid,n);           /* broadcast container */

   if(myid != 0)                          /* copy result of broadcast */
   {
      fail = _ada_use_c2phc(4,a,b,c);     /* copy container to target */
      fail = _ada_use_c2phc(27,a,b,c);    /* clear systems container */
     /* fail = _ada_use_c2phc(14,a,b,c); */  /* write start system */
   }

   if(myid == 0)
   {
      fail = _ada_use_c2phc(32,a,nbsols,c);  /* get #solutions */
     /* printf("There are %d start solutions.\n", *nbsols); */
   }
}
Пример #28
0
int permutation_after_loop ( int d, int *permutation )
{
   int *a,fail;
   double *c;

   fail = _ada_use_c2phc(52,a,permutation,c);   /* compute permutation */

   return fail;
}
Пример #29
0
int number_of_irreducible_factors ( int *nf )
{
   int *b,fail;
   double *c;

   fail = _ada_use_c2phc(68,nf,b,c);

   return fail;
}
Пример #30
0
int initialize_sampler ( int dim )
{
   int *b,fail;
   double *c;

   fail = _ada_use_c2phc(42,&dim,b,c);        /* initialize sampler */

   return fail;
}