Skip to content

Commit

Permalink
Merge pull request #76 from njoy/fix/pybinf11-default-ctors
Browse files Browse the repository at this point in the history
Fix/pybinf11 default ctors
  • Loading branch information
whaeck authored Sep 9, 2024
2 parents 020aa0d + 64c9eca commit 003ae3b
Show file tree
Hide file tree
Showing 13 changed files with 51 additions and 9 deletions.
5 changes: 5 additions & 0 deletions src/scion/math/ChebyshevApproximation/src/ctor.hpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* @brief Default constructor (for pybind11 purposes only)
*/
ChebyshevApproximation() = default;

/**
* @brief Constructor
*
Expand Down
5 changes: 5 additions & 0 deletions src/scion/math/ChebyshevSeries/src/ctor.hpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* @brief Default constructor (for pybind11 purposes only)
*/
ChebyshevSeries() = default;

/**
* @brief Constructor
*
Expand Down
3 changes: 2 additions & 1 deletion src/scion/math/ChebyshevSeries/test/ChebyshevSeries.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,8 @@ SCENARIO( "ChebyshevSeries" ) {

THEN( "an exception is thrown" ) {

CHECK_THROWS( ChebyshevSeries< double >( {} ) );
std::vector< double > empty = {};
CHECK_THROWS( ChebyshevSeries< double >( empty ) );
} // THEN
} // WHEN
} // GIVEN
Expand Down
5 changes: 5 additions & 0 deletions src/scion/math/InterpolationTable/src/ctor.hpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* @brief Default constructor (for pybind11 purposes only)
*/
InterpolationTable() = default;

/**
* @brief Copy constructor
*
Expand Down
1 change: 1 addition & 0 deletions src/scion/math/InterpolationTable/src/evaluateOnGrid.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ std::vector< Y > evaluateOnGrid( const std::vector< X >& x ) const {
auto xIter = std::lower_bound( x.begin(), x.end(), this->x().front() );
if ( *std::next( xIter ) == this->x().front() ) {

// move to the next x value in case of a jump
++xIter;
}
auto yIter = std::next( y.begin(), std::distance( x.begin(), xIter ) );
Expand Down
5 changes: 5 additions & 0 deletions src/scion/math/InterpolationTableFunction/src/ctor.hpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* @brief Default constructor (for pybind11 purposes only)
*/
InterpolationTableFunction() = default;

/**
* @brief Copy constructor
*
Expand Down
5 changes: 5 additions & 0 deletions src/scion/math/LegendreSeries/src/ctor.hpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* @brief Default constructor (for pybind11 purposes only)
*/
LegendreSeries() = default;

/**
* @brief Constructor
*
Expand Down
3 changes: 2 additions & 1 deletion src/scion/math/LegendreSeries/test/LegendreSeries.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,8 @@ SCENARIO( "LegendreSeries" ) {

THEN( "an exception is thrown" ) {

CHECK_THROWS( LegendreSeries< double >( {} ) );
std::vector< double > empty = {};
CHECK_THROWS( LegendreSeries< double >( empty ) );
} // THEN
} // WHEN
} // GIVEN
Expand Down
11 changes: 7 additions & 4 deletions src/scion/math/OneDimensionalFunctionBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ namespace math {

/* constructor */

/**
* @brief Default constructor (for pybind11 purposes only)
*/
OneDimensionalFunctionBase() = default;

/**
* @brief Constructor
*
Expand All @@ -54,10 +59,8 @@ namespace math {
/* methods */

/**
* @brief Check whether or not a value is inside the domain (including
* boundaries)
*
* @param x the value to be tested
* @brief Return the domain of the function (either an open or interval
* domain)
*/
const DomainVariant& domain() const noexcept {

Expand Down
5 changes: 5 additions & 0 deletions src/scion/math/PolynomialSeries/src/ctor.hpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* @brief Default constructor (for pybind11 purposes only)
*/
PolynomialSeries() = default;

/**
* @brief Constructor
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,8 @@ SCENARIO( "PolynomialSeries" ) {

THEN( "an exception is thrown" ) {

CHECK_THROWS( PolynomialSeries< double >( {} ) );
std::vector< double > empty = {};
CHECK_THROWS( PolynomialSeries< double >( empty ) );
} // THEN
} // WHEN
} // GIVEN
Expand Down
5 changes: 5 additions & 0 deletions src/scion/math/SeriesBase/src/ctor.hpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* @brief Default constructor (for pybind11 purposes only)
*/
SeriesBase() = default;

/**
* @brief Constructor
*
Expand Down
4 changes: 2 additions & 2 deletions src/scion/unionisation/unionise.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ namespace unionisation {
* @brief Unionise two grids and preserve duplicate points that appear in each
*
* If the grids do not have the same begin and/or end point, a duplicate point
* is inserted into the grid corresponding to the highest begining and/or
* lowest end point (unless those is already a duplicate point).
* is inserted into the grid corresponding to the highest beginning and/or
* lowest end point (unless those are already a duplicate point).
*
* @param first the first grid (assumed to be sorted)
* @param second the second grid (assumed to be sorted)
Expand Down

0 comments on commit 003ae3b

Please sign in to comment.