bridge/class-master/depend/pari/src/modules/mpqs.c
/* To be called after choosing k and putting kN into the handle:
 * Pick up the requested parameter set for the given size of kN in decimal
 * digits and fill in various fields in the handle.  Return 0 when kN is
 * too large, 1 when we're ok. */
To be called after choosing k and putting kN into the handle:
Pick up the requested parameter set for the given size of kN in decimal
digits and fill in various fields in the handle.  Return 0 when kN is
too large, 1 when we're ok.
To be called after choosing k and putting kN into the handle : Pick up the requested parameter set for the given size of kN in decimal digits and fill in various fields in the handle . Return 0 when kN is too large 1 when we ' re ok .
static int
mpqs_set_parameters(mpqs_handle_t *h)
{
  long i;
  const mpqs_parameterset_t *P;
  h->digit_size_kN = decimal_len(h->kN);
  if (h->digit_size_kN <= 9)
    i = 0;
  else if (h->digit_size_kN > MPQS_MAX_DIGIT_SIZE_KN)
    return 0;
  else
    i = h->digit_size_kN - 9;
  if (i >= 79)
    pari_warn(warner, "MPQS: factoring this number will take %s hours:\nN = %Ps",
        i >= 86 ? "many": "several", h->N);
  if (DEBUGLEVEL >= 5)
  {
    err_printf("MPQS: kN = %Ps\n", h->kN);
    err_printf("MPQS: kN has %ld decimal digits\n", h->digit_size_kN);
  }
  P = &(mpqs_parameters[i]);
  h->tolerance        = P->tolerance;
  h->lp_scale         = P->lp_scale;
  h->size_of_FB       = P->size_of_FB + h->_k->omega_k;
  h->target_no_rels   = (h->size_of_FB >= 200 ?
                         h->size_of_FB + 70 :
                         (mpqs_int32_t)(h->size_of_FB * 1.35));
  h->M                = P->M;
  h->omega_A          = P->omega_A;
  h->no_B             = 1UL << (P->omega_A - 1);
  h->pmin_index1      = P->pmin_index1;
  h->index0_FB        = 3 + h->_k->omega_k;
  h->first_sort_point = 10 * P->first_sort_point;
  h->sort_pt_interval = 10 * P->sort_pt_interval;
  if (DEBUGLEVEL >= 5)
  {
    double mb = (h->size_of_FB + 1)/(8.*1048576.) * h->target_no_rels;
    err_printf("\t(estimated memory needed: %4.1fMBy)\n", mb);
  }
  return 1;
}
static int mpqs_set_parameters ( mpqs_handle_t * h ) { long i ; const mpqs_parameterset_t * P ; h -> digit_size_kN = decimal_len ( h -> kN ) ; if ( h -> digit_size_kN <= 9 ) i = 0 ; else if ( h -> digit_size_kN > MPQS_MAX_DIGIT_SIZE_KN ) return 0 ; else i = h -> digit_size_kN - 9 ; if ( i >= 79 ) pari_warn ( warner , " \n " , i >= 86 ? " " : " " , h -> N ) ; if ( DEBUGLEVEL >= 5 ) { err_printf ( " \n " , h -> kN ) ; err_printf ( " \n " , h -> digit_size_kN ) ; } P = & ( mpqs_parameters [ i ] ) ; h -> tolerance = P -> tolerance ; h -> lp_scale = P -> lp_scale ; h -> size_of_FB = P -> size_of_FB + h -> _k -> omega_k ; h -> target_no_rels = ( h -> size_of_FB >= 200 ? h -> size_of_FB + 70 : ( mpqs_int32_t ) ( h -> size_of_FB * 1.35 ) ) ; h -> M = P -> M ; h -> omega_A = P -> omega_A ; h -> no_B = 1UL << ( P -> omega_A - 1 ) ; h -> pmin_index1 = P -> pmin_index1 ; h -> index0_FB = 3 + h -> _k -> omega_k ; h -> first_sort_point = 10 * P -> first_sort_point ; h -> sort_pt_interval = 10 * P -> sort_pt_interval ; if ( DEBUGLEVEL >= 5 ) { double mb = ( h -> size_of_FB + 1 ) / ( 8. * 1048576. ) * h -> target_no_rels ; err_printf ( " \t \n " , mb ) ; } return 1 ; }
To be called after choosing k and putting kN into the handle:
 Pick up the requested parameter set for the given size of kN in decimal
 digits and fill in various fields in the handle.
To be called after choosing k and putting kN into the handle : Pick up the requested parameter set for the given size of kN in decimal digits and fill in various fields in the handle .
/* (cf PARI bug#235) the following has always been, and will remain,
   * a moving target... increased thresholds from 64, 80 to 79, 86
   * respectively --GN20050601.  Note that the new values correspond to
   * kN having >= 86 or >= 95 decimal digits, respectively.  Note also
   * that the current sizing parameters for 90 or more digits are based
   * on 100% theory and 0% practice. */ /* make room for prime factors of k if any: */ /* for the purpose of Gauss elimination etc., prime factors of k behave
   * like real FB primes, so take them into account when setting the goal: */ /* certain subscripts into h->FB should also be offset by omega_k: */ /* following are converted from % to parts per thousand: */