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 << 
")" 
   65   double coeff = std::min (from.
fh, to.
fh) - std::max (from.
fl, to.
fl);
 
   66   coeff = std::max (0.0, coeff);
 
   67   coeff = std::min (1.0, coeff / (to.
fh - to.
fl));
 
   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
 
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 
 
std::vector< std::vector< double > > m_conversionMatrix
 
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC. 
 
Every class exported by the ns3 library is enclosed in the ns3 namespace. 
 
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 
 
Ptr< const SpectrumModel > m_fromSpectrumModel
 
double fh
upper limit of subband 
 
The building block of a SpectrumModel.