Set of values corresponding to a given SpectrumModel.
More...
#include <spectrum-value.h>
List of all members.
Public Member Functions |
| SpectrumValue (Ptr< const SpectrumModel > sm) |
| SpectrumValue constructor.
|
double & | operator[] (size_t index) |
SpectrumModelUid_t | GetSpectrumModelUid () const |
Ptr< const SpectrumModel > | GetSpectrumModel () const |
Bands::const_iterator | ConstBandsBegin () const |
Bands::const_iterator | ConstBandsEnd () const |
Values::const_iterator | ConstValuesBegin () const |
Values::const_iterator | ConstValuesEnd () const |
Values::iterator | ValuesBegin () |
Values::iterator | ValuesEnd () |
SpectrumValue | operator<< (int n) const |
SpectrumValue | operator>> (int n) const |
SpectrumValue & | operator+= (const SpectrumValue &rhs) |
SpectrumValue & | operator-= (const SpectrumValue &rhs) |
SpectrumValue & | operator*= (const SpectrumValue &rhs) |
SpectrumValue & | operator/= (const SpectrumValue &rhs) |
SpectrumValue & | operator+= (double rhs) |
SpectrumValue & | operator-= (double rhs) |
SpectrumValue & | operator*= (double rhs) |
SpectrumValue & | operator/= (double rhs) |
SpectrumValue & | operator= (double rhs) |
Ptr< SpectrumValue > | Copy () const |
Friends |
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 &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 &rhs) |
double | Norm (const SpectrumValue &x) |
double | Sum (const SpectrumValue &x) |
double | Prod (const SpectrumValue &x) |
SpectrumValue | Pow (const SpectrumValue &base, double exp) |
SpectrumValue | Pow (double base, const SpectrumValue &exp) |
SpectrumValue | Log10 (const SpectrumValue &arg) |
SpectrumValue | Log2 (const SpectrumValue &arg) |
SpectrumValue | Log (const SpectrumValue &arg) |
Detailed Description
Set of values corresponding to a given SpectrumModel.
This class implements a Function Space which can represent any function 
Every instance of this class represent a particular function
. The domain of the function space, i.e.,
, is implemented by SetOfFreq. The codomain of the function space is implemented by SetOfValues
To every possible value of
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.
Constructor & Destructor Documentation
SpectrumValue constructor.
- Parameters:
-
| sm | pointer 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.
Member Function Documentation
Bands::const_iterator ns3::SpectrumValue::ConstBandsBegin |
( |
|
) |
const |
- Returns:
- a const iterator pointing to the beginning of the embedded SpectrumModel
Bands::const_iterator ns3::SpectrumValue::ConstBandsEnd |
( |
|
) |
const |
- Returns:
- a const iterator pointing to the end of the embedded SpectrumModel
Values::const_iterator ns3::SpectrumValue::ConstValuesBegin |
( |
|
) |
const |
- Returns:
- a const iterator pointing to the beginning of the embedded SpectrumModel
Values::const_iterator ns3::SpectrumValue::ConstValuesEnd |
( |
|
) |
const |
- Returns:
- a const iterator pointing to the end of the embedded SpectrumModel
- Returns:
- a Ptr to a copy of this instance
SpectrumModelUid_t ns3::SpectrumValue::GetSpectrumModelUid |
( |
|
) |
const |
Multiply every component of *this by the value of the Right Hand Side of the operator
- Parameters:
-
- Returns:
- a reference to *this
Multiply *this by the Right Hand Side of the operator, component by component
- Parameters:
-
- Returns:
- a reference to *this
Add the value of the Right Hand Side of the operator to all components of *this
- Parameters:
-
- Returns:
- a reference to *this
Add the Right Hand Side of the operator to *this, component by component
- Parameters:
-
- Returns:
- a reference to *this
Subtract the value of the Right Hand Side of the operator from all components of *this
- Parameters:
-
- Returns:
- a reference to *this
Subtract the Right Hand Side of the operator from *this, component by component
- Parameters:
-
- Returns:
- a reference to *this
Divide every component of *this by the value of the Right Hand Side of the operator
- Parameters:
-
- Returns:
- a reference to *this
Divide *this by the Right Hand Side of the operator, component by component
- Parameters:
-
- Returns:
- a reference to *this
left shift operator
- Parameters:
-
- 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.
Assign each component of *this to the value of the Right Hand Side of the operator
- Parameters:
-
- Returns:
right shift operator
- Parameters:
-
- 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.
double& ns3::SpectrumValue::operator[] |
( |
size_t |
index |
) |
|
Access value at given frequency index
- Parameters:
-
| index | the given frequency index |
- Returns:
- reference to the value
Values::iterator ns3::SpectrumValue::ValuesBegin |
( |
|
) |
|
- Returns:
- an iterator pointing to the beginning of the embedded SpectrumModel
Values::iterator ns3::SpectrumValue::ValuesEnd |
( |
|
) |
|
- Returns:
- an iterator pointing to the end of the embedded SpectrumModel
Friends And Related Function Documentation
- Parameters:
-
- Returns:
- the logarithm in base e of all values in the argument
- Parameters:
-
- Returns:
- the logarithm in base 10 of all values in the argument
- Parameters:
-
- Returns:
- the logarithm in base 2 of all values in the argument
- Parameters:
-
- Returns:
- the euclidean norm, i.e., the sum of the squares of all the values in x
multiplication of a scalar
- Parameters:
-
| lhs | Left Hand Side of the operator |
| rhs | Right Hand Side of the operator |
- Returns:
- the value of lhs * rhs
multiplication by a scalar
- Parameters:
-
| lhs | Left Hand Side of the operator |
| rhs | Right Hand Side of the operator |
- Returns:
- the value of lhs * rhs
multiplication component-by-component (Schur product)
- Parameters:
-
| lhs | Left Hand Side of the operator |
| rhs | Right Hand Side of the operator |
- Returns:
- the value of lhs * rhs
addition operator
- Parameters:
-
| lhs | Left Hand Side of the operator |
| rhs | Right Hand Side of the operator |
- Returns:
- the value of lhs + rhs
addition operator
- Parameters:
-
| lhs | Left Hand Side of the operator |
| rhs | Right Hand Side of the operator |
- Returns:
- the value of lhs + rhs
unary plus operator
- Returns:
- the value of *this
addition operator
- Parameters:
-
| lhs | Left Hand Side of the operator |
| rhs | Right Hand Side of the operator |
- Returns:
- the value of lhs + rhs
subtraction operator
- Parameters:
-
| lhs | Left Hand Side of the operator |
| rhs | Right Hand Side of the operator |
- Returns:
- the value of lhs - rhs
subtraction operator
- Parameters:
-
| lhs | Left Hand Side of the operator |
| rhs | Right Hand Side of the operator |
- Returns:
- the value of lhs - rhs
subtraction operator
- Parameters:
-
| lhs | Left Hand Side of the operator |
| rhs | Right Hand Side of the operator |
- Returns:
- the value of lhs - rhs
unary minus operator
- Returns:
- the value of - *this
division component-by-component
- Parameters:
-
| lhs | Left Hand Side of the operator |
| rhs | Right Hand Side of the operator |
- Returns:
- the value of lhs / rhs
division by a scalar
- Parameters:
-
| lhs | Left Hand Side of the operator |
| rhs | Right Hand Side of the operator |
- Returns:
- the value of *this / rhs
division of a scalar
- Parameters:
-
| lhs | Left Hand Side of the operator |
| rhs | Right Hand Side of the operator |
- Returns:
- the value of *this / rhs
- Parameters:
-
| base | the base |
| exp | the exponent |
- Returns:
- the value in base raised to each value in the exponent
- Parameters:
-
| base | the base |
| exp | the exponent |
- Returns:
- each value in base raised to the exponent
- Parameters:
-
- Returns:
- the product of all the values in x
- Parameters:
-
- Returns:
- the sum of all the values in x
The documentation for this class was generated from the following file:
- src/common/spectrum-value.h