// Copyright (c) 1997 ETH Zurich (Switzerland). // All rights reserved. // // This file is part of CGAL (www.cgal.org); you may redistribute it under // the terms of the Q Public License version 1.0. // See the file LICENSE.QPL distributed with CGAL. // // Licensees holding a valid commercial license may use this file in // accordance with the commercial license agreement provided with the software. // // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. // // $URL$ // $Id$ // // // Author(s) : Sven Schoenherr // Bernd Gaertner #ifndef CGAL_OPTIMISATION_SPHERE_D_H #define CGAL_OPTIMISATION_SPHERE_D_H CGAL_BEGIN_NAMESPACE // Class declarations // ================== // general template template class Optimisation_sphere_d; template class Optimisation_sphere_d; template class Optimisation_sphere_d; CGAL_END_NAMESPACE // Class interfaces and implementation // ================================== // includes #include #include CGAL_BEGIN_NAMESPACE // Cartesian version // ----------------- template class Optimisation_sphere_d { private: typedef typename Traits::Access_coordinates_begin_d::Coordinate_iterator It; // hack needed for egcs, see also test programs typedef FT FT_; int d; // dimension int m; // |B| int s; // |B\cup S| FT** q; // the q_j's FT*** inv; // the A^{-1}_{B^j}'s FT* v_basis; // the vector v_B FT* x; // solution vector FT* v; // auxiliary vector FT* c; // center, for internal use PT ctr; // center, for external use FT sqr_r; // squared_radius Traits tco; public: Optimisation_sphere_d& get_sphere (Cartesian_tag) {return *this;} const Optimisation_sphere_d& get_sphere (Cartesian_tag) const {return *this;} Optimisation_sphere_d (const Traits& t = Traits()) : d(-1), m(0), s(0), tco (t) {} void set_tco (const Traits& tcobj) { tco = tcobj; } void init (int ambient_dimension) { d = ambient_dimension; m = 0; s = 0; sqr_r = -FT(1); q = new FT*[d+1]; inv = new FT**[d+1]; v_basis = new FT[d+2]; x = new FT[d+2]; v = new FT[d+2]; c = new FT[d]; for (int j=0; j class Optimisation_sphere_d { private: typedef typename Traits::Access_coordinates_begin_d::Coordinate_iterator It; // hack needed for egcs, see also test programs typedef RT RT_; int d; // dimension int m; // |B| int s; // |B\cup S| RT** q; // the q_j's RT*** inv; // the \tilde{A}^{-1}_{B^j}'s RT* denom; // corresponding denominators RT** v_basis; // the \tilde{v}_B^j RT* x; // solution vector mutable RT* v; // auxiliary vector RT* c; // center, for internal use PT ctr; // center, for external use RT sqr_r; // numerator of squared_radius Traits tco; public: Optimisation_sphere_d& get_sphere (Homogeneous_tag t) {return *this;} const Optimisation_sphere_d& get_sphere (Homogeneous_tag t) const {return *this;} Optimisation_sphere_d (const Traits& t = Traits()) : d(-1), m(0), s(0), tco(t) {} void set_tco (const Traits& tcobj) { tco = tcobj; } void init (int ambient_dimension) { d = ambient_dimension; m = 0; s = 0; sqr_r = -RT(1); q = new RT*[d+1]; inv = new RT**[d+1]; denom = new RT[d+1]; v_basis = new RT*[d+1]; x = new RT[d+2]; v = new RT[d+2]; c = new RT[d+1]; for (int j=0; j