36 #ifndef WFMATH_MINIBALL_H
37 #define WFMATH_MINIBALL_H
40 #include <wfmath/wrapped_array.h>
42 namespace WFMath {
namespace _miniball {
44 template <
int d>
class Miniball;
45 template <
int d>
class Basis;
55 typedef typename std::list<Point>::iterator It;
56 typedef typename std::list<Point>::const_iterator Cit;
67 void move_to_front (It j);
68 double max_excess (It t, It i, It& pivot)
const;
69 double abs (
double r)
const {
return (r>0)? r: (-r);}
70 double sqr (
double r)
const {
return r*r;}
74 Miniball() : L(), B(), support_end() {}
75 void check_in (
const Point& p);
76 void build (
bool pivoting =
true);
80 double squared_radius ()
const;
81 int nr_points ()
const;
82 Cit points_begin ()
const;
83 Cit points_end ()
const;
84 int nr_support_points ()
const;
85 Cit support_points_begin ()
const;
86 Cit support_points_end ()
const;
89 double accuracy (
double& slack)
const;
90 bool is_valid (
double tolerance = 1e-15)
const;
117 double current_sqr_r;
119 double sqr (
double r)
const {
return r*r;}
125 const double* center()
const;
126 double squared_radius()
const;
128 int support_size()
const;
129 double excess (
const Point& p)
const;
133 bool push (
const Point& p);
137 double slack()
const;
Generic library namespace.