21 #include <ns3/spectrum-converter.h>
22 #include <ns3/assert.h>
42 for (Bands::const_iterator toit = toSpectrumModel->
Begin (); toit != toSpectrumModel->
End (); ++toit)
44 std::vector<double> coeffs;
46 for (Bands::const_iterator fromit = fromSpectrumModel->
Begin (); fromit != fromSpectrumModel->
End (); ++fromit)
49 NS_LOG_LOGIC (
"(" << fromit->fl <<
"," << fromit->fh <<
")"
51 "(" << toit->fl <<
"," << toit->fh <<
")"
83 for (std::vector<std::vector<double> >::const_iterator toit =
m_conversionMatrix.begin ();
88 Values::const_iterator fvit = fvvf->ConstValuesBegin ();
91 for (std::vector<double>::const_iterator fromit = toit->begin ();
92 fromit != toit->end ();
95 NS_ASSERT (fvit != fvvf->ConstValuesEnd ());
96 sum += (*fvit) * (*fromit);
Ptr< const SpectrumModel > m_toSpectrumModel
the SpectrumModel this SpectrumConverter instance can convert to
double GetCoefficient(const BandInfo &from, const BandInfo &to) const
Calculate the coefficient for value conversion between elements.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
#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.
Values::iterator ValuesEnd()
Bands::const_iterator End() const
Const Iterator to the model Bands container end.
std::vector< std::vector< double > > m_conversionMatrix
matrix of conversion coefficients
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
double fl
lower limit of subband
Ptr< SpectrumValue > Convert(Ptr< const SpectrumValue > vvf) const
Convert a particular ValueVsFreq instance to.
Values::iterator ValuesBegin()
Bands::const_iterator Begin() const
Const Iterator to the model Bands container start.
Ptr< const SpectrumModel > m_fromSpectrumModel
the SpectrumModel this SpectrumConverter instance can convert from
double fh
upper limit of subband
The building block of a SpectrumModel.