Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:57:10

0001 // This file is part of Eigen, a lightweight C++ template library
0002 // for linear algebra.
0003 //
0004 // Copyright (C) 20010-2011 Hauke Heibel <hauke.heibel@gmail.com>
0005 //
0006 // This Source Code Form is subject to the terms of the Mozilla
0007 // Public License v. 2.0. If a copy of the MPL was not distributed
0008 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
0009 
0010 #ifndef EIGEN_SPLINES_FWD_H
0011 #define EIGEN_SPLINES_FWD_H
0012 
0013 #include "../../../../Eigen/Core"
0014 
0015 namespace Eigen
0016 {
0017     template <typename Scalar, int Dim, int Degree = Dynamic> class Spline;
0018 
0019     template < typename SplineType, int DerivativeOrder = Dynamic > struct SplineTraits {};
0020 
0021     /**
0022      * \ingroup Splines_Module
0023      * \brief Compile-time attributes of the Spline class for Dynamic degree.
0024      **/
0025     template <typename _Scalar, int _Dim, int _Degree>
0026     struct SplineTraits< Spline<_Scalar, _Dim, _Degree>, Dynamic >
0027     {
0028       typedef _Scalar Scalar; /*!< The spline curve's scalar type. */
0029       enum { Dimension = _Dim /*!< The spline curve's dimension. */ };
0030       enum { Degree = _Degree /*!< The spline curve's degree. */ };
0031 
0032       enum { OrderAtCompileTime = _Degree==Dynamic ? Dynamic : _Degree+1 /*!< The spline curve's order at compile-time. */ };
0033       enum { NumOfDerivativesAtCompileTime = OrderAtCompileTime /*!< The number of derivatives defined for the current spline. */ };
0034       
0035       enum { DerivativeMemoryLayout = Dimension==1 ? RowMajor : ColMajor /*!< The derivative type's memory layout. */ };
0036 
0037       /** \brief The data type used to store non-zero basis functions. */
0038       typedef Array<Scalar,1,OrderAtCompileTime> BasisVectorType;
0039 
0040       /** \brief The data type used to store the values of the basis function derivatives. */
0041       typedef Array<Scalar,Dynamic,Dynamic,RowMajor,NumOfDerivativesAtCompileTime,OrderAtCompileTime> BasisDerivativeType;
0042       
0043       /** \brief The data type used to store the spline's derivative values. */
0044       typedef Array<Scalar,Dimension,Dynamic,DerivativeMemoryLayout,Dimension,NumOfDerivativesAtCompileTime> DerivativeType;
0045 
0046       /** \brief The point type the spline is representing. */
0047       typedef Array<Scalar,Dimension,1> PointType;
0048       
0049       /** \brief The data type used to store knot vectors. */
0050       typedef Array<Scalar,1,Dynamic> KnotVectorType;
0051 
0052       /** \brief The data type used to store parameter vectors. */
0053       typedef Array<Scalar,1,Dynamic> ParameterVectorType;
0054       
0055       /** \brief The data type representing the spline's control points. */
0056       typedef Array<Scalar,Dimension,Dynamic> ControlPointVectorType;
0057     };
0058 
0059     /**
0060      * \ingroup Splines_Module
0061      * \brief Compile-time attributes of the Spline class for fixed degree.
0062      *
0063      * The traits class inherits all attributes from the SplineTraits of Dynamic degree.
0064      **/
0065     template < typename _Scalar, int _Dim, int _Degree, int _DerivativeOrder >
0066     struct SplineTraits< Spline<_Scalar, _Dim, _Degree>, _DerivativeOrder > : public SplineTraits< Spline<_Scalar, _Dim, _Degree> >
0067     {
0068       enum { OrderAtCompileTime = _Degree==Dynamic ? Dynamic : _Degree+1 /*!< The spline curve's order at compile-time. */ };
0069       enum { NumOfDerivativesAtCompileTime = _DerivativeOrder==Dynamic ? Dynamic : _DerivativeOrder+1 /*!< The number of derivatives defined for the current spline. */ };
0070       
0071       enum { DerivativeMemoryLayout = _Dim==1 ? RowMajor : ColMajor /*!< The derivative type's memory layout. */ };
0072 
0073       /** \brief The data type used to store the values of the basis function derivatives. */
0074       typedef Array<_Scalar,Dynamic,Dynamic,RowMajor,NumOfDerivativesAtCompileTime,OrderAtCompileTime> BasisDerivativeType;
0075       
0076       /** \brief The data type used to store the spline's derivative values. */      
0077       typedef Array<_Scalar,_Dim,Dynamic,DerivativeMemoryLayout,_Dim,NumOfDerivativesAtCompileTime> DerivativeType;
0078     };
0079 
0080     /** \brief 2D float B-spline with dynamic degree. */
0081     typedef Spline<float,2> Spline2f;
0082     
0083     /** \brief 3D float B-spline with dynamic degree. */
0084     typedef Spline<float,3> Spline3f;
0085 
0086     /** \brief 2D double B-spline with dynamic degree. */
0087     typedef Spline<double,2> Spline2d;
0088     
0089     /** \brief 3D double B-spline with dynamic degree. */
0090     typedef Spline<double,3> Spline3d;
0091 }
0092 
0093 #endif // EIGEN_SPLINES_FWD_H