Beispiel #1
0
void iinit(void)
{
  _q_verbose = DEFAULT_VERBOSE ;
  _q_debug = DEFAULT_DEBUG ;
  _q_prefer_length = DEFAULT_PREFER_LENGTH ;
  _q_accept_length = DEFAULT_ACCEPT_LENGTH ;
  bss_Outbuf = (char *)bss_malloc(I0_OUTBUFSIZE) ;
  bss_startup();
  reinit() ;
}
Beispiel #2
0
  int *color, *ptr;
  int iter_limit;
  queue_ADT ln_q;
  struct lanczos_node *ln_ptr;
  double  *dv, *ev, *dv_w, *ev_w, dmax, dmin, **z, **Q;
  double *w_k, *tmp, *v_k, *v_k_old;
  double la, lb;
  int *companion;
  

  /* queue to hold lanczos vectors */
  ln_q = new_queue();

  /* initial rhs w/2-norm of ~1.0 and orthogonal to (1,1,...,1)^T */
  r_k = Init_rhs(n);
  p_k = (double *) bss_malloc(n*FLOAT_LEN);
  rvec_copy(p_k,r_k,n);
  rr  = hmt_ddot(r_k,r_k,n);

  /* x_k to initial guess (the 0.0 vector) */
  x_k  = Init_guess(n);

  /* space for Ap_k */
  Ap_k = (double *) bss_malloc(n*FLOAT_LEN);
  rvec_zero(Ap_k,n);
  
  /* set lanczos limits */
  rr_limit = rr*RES_LIMIT;
  iter_limit = MIN(n,CG_LIMIT);

  /* lanczos */