diff options
author | Yi Kong <yikong@google.com> | 2022-02-25 19:59:12 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2022-02-25 19:59:12 +0000 |
commit | 0eda9fda57a94cdb1e6dafdeea5cd469d12e7e13 (patch) | |
tree | fb979fb4cf4f8052c8cc66b1ec9516d91fcd859b /unsupported/Eigen/src/Splines | |
parent | 8fd413e275f78a4c240f1442ce5cf77c73a20a55 (diff) | |
parent | edb0ad5bb04b48aab7dd0978f0475edd3550de7c (diff) | |
download | eigen-0eda9fda57a94cdb1e6dafdeea5cd469d12e7e13.tar.gz |
Merge changes Iee153445,Iee274471 am: 79df15ea88 am: 10f298fc41 am: 7cb5001398 am: bc0f5df265 am: edb0ad5bb0
Original change: https://android-review.googlesource.com/c/platform/external/eigen/+/1999079
Change-Id: Ie3f66a4da4b417c7ddfe10af92338237c7a8098e
Diffstat (limited to 'unsupported/Eigen/src/Splines')
-rw-r--r-- | unsupported/Eigen/src/Splines/Spline.h | 9 | ||||
-rw-r--r-- | unsupported/Eigen/src/Splines/SplineFitting.h | 11 | ||||
-rw-r--r-- | unsupported/Eigen/src/Splines/SplineFwd.h | 2 |
3 files changed, 9 insertions, 13 deletions
diff --git a/unsupported/Eigen/src/Splines/Spline.h b/unsupported/Eigen/src/Splines/Spline.h index 627f6e482..79edd52ce 100644 --- a/unsupported/Eigen/src/Splines/Spline.h +++ b/unsupported/Eigen/src/Splines/Spline.h @@ -191,7 +191,7 @@ namespace Eigen DenseIndex span(Scalar u) const; /** - * \brief Computes the spang within the provided knot vector in which u is falling. + * \brief Computes the span within the provided knot vector in which u is falling. **/ static DenseIndex Span(typename SplineTraits<Spline>::Scalar u, DenseIndex degree, const typename SplineTraits<Spline>::KnotVectorType& knots); @@ -249,15 +249,13 @@ namespace Eigen DenseIndex degree, const typename Spline<_Scalar, _Dim, _Degree>::KnotVectorType& knots) { - typedef typename Spline<_Scalar, _Dim, _Degree>::BasisVectorType BasisVectorType; - const DenseIndex p = degree; const DenseIndex i = Spline::Span(u, degree, knots); const KnotVectorType& U = knots; BasisVectorType left(p+1); left(0) = Scalar(0); - BasisVectorType right(p+1); right(0) = Scalar(0); + BasisVectorType right(p+1); right(0) = Scalar(0); VectorBlock<BasisVectorType,Degree>(left,1,p) = u - VectorBlock<const KnotVectorType,Degree>(U,i+1-p,p).reverse(); VectorBlock<BasisVectorType,Degree>(right,1,p) = VectorBlock<const KnotVectorType,Degree>(U,i+1,p) - u; @@ -380,9 +378,6 @@ namespace Eigen typedef Spline<_Scalar, _Dim, _Degree> SplineType; enum { Order = SplineTraits<SplineType>::OrderAtCompileTime }; - typedef typename SplineTraits<SplineType>::Scalar Scalar; - typedef typename SplineTraits<SplineType>::BasisVectorType BasisVectorType; - const DenseIndex span = SplineType::Span(u, p, U); const DenseIndex n = (std::min)(p, order); diff --git a/unsupported/Eigen/src/Splines/SplineFitting.h b/unsupported/Eigen/src/Splines/SplineFitting.h index c761a9b3d..9f6e8afa0 100644 --- a/unsupported/Eigen/src/Splines/SplineFitting.h +++ b/unsupported/Eigen/src/Splines/SplineFitting.h @@ -17,8 +17,8 @@ #include "SplineFwd.h" -#include <Eigen/LU> -#include <Eigen/QR> +#include "../../../../Eigen/LU" +#include "../../../../Eigen/QR" namespace Eigen { @@ -181,7 +181,7 @@ namespace Eigen * \ingroup Splines_Module * * \param[in] pts The data points to which a spline should be fit. - * \param[out] chord_lengths The resulting chord lenggth vector. + * \param[out] chord_lengths The resulting chord length vector. * * \sa Les Piegl and Wayne Tiller, The NURBS book (2nd ed.), 1997, 9.2.1 Global Curve Interpolation to Point Data **/ @@ -385,7 +385,7 @@ namespace Eigen { const DenseIndex span = SplineType::Span(parameters[i], degree, knots); - if (derivativeIndices[derivativeIndex] == i) + if (derivativeIndex < derivativeIndices.size() && derivativeIndices[derivativeIndex] == i) { A.block(row, span - degree, 2, degree + 1) = SplineType::BasisFunctionDerivatives(parameters[i], 1, degree, knots); @@ -395,8 +395,9 @@ namespace Eigen } else { - A.row(row++).segment(span - degree, degree + 1) + A.row(row).segment(span - degree, degree + 1) = SplineType::BasisFunctions(parameters[i], degree, knots); + b.col(row++) = points.col(i); } } b.col(0) = points.col(0); diff --git a/unsupported/Eigen/src/Splines/SplineFwd.h b/unsupported/Eigen/src/Splines/SplineFwd.h index 0a95fbf3e..00d6b4921 100644 --- a/unsupported/Eigen/src/Splines/SplineFwd.h +++ b/unsupported/Eigen/src/Splines/SplineFwd.h @@ -10,7 +10,7 @@ #ifndef EIGEN_SPLINES_FWD_H #define EIGEN_SPLINES_FWD_H -#include <Eigen/Core> +#include "../../../../Eigen/Core" namespace Eigen { |