mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Avoid leading underscore followed by cap in template identifiers
This commit is contained in:
committed by
Rasmus Munk Larsen
parent
5ad8b9bfe2
commit
4ba872bd75
@@ -25,18 +25,18 @@ namespace Eigen
|
||||
* C(u) & = \sum_{i=0}^{n}N_{i,p}(u)P_i
|
||||
* \f}
|
||||
*
|
||||
* \tparam _Scalar The underlying data type (typically float or double)
|
||||
* \tparam _Dim The curve dimension (e.g. 2 or 3)
|
||||
* \tparam Scalar_ The underlying data type (typically float or double)
|
||||
* \tparam Dim_ The curve dimension (e.g. 2 or 3)
|
||||
* \tparam _Degree Per default set to Dynamic; could be set to the actual desired
|
||||
* degree for optimization purposes (would result in stack allocation
|
||||
* of several temporary variables).
|
||||
**/
|
||||
template <typename _Scalar, int _Dim, int _Degree>
|
||||
template <typename Scalar_, int Dim_, int _Degree>
|
||||
class Spline
|
||||
{
|
||||
public:
|
||||
typedef _Scalar Scalar; /*!< The spline curve's scalar type. */
|
||||
enum { Dimension = _Dim /*!< The spline curve's dimension. */ };
|
||||
typedef Scalar_ Scalar; /*!< The spline curve's scalar type. */
|
||||
enum { Dimension = Dim_ /*!< The spline curve's dimension. */ };
|
||||
enum { Degree = _Degree /*!< The spline curve's degree. */ };
|
||||
|
||||
/** \brief The point type the spline is representing. */
|
||||
@@ -223,18 +223,18 @@ namespace Eigen
|
||||
|
||||
template <typename DerivativeType>
|
||||
static void BasisFunctionDerivativesImpl(
|
||||
const typename Spline<_Scalar, _Dim, _Degree>::Scalar u,
|
||||
const typename Spline<Scalar_, Dim_, _Degree>::Scalar u,
|
||||
const DenseIndex order,
|
||||
const DenseIndex p,
|
||||
const typename Spline<_Scalar, _Dim, _Degree>::KnotVectorType& U,
|
||||
const typename Spline<Scalar_, Dim_, _Degree>::KnotVectorType& U,
|
||||
DerivativeType& N_);
|
||||
};
|
||||
|
||||
template <typename _Scalar, int _Dim, int _Degree>
|
||||
DenseIndex Spline<_Scalar, _Dim, _Degree>::Span(
|
||||
typename SplineTraits< Spline<_Scalar, _Dim, _Degree> >::Scalar u,
|
||||
template <typename Scalar_, int Dim_, int _Degree>
|
||||
DenseIndex Spline<Scalar_, Dim_, _Degree>::Span(
|
||||
typename SplineTraits< Spline<Scalar_, Dim_, _Degree> >::Scalar u,
|
||||
DenseIndex degree,
|
||||
const typename SplineTraits< Spline<_Scalar, _Dim, _Degree> >::KnotVectorType& knots)
|
||||
const typename SplineTraits< Spline<Scalar_, Dim_, _Degree> >::KnotVectorType& knots)
|
||||
{
|
||||
// Piegl & Tiller, "The NURBS Book", A2.1 (p. 68)
|
||||
if (u <= knots(0)) return degree;
|
||||
@@ -242,12 +242,12 @@ namespace Eigen
|
||||
return static_cast<DenseIndex>( std::distance(knots.data(), pos) - 1 );
|
||||
}
|
||||
|
||||
template <typename _Scalar, int _Dim, int _Degree>
|
||||
typename Spline<_Scalar, _Dim, _Degree>::BasisVectorType
|
||||
Spline<_Scalar, _Dim, _Degree>::BasisFunctions(
|
||||
typename Spline<_Scalar, _Dim, _Degree>::Scalar u,
|
||||
template <typename Scalar_, int Dim_, int _Degree>
|
||||
typename Spline<Scalar_, Dim_, _Degree>::BasisVectorType
|
||||
Spline<Scalar_, Dim_, _Degree>::BasisFunctions(
|
||||
typename Spline<Scalar_, Dim_, _Degree>::Scalar u,
|
||||
DenseIndex degree,
|
||||
const typename Spline<_Scalar, _Dim, _Degree>::KnotVectorType& knots)
|
||||
const typename Spline<Scalar_, Dim_, _Degree>::KnotVectorType& knots)
|
||||
{
|
||||
const DenseIndex p = degree;
|
||||
const DenseIndex i = Spline::Span(u, degree, knots);
|
||||
@@ -276,8 +276,8 @@ namespace Eigen
|
||||
return N;
|
||||
}
|
||||
|
||||
template <typename _Scalar, int _Dim, int _Degree>
|
||||
DenseIndex Spline<_Scalar, _Dim, _Degree>::degree() const
|
||||
template <typename Scalar_, int Dim_, int _Degree>
|
||||
DenseIndex Spline<Scalar_, Dim_, _Degree>::degree() const
|
||||
{
|
||||
if (_Degree == Dynamic)
|
||||
return m_knots.size() - m_ctrls.cols() - 1;
|
||||
@@ -285,14 +285,14 @@ namespace Eigen
|
||||
return _Degree;
|
||||
}
|
||||
|
||||
template <typename _Scalar, int _Dim, int _Degree>
|
||||
DenseIndex Spline<_Scalar, _Dim, _Degree>::span(Scalar u) const
|
||||
template <typename Scalar_, int Dim_, int _Degree>
|
||||
DenseIndex Spline<Scalar_, Dim_, _Degree>::span(Scalar u) const
|
||||
{
|
||||
return Spline::Span(u, degree(), knots());
|
||||
}
|
||||
|
||||
template <typename _Scalar, int _Dim, int _Degree>
|
||||
typename Spline<_Scalar, _Dim, _Degree>::PointType Spline<_Scalar, _Dim, _Degree>::operator()(Scalar u) const
|
||||
template <typename Scalar_, int Dim_, int _Degree>
|
||||
typename Spline<Scalar_, Dim_, _Degree>::PointType Spline<Scalar_, Dim_, _Degree>::operator()(Scalar u) const
|
||||
{
|
||||
enum { Order = SplineTraits<Spline>::OrderAtCompileTime };
|
||||
|
||||
@@ -337,28 +337,28 @@ namespace Eigen
|
||||
}
|
||||
}
|
||||
|
||||
template <typename _Scalar, int _Dim, int _Degree>
|
||||
typename SplineTraits< Spline<_Scalar, _Dim, _Degree> >::DerivativeType
|
||||
Spline<_Scalar, _Dim, _Degree>::derivatives(Scalar u, DenseIndex order) const
|
||||
template <typename Scalar_, int Dim_, int _Degree>
|
||||
typename SplineTraits< Spline<Scalar_, Dim_, _Degree> >::DerivativeType
|
||||
Spline<Scalar_, Dim_, _Degree>::derivatives(Scalar u, DenseIndex order) const
|
||||
{
|
||||
typename SplineTraits< Spline >::DerivativeType res;
|
||||
derivativesImpl(*this, u, order, res);
|
||||
return res;
|
||||
}
|
||||
|
||||
template <typename _Scalar, int _Dim, int _Degree>
|
||||
template <typename Scalar_, int Dim_, int _Degree>
|
||||
template <int DerivativeOrder>
|
||||
typename SplineTraits< Spline<_Scalar, _Dim, _Degree>, DerivativeOrder >::DerivativeType
|
||||
Spline<_Scalar, _Dim, _Degree>::derivatives(Scalar u, DenseIndex order) const
|
||||
typename SplineTraits< Spline<Scalar_, Dim_, _Degree>, DerivativeOrder >::DerivativeType
|
||||
Spline<Scalar_, Dim_, _Degree>::derivatives(Scalar u, DenseIndex order) const
|
||||
{
|
||||
typename SplineTraits< Spline, DerivativeOrder >::DerivativeType res;
|
||||
derivativesImpl(*this, u, order, res);
|
||||
return res;
|
||||
}
|
||||
|
||||
template <typename _Scalar, int _Dim, int _Degree>
|
||||
typename SplineTraits< Spline<_Scalar, _Dim, _Degree> >::BasisVectorType
|
||||
Spline<_Scalar, _Dim, _Degree>::basisFunctions(Scalar u) const
|
||||
template <typename Scalar_, int Dim_, int _Degree>
|
||||
typename SplineTraits< Spline<Scalar_, Dim_, _Degree> >::BasisVectorType
|
||||
Spline<Scalar_, Dim_, _Degree>::basisFunctions(Scalar u) const
|
||||
{
|
||||
return Spline::BasisFunctions(u, degree(), knots());
|
||||
}
|
||||
@@ -366,16 +366,16 @@ namespace Eigen
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
|
||||
template <typename _Scalar, int _Dim, int _Degree>
|
||||
template <typename Scalar_, int Dim_, int _Degree>
|
||||
template <typename DerivativeType>
|
||||
void Spline<_Scalar, _Dim, _Degree>::BasisFunctionDerivativesImpl(
|
||||
const typename Spline<_Scalar, _Dim, _Degree>::Scalar u,
|
||||
void Spline<Scalar_, Dim_, _Degree>::BasisFunctionDerivativesImpl(
|
||||
const typename Spline<Scalar_, Dim_, _Degree>::Scalar u,
|
||||
const DenseIndex order,
|
||||
const DenseIndex p,
|
||||
const typename Spline<_Scalar, _Dim, _Degree>::KnotVectorType& U,
|
||||
const typename Spline<Scalar_, Dim_, _Degree>::KnotVectorType& U,
|
||||
DerivativeType& N_)
|
||||
{
|
||||
typedef Spline<_Scalar, _Dim, _Degree> SplineType;
|
||||
typedef Spline<Scalar_, Dim_, _Degree> SplineType;
|
||||
enum { Order = SplineTraits<SplineType>::OrderAtCompileTime };
|
||||
|
||||
const DenseIndex span = SplineType::Span(u, p, U);
|
||||
@@ -471,32 +471,32 @@ namespace Eigen
|
||||
}
|
||||
}
|
||||
|
||||
template <typename _Scalar, int _Dim, int _Degree>
|
||||
typename SplineTraits< Spline<_Scalar, _Dim, _Degree> >::BasisDerivativeType
|
||||
Spline<_Scalar, _Dim, _Degree>::basisFunctionDerivatives(Scalar u, DenseIndex order) const
|
||||
template <typename Scalar_, int Dim_, int _Degree>
|
||||
typename SplineTraits< Spline<Scalar_, Dim_, _Degree> >::BasisDerivativeType
|
||||
Spline<Scalar_, Dim_, _Degree>::basisFunctionDerivatives(Scalar u, DenseIndex order) const
|
||||
{
|
||||
typename SplineTraits<Spline<_Scalar, _Dim, _Degree> >::BasisDerivativeType der;
|
||||
typename SplineTraits<Spline<Scalar_, Dim_, _Degree> >::BasisDerivativeType der;
|
||||
BasisFunctionDerivativesImpl(u, order, degree(), knots(), der);
|
||||
return der;
|
||||
}
|
||||
|
||||
template <typename _Scalar, int _Dim, int _Degree>
|
||||
template <typename Scalar_, int Dim_, int _Degree>
|
||||
template <int DerivativeOrder>
|
||||
typename SplineTraits< Spline<_Scalar, _Dim, _Degree>, DerivativeOrder >::BasisDerivativeType
|
||||
Spline<_Scalar, _Dim, _Degree>::basisFunctionDerivatives(Scalar u, DenseIndex order) const
|
||||
typename SplineTraits< Spline<Scalar_, Dim_, _Degree>, DerivativeOrder >::BasisDerivativeType
|
||||
Spline<Scalar_, Dim_, _Degree>::basisFunctionDerivatives(Scalar u, DenseIndex order) const
|
||||
{
|
||||
typename SplineTraits< Spline<_Scalar, _Dim, _Degree>, DerivativeOrder >::BasisDerivativeType der;
|
||||
typename SplineTraits< Spline<Scalar_, Dim_, _Degree>, DerivativeOrder >::BasisDerivativeType der;
|
||||
BasisFunctionDerivativesImpl(u, order, degree(), knots(), der);
|
||||
return der;
|
||||
}
|
||||
|
||||
template <typename _Scalar, int _Dim, int _Degree>
|
||||
typename SplineTraits<Spline<_Scalar, _Dim, _Degree> >::BasisDerivativeType
|
||||
Spline<_Scalar, _Dim, _Degree>::BasisFunctionDerivatives(
|
||||
const typename Spline<_Scalar, _Dim, _Degree>::Scalar u,
|
||||
template <typename Scalar_, int Dim_, int _Degree>
|
||||
typename SplineTraits<Spline<Scalar_, Dim_, _Degree> >::BasisDerivativeType
|
||||
Spline<Scalar_, Dim_, _Degree>::BasisFunctionDerivatives(
|
||||
const typename Spline<Scalar_, Dim_, _Degree>::Scalar u,
|
||||
const DenseIndex order,
|
||||
const DenseIndex degree,
|
||||
const typename Spline<_Scalar, _Dim, _Degree>::KnotVectorType& knots)
|
||||
const typename Spline<Scalar_, Dim_, _Degree>::KnotVectorType& knots)
|
||||
{
|
||||
typename SplineTraits<Spline>::BasisDerivativeType der;
|
||||
BasisFunctionDerivativesImpl(u, order, degree, knots, der);
|
||||
|
||||
@@ -22,11 +22,11 @@ namespace Eigen
|
||||
* \ingroup Splines_Module
|
||||
* \brief Compile-time attributes of the Spline class for Dynamic degree.
|
||||
**/
|
||||
template <typename _Scalar, int _Dim, int _Degree>
|
||||
struct SplineTraits< Spline<_Scalar, _Dim, _Degree>, Dynamic >
|
||||
template <typename Scalar_, int Dim_, int _Degree>
|
||||
struct SplineTraits< Spline<Scalar_, Dim_, _Degree>, Dynamic >
|
||||
{
|
||||
typedef _Scalar Scalar; /*!< The spline curve's scalar type. */
|
||||
enum { Dimension = _Dim /*!< The spline curve's dimension. */ };
|
||||
typedef Scalar_ Scalar; /*!< The spline curve's scalar type. */
|
||||
enum { Dimension = Dim_ /*!< The spline curve's dimension. */ };
|
||||
enum { Degree = _Degree /*!< The spline curve's degree. */ };
|
||||
|
||||
enum { OrderAtCompileTime = _Degree==Dynamic ? Dynamic : _Degree+1 /*!< The spline curve's order at compile-time. */ };
|
||||
@@ -62,19 +62,19 @@ namespace Eigen
|
||||
*
|
||||
* The traits class inherits all attributes from the SplineTraits of Dynamic degree.
|
||||
**/
|
||||
template < typename _Scalar, int _Dim, int _Degree, int _DerivativeOrder >
|
||||
struct SplineTraits< Spline<_Scalar, _Dim, _Degree>, _DerivativeOrder > : public SplineTraits< Spline<_Scalar, _Dim, _Degree> >
|
||||
template < typename Scalar_, int Dim_, int _Degree, int _DerivativeOrder >
|
||||
struct SplineTraits< Spline<Scalar_, Dim_, _Degree>, _DerivativeOrder > : public SplineTraits< Spline<Scalar_, Dim_, _Degree> >
|
||||
{
|
||||
enum { OrderAtCompileTime = _Degree==Dynamic ? Dynamic : _Degree+1 /*!< The spline curve's order at compile-time. */ };
|
||||
enum { NumOfDerivativesAtCompileTime = _DerivativeOrder==Dynamic ? Dynamic : _DerivativeOrder+1 /*!< The number of derivatives defined for the current spline. */ };
|
||||
|
||||
enum { DerivativeMemoryLayout = _Dim==1 ? RowMajor : ColMajor /*!< The derivative type's memory layout. */ };
|
||||
enum { DerivativeMemoryLayout = Dim_==1 ? RowMajor : ColMajor /*!< The derivative type's memory layout. */ };
|
||||
|
||||
/** \brief The data type used to store the values of the basis function derivatives. */
|
||||
typedef Array<_Scalar,Dynamic,Dynamic,RowMajor,NumOfDerivativesAtCompileTime,OrderAtCompileTime> BasisDerivativeType;
|
||||
typedef Array<Scalar_,Dynamic,Dynamic,RowMajor,NumOfDerivativesAtCompileTime,OrderAtCompileTime> BasisDerivativeType;
|
||||
|
||||
/** \brief The data type used to store the spline's derivative values. */
|
||||
typedef Array<_Scalar,_Dim,Dynamic,DerivativeMemoryLayout,_Dim,NumOfDerivativesAtCompileTime> DerivativeType;
|
||||
typedef Array<Scalar_,Dim_,Dynamic,DerivativeMemoryLayout,Dim_,NumOfDerivativesAtCompileTime> DerivativeType;
|
||||
};
|
||||
|
||||
/** \brief 2D float B-spline with dynamic degree. */
|
||||
|
||||
Reference in New Issue
Block a user