Skip to content

Commit

Permalink
Removing normalisation
Browse files Browse the repository at this point in the history
  • Loading branch information
whaeck committed Aug 23, 2024
1 parent cdb9ee5 commit c52a805
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 59 deletions.
9 changes: 1 addition & 8 deletions src/scion/math/ChebyshevSeries.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
20 changes: 1 addition & 19 deletions src/scion/math/LegendreSeries.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
16 changes: 0 additions & 16 deletions src/scion/math/LegendreSeries/test/LegendreSeries.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
9 changes: 1 addition & 8 deletions src/scion/math/PolynomialSeries.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 0 additions & 8 deletions src/scion/math/SeriesBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit c52a805

Please sign in to comment.