#ifndef CGAL_KD_COAFFINE_H #define CGAL_KD_COAFFINE_H #include #include #include #include #include namespace CGAL { namespace CartesianDKernelFunctors { struct Flat_orientation { std::vector proj; std::vector rest; }; template struct Construct_flat_orientation : private Store_kernel { CGAL_FUNCTOR_INIT_STORE(Construct_flat_orientation) typedef R_ R; typedef typename R_::FT FT; typedef typename R::template Type::type Point; typedef typename R::template Functor::type CCC; typedef typename R::LA LA; typedef typename Increment_dimension::type Dplusone; typedef typename LA::template Matrix::type Matrix; typedef typename R::template Functor::type PD; typedef Flat_orientation result_type; // This implementation is going to suck. Maybe we should push the // functionality into LA. template result_type operator()(Iter f, Iter e)const{ PD pd (this->kernel()); CCC ccc (this->kernel()); int dim = pd(*f); Matrix coord (dim+1, dim+1); // use distance(f,e)? int col = 0; Flat_orientation o; std::vector& proj=o.proj; std::vector& rest=o.rest; rest.reserve(dim+1); for(int i=0; i::iterator it=rest.begin();it!=rest.end();++it) { for(int i=0; i struct Contained_in_affine_hull : private Store_kernel { CGAL_FUNCTOR_INIT_STORE(Contained_in_affine_hull) typedef R_ R; typedef typename R_::FT FT; typedef typename R::LA LA; typedef typename R::template Type::type Point; typedef typename R::Orientation result_type; typedef typename R::template Functor::type CCC; typedef typename R::template Functor::type PD; typedef typename Increment_dimension::type D1; typedef typename Increment_dimension::type D2; typedef typename LA::template Matrix::type Matrix; // mostly copied from Construct_flat_orientation. TODO: dedup this code. template result_type operator()(Iter f, Iter e, Point const&x) const { PD pd (this->kernel()); CCC ccc (this->kernel()); int dim=pd(*f); Matrix coord (dim+1, dim+1); // use distance int col = 0; std::vector proj; std::vector rest; rest.reserve(dim+1); for(int i=0; i::iterator it=rest.begin();it!=rest.end();++it) { for(int i=0; i::iterator it=rest.begin();it!=rest.end();++it) { for(int i=0; i struct In_flat_orientation : private Store_kernel { CGAL_FUNCTOR_INIT_STORE(In_flat_orientation) typedef R_ R; typedef typename R_::FT FT; typedef typename R::template Type::type Point; typedef typename R::Orientation result_type; typedef typename Increment_dimension::type D1; typedef typename Increment_dimension::type D2; typedef typename R::LA::template Matrix::type Matrix; template result_type operator()(Flat_orientation const&o, Iter f, Iter e) const { // TODO: work in the projection instead of the ambient space. typename R::template Functor::type c(this->kernel()); typename R::template Functor::type pd(this->kernel()); int d=pd(*f); Matrix m(d+1,d+1); int i=0; for(;f!=e;++f,++i) { Point const& p=*f; m(i,0)=1; for(int j=0;j::const_iterator it = o.rest.begin(); it != o.rest.end() /* i struct In_flat_side_of_oriented_sphere : private Store_kernel { CGAL_FUNCTOR_INIT_STORE(In_flat_side_of_oriented_sphere) typedef R_ R; typedef typename R_::FT FT; typedef typename R::template Type::type Point; typedef typename R::Orientation result_type; typedef typename Increment_dimension::type D1; typedef typename Increment_dimension::type D2; typedef typename R::LA::template Matrix::type Matrix; template result_type operator()(Flat_orientation const&o, Iter f, Iter e, Point const&x) const { // TODO: can't work in the projection, but we should at least remove the row of 1s. typename R::template Functor::type c(this->kernel()); typename R::template Functor::type pd(this->kernel()); int d=pd(*f); Matrix m(d+2,d+2); int i=0; for(;f!=e;++f,++i) { Point const& p=*f; m(i,0)=1; m(i,d+1)=0; for(int j=0;j::const_iterator it = o.rest.begin(); it != o.rest.end() /* i