Navigation: Up, Table of Contents, Bibliography, Index, Title Page

Requirements of Traits Classes for Smallest Enclosing Sphere

The class template CGAL_Min_sphere_d is parameterized with a Traits class which defines the interface between the optimisation algorithm and the point class used to represent the input points. The following requirements catalog lists the types, member functions etc., that must be defined for a class that can be used to parameterize CGAL_Min_sphere_d. Traits class implementations with points of the types CGAL_Point_2<R>, CGAL_Point_3<R> and CGAL_Point_d<R> are available and described in Section reference arrow.

Traits Class (Traits)

Definition

A class that satisfies the requirements of a traits class for CGAL_Min_sphere_d must provide the following.

Types

Traits::R
A representation type. R is either CGAL_Cartesian<FT> or CGAL_Homogeneous<RT>, where FT resp. RT fulfill the requirements of a CGAL field type resp. ring type.

Traits::Point
The point type must provide default and copy constructor and an assignment operator.

Traits::DA
The data accessor type defines the access to coordinates of the points. The requirements are listed in the next section below.

In addition, if I/O is used, the corresponding I/O operators for Point have to be provided.

Variables

Traits::DA da; A data accessor object.

Creation

Only default and copy constructor are required.

Traits traits;
A default constructor.

Traits traits ( Traits);
A copy constructor.

Read/Write Data Accessor (DA)

This type defines the coordinate access to points of the type Traits::Point, with respect to the representation Traits::R (homogeneous or cartesian).

Types

DA::InputIterator
This class must satisfy the requirements of an STL input iterator. Its value type is R::RT.

Creation

DA da;
Default constructor.

DA da ( DA);
Copy constructor.

Operations

int da.get_dimension ( Point p)
returns the dimension of p.
InputIterator da.get_begin ( Point p)
returns an iterator pointing to the first coordinate of p.

In case of a cartesian representation, the coordinate range consists of get_dimension(p) numbers. For homogeneous representations, we have get_dimension(p)+1 numbers, the last of which is assumed to be the homogenizing coordinate.

void da.set ( Point& p, R::RT *first, R::RT *last)
copies the range [first, last) into p. The caller of this function guarantees that the range contains d elements in the cartesian and d+1 elements in the homogeneous case, where d is the ambient dimension of the CGAL_Min_sphere_d<Traits> object. set is never called if the sphere is empty.


Next: Function Declaration of CGAL_maximum_area_inscribed_k_gon
Navigation: Up, Table of Contents, Bibliography, Index, Title Page
The CGAL Project. 22 January, 1999.