From 16aaf4cda5fd97da12a7f1da8b0a5168fac2e289 Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Tue, 11 Oct 2016 13:57:03 +0000 Subject: Problem of merge with tangentialcomplex branch. Redo in an integration branch git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/tangential_integration@1701 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: fa029e8e90b3e203ea675f02098ec6fe95596f9f --- .../CGAL/NewKernel_d/Cartesian_LA_base.h | 177 +++++++++++++++++++++ 1 file changed, 177 insertions(+) create mode 100644 src/common/include/gudhi_patches/CGAL/NewKernel_d/Cartesian_LA_base.h (limited to 'src/common/include/gudhi_patches/CGAL/NewKernel_d/Cartesian_LA_base.h') diff --git a/src/common/include/gudhi_patches/CGAL/NewKernel_d/Cartesian_LA_base.h b/src/common/include/gudhi_patches/CGAL/NewKernel_d/Cartesian_LA_base.h new file mode 100644 index 00000000..c13a9801 --- /dev/null +++ b/src/common/include/gudhi_patches/CGAL/NewKernel_d/Cartesian_LA_base.h @@ -0,0 +1,177 @@ +// 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 -- cgit v1.2.3