From c52a80534697f10d82c89825021140569e545f95 Mon Sep 17 00:00:00 2001 From: Wim Haeck Date: Fri, 23 Aug 2024 11:24:34 -0600 Subject: [PATCH] Removing normalisation --- src/scion/math/ChebyshevSeries.hpp | 9 +-------- src/scion/math/LegendreSeries.hpp | 20 +------------------ .../test/LegendreSeries.test.cpp | 16 --------------- src/scion/math/PolynomialSeries.hpp | 9 +-------- src/scion/math/SeriesBase.hpp | 8 -------- 5 files changed, 3 insertions(+), 59 deletions(-) diff --git a/src/scion/math/ChebyshevSeries.hpp b/src/scion/math/ChebyshevSeries.hpp index 786528e..20e42ec 100644 --- a/src/scion/math/ChebyshevSeries.hpp +++ b/src/scion/math/ChebyshevSeries.hpp @@ -78,14 +78,7 @@ namespace math { /* methods */ - /** - * @brief Return the series coefficients - */ - const std::vector< Y >& coefficients() const noexcept { - - return Parent::coefficients(); - } - + using Parent::coefficients; using Parent::order; using Parent::roots; using Parent::derivative; diff --git a/src/scion/math/LegendreSeries.hpp b/src/scion/math/LegendreSeries.hpp index 7876e95..e0a9bde 100644 --- a/src/scion/math/LegendreSeries.hpp +++ b/src/scion/math/LegendreSeries.hpp @@ -84,25 +84,7 @@ namespace math { /* methods */ - /** - * @brief Normalise the LegendreSeries - * - * This function sets the order 0 coefficient equal to 0.5 so that - * the integral of the series over [-1,1] is 1. - */ - void normalise() noexcept { - - Parent::coefficients()[0] = Y( 0.5 ); - } - - /** - * @brief Return the series coefficients - */ - const std::vector< Y >& coefficients() const noexcept { - - return Parent::coefficients(); - } - + using Parent::coefficients; using Parent::order; using Parent::roots; using Parent::derivative; diff --git a/src/scion/math/LegendreSeries/test/LegendreSeries.test.cpp b/src/scion/math/LegendreSeries/test/LegendreSeries.test.cpp index 781a57a..d8ec826 100644 --- a/src/scion/math/LegendreSeries/test/LegendreSeries.test.cpp +++ b/src/scion/math/LegendreSeries/test/LegendreSeries.test.cpp @@ -105,22 +105,6 @@ SCENARIO( "LegendreSeries" ) { CHECK_THAT( 0.057142857142857, WithinRel( primitive.coefficients()[4] ) ); } // THEN - THEN( "the LegendreSeries can be normalised" ) { - - LegendreSeries< double > copy = chunk; - copy.normalise(); - - CHECK( 3 == copy.order() ); - CHECK( 4 == copy.coefficients().size() ); - CHECK_THAT( 0.5 , WithinRel( copy.coefficients()[0] ) ); - CHECK_THAT( 14.6 , WithinRel( copy.coefficients()[1] ) ); - CHECK_THAT( -4.66666666666666, WithinRel( copy.coefficients()[2] ) ); - CHECK_THAT( 0.4 , WithinRel( copy.coefficients()[3] ) ); - - LegendreSeries< double > primitive = copy.primitive( -1. ); - CHECK_THAT( 1., WithinRel( primitive( 1. ) ) ); - } - THEN( "roots can be calculated" ) { std::vector< double > roots = chunk.roots(); diff --git a/src/scion/math/PolynomialSeries.hpp b/src/scion/math/PolynomialSeries.hpp index be7c260..63757c0 100644 --- a/src/scion/math/PolynomialSeries.hpp +++ b/src/scion/math/PolynomialSeries.hpp @@ -70,14 +70,7 @@ namespace math { /* methods */ - /** - * @brief Return the series coefficients - */ - const std::vector< Y >& coefficients() const noexcept { - - return Parent::coefficients(); - } - + using Parent::coefficients; using Parent::order; using Parent::roots; using Parent::derivative; diff --git a/src/scion/math/SeriesBase.hpp b/src/scion/math/SeriesBase.hpp index ebdac98..54cbe35 100644 --- a/src/scion/math/SeriesBase.hpp +++ b/src/scion/math/SeriesBase.hpp @@ -54,14 +54,6 @@ namespace math { #include "scion/math/SeriesBase/src/ctor.hpp" - /** - * @brief Return the series coefficients - */ - std::vector< Y >& coefficients() noexcept { - - return this->coefficients_; - } - public: /* methods */