// Copyright (c) 2014 // INRIA Saclay-Ile de France (France) // // This file is part of CGAL (www.cgal.org) // // $URL: https://github.com/CGAL/cgal/blob/v5.2/NewKernel_d/include/CGAL/NewKernel_d/Cartesian_LA_base.h $ // $Id: Cartesian_LA_base.h 0779373 2020-03-26T13:31:46+01:00 Sébastien Loriot // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial // // 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 ::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; }; constexpr Cartesian_LA_base_d(){} constexpr Cartesian_LA_base_d(int d):Dimension_base(d){} }; } //namespace CGAL #endif // CGAL_KERNEL_D_CARTESIAN_LA_BASE_H