diff --git a/Ponca/src/Fitting/basket.h b/Ponca/src/Fitting/basket.h index 453709f1c..3f309eb7b 100644 --- a/Ponca/src/Fitting/basket.h +++ b/Ponca/src/Fitting/basket.h @@ -69,6 +69,20 @@ namespace internal struct BasketDiffAggregate : BasketDiffAggregateImpl { }; + + /*! \brief Internal class used to build the BasketAutoDiff structure */ + template class Ext0, + template class... Exts> + struct BasketAutoDiffAggregate + { + private: + using Base = Ext0>; + using Aggregate = typename BasketAggregateImpl::type; // Same impl + + public: + using type = typename Base::template DDerType>; + }; } #endif @@ -241,5 +255,12 @@ namespace internal } }; // class Basket + template class Ext0, + template class... Exts> + class BasketAutoDiff : public internal::BasketAutoDiffAggregate::type + { + }; // class BasketAutoDiff + } //namespace Ponca diff --git a/tests/src/basket.cpp b/tests/src/basket.cpp index f89d87b04..85601a658 100644 --- a/tests/src/basket.cpp +++ b/tests/src/basket.cpp @@ -193,6 +193,14 @@ void hasSamePlaneDerivatives(const Fit1& fit1, const Fit2& fit2) { VERIFY(dnor1.isApprox( dnor2 )); } +// For BasketAutoDiff +template +struct AutoDiffExt : public T +{ + template + using DDerType = OrientedSphereDerImpl; +}; + template void callSubTests() { @@ -230,6 +238,10 @@ void callSubTests() using HybridSpaceDiff = BasketDiff; using HybridScaleSpaceDiff = BasketDiff; + //! [BasketAutoDiff] + using AutoDiff = BasketAutoDiff; + //! [BasketAutoDiff] + KdTreetree; Scalar scale = generateData(tree);