A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ns3::SpectrumValue Class Reference

Set of values corresponding to a given SpectrumModel. More...

#include <spectrum-value.h>

+ Inheritance diagram for ns3::SpectrumValue:
+ Collaboration diagram for ns3::SpectrumValue:

Public Member Functions

 SpectrumValue (Ptr< const SpectrumModel > sm)
 SpectrumValue constructor.
 SpectrumValue ()
Bands::const_iterator ConstBandsBegin () const
Bands::const_iterator ConstBandsEnd () const
Values::const_iterator ConstValuesBegin () const
Values::const_iterator ConstValuesEnd () const
Ptr< SpectrumValueCopy () const
Ptr< const SpectrumModelGetSpectrumModel () const
SpectrumModelUid_t GetSpectrumModelUid () const
SpectrumValueoperator*= (const SpectrumValue &rhs)
SpectrumValueoperator*= (double rhs)
SpectrumValueoperator+= (const SpectrumValue &rhs)
SpectrumValueoperator+= (double rhs)
SpectrumValueoperator-= (const SpectrumValue &rhs)
SpectrumValueoperator-= (double rhs)
SpectrumValueoperator/= (const SpectrumValue &rhs)
SpectrumValueoperator/= (double rhs)
SpectrumValue operator<< (int n) const
SpectrumValueoperator= (double rhs)
SpectrumValue operator>> (int n) const
double & operator[] (size_t index)
Values::iterator ValuesBegin ()
Values::iterator ValuesEnd ()
- Public Member Functions inherited from ns3::SimpleRefCount< SpectrumValue >
 SimpleRefCount ()
 SimpleRefCount (const SimpleRefCount &o)
uint32_t GetReferenceCount (void) const
SimpleRefCountoperator= (const SimpleRefCount &o)
void Ref (void) const
void Unref (void) const

Private Member Functions

void Add (const SpectrumValue &x)
void Add (double s)
void ChangeSign ()
void Divide (const SpectrumValue &x)
void Divide (double s)
void Exp (double base)
void Log ()
void Log10 ()
void Log2 ()
void Multiply (const SpectrumValue &x)
void Multiply (double s)
void Pow (double exp)
void ShiftLeft (int n)
void ShiftRight (int n)
void Subtract (const SpectrumValue &x)
void Subtract (double s)

Private Attributes

Ptr< const SpectrumModelm_spectrumModel
Values m_values

Friends

double Integral (const SpectrumValue &arg)
SpectrumValue Log (const SpectrumValue &arg)
SpectrumValue Log10 (const SpectrumValue &arg)
SpectrumValue Log2 (const SpectrumValue &arg)
double Norm (const SpectrumValue &x)
SpectrumValue operator* (const SpectrumValue &lhs, const SpectrumValue &rhs)
SpectrumValue operator* (const SpectrumValue &lhs, double rhs)
SpectrumValue operator* (double lhs, const SpectrumValue &rhs)
SpectrumValue operator+ (const SpectrumValue &lhs, const SpectrumValue &rhs)
SpectrumValue operator+ (const SpectrumValue &lhs, double rhs)
SpectrumValue operator+ (double lhs, const SpectrumValue &rhs)
SpectrumValue operator+ (const SpectrumValue &rhs)
SpectrumValue operator- (const SpectrumValue &lhs, const SpectrumValue &rhs)
SpectrumValue operator- (const SpectrumValue &lhs, double rhs)
SpectrumValue operator- (double lhs, const SpectrumValue &rhs)
SpectrumValue operator- (const SpectrumValue &rhs)
SpectrumValue operator/ (const SpectrumValue &lhs, const SpectrumValue &rhs)
SpectrumValue operator/ (const SpectrumValue &lhs, double rhs)
SpectrumValue operator/ (double lhs, const SpectrumValue &rhs)
SpectrumValue Pow (const SpectrumValue &lhs, double rhs)
SpectrumValue Pow (double lhs, const SpectrumValue &rhs)
double Prod (const SpectrumValue &x)
double Sum (const SpectrumValue &x)

Additional Inherited Members

- Static Public Member Functions inherited from ns3::SimpleRefCount< SpectrumValue >
static void Cleanup (void)

Detailed Description

Set of values corresponding to a given SpectrumModel.

This class implements a Function Space which can represent any function $ g: F \in {\sf R\hspace*{-0.9ex}\rule{0.15ex}{1.5ex}\hspace*{0.9ex}}^N \rightarrow {\sf R\hspace*{-0.9ex}\rule{0.15ex}{1.5ex}\hspace*{0.9ex}} $

Every instance of this class represent a particular function $ g(F) $. The domain of the function space, i.e., $ F $, is implemented by SetOfFreq. The codomain of the function space is implemented by SetOfValues

To every possible value of $ F$ corresponds a different Function Space. Mathematical operations are defined in this Function Space; these operations are implemented by means of operator overloading.

The intended use of this class is to represent frequency-dependent things, such as power spectral densities, frequency-dependent propagation losses, spectral masks, etc.

Definition at line 57 of file spectrum-value.h.

Constructor & Destructor Documentation

ns3::SpectrumValue::SpectrumValue ( Ptr< const SpectrumModel sm)

SpectrumValue constructor.

Parameters
smpointer to the SpectrumModel which implements the set of frequencies to which the values will be referring.
Warning
the intended use if that sm points to a static object which will be there for the whole simulation. This is reasonable since the set of frequencies which are to be used in the simulation is normally known before the simulation starts. Make sure that the SpectrumModel instance which sm points to has already been initialized by the time this method is invoked. The main reason is that if you initialize the SpectrumModel instance afterwards, and the memory for the underlying std::vector gets reallocated, then sm will not be a valid reference anymore. Another reason is that m_values could end up having the wrong size.

Definition at line 41 of file spectrum-value.cc.

ns3::SpectrumValue::SpectrumValue ( )

Definition at line 37 of file spectrum-value.cc.

Member Function Documentation

void ns3::SpectrumValue::Add ( const SpectrumValue x)
private

Definition at line 108 of file spectrum-value.cc.

References m_spectrumModel, m_values, and NS_ASSERT.

Referenced by ns3::operator+(), operator+=(), ns3::operator-(), and Subtract().

+ Here is the caller graph for this function:

void ns3::SpectrumValue::Add ( double  s)
private

Definition at line 126 of file spectrum-value.cc.

References m_values.

void ns3::SpectrumValue::ChangeSign ( )
private

Definition at line 233 of file spectrum-value.cc.

References m_values.

Referenced by ns3::operator-().

+ Here is the caller graph for this function:

Bands::const_iterator ns3::SpectrumValue::ConstBandsBegin ( ) const
Returns
a const iterator pointing to the beginning of the embedded SpectrumModel

Definition at line 95 of file spectrum-value.cc.

References ns3::SpectrumModel::Begin(), and m_spectrumModel.

Referenced by ns3::ConstantSpectrumPropagationLossModel::DoCalcRxPowerSpectralDensity(), ns3::FriisSpectrumPropagationLossModel::DoCalcRxPowerSpectralDensity(), ns3::ShannonSpectrumErrorModel::EvaluateChunk(), ns3::Integral(), and ns3::WriteAveragePowerSpectralDensityReport().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Bands::const_iterator ns3::SpectrumValue::ConstBandsEnd ( ) const
Returns
a const iterator pointing to the end of the embedded SpectrumModel

Definition at line 101 of file spectrum-value.cc.

References ns3::SpectrumModel::End(), and m_spectrumModel.

Referenced by ns3::ConstantSpectrumPropagationLossModel::DoCalcRxPowerSpectralDensity(), ns3::FriisSpectrumPropagationLossModel::DoCalcRxPowerSpectralDensity(), ns3::ShannonSpectrumErrorModel::EvaluateChunk(), ns3::Integral(), and ns3::WriteAveragePowerSpectralDensityReport().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Values::const_iterator ns3::SpectrumValue::ConstValuesBegin ( ) const
Values::const_iterator ns3::SpectrumValue::ConstValuesEnd ( ) const
Ptr< SpectrumValue > ns3::SpectrumValue::Copy ( void  ) const
Returns
a Ptr to a copy of this instance

Definition at line 410 of file spectrum-value.cc.

References m_spectrumModel.

Referenced by ns3::SpectrumSignalParameters::SpectrumSignalParameters(), and ns3::LteInterference::StartRx().

+ Here is the caller graph for this function:

void ns3::SpectrumValue::Divide ( const SpectrumValue x)
private

Definition at line 199 of file spectrum-value.cc.

References m_spectrumModel, m_values, and NS_ASSERT.

Referenced by ns3::operator/(), and operator/=().

+ Here is the caller graph for this function:

void ns3::SpectrumValue::Divide ( double  s)
private

Definition at line 217 of file spectrum-value.cc.

References m_values, and NS_LOG_FUNCTION.

void ns3::SpectrumValue::Exp ( double  base)
private

Definition at line 295 of file spectrum-value.cc.

References m_values, and NS_LOG_FUNCTION.

Referenced by ns3::Pow().

+ Here is the caller graph for this function:

SpectrumModelUid_t ns3::SpectrumValue::GetSpectrumModelUid ( ) const
Returns
the uid of the embedded SpectrumModel

Definition at line 56 of file spectrum-value.cc.

References ns3::SpectrumModel::GetUid(), and m_spectrumModel.

Referenced by ns3::LteNoisePsdTestCase::DoRun(), and ns3::LteTxPsdTestCase::DoRun().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::SpectrumValue::Log ( )
private

Definition at line 336 of file spectrum-value.cc.

References m_values, and NS_LOG_FUNCTION.

void ns3::SpectrumValue::Log10 ( )
private

Definition at line 309 of file spectrum-value.cc.

References m_values, and NS_LOG_FUNCTION.

void ns3::SpectrumValue::Log2 ( )
private

Definition at line 322 of file spectrum-value.cc.

References m_values, and NS_LOG_FUNCTION.

void ns3::SpectrumValue::Multiply ( const SpectrumValue x)
private

Definition at line 166 of file spectrum-value.cc.

References m_spectrumModel, m_values, and NS_ASSERT.

Referenced by ns3::operator*(), and operator*=().

+ Here is the caller graph for this function:

void ns3::SpectrumValue::Multiply ( double  s)
private

Definition at line 184 of file spectrum-value.cc.

References m_values.

SpectrumValue & ns3::SpectrumValue::operator*= ( const SpectrumValue rhs)

Multiply *this by the Right Hand Side of the operator, component by component

Parameters
rhsthe Right Hand Side
Returns
a reference to *this

Definition at line 616 of file spectrum-value.cc.

References Multiply().

+ Here is the call graph for this function:

SpectrumValue & ns3::SpectrumValue::operator*= ( double  rhs)

Multiply every component of *this by the value of the Right Hand Side of the operator

Parameters
rhsthe Right Hand Side
Returns
a reference to *this

Definition at line 645 of file spectrum-value.cc.

References Multiply().

+ Here is the call graph for this function:

SpectrumValue & ns3::SpectrumValue::operator+= ( const SpectrumValue rhs)

Add the Right Hand Side of the operator to *this, component by component

Parameters
rhsthe Right Hand Side
Returns
a reference to *this

Definition at line 602 of file spectrum-value.cc.

References Add().

+ Here is the call graph for this function:

SpectrumValue & ns3::SpectrumValue::operator+= ( double  rhs)

Add the value of the Right Hand Side of the operator to all components of *this

Parameters
rhsthe Right Hand Side
Returns
a reference to *this

Definition at line 631 of file spectrum-value.cc.

References Add().

+ Here is the call graph for this function:

SpectrumValue & ns3::SpectrumValue::operator-= ( const SpectrumValue rhs)

Subtract the Right Hand Side of the operator from *this, component by component

Parameters
rhsthe Right Hand Side
Returns
a reference to *this

Definition at line 609 of file spectrum-value.cc.

References Subtract().

+ Here is the call graph for this function:

SpectrumValue & ns3::SpectrumValue::operator-= ( double  rhs)

Subtract the value of the Right Hand Side of the operator from all components of *this

Parameters
rhsthe Right Hand Side
Returns
a reference to *this

Definition at line 638 of file spectrum-value.cc.

References Subtract().

+ Here is the call graph for this function:

SpectrumValue & ns3::SpectrumValue::operator/= ( const SpectrumValue rhs)

Divide *this by the Right Hand Side of the operator, component by component

Parameters
rhsthe Right Hand Side
Returns
a reference to *this

Definition at line 623 of file spectrum-value.cc.

References Divide().

+ Here is the call graph for this function:

SpectrumValue & ns3::SpectrumValue::operator/= ( double  rhs)

Divide every component of *this by the value of the Right Hand Side of the operator

Parameters
rhsthe Right Hand Side
Returns
a reference to *this

Definition at line 652 of file spectrum-value.cc.

References Divide().

+ Here is the call graph for this function:

SpectrumValue ns3::SpectrumValue::operator<< ( int  n) const

left shift operator

Parameters
nposition to shift
Returns
the value of *this left shifted by n positions. In other words, the function of the set of frequencies represented by *this is left-shifted in frequency by n positions.

Definition at line 675 of file spectrum-value.cc.

References ShiftLeft().

+ Here is the call graph for this function:

SpectrumValue & ns3::SpectrumValue::operator= ( double  rhs)

Assign each component of *this to the value of the Right Hand Side of the operator

Parameters
rhs
Returns

Definition at line 660 of file spectrum-value.cc.

References m_values.

SpectrumValue ns3::SpectrumValue::operator>> ( int  n) const

right shift operator

Parameters
nposition to shift
Returns
the value of *this right shifted by n positions. In other words, the function of the set of frequencies represented by *this is left-shifted in frequency by n positions.

Definition at line 683 of file spectrum-value.cc.

References ShiftRight().

+ Here is the call graph for this function:

double & ns3::SpectrumValue::operator[] ( size_t  index)

Access value at given frequency index

Parameters
indexthe given frequency index
Returns
reference to the value

Definition at line 49 of file spectrum-value.cc.

References m_values.

void ns3::SpectrumValue::Pow ( double  exp)
private

Definition at line 281 of file spectrum-value.cc.

References m_values, and NS_LOG_FUNCTION.

void ns3::SpectrumValue::ShiftLeft ( int  n)
private

Definition at line 246 of file spectrum-value.cc.

References m_values.

Referenced by operator<<().

+ Here is the caller graph for this function:

void ns3::SpectrumValue::ShiftRight ( int  n)
private

Definition at line 263 of file spectrum-value.cc.

References m_values.

Referenced by operator>>().

+ Here is the caller graph for this function:

void ns3::SpectrumValue::Subtract ( const SpectrumValue x)
private

Definition at line 140 of file spectrum-value.cc.

References m_spectrumModel, m_values, and NS_ASSERT.

Referenced by ns3::operator-(), and operator-=().

+ Here is the caller graph for this function:

void ns3::SpectrumValue::Subtract ( double  s)
private

Definition at line 158 of file spectrum-value.cc.

References Add().

+ Here is the call graph for this function:

Values::iterator ns3::SpectrumValue::ValuesBegin ( )
Values::iterator ns3::SpectrumValue::ValuesEnd ( )

Friends And Related Function Documentation

double Integral ( const SpectrumValue arg)
friend
Parameters
argthe argument
Returns
the value of the integral $\int_F g(f) df $

Definition at line 391 of file spectrum-value.cc.

SpectrumValue Log ( const SpectrumValue arg)
friend
Parameters
argthe argument
Returns
the logarithm in base e of all values in the argument

Definition at line 594 of file spectrum-value.cc.

Referenced by ns3::Log().

SpectrumValue Log10 ( const SpectrumValue arg)
friend
Parameters
argthe argument
Returns
the logarithm in base 10 of all values in the argument

Definition at line 578 of file spectrum-value.cc.

Referenced by ns3::Log10().

SpectrumValue Log2 ( const SpectrumValue arg)
friend
Parameters
argthe argument
Returns
the logarithm in base 2 of all values in the argument

Definition at line 586 of file spectrum-value.cc.

Referenced by ns3::Log2().

double Norm ( const SpectrumValue x)
friend
Parameters
xthe operand
Returns
the euclidean norm, i.e., the sum of the squares of all the values in x

Definition at line 349 of file spectrum-value.cc.

SpectrumValue operator* ( const SpectrumValue lhs,
const SpectrumValue rhs 
)
friend

multiplication component-by-component (Schur product)

Parameters
lhsLeft Hand Side of the operator
rhsRight Hand Side of the operator
Returns
the value of lhs * rhs

Definition at line 491 of file spectrum-value.cc.

SpectrumValue operator* ( const SpectrumValue lhs,
double  rhs 
)
friend

multiplication by a scalar

Parameters
lhsLeft Hand Side of the operator
rhsRight Hand Side of the operator
Returns
the value of lhs * rhs

Definition at line 500 of file spectrum-value.cc.

SpectrumValue operator* ( double  lhs,
const SpectrumValue rhs 
)
friend

multiplication of a scalar

Parameters
lhsLeft Hand Side of the operator
rhsRight Hand Side of the operator
Returns
the value of lhs * rhs

Definition at line 509 of file spectrum-value.cc.

SpectrumValue operator+ ( const SpectrumValue lhs,
const SpectrumValue rhs 
)
friend

addition operator

Parameters
lhsLeft Hand Side of the operator
rhsRight Hand Side of the operator
Returns
the value of lhs + rhs

Definition at line 436 of file spectrum-value.cc.

SpectrumValue operator+ ( const SpectrumValue lhs,
double  rhs 
)
friend

addition operator

Parameters
lhsLeft Hand Side of the operator
rhsRight Hand Side of the operator
Returns
the value of lhs + rhs

Definition at line 445 of file spectrum-value.cc.

SpectrumValue operator+ ( double  lhs,
const SpectrumValue rhs 
)
friend

addition operator

Parameters
lhsLeft Hand Side of the operator
rhsRight Hand Side of the operator
Returns
the value of lhs + rhs

Definition at line 454 of file spectrum-value.cc.

SpectrumValue operator+ ( const SpectrumValue rhs)
friend

unary plus operator

Returns
the value of *this

Definition at line 545 of file spectrum-value.cc.

SpectrumValue operator- ( const SpectrumValue lhs,
const SpectrumValue rhs 
)
friend

subtraction operator

Parameters
lhsLeft Hand Side of the operator
rhsRight Hand Side of the operator
Returns
the value of lhs - rhs

Definition at line 463 of file spectrum-value.cc.

SpectrumValue operator- ( const SpectrumValue lhs,
double  rhs 
)
friend

subtraction operator

Parameters
lhsLeft Hand Side of the operator
rhsRight Hand Side of the operator
Returns
the value of lhs - rhs

Definition at line 474 of file spectrum-value.cc.

SpectrumValue operator- ( double  lhs,
const SpectrumValue rhs 
)
friend

subtraction operator

Parameters
lhsLeft Hand Side of the operator
rhsRight Hand Side of the operator
Returns
the value of lhs - rhs

Definition at line 483 of file spectrum-value.cc.

SpectrumValue operator- ( const SpectrumValue rhs)
friend

unary minus operator

Returns
the value of - *this

Definition at line 551 of file spectrum-value.cc.

SpectrumValue operator/ ( const SpectrumValue lhs,
const SpectrumValue rhs 
)
friend

division component-by-component

Parameters
lhsLeft Hand Side of the operator
rhsRight Hand Side of the operator
Returns
the value of lhs / rhs

Definition at line 518 of file spectrum-value.cc.

SpectrumValue operator/ ( const SpectrumValue lhs,
double  rhs 
)
friend

division by a scalar

Parameters
lhsLeft Hand Side of the operator
rhsRight Hand Side of the operator
Returns
the value of *this / rhs

Definition at line 527 of file spectrum-value.cc.

SpectrumValue operator/ ( double  lhs,
const SpectrumValue rhs 
)
friend

division of a scalar

Parameters
lhsLeft Hand Side of the operator
rhsRight Hand Side of the operator
Returns
the value of *this / rhs

Definition at line 536 of file spectrum-value.cc.

SpectrumValue Pow ( const SpectrumValue lhs,
double  rhs 
)
friend
Parameters
lhsthe base
rhsthe exponent
Returns
each value in base raised to the exponent

Definition at line 569 of file spectrum-value.cc.

Referenced by ns3::Pow().

SpectrumValue Pow ( double  lhs,
const SpectrumValue rhs 
)
friend
Parameters
lhsthe base
rhsthe exponent
Returns
the value in base raised to each value in the exponent

Definition at line 560 of file spectrum-value.cc.

double Prod ( const SpectrumValue x)
friend
Parameters
xthe operand
Returns
the product of all the values in x

Definition at line 378 of file spectrum-value.cc.

double Sum ( const SpectrumValue x)
friend
Parameters
xthe operand
Returns
the sum of all the values in x

Definition at line 363 of file spectrum-value.cc.

Member Data Documentation

Ptr<const SpectrumModel> ns3::SpectrumValue::m_spectrumModel
private
Values ns3::SpectrumValue::m_values
private

Set of values which implement the codomain of the functions in the Function Space defined by SpectrumValue. There is no restriction on what these values represent (a transmission power density, a propagation loss, etc.).

Definition at line 528 of file spectrum-value.h.

Referenced by Add(), ChangeSign(), ConstValuesBegin(), ConstValuesEnd(), Divide(), Exp(), Log(), Log10(), Log2(), Multiply(), operator=(), operator[](), Pow(), ShiftLeft(), ShiftRight(), Subtract(), ValuesBegin(), and ValuesEnd().


The documentation for this class was generated from the following files: