23#include <ns3/spectrum-value.h>
35 : m_spectrumModel(sof),
36 m_values(sof->GetNumBands())
103 Values::iterator it1 =
m_values.begin();
104 Values::const_iterator it2 = x.m_values.begin();
120 Values::iterator it1 =
m_values.begin();
132 Values::iterator it1 =
m_values.begin();
133 Values::const_iterator it2 = x.m_values.begin();
155 Values::iterator it1 =
m_values.begin();
156 Values::const_iterator it2 = x.m_values.begin();
172 Values::iterator it1 =
m_values.begin();
184 Values::iterator it1 =
m_values.begin();
185 Values::const_iterator it2 = x.m_values.begin();
202 Values::iterator it1 =
m_values.begin();
214 Values::iterator it1 =
m_values.begin();
227 while (i < (
int)
m_values.size() - n)
259 Values::iterator it1 =
m_values.begin();
263 *it1 = std::pow(*it1, exp);
272 Values::iterator it1 =
m_values.begin();
276 *it1 = std::pow(base, *it1);
285 Values::iterator it1 =
m_values.begin();
289 *it1 = std::log10(*it1);
298 Values::iterator it1 =
m_values.begin();
311 Values::iterator it1 =
m_values.begin();
315 *it1 = std::log(*it1);
324 Values::const_iterator it1 = x.ConstValuesBegin();
325 while (it1 != x.ConstValuesEnd())
327 s += (*it1) * (*it1);
337 Values::const_iterator it1 = x.ConstValuesBegin();
338 while (it1 != x.ConstValuesEnd())
350 Values::const_iterator it1 = x.ConstValuesBegin();
351 while (it1 != x.ConstValuesEnd())
368 i += (*vit) * (bit->fh - bit->fl);
615 Values::iterator it1 =
m_values.begin();
Smart pointer class similar to boost::intrusive_ptr.
Bands::const_iterator End() const
Const Iterator to the model Bands container end.
Bands::const_iterator Begin() const
Const Iterator to the model Bands container start.
SpectrumModelUid_t GetUid() const
Set of values corresponding to a given SpectrumModel.
double & operator[](size_t index)
Access value at given frequency index.
void Subtract(const SpectrumValue &x)
Subtracts a SpectrumValue (element by element subtraction)
Values::const_iterator ConstValuesBegin() const
Bands::const_iterator ConstBandsEnd() const
void Divide(const SpectrumValue &x)
Divides by a SpectrumValue (element to element division)
SpectrumValue & operator=(double rhs)
Assign each component of *this to the value of the Right Hand Side of the operator.
Values::iterator ValuesBegin()
void Exp(double base)
Modifies each element so that it is the base raised to each element value.
Bands::const_iterator ConstBandsBegin() const
void ChangeSign()
Change the values sign.
friend SpectrumValue Log2(const SpectrumValue &arg)
friend SpectrumValue Log10(const SpectrumValue &arg)
SpectrumValue operator<<(int n) const
left shift operator
void ShiftLeft(int n)
Shift the values to the left.
Ptr< SpectrumValue > Copy() const
friend SpectrumValue Log(const SpectrumValue &arg)
Values m_values
Set of values which implement the codomain of the functions in the Function Space defined by Spectrum...
uint32_t GetValuesN() const
Get the number of values stored in the array.
Values::iterator ValuesEnd()
Ptr< const SpectrumModel > GetSpectrumModel() const
SpectrumValue & operator*=(const SpectrumValue &rhs)
Multiply *this by the Right Hand Side of the operator, component by component.
Ptr< const SpectrumModel > m_spectrumModel
The spectrum model.
void ShiftRight(int n)
Shift the values to the right.
void Add(const SpectrumValue &x)
Add a SpectrumValue (element to element addition)
void Multiply(const SpectrumValue &x)
Multiplies for a SpectrumValue (element to element multiplication)
SpectrumModelUid_t GetSpectrumModelUid() const
SpectrumValue & operator/=(const SpectrumValue &rhs)
Divide *this by the Right Hand Side of the operator, component by component.
SpectrumValue & operator+=(const SpectrumValue &rhs)
Add the Right Hand Side of the operator to *this, component by component.
Values::const_iterator ConstValuesEnd() const
SpectrumValue & operator-=(const SpectrumValue &rhs)
Subtract the Right Hand Side of the operator from *this, component by component.
SpectrumValue operator>>(int n) const
right shift operator
friend SpectrumValue Pow(const SpectrumValue &lhs, double rhs)
const double & ValuesAt(uint32_t pos) const
Get the value element at the position.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
int64x64_t operator/(const int64x64_t &lhs, const int64x64_t &rhs)
Division operator.
int64x64_t operator-(const int64x64_t &lhs, const int64x64_t &rhs)
Subtraction operator.
int64x64_t operator+(const int64x64_t &lhs, const int64x64_t &rhs)
Addition operator.
int64x64_t operator*(const int64x64_t &lhs, const int64x64_t &rhs)
Multiplication operator.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#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.
SpectrumValue Pow(double lhs, const SpectrumValue &rhs)
std::ostream & operator<<(std::ostream &os, const Angles &a)
double Integral(const SpectrumValue &arg)
uint32_t SpectrumModelUid_t
Uid for SpectrumModels.
SpectrumValue Log2(const SpectrumValue &arg)
SpectrumValue Log10(const SpectrumValue &arg)
double Norm(const SpectrumValue &x)
SpectrumValue Log(const SpectrumValue &arg)
double Prod(const SpectrumValue &x)
double Sum(const SpectrumValue &x)