// Copyright (c) 2014 // INRIA Saclay-Ile de France (France) // // This file is part of CGAL (www.cgal.org); you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public License as // published by the Free Software Foundation; either version 3 of the License, // or (at your option) any later version. // // 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) : Marc Glisse #ifndef CGAL_KERNEL_D_CARTESIAN_LA_BASE_H #define CGAL_KERNEL_D_CARTESIAN_LA_BASE_H #include #include #include #include #include #include #include #include #include #include #include #include #ifdef CGAL_EIGEN3_ENABLED #include #else #error Eigen3 is required #endif namespace CGAL { template < typename FT_, typename Dim_, #if 1 typename Vec_=Mix_vector, Vector_vector, FT_, Dim_>, #elif 0 typename Vec_=Array_vector, #elif 0 typename Vec_=Vector_vector, #else // Dangerous because of alignment. Ok on x86_64 without AVX. typename Vec_=LA_eigen, #endif typename LA_=LA_eigen > /* Default LA to Vec or to LA_eigen? */ struct Cartesian_LA_base_d : public Dimension_base { typedef Cartesian_LA_base_d Self; typedef Cartesian_tag Rep_tag; typedef Cartesian_tag Kernel_tag; typedef Dim_ Default_ambient_dimension; typedef Dim_ Max_ambient_dimension; typedef Dim_ Dimension; typedef LA_ LA; template struct Ambient_dimension { typedef Dim_ type; }; typedef Vec_ LA_vector; typedef typename LA_vector::Vector Point; typedef typename LA_vector::Vector Vector; typedef typename LA_vector::Vector Vector_; typedef typename LA_vector::Construct_vector Constructor; typedef typename LA_vector::Vector_const_iterator Point_cartesian_const_iterator; typedef typename LA_vector::Vector_const_iterator Vector_cartesian_const_iterator; template struct Type {}; template struct Type< Point_tag, D> { typedef Vector_ type; }; template struct Type { typedef Vector_ type; }; template struct Type< FT_tag, D> { typedef FT_ type; }; template struct Type< RT_tag, D> { typedef FT_ type; }; typedef typeset ::add::type // FIXME: These have nothing to do here. ::add::type ::add::type ::add::type ::add::type Object_list; typedef typeset< Point_cartesian_const_iterator_tag>::type ::add::type Iterator_list; template > struct Functor { typedef Null_functor type; }; template struct Functor,D> { typedef CartesianDVectorBase::Construct_LA_vector type; }; template struct Functor,D> { typedef CartesianDVectorBase::Construct_LA_vector type; }; template struct Functor,D> { typedef CartesianDVectorBase::Construct_cartesian_const_iterator type; }; template struct Functor,D> { typedef CartesianDVectorBase::Construct_cartesian_const_iterator type; }; template struct Functor::value> > { typedef CartesianDVectorBase::Sum_of_vectors type; }; template struct Functor::value> > { typedef CartesianDVectorBase::Difference_of_vectors type; }; template struct Functor::value> > { typedef CartesianDVectorBase::Opposite_vector type; }; template struct Functor::value || !LA_vector::template Property::value> > { typedef CartesianDVectorBase::Midpoint type; }; template struct Functor { typedef CartesianDVectorBase::Compute_cartesian_coordinate type; }; template struct Functor { typedef CartesianDVectorBase::Compute_cartesian_coordinate type; }; template struct Functor { typedef CartesianDVectorBase::PV_dimension type; }; template struct Functor { typedef CartesianDVectorBase::PV_dimension type; }; template struct Functor::value> > { typedef CartesianDVectorBase::Orientation_of_vectors type; }; template struct Functor::value> > { typedef CartesianDVectorBase::Orientation_of_points type; }; template struct Functor::value> > { typedef CartesianDVectorBase::Scalar_product type; }; template struct Functor::value> > { typedef CartesianDVectorBase::Squared_distance_to_origin_stored type; }; // Use integral_constant in case of failure, to distinguish from the previous one. template struct Functor::value || !LA_vector::template Property::value)*2> > { typedef CartesianDVectorBase::Squared_distance_to_origin_via_dotprod type; }; template struct Functor { typedef CartesianDVectorBase::Identity_functor type; }; template struct Functor { typedef CartesianDVectorBase::Identity_functor type; }; CGAL_CONSTEXPR Cartesian_LA_base_d(){} CGAL_CONSTEXPR Cartesian_LA_base_d(int d):Dimension_base(d){} }; } //namespace CGAL #endif // CGAL_KERNEL_D_CARTESIAN_LA_BASE_H