20#include <ns3/assert.h>
22#include <ns3/spectrum-converter.h>
43 for (Bands::const_iterator toit = toSpectrumModel->Begin(); toit != toSpectrumModel->End();
47 for (Bands::const_iterator fromit = fromSpectrumModel->Begin();
48 fromit != fromSpectrumModel->End();
52 NS_LOG_LOGIC(
"(" << fromit->fl <<
"," << fromit->fh <<
")"
54 <<
"(" << toit->fl <<
"," << toit->fh <<
")"
72 double coeff = std::min(from.
fh, to.
fh) - std::max(from.
fl, to.
fl);
73 coeff = std::max(0.0, coeff);
74 coeff = std::min(1.0, coeff / (to.
fh - to.
fl));
85 Values::iterator tvit = tvvf->ValuesBegin();
Smart pointer class similar to boost::intrusive_ptr.
std::vector< double > m_conversionMatrix
matrix of conversion coefficients stored in Compressed Row Storage format
Ptr< const SpectrumModel > m_fromSpectrumModel
the SpectrumModel this SpectrumConverter instance can convert from
double GetCoefficient(const BandInfo &from, const BandInfo &to) const
Calculate the coefficient for value conversion between elements.
Ptr< const SpectrumModel > m_toSpectrumModel
the SpectrumModel this SpectrumConverter instance can convert to
Ptr< SpectrumValue > Convert(Ptr< const SpectrumValue > vvf) const
Convert a particular ValueVsFreq instance to.
std::vector< size_t > m_conversionRowPtr
offset of rows in m_conversionMatrix
std::vector< size_t > m_conversionColInd
column of each non-zero element in m_conversionMatrix
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
Every class exported by the ns3 library is enclosed in the ns3 namespace.
The building block of a SpectrumModel.
double fl
lower limit of subband
double fh
upper limit of subband