1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-25 09:18:54 -05:00

Fix for #1087. Support compilation with Boost >= 1.77

This commit is contained in:
Jon Beniston 2021-12-28 11:31:15 +00:00
parent 5c742a873b
commit cc3f4ab2f8
2 changed files with 18 additions and 2 deletions

View File

@ -16,6 +16,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>. // // along with this program. If not, see <http://www.gnu.org/licenses/>. //
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
#include <boost/version.hpp>
#include <boost/math/interpolators/barycentric_rational.hpp> #include <boost/math/interpolators/barycentric_rational.hpp>
#include "noisefigure.h" #include "noisefigure.h"
@ -41,6 +42,12 @@
#include "channel/channelwebapiutils.h" #include "channel/channelwebapiutils.h"
#include "maincore.h" #include "maincore.h"
#if BOOST_VERSION < 107700
using namespace boost::math;
#else
using namespace boost::math::interpolators;
#endif
MESSAGE_CLASS_DEFINITION(NoiseFigure::MsgConfigureNoiseFigure, Message) MESSAGE_CLASS_DEFINITION(NoiseFigure::MsgConfigureNoiseFigure, Message)
MESSAGE_CLASS_DEFINITION(NoiseFigure::MsgPowerMeasurement, Message) MESSAGE_CLASS_DEFINITION(NoiseFigure::MsgPowerMeasurement, Message)
MESSAGE_CLASS_DEFINITION(NoiseFigure::MsgNFMeasurement, Message) MESSAGE_CLASS_DEFINITION(NoiseFigure::MsgNFMeasurement, Message)
@ -180,7 +187,7 @@ double NoiseFigure::calcENR(double frequency)
else else
{ {
int order = size - 1; int order = size - 1;
boost::math::barycentric_rational<double> interpolant(std::move(x), std::move(y), order); barycentric_rational<double> interpolant(std::move(x), std::move(y), order);
enr = interpolant(frequency); enr = interpolant(frequency);
} }
} }

View File

@ -17,11 +17,20 @@
#include <QDebug> #include <QDebug>
#include <array>
#include <boost/version.hpp>
#include <boost/math/interpolators/barycentric_rational.hpp> #include <boost/math/interpolators/barycentric_rational.hpp>
#include "noisefigureenrdialog.h" #include "noisefigureenrdialog.h"
#include "util/interpolation.h" #include "util/interpolation.h"
#if BOOST_VERSION < 107700
using namespace boost::math;
#else
using namespace boost::math::interpolators;
#endif
NoiseFigureENRDialog::NoiseFigureENRDialog(NoiseFigureSettings *settings, QWidget* parent) : NoiseFigureENRDialog::NoiseFigureENRDialog(NoiseFigureSettings *settings, QWidget* parent) :
QDialog(parent), QDialog(parent),
m_settings(settings), m_settings(settings),
@ -153,7 +162,7 @@ void NoiseFigureENRDialog::plotChart()
y[i] = points[i][1]; y[i] = points[i][1];
} }
int order = size - 1; int order = size - 1;
boost::math::barycentric_rational<double> interpolant(std::move(x), std::move(y), order); barycentric_rational<double> interpolant(std::move(x), std::move(y), order);
x.resize(size); x.resize(size);
y.resize(size); y.resize(size);