diff --git a/src/scion/math/ChebyshevApproximation.hpp b/src/scion/math/ChebyshevApproximation.hpp index 4bdb1b1..67bd4cc 100644 --- a/src/scion/math/ChebyshevApproximation.hpp +++ b/src/scion/math/ChebyshevApproximation.hpp @@ -57,7 +57,14 @@ namespace math { public: + /* type aliases */ + + using typename Parent::XType; + using typename Parent::YType; + using typename Parent::DomainVariant; + /* constructor */ + #include "scion/math/ChebyshevApproximation/src/ctor.hpp" /* interface implementation function */ diff --git a/src/scion/math/ChebyshevSeries.hpp b/src/scion/math/ChebyshevSeries.hpp index 556f6bc..20e42ec 100644 --- a/src/scion/math/ChebyshevSeries.hpp +++ b/src/scion/math/ChebyshevSeries.hpp @@ -66,7 +66,14 @@ namespace math { public: + /* type aliases */ + + using typename Parent::XType; + using typename Parent::YType; + using typename Parent::DomainVariant; + /* constructor */ + #include "scion/math/ChebyshevSeries/src/ctor.hpp" /* methods */ diff --git a/src/scion/math/HistogramTable.hpp b/src/scion/math/HistogramTable.hpp index 0ded725..e6dc127 100644 --- a/src/scion/math/HistogramTable.hpp +++ b/src/scion/math/HistogramTable.hpp @@ -56,7 +56,14 @@ namespace math { public: + /* type aliases */ + + using typename Parent::XType; + using typename Parent::YType; + using typename Parent::DomainVariant; + /* constructor */ + #include "scion/math/HistogramTable/src/ctor.hpp" /* methods */ diff --git a/src/scion/math/HistogramTableFunction.hpp b/src/scion/math/HistogramTableFunction.hpp index 263e18e..fbc73cc 100644 --- a/src/scion/math/HistogramTableFunction.hpp +++ b/src/scion/math/HistogramTableFunction.hpp @@ -22,22 +22,22 @@ namespace math { * type F and the container type used for the x values and the functions. This allows us to * use something like utility::IteratorView instead of std::vector. */ - template < typename X, typename Y, typename Z, typename F, + template < typename X, typename F, typename XContainer = std::vector< X >, typename FContainer = std::vector< F > > class HistogramTableFunction : - public SingleTableFunctionBase< HistogramTableFunction< X, Y, Z, F, XContainer, FContainer >, - interpolation::Histogram, X, Y, Z, F, + public SingleTableFunctionBase< HistogramTableFunction< X, F, XContainer, FContainer >, + interpolation::Histogram, X, F, XContainer, FContainer > { /* friend declarations */ - friend class SingleTableFunctionBase< HistogramTableFunction< X, Y, Z, F, XContainer, FContainer >, - interpolation::Histogram, X, Y, Z, F, + friend class SingleTableFunctionBase< HistogramTableFunction< X, F, XContainer, FContainer >, + interpolation::Histogram, X, F, XContainer, FContainer >; /* type aliases */ - using Parent = SingleTableFunctionBase< HistogramTableFunction< X, Y, Z, F, XContainer, FContainer >, - interpolation::Histogram, X, Y, Z, F, + using Parent = SingleTableFunctionBase< HistogramTableFunction< X, F, XContainer, FContainer >, + interpolation::Histogram, X, F, XContainer, FContainer >; /* fields */ diff --git a/src/scion/math/HistogramTableFunction/test/HistogramTableFunction.test.cpp b/src/scion/math/HistogramTableFunction/test/HistogramTableFunction.test.cpp index 7d7b821..73d7a0c 100644 --- a/src/scion/math/HistogramTableFunction/test/HistogramTableFunction.test.cpp +++ b/src/scion/math/HistogramTableFunction/test/HistogramTableFunction.test.cpp @@ -14,11 +14,10 @@ using Catch::Matchers::WithinRel; using namespace njoy::scion; template < typename X, typename Y = X > using InterpolationTable = math::InterpolationTable< X, Y >; -template < typename X, typename Y = X, typename Z = X, - typename F = InterpolationTable< X >, +template < typename X, typename F = InterpolationTable< X >, typename XContainer = std::vector< X >, typename FContainer = std::vector< F > > -using HistogramTableFunction = math::HistogramTableFunction< X, Y, Z, F, XContainer, FContainer >; +using HistogramTableFunction = math::HistogramTableFunction< X, F, XContainer, FContainer >; using InterpolationType = interpolation::InterpolationType; SCENARIO( "HistogramTableFunction" ) { @@ -115,8 +114,8 @@ SCENARIO( "HistogramTableFunction" ) { XView x = njoy::utility::make_view( xvalues ); FView f = njoy::utility::make_view( fvalues ); - HistogramTableFunction< double, double, double, InterpolationTable< double >, - XView, FView > chunk( std::move( x ), std::move( f ) ); + HistogramTableFunction< double, InterpolationTable< double >, + XView, FView > chunk( std::move( x ), std::move( f ) ); THEN( "a HistogramTable can be constructed and members can be tested" ) { diff --git a/src/scion/math/InterpolationTable.hpp b/src/scion/math/InterpolationTable.hpp index 570e9f9..d942553 100644 --- a/src/scion/math/InterpolationTable.hpp +++ b/src/scion/math/InterpolationTable.hpp @@ -76,7 +76,14 @@ namespace math { public: + /* type aliases */ + + using typename Parent::XType; + using typename Parent::YType; + using typename Parent::DomainVariant; + /* constructor */ + #include "scion/math/InterpolationTable/src/ctor.hpp" /* methods */ diff --git a/src/scion/math/InterpolationTableFunction.hpp b/src/scion/math/InterpolationTableFunction.hpp index e1933ca..55e03c2 100644 --- a/src/scion/math/InterpolationTableFunction.hpp +++ b/src/scion/math/InterpolationTableFunction.hpp @@ -25,25 +25,30 @@ namespace math { * @class * @brief Tabulated data with one or more interpolation types */ - template < typename X, typename F, typename Y, typename Z > + template < typename X, typename F > class InterpolationTableFunction : - public TwoDimensionalFunctionBase< InterpolationTableFunction< X, F, Y, Z >, X, Y, Z > { + public TwoDimensionalFunctionBase< InterpolationTableFunction< X, F >, + X, typename F::XType, typename F::YType > { /* friend declarations */ - friend class TwoDimensionalFunctionBase< InterpolationTableFunction< X, F, Y, Z >, X, Y, Z >; + friend class TwoDimensionalFunctionBase< InterpolationTableFunction< X, F >, + X, typename F::XType, typename F::YType >; /* type aliases */ - using Parent = TwoDimensionalFunctionBase< InterpolationTableFunction< X, F, Y, Z >, X, Y, Z >; + using Parent = TwoDimensionalFunctionBase< InterpolationTableFunction< X, F >, X, + typename F::XType, typename F::YType >; + using Y = typename Parent::YType; + using Z = typename Parent::ZType; using XIterator = typename std::vector< X >::const_iterator; using FIterator = typename std::vector< F >::const_iterator; using XContainer = njoy::utility::IteratorView< XIterator >; using FContainer = njoy::utility::IteratorView< FIterator >; using TableVariant = std::variant< - LinearLinearTableFunction< X, Y, Z, F, XContainer, FContainer >, - HistogramTableFunction< X, Y, Z, F, XContainer, FContainer >, - LinearLogTableFunction< X, Y, Z, F, XContainer, FContainer >, - LogLinearTableFunction< X, Y, Z, F, XContainer, FContainer >, - LogLogTableFunction< X, Y, Z, F, XContainer, FContainer > >; + LinearLinearTableFunction< X, F, XContainer, FContainer >, + HistogramTableFunction< X, F, XContainer, FContainer >, + LinearLogTableFunction< X, F, XContainer, FContainer >, + LogLinearTableFunction< X, F, XContainer, FContainer >, + LogLogTableFunction< X, F, XContainer, FContainer > >; /* fields */ std::vector< X > x_; @@ -69,7 +74,14 @@ namespace math { public: + /* type aliases */ + + using typename Parent::XType; + using typename Parent::YType; + using typename Parent::ZType; + /* constructor */ + #include "scion/math/InterpolationTableFunction/src/ctor.hpp" /* methods */ diff --git a/src/scion/math/InterpolationTableFunction/src/generateTables.hpp b/src/scion/math/InterpolationTableFunction/src/generateTables.hpp index 1923529..d54d8a2 100644 --- a/src/scion/math/InterpolationTableFunction/src/generateTables.hpp +++ b/src/scion/math/InterpolationTableFunction/src/generateTables.hpp @@ -18,7 +18,7 @@ void generateTables() { case interpolation::InterpolationType::LinearLinear : { tables.emplace_back( - LinearLinearTableFunction< X, Y, Z, F, XContainer, FContainer >( + LinearLinearTableFunction< X, F, XContainer, FContainer >( XContainer( xStart, xEnd ), FContainer( fStart, fEnd ) ) ); break; @@ -27,7 +27,7 @@ void generateTables() { linearised = false; tables.emplace_back( - HistogramTableFunction< X, Y, Z, F, XContainer, FContainer >( + HistogramTableFunction< X, F, XContainer, FContainer >( XContainer( xStart, xEnd ), FContainer( fStart, fEnd ) ) ); break; @@ -36,7 +36,7 @@ void generateTables() { linearised = false; tables.emplace_back( - LinearLogTableFunction< X, Y, Z, F, XContainer, FContainer >( + LinearLogTableFunction< X, F, XContainer, FContainer >( XContainer( xStart, xEnd ), FContainer( fStart, fEnd ) ) ); break; @@ -45,7 +45,7 @@ void generateTables() { linearised = false; tables.emplace_back( - LogLinearTableFunction< X, Y, Z, F, XContainer, FContainer >( + LogLinearTableFunction< X, F, XContainer, FContainer >( XContainer( xStart, xEnd ), FContainer( fStart, fEnd ) ) ); break; @@ -54,7 +54,7 @@ void generateTables() { linearised = false; tables.emplace_back( - LogLogTableFunction< X, Y, Z, F, XContainer, FContainer >( + LogLogTableFunction< X, F, XContainer, FContainer >( XContainer( xStart, xEnd ), FContainer( fStart, fEnd ) ) ); break; diff --git a/src/scion/math/InterpolationTableFunction/test/InterpolationTableFunction.test.cpp b/src/scion/math/InterpolationTableFunction/test/InterpolationTableFunction.test.cpp index 375084b..4ef88e5 100644 --- a/src/scion/math/InterpolationTableFunction/test/InterpolationTableFunction.test.cpp +++ b/src/scion/math/InterpolationTableFunction/test/InterpolationTableFunction.test.cpp @@ -16,8 +16,8 @@ template < typename X, typename Y = X > using InterpolationTable = math::InterpolationTable< X, Y >; template < typename X, typename Y = X > using LegendreSeries = math::LegendreSeries< X, Y >; -template < typename X, typename F, typename Y = X, typename Z = X > -using InterpolationTableFunction = math::InterpolationTableFunction< X, F, Y, Z >; +template < typename X, typename F > +using InterpolationTableFunction = math::InterpolationTableFunction< X, F >; using InterpolationType = interpolation::InterpolationType; using Table2D = InterpolationTableFunction< double, InterpolationTable< double > >; diff --git a/src/scion/math/LegendreSeries.hpp b/src/scion/math/LegendreSeries.hpp index 481e9c8..e0a9bde 100644 --- a/src/scion/math/LegendreSeries.hpp +++ b/src/scion/math/LegendreSeries.hpp @@ -72,7 +72,14 @@ namespace math { public: + /* type aliases */ + + using typename Parent::XType; + using typename Parent::YType; + using typename Parent::DomainVariant; + /* constructor */ + #include "scion/math/LegendreSeries/src/ctor.hpp" /* methods */ diff --git a/src/scion/math/LinearLinearTableFunction.hpp b/src/scion/math/LinearLinearTableFunction.hpp index e98fb19..ced52b8 100644 --- a/src/scion/math/LinearLinearTableFunction.hpp +++ b/src/scion/math/LinearLinearTableFunction.hpp @@ -22,22 +22,22 @@ namespace math { * type F and the container type used for the x values and the functions. This allows us to * use something like utility::IteratorView instead of std::vector. */ - template < typename X, typename Y, typename Z, typename F, + template < typename X, typename F, typename XContainer = std::vector< X >, typename FContainer = std::vector< F > > class LinearLinearTableFunction : - public SingleTableFunctionBase< LinearLinearTableFunction< X, Y, Z, F, XContainer, FContainer >, - interpolation::LinearLinear, X, Y, Z, F, + public SingleTableFunctionBase< LinearLinearTableFunction< X, F, XContainer, FContainer >, + interpolation::LinearLinear, X, F, XContainer, FContainer > { /* friend declarations */ - friend class SingleTableFunctionBase< LinearLinearTableFunction< X, Y, Z, F, XContainer, FContainer >, - interpolation::LinearLinear, X, Y, Z, F, + friend class SingleTableFunctionBase< LinearLinearTableFunction< X, F, XContainer, FContainer >, + interpolation::LinearLinear, X, F, XContainer, FContainer >; /* type aliases */ - using Parent = SingleTableFunctionBase< LinearLinearTableFunction< X, Y, Z, F, XContainer, FContainer >, - interpolation::LinearLinear, X, Y, Z, F, + using Parent = SingleTableFunctionBase< LinearLinearTableFunction< X, F, XContainer, FContainer >, + interpolation::LinearLinear, X, F, XContainer, FContainer >; /* fields */ diff --git a/src/scion/math/LinearLinearTableFunction/test/LinearLinearTableFunction.test.cpp b/src/scion/math/LinearLinearTableFunction/test/LinearLinearTableFunction.test.cpp index 3e5a776..c9e20bf 100644 --- a/src/scion/math/LinearLinearTableFunction/test/LinearLinearTableFunction.test.cpp +++ b/src/scion/math/LinearLinearTableFunction/test/LinearLinearTableFunction.test.cpp @@ -14,11 +14,10 @@ using Catch::Matchers::WithinRel; using namespace njoy::scion; template < typename X, typename Y = X > using InterpolationTable = math::InterpolationTable< X, Y >; -template < typename X, typename Y = X, typename Z = X, - typename F = InterpolationTable< X >, +template < typename X, typename F = InterpolationTable< X >, typename XContainer = std::vector< X >, typename FContainer = std::vector< F > > -using LinearLinearTableFunction = math::LinearLinearTableFunction< X, Y, Z, F, XContainer, FContainer >; +using LinearLinearTableFunction = math::LinearLinearTableFunction< X, F, XContainer, FContainer >; using InterpolationType = interpolation::InterpolationType; SCENARIO( "LinearLinearTableFunction" ) { @@ -115,7 +114,7 @@ SCENARIO( "LinearLinearTableFunction" ) { XView x = njoy::utility::make_view( xvalues ); FView f = njoy::utility::make_view( fvalues ); - LinearLinearTableFunction< double, double, double, InterpolationTable< double >, + LinearLinearTableFunction< double, InterpolationTable< double >, XView, FView > chunk( std::move( x ), std::move( f ) ); THEN( "a LinearLinearTable can be constructed and members can be tested" ) { diff --git a/src/scion/math/LinearLogTableFunction.hpp b/src/scion/math/LinearLogTableFunction.hpp index 1da89ea..d662c57 100644 --- a/src/scion/math/LinearLogTableFunction.hpp +++ b/src/scion/math/LinearLogTableFunction.hpp @@ -22,22 +22,22 @@ namespace math { * type F and the container type used for the x values and the functions. This allows us to * use something like utility::IteratorView instead of std::vector. */ - template < typename X, typename Y, typename Z, typename F, + template < typename X, typename F, typename XContainer = std::vector< X >, typename FContainer = std::vector< F > > class LinearLogTableFunction : - public SingleTableFunctionBase< LinearLogTableFunction< X, Y, Z, F, XContainer, FContainer >, - interpolation::LinearLogarithmic, X, Y, Z, F, + public SingleTableFunctionBase< LinearLogTableFunction< X, F, XContainer, FContainer >, + interpolation::LinearLogarithmic, X, F, XContainer, FContainer > { /* friend declarations */ - friend class SingleTableFunctionBase< LinearLogTableFunction< X, Y, Z, F, XContainer, FContainer >, - interpolation::LinearLogarithmic, X, Y, Z, F, + friend class SingleTableFunctionBase< LinearLogTableFunction< X, F, XContainer, FContainer >, + interpolation::LinearLogarithmic, X, F, XContainer, FContainer >; /* type aliases */ - using Parent = SingleTableFunctionBase< LinearLogTableFunction< X, Y, Z, F, XContainer, FContainer >, - interpolation::LinearLogarithmic, X, Y, Z, F, + using Parent = SingleTableFunctionBase< LinearLogTableFunction< X, F, XContainer, FContainer >, + interpolation::LinearLogarithmic, X, F, XContainer, FContainer >; /* fields */ diff --git a/src/scion/math/LinearLogTableFunction/test/LinearLogTableFunction.test.cpp b/src/scion/math/LinearLogTableFunction/test/LinearLogTableFunction.test.cpp index 01365d3..adefe66 100644 --- a/src/scion/math/LinearLogTableFunction/test/LinearLogTableFunction.test.cpp +++ b/src/scion/math/LinearLogTableFunction/test/LinearLogTableFunction.test.cpp @@ -14,11 +14,10 @@ using Catch::Matchers::WithinRel; using namespace njoy::scion; template < typename X, typename Y = X > using InterpolationTable = math::InterpolationTable< X, Y >; -template < typename X, typename Y = X, typename Z = X, - typename F = InterpolationTable< X >, +template < typename X, typename F = InterpolationTable< X >, typename XContainer = std::vector< X >, typename FContainer = std::vector< F > > -using LinearLogTableFunction = math::LinearLogTableFunction< X, Y, Z, F, XContainer, FContainer >; +using LinearLogTableFunction = math::LinearLogTableFunction< X, F, XContainer, FContainer >; using InterpolationType = interpolation::InterpolationType; SCENARIO( "LinearLogTableFunction" ) { @@ -115,8 +114,8 @@ SCENARIO( "LinearLogTableFunction" ) { XView x = njoy::utility::make_view( xvalues ); FView f = njoy::utility::make_view( fvalues ); - LinearLogTableFunction< double, double, double, InterpolationTable< double >, - XView, FView > chunk( std::move( x ), std::move( f ) ); + LinearLogTableFunction< double, InterpolationTable< double >, + XView, FView > chunk( std::move( x ), std::move( f ) ); THEN( "a LinearLogTable can be constructed and members can be tested" ) { diff --git a/src/scion/math/LogLinearTableFunction.hpp b/src/scion/math/LogLinearTableFunction.hpp index ba07858..6934a26 100644 --- a/src/scion/math/LogLinearTableFunction.hpp +++ b/src/scion/math/LogLinearTableFunction.hpp @@ -22,22 +22,22 @@ namespace math { * type F and the container type used for the x values and the functions. This allows us to * use something like utility::IteratorView instead of std::vector. */ - template < typename X, typename Y, typename Z, typename F, + template < typename X, typename F, typename XContainer = std::vector< X >, typename FContainer = std::vector< F > > class LogLinearTableFunction : - public SingleTableFunctionBase< LogLinearTableFunction< X, Y, Z, F, XContainer, FContainer >, - interpolation::LogarithmicLinear, X, Y, Z, F, + public SingleTableFunctionBase< LogLinearTableFunction< X, F, XContainer, FContainer >, + interpolation::LogarithmicLinear, X, F, XContainer, FContainer > { /* friend declarations */ - friend class SingleTableFunctionBase< LogLinearTableFunction< X, Y, Z, F, XContainer, FContainer >, - interpolation::LogarithmicLinear, X, Y, Z, F, + friend class SingleTableFunctionBase< LogLinearTableFunction< X, F, XContainer, FContainer >, + interpolation::LogarithmicLinear, X, F, XContainer, FContainer >; /* type aliases */ - using Parent = SingleTableFunctionBase< LogLinearTableFunction< X, Y, Z, F, XContainer, FContainer >, - interpolation::LogarithmicLinear, X, Y, Z, F, + using Parent = SingleTableFunctionBase< LogLinearTableFunction< X, F, XContainer, FContainer >, + interpolation::LogarithmicLinear, X, F, XContainer, FContainer >; /* fields */ diff --git a/src/scion/math/LogLinearTableFunction/test/LogLinearTableFunction.test.cpp b/src/scion/math/LogLinearTableFunction/test/LogLinearTableFunction.test.cpp index f4595cf..243a8e3 100644 --- a/src/scion/math/LogLinearTableFunction/test/LogLinearTableFunction.test.cpp +++ b/src/scion/math/LogLinearTableFunction/test/LogLinearTableFunction.test.cpp @@ -14,11 +14,10 @@ using Catch::Matchers::WithinRel; using namespace njoy::scion; template < typename X, typename Y = X > using InterpolationTable = math::InterpolationTable< X, Y >; -template < typename X, typename Y = X, typename Z = X, - typename F = InterpolationTable< X >, +template < typename X, typename F = InterpolationTable< X >, typename XContainer = std::vector< X >, typename FContainer = std::vector< F > > -using LogLinearTableFunction = math::LogLinearTableFunction< X, Y, Z, F, XContainer, FContainer >; +using LogLinearTableFunction = math::LogLinearTableFunction< X, F, XContainer, FContainer >; using InterpolationType = interpolation::InterpolationType; SCENARIO( "LogLinearTableFunction" ) { @@ -115,8 +114,8 @@ SCENARIO( "LogLinearTableFunction" ) { XView x = njoy::utility::make_view( xvalues ); FView f = njoy::utility::make_view( fvalues ); - LogLinearTableFunction< double, double, double, InterpolationTable< double >, - XView, FView > chunk( std::move( x ), std::move( f ) ); + LogLinearTableFunction< double, InterpolationTable< double >, + XView, FView > chunk( std::move( x ), std::move( f ) ); THEN( "a LogLinearTable can be constructed and members can be tested" ) { diff --git a/src/scion/math/LogLogTableFunction.hpp b/src/scion/math/LogLogTableFunction.hpp index 37e47b8..d0e7cd3 100644 --- a/src/scion/math/LogLogTableFunction.hpp +++ b/src/scion/math/LogLogTableFunction.hpp @@ -22,22 +22,22 @@ namespace math { * type F and the container type used for the x values and the functions. This allows us to * use something like utility::IteratorView instead of std::vector. */ - template < typename X, typename Y, typename Z, typename F, + template < typename X, typename F, typename XContainer = std::vector< X >, typename FContainer = std::vector< F > > class LogLogTableFunction : - public SingleTableFunctionBase< LogLogTableFunction< X, Y, Z, F, XContainer, FContainer >, - interpolation::LogarithmicLogarithmic, X, Y, Z, F, + public SingleTableFunctionBase< LogLogTableFunction< X, F, XContainer, FContainer >, + interpolation::LogarithmicLogarithmic, X, F, XContainer, FContainer > { /* friend declarations */ - friend class SingleTableFunctionBase< LogLogTableFunction< X, Y, Z, F, XContainer, FContainer >, - interpolation::LogarithmicLogarithmic, X, Y, Z, F, + friend class SingleTableFunctionBase< LogLogTableFunction< X, F, XContainer, FContainer >, + interpolation::LogarithmicLogarithmic, X, F, XContainer, FContainer >; /* type aliases */ - using Parent = SingleTableFunctionBase< LogLogTableFunction< X, Y, Z, F, XContainer, FContainer >, - interpolation::LogarithmicLogarithmic, X, Y, Z, F, + using Parent = SingleTableFunctionBase< LogLogTableFunction< X, F, XContainer, FContainer >, + interpolation::LogarithmicLogarithmic, X, F, XContainer, FContainer >; /* fields */ diff --git a/src/scion/math/LogLogTableFunction/test/LogLogTableFunction.test.cpp b/src/scion/math/LogLogTableFunction/test/LogLogTableFunction.test.cpp index b931d10..c668a10 100644 --- a/src/scion/math/LogLogTableFunction/test/LogLogTableFunction.test.cpp +++ b/src/scion/math/LogLogTableFunction/test/LogLogTableFunction.test.cpp @@ -14,11 +14,10 @@ using Catch::Matchers::WithinRel; using namespace njoy::scion; template < typename X, typename Y = X > using InterpolationTable = math::InterpolationTable< X, Y >; -template < typename X, typename Y = X, typename Z = X, - typename F = InterpolationTable< X >, +template < typename X, typename F = InterpolationTable< X >, typename XContainer = std::vector< X >, typename FContainer = std::vector< F > > -using LogLogTableFunction = math::LogLogTableFunction< X, Y, Z, F, XContainer, FContainer >; +using LogLogTableFunction = math::LogLogTableFunction< X, F, XContainer, FContainer >; using InterpolationType = interpolation::InterpolationType; SCENARIO( "LogLogTableFunction" ) { @@ -115,8 +114,8 @@ SCENARIO( "LogLogTableFunction" ) { XView x = njoy::utility::make_view( xvalues ); FView f = njoy::utility::make_view( fvalues ); - LogLogTableFunction< double, double, double, InterpolationTable< double >, - XView, FView > chunk( std::move( x ), std::move( f ) ); + LogLogTableFunction< double, InterpolationTable< double >, + XView, FView > chunk( std::move( x ), std::move( f ) ); THEN( "a LogLogTable can be constructed and members can be tested" ) { diff --git a/src/scion/math/OneDimensionalFunctionBase.hpp b/src/scion/math/OneDimensionalFunctionBase.hpp index 41f9a3b..889711e 100644 --- a/src/scion/math/OneDimensionalFunctionBase.hpp +++ b/src/scion/math/OneDimensionalFunctionBase.hpp @@ -25,6 +25,9 @@ namespace math { public: /* type aliases */ + + using XType = X; + using YType = Y; using DomainVariant = std::variant< IntervalDomain< X >, OpenDomain< X > >; private: diff --git a/src/scion/math/PolynomialSeries.hpp b/src/scion/math/PolynomialSeries.hpp index c33be95..63757c0 100644 --- a/src/scion/math/PolynomialSeries.hpp +++ b/src/scion/math/PolynomialSeries.hpp @@ -59,9 +59,13 @@ namespace math { public: /* type aliases */ - using DomainVariant = typename Parent::DomainVariant; + + using typename Parent::XType; + using typename Parent::YType; + using typename Parent::DomainVariant; /* constructor */ + #include "scion/math/PolynomialSeries/src/ctor.hpp" /* methods */ diff --git a/src/scion/math/SeriesBase.hpp b/src/scion/math/SeriesBase.hpp index 45da46d..cfe7f95 100644 --- a/src/scion/math/SeriesBase.hpp +++ b/src/scion/math/SeriesBase.hpp @@ -34,7 +34,10 @@ namespace math { public: /* type aliases */ - using DomainVariant = typename Parent::DomainVariant; + + using typename Parent::XType; + using typename Parent::YType; + using typename Parent::DomainVariant; private: @@ -48,6 +51,7 @@ namespace math { protected: /* constructor */ + #include "scion/math/SeriesBase/src/ctor.hpp" public: diff --git a/src/scion/math/SingleTableBase.hpp b/src/scion/math/SingleTableBase.hpp index 8ef0989..8bb16e0 100644 --- a/src/scion/math/SingleTableBase.hpp +++ b/src/scion/math/SingleTableBase.hpp @@ -35,7 +35,10 @@ namespace math { public: /* type aliases */ - using DomainVariant = typename Parent::DomainVariant; + + using typename Parent::XType; + using typename Parent::YType; + using typename Parent::DomainVariant; private: diff --git a/src/scion/math/SingleTableFunctionBase.hpp b/src/scion/math/SingleTableFunctionBase.hpp index 7bf687c..c18d1a7 100644 --- a/src/scion/math/SingleTableFunctionBase.hpp +++ b/src/scion/math/SingleTableFunctionBase.hpp @@ -18,13 +18,16 @@ namespace math { * @brief Base class for x,f(y) tabulated data using a single interpolation region */ template < typename Derived, typename Interpolator, - typename X, typename Y, typename Z, typename F, + typename X, typename F, typename XContainer = std::vector< X >, typename FContainer = std::vector< F > > - class SingleTableFunctionBase : public TwoDimensionalFunctionBase< Derived, X, Y, Z > { + class SingleTableFunctionBase : + public TwoDimensionalFunctionBase< Derived, X, typename F::XType, typename F::YType > { /* type aliases */ - using Parent = TwoDimensionalFunctionBase< Derived, X, Y, Z >; + using Parent = TwoDimensionalFunctionBase< Derived, X, typename F::XType, typename F::YType >; + using Y = typename Parent::YType; + using Z = typename Parent::ZType; /* fields */ Interpolator interpolator_; diff --git a/src/scion/math/TwoDimensionalFunctionBase.hpp b/src/scion/math/TwoDimensionalFunctionBase.hpp index 3479173..05f7b3f 100644 --- a/src/scion/math/TwoDimensionalFunctionBase.hpp +++ b/src/scion/math/TwoDimensionalFunctionBase.hpp @@ -13,7 +13,7 @@ namespace math { * @class * @brief Base class for two dimensional function objects modelling y = f(x,y) * - * This base class provides the common interface for all two dimensional + * This base class provides the common interface for all two dimensional * function objects. This includes function evaluation. */ template < typename Derived, typename X, typename Y, typename Z > @@ -21,6 +21,12 @@ namespace math { public: + /* type aliases */ + + using XType = X; + using YType = Y; + using ZType = Z; + /* methods */ /**