Miniball<CoordAccessor>::Miniball (int d_, Pit begin, Pit end, 
				     CoordAccessor ca) 
    : d (d_), 
      points_begin (begin), 
      points_end (end), 
      coord_accessor (ca), 
      time (clock()), 
      nt0 (NT(0)), 
      L(), 
      support_end (L.begin()), 
      fsize(0), 
      ssize(0), 
      current_c (NULL), 
      current_sqr_r (NT(-1)),
      c (NULL),
      sqr_r (NULL),
      q0 (NULL),
      z (NULL),
      f (NULL),
      v (NULL),
      a (NULL)
  {	
    assert (points_begin != points_end);
    create_arrays();

    // set initial center
    for (int j=0; j<d; ++j) c[0][j] = nt0;
    current_c = c[0];

    // compute miniball
    pivot_mb (points_end);

    // update time
    time = (clock() - time) / CLOCKS_PER_SEC;
  }
Esempio n. 2
0
 void Miniball::build (bool pivoting)
 {
     B.reset();
     support_end = L.begin();
     if (pivoting)
         pivot_mb (L.end());
     else
         mtf_mb (L.end());
 }