Skip to content

Commit

Permalink
Ensuring that the coefficients of series are const on the public side
Browse files Browse the repository at this point in the history
  • Loading branch information
whaeck committed Aug 23, 2024
1 parent 6a25959 commit cdb9ee5
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 4 deletions.
9 changes: 8 additions & 1 deletion src/scion/math/ChebyshevSeries.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,14 @@ namespace math {

/* methods */

using Parent::coefficients;
/**
* @brief Return the series coefficients
*/
const std::vector< Y >& coefficients() const noexcept {

return Parent::coefficients();
}

using Parent::order;
using Parent::roots;
using Parent::derivative;
Expand Down
11 changes: 9 additions & 2 deletions src/scion/math/LegendreSeries.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,17 @@ namespace math {
*/
void normalise() noexcept {

this->coefficients()[0] = Y( 0.5 );
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
9 changes: 8 additions & 1 deletion src/scion/math/PolynomialSeries.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,14 @@ namespace math {

/* methods */

using Parent::coefficients;
/**
* @brief Return the series coefficients
*/
const std::vector< Y >& coefficients() const noexcept {

return Parent::coefficients();
}

using Parent::order;
using Parent::roots;
using Parent::derivative;
Expand Down

0 comments on commit cdb9ee5

Please sign in to comment.