INET Framework for OMNeT++/OMNEST
inet::math Namespace Reference

Support functions for mathematical operations. More...

Namespaces

 internal
 

Classes

class  AddedFunction
 
class  ApproximatedFunction
 Approximates the values and partitioning of a multidimensional function along one of the dimensions. More...
 
class  AverageInterpolator
 
class  BilinearFunction
 Linear in two dimensions and constant in the others. More...
 
class  Boxcar1DFunction
 Some constant value r between lower and upper and zero otherwise. More...
 
class  Boxcar2DFunction
 Some constant value r between (lowerX, lowerY) and (upperX, upperY) and zero otherwise. More...
 
class  CloserInterpolator
 
class  Combined2DFunction
 Combines 2 one-dimensional functions into a two-dimensional function. More...
 
class  ConstantFunction
 
class  ConstantInterpolatorBase
 
class  DividedFunction
 
class  Domain
 This class represents the domain of a mathematical function. More...
 
class  DomainLimitedFunction
 Limits the domain of a multidimensional function. More...
 
class  DomainModulated2DFunction
 Modulates the domain of a two-dimensional function with the values of a one-dimensional function. More...
 
class  DomainShiftedFunction
 Shifts the domain of a multidimensional function. More...
 
class  EitherInterpolator
 Interpolation that can only be used if y1 == y2. More...
 
class  Extruded2DFunction
 Extrudes a one-dimensional function into a two-dimensional function. More...
 
class  FunctionBase
 Useful base class for most IFunction implementations with some default behavior. More...
 
class  FunctionChecker
 Verifies that partitioning on a domain is correct in the sense that the original function and the function over the partition return the same values at the corners and center of the subdomain. More...
 
class  GaussFunction
 The one-dimensional Gauss function. More...
 
class  IFunction
 This interface represents a mathematical function from domain D to range R. More...
 
class  IInterpolator
 This interface represents interpolation of values (y) between two points x1 and x2. More...
 
class  IntegratedFunction
 
class  IntegratedFunction< R, Domain< X, Y >, DIMS, RI, Domain< X > >
 Integrates a multidimensional function in one of the dimensions producing a function with one less number of dimensions. More...
 
class  Interpolated1DFunction
 One-dimensional interpolated (e.g. More...
 
class  InterpolatorBase
 
class  Interval
 N-dimensional interval (cuboid), given by its two opposite corners. More...
 
class  LeftCurryingFunction
 Fixes the parameters of a function from the left. More...
 
class  LeftInterpolator
 
class  LineardbInterpolator
 
class  LinearInterpolator
 
class  MaximumInterpolator
 
class  MemoizedFunction
 Truncates the values of a multidimensional function outside the given domain to 0. More...
 
class  MinimumInterpolator
 
class  MultipliedFunction
 
class  PeriodicallyInterpolated1DFunction
 One-dimensional interpolated (e.g. More...
 
class  PeriodicallyInterpolated2DFunction
 
class  Point
 N-dimensional point. More...
 
class  Rasterized2DFunction
 Rasterizes a function into a grid where each cell is a constant value with the mean of the original function. More...
 
class  RightCurryingFunction
 Fixes the parameters of a function from the right. More...
 
class  RightInterpolator
 
class  SawtoothFunction
 One-dimensional periodic function with a sawtooth shape. More...
 
class  SubtractedFunction
 
class  SummedFunction
 
class  UnilinearFunction
 Linear in one dimension and constant in the others. More...
 
class  UnireciprocalFunction
 Reciprocal in a given dimension and constant in the others. More...
 

Functions

double mod (double dividend, double divisor)
 Returns the rest of a whole-numbered division. More...
 
double div (double dividend, double divisor)
 Returns the result of a whole-numbered division. More...
 
double modulo (double a, double n)
 Returns the remainder r on division of dividend a by divisor n, using floored division. More...
 
bool close (double one, double two)
 Tests whether two doubles are close enough to be declared equal. More...
 
int stepfunction (double i)
 Returns 0 if i is close to 0, 1 if i is positive and greater than epsilon, or -1 if it is negative and less than epsilon. More...
 
double step (double a, double b)
 
double clamp (double v, double l, double u)
 
int sign (double v)
 Returns 1 if the parameter is greater than zero, -1 if less than zero, 0 otherwise. More...
 
int round (double d)
 Returns an integer that corresponds to rounded double parameter. More...
 
double floorToZero (double d)
 Discards the fractional part of the parameter, e.g. More...
 
double dB2fraction (double dB)
 Converts a dB value to fraction. More...
 
double fraction2dB (double fraction)
 Convert a fraction value to dB. More...
 
double dBmW2mW (double dBm)
 Converts a dBmW value to mW. More...
 
double mW2dBmW (double mW)
 Convert a mW value to dBmW. More...
 
double dBmWpMHz2WpHz (double dBmWpMHz)
 Converts a dBmW/MHz value into W/Hz. More...
 
double wpHz2dBmWpMHz (double wpHz)
 Convert a W/Hz value to dBmW/MHz. More...
 
double deg2rad (double deg)
 Convert a degree value to radian. More...
 
double rad2deg (double rad)
 Convert a radian value to degree. More...
 
double n_choose_k (int n, int k)
 Implementation of the n choose k (binomial coefficient) function, from the MiXiM Framework Author Karl Wessel. More...
 
template<typename T >
const T minnan (const T &a, const T &b)
 This function properly and symmetrically handles NaNs in contrast with std::min and std::fmin. More...
 
template<typename T >
const T maxnan (const T &a, const T &b)
 This function properly and symmetrically handles NaNs in contrast with std::max and std::fmax. More...
 
template<typename R , typename D >
Ptr< const DomainLimitedFunction< R, D > > makeFirstQuadrantLimitedFunction (const Ptr< const IFunction< R, D >> &f)
 
template<typename R , typename D , int DIMS, typename RI , typename DI >
Ptr< const IFunction< RI, DI > > integrate (const Ptr< const IFunction< R, D >> &f)
 
template<typename... T>
std::ostream & operator<< (std::ostream &os, const Domain< T ... > &d)
 
template<typename R , typename... T>
std::ostream & operator<< (std::ostream &os, const IFunction< R, Domain< T ... >> &f)
 
template<typename X , typename Y >
const IInterpolator< X, Y > * createInterpolator (const char *text)
 
void iterateCorners (const Interval<> &i, const std::function< void(const Point<> &)> f)
 
template<typename T0 , typename... TS>
void iterateCorners (const Interval< T0, TS ... > &i, const std::function< void(const Point< T0, TS ... > &)> f)
 
template<typename... T>
std::ostream & operator<< (std::ostream &os, const Interval< T ... > &i)
 
template<typename T >
void printUnit (std::ostream &os, T v)
 
template<>
void printUnit (std::ostream &os, double v)
 
template<>
void printUnit (std::ostream &os, simtime_t v)
 
template<>
void printUnit (std::ostream &os, Quaternion v)
 
template<typename T >
double toDouble (const T v)
 
template<>
double toDouble (const simsec v)
 
template<>
double toDouble (const double v)
 
template<>
double toDouble (const simtime_t v)
 
template<typename T >
T getLowerBound ()
 
template<>
simsec getLowerBound ()
 
template<typename T >
T getUpperBound ()
 
template<>
simsec getUpperBound ()
 
template<typename T , typename... TS>
T head (const Point< T, TS ... > &p)
 Returns the first coordinate of p. More...
 
template<typename T , typename... TS>
Point< TS ... > tail (const Point< T, TS ... > &p)
 Returns all but the first coordinate of p. More...
 
template<typename... TS1, typename... TS2>
Point< TS1 ..., TS2 ... > concat (const Point< TS1 ... > &p1, const Point< TS2 ... > &p2)
 Returns a point by concatenating the coordinates of p1 and p2. More...
 
template<typename T0 >
std::ostream & operator<< (std::ostream &os, const Point< T0 > &p)
 
template<typename... T>
std::ostream & operator<< (std::ostream &os, const Point< T ... > &p)
 
template<typename R , typename D >
void simplifyAndCall (const typename D::I &i, const IFunction< R, D > *f, const std::function< void(const typename D::I &, const IFunction< R, D > *)> callback)
 
template<typename R , typename D >
void simplifyAndCall (const typename D::I &i, const UnilinearFunction< R, D > *f, const std::function< void(const typename D::I &, const IFunction< R, D > *)> callback)
 
template<typename R , typename D >
void simplifyAndCall (const typename D::I &i, const BilinearFunction< R, D > *f, const std::function< void(const typename D::I &, const IFunction< R, D > *)> callback)
 

Variables

template<typename R , typename D , int DIMS, typename RI , typename DI >
class INET_API IntegratedFunction
 
template<typename R , typename D >
class INET_API ConstantFunction
 
template<typename R , typename D >
class INET_API AddedFunction
 
template<typename R , typename D >
class INET_API SubtractedFunction
 
template<typename R , typename D >
class INET_API MultipliedFunction
 
template<typename R , typename D >
class INET_API DividedFunction
 

Detailed Description

Support functions for mathematical operations.

This namespace contains all kind of mathematical support functions

Function Documentation

◆ clamp()

double inet::math::clamp ( double  v,
double  l,
double  u 
)
inline
133 { return v < l ? l : v > u ? u : v; }

Referenced by inet::Coord::clamp().

◆ close()

bool inet::math::close ( double  one,
double  two 
)
inline

Tests whether two doubles are close enough to be declared equal.

Returns true if parameters are at most epsilon apart, false otherwise

123 { return fabs(one - two) < EPSILON; }

Referenced by inet::PostureTransition::isMarkovian(), inet::RotationMatrix::RotationMatrix(), stepfunction(), and inet::NetworkNamespaceContext::~NetworkNamespaceContext().

◆ concat()

template<typename... TS1, typename... TS2>
Point<TS1 ..., TS2 ...> inet::math::concat ( const Point< TS1 ... > &  p1,
const Point< TS2 ... > &  p2 
)

◆ createInterpolator()

template<typename X , typename Y >
const IInterpolator<X, Y>* inet::math::createInterpolator ( const char *  text)
226  {
227  if (!strcmp("either", text))
228  return &EitherInterpolator<X, Y>::singleton;
229  else if (!strcmp("left", text))
230  return &LeftInterpolator<X, Y>::singleton;
231  else if (!strcmp("right", text))
232  return &RightInterpolator<X, Y>::singleton;
233  else if (!strcmp("average", text))
234  return &AverageInterpolator<X, Y>::singleton;
235  else if (!strcmp("closer", text))
236  return &CloserInterpolator<X, Y>::singleton;
237  else if (!strcmp("minimum", text))
238  return &MinimumInterpolator<X, Y>::singleton;
239  else if (!strcmp("maximum", text))
240  return &MaximumInterpolator<X, Y>::singleton;
241  else if (!strcmp("linear", text))
242  return &LinearInterpolator<X, Y>::singleton;
243  else if (!strcmp("lineardb", text))
244  return &LineardbInterpolator<X, Y>::singleton;
245  else
246  throw cRuntimeError("Unknown interpolator: '%s'", text);
247 }

◆ dB2fraction()

◆ dBmW2mW()

◆ dBmWpMHz2WpHz()

double inet::math::dBmWpMHz2WpHz ( double  dBmWpMHz)
inline

Converts a dBmW/MHz value into W/Hz.

173 { return pow(10.0, dBmWpMHz / 10.0) / 1000000.0 / 1000.0; }

Referenced by inet::physicallayer::IsotropicDimensionalBackgroundNoise::initialize().

◆ deg2rad()

double inet::math::deg2rad ( double  deg)
inline

◆ div()

double inet::math::div ( double  dividend,
double  divisor 
)
inline

Returns the result of a whole-numbered division.

106 {
107  double i;
108  modf(dividend / divisor, &i);
109  return i;
110 }

Referenced by inet::Int128::operator%=(), and inet::Int128::operator/=().

◆ floorToZero()

double inet::math::floorToZero ( double  d)
inline

Discards the fractional part of the parameter, e.g.

-3.8 becomes -3

148 { return (d >= 0.0) ? floor(d) : ceil(d); }

◆ fraction2dB()

double inet::math::fraction2dB ( double  fraction)
inline

◆ getLowerBound() [1/2]

template<typename T >
T inet::math::getLowerBound ( )
inline
37 { return T(-INFINITY); }

◆ getLowerBound() [2/2]

template<>
simtime_t inet::math::getLowerBound ( )
inline
39 { return simsec(-SimTime::getMaxTime() / 2); }

◆ getUpperBound() [1/2]

template<typename T >
T inet::math::getUpperBound ( )
inline
46 { return T(INFINITY); }

◆ getUpperBound() [2/2]

template<>
simtime_t inet::math::getUpperBound ( )
inline
48 { return simsec(SimTime::getMaxTime() / 2); }

◆ head()

◆ integrate()

template<typename R , typename D , int DIMS, typename RI , typename DI >
Ptr<const IFunction<RI, DI> > inet::math::integrate ( const Ptr< const IFunction< R, D >> &  f)
850  {
851  return makeShared<IntegratedFunction<R, D, DIMS, RI, DI>>(f);
852 }

◆ iterateCorners() [1/2]

template<typename T0 , typename... TS>
void inet::math::iterateCorners ( const Interval< T0, TS ... > &  i,
const std::function< void(const Point< T0, TS ... > &)>  f 
)
inline
191  {
192  Interval<TS ...> i1(tail(i.getLower()), tail(i.getUpper()), i.getLowerClosed() >> 1, i.getUpperClosed() >> 1, i.getFixed() >> 1);
193  iterateCorners(i1, std::function<void(const Point<TS ...>&)>([&] (const Point<TS ...>& q) {
194  f(concat(Point<T0>(head(i.getLower())), q));
195  f(concat(Point<T0>(head(i.getUpper())), q));
196  }));
197 }

◆ iterateCorners() [2/2]

void inet::math::iterateCorners ( const Interval<> &  i,
const std::function< void(const Point<> &)>  f 
)
inline

◆ makeFirstQuadrantLimitedFunction()

template<typename R , typename D >
Ptr<const DomainLimitedFunction<R, D> > inet::math::makeFirstQuadrantLimitedFunction ( const Ptr< const IFunction< R, D >> &  f)
71  {
72  auto m = (1 << std::tuple_size<typename D::P::type>::value) - 1;
73  typename D::I i(D::P::getZero(), D::P::getUpperBounds(), m, 0, 0);
74  return makeShared<DomainLimitedFunction<R, D>>(f, i);
75 }

Referenced by inet::physicallayer::IsotropicDimensionalBackgroundNoise::computeNoise(), and inet::physicallayer::DimensionalTransmitterBase::createPowerFunction().

◆ maxnan()

template<typename T >
const T inet::math::maxnan ( const T a,
const T b 
)
inline

◆ minnan()

template<typename T >
const T inet::math::minnan ( const T a,
const T b 
)
inline

This function properly and symmetrically handles NaNs in contrast with std::min and std::fmin.

For example, the minimum of NaN and 1 must be NaN independently of the argument order. See 'Not a number' section at https://2pi.dk/2016/05/ieee-min-max

216  {
217 static_assert(!std::is_integral<T>::value, "minnan() is only meant for doubles and double based units, use std::min() for integers");
218  if (a < b)
219  return a;
220  else if (b < a)
221  return b;
222  else if (a == b)
223  return a;
224  else
225  return T(NaN);
226 }

Referenced by inet::physicallayer::ParabolicAntenna::AntennaGain::computeGain(), inet::physicallayer::CosineAntenna::AntennaGain::computeGain(), inet::physicallayer::AxiallySymmetricAntenna::AntennaGain::computeGain(), inet::physicallayer::DipoleAntenna::AntennaGain::computeGain(), inet::Cuboid::computeIntersection(), inet::physicallayer::ConvolutionalCode::computeNetBitErrorRate(), inet::physicallayer::Ieee80211NistErrorModel::getFec1024QamBer(), inet::physicallayer::Ieee80211NistErrorModel::getFec16QamBer(), inet::physicallayer::Ieee80211NistErrorModel::getFec256QamBer(), inet::physicallayer::Ieee80211NistErrorModel::getFec64QamBer(), inet::physicallayer::Ieee80211NistErrorModel::getFecBpskBer(), inet::physicallayer::Ieee80211YansErrorModel::getFecBpskBer(), inet::physicallayer::Ieee80211YansErrorModel::getFecQamBer(), inet::physicallayer::Ieee80211NistErrorModel::getFecQpskBer(), inet::math::InterpolatorBase< X, Y >::getMin(), inet::math::FunctionBase< R, Domain< X > >::getMin(), inet::math::UnilinearFunction< R, D >::getMin(), inet::math::BilinearFunction< R, D >::getMin(), inet::math::UnireciprocalFunction< R, D >::getMin(), inet::math::UnilinearFunction< R, D >::getRange(), inet::math::BilinearFunction< R, D >::getRange(), inet::math::MinimumInterpolator< X, Y >::getValue(), inet::math::ApproximatedFunction< R, D, DIMENSION, X >::getValue(), inet::math::Interval< R >::intersectImpl(), and inet::Quaternion::toEulerAngles().

◆ mod()

◆ modulo()

double inet::math::modulo ( double  a,
double  n 
)
inline

Returns the remainder r on division of dividend a by divisor n, using floored division.

The remainder r has the same sign as the divisor n.

116 { return a - n * floor(a / n); }

Referenced by inet::EulerAngles::normalize().

◆ mW2dBmW()

double inet::math::mW2dBmW ( double  mW)
inline

Convert a mW value to dBmW.

168 { return 10.0 * log10(mW); }

Referenced by inet::visualizer::Ieee80211VisualizerBase::getIcon().

◆ n_choose_k()

double inet::math::n_choose_k ( int  n,
int  k 
)
inline

Implementation of the n choose k (binomial coefficient) function, from the MiXiM Framework Author Karl Wessel.

194  {
195  if (n < k)
196  return 0.0;
197 
198  const int iK = (k << 1) > n ? n - k : k;
199  const double dNSubK = (n - iK);
200  int i = 1;
201  double dRes = i > iK ? 1.0 : (dNSubK + i);
202 
203  for (++i; i <= iK; ++i) {
204  dRes *= dNSubK + i;
205  dRes /= i;
206  }
207  return dRes;
208 }

Referenced by inet::physicallayer::DsssOqpsk16Modulation::calculateBER().

◆ operator<<() [1/5]

template<typename... T>
std::ostream& inet::math::operator<< ( std::ostream &  os,
const Domain< T ... > &  d 
)
inline
42  {
43  os << "(";
44  internal::print(os, d, std::index_sequence_for<T ...>{});
45  os << ")";
46  return os;
47 }

◆ operator<<() [2/5]

template<typename R , typename... T>
std::ostream& inet::math::operator<< ( std::ostream &  os,
const IFunction< R, Domain< T ... >> &  f 
)
inline
171  {
172  f.print(os);
173  return os;
174 }

◆ operator<<() [3/5]

template<typename... T>
std::ostream& inet::math::operator<< ( std::ostream &  os,
const Interval< T ... > &  i 
)
inline
221  {
222  internal::print(os, i, std::index_sequence_for<T ...>{});
223  return os;
224 }

◆ operator<<() [4/5]

template<typename... T>
std::ostream& inet::math::operator<< ( std::ostream &  os,
const Point< T ... > &  p 
)
inline
244  {
245  os << "(";
246  internal::print(os, p, std::index_sequence_for<T ...>{});
247  os << ")";
248  return os;
249 }

◆ operator<<() [5/5]

template<typename T0 >
std::ostream& inet::math::operator<< ( std::ostream &  os,
const Point< T0 > &  p 
)
inline
239  {
240  return os << std::get<0>(p);
241 }

◆ printUnit() [1/4]

template<>
void inet::math::printUnit ( std::ostream &  os,
double  v 
)
inline
21 { os << "unit"; }

◆ printUnit() [2/4]

template<>
void inet::math::printUnit ( std::ostream &  os,
Quaternion  v 
)
inline
25 { os << "quaternion"; }

◆ printUnit() [3/4]

template<>
void inet::math::printUnit ( std::ostream &  os,
simtime_t  v 
)
inline
23 { os << "s"; }

◆ printUnit() [4/4]

template<typename T >
void inet::math::printUnit ( std::ostream &  os,
T  v 
)
inline
19 { units::output_unit<typename T::unit>::fn(os); }

Referenced by inet::math::internal::print(), and inet::math::FunctionBase< R, Domain< X > >::print().

◆ rad2deg()

double inet::math::rad2deg ( double  rad)
inline

Convert a radian value to degree.

188 { return rad * 180 / M_PI; }

Referenced by inet::MobilityBase::updateDisplayStringFromMobilityState().

◆ round()

◆ sign()

int inet::math::sign ( double  v)
inline

Returns 1 if the parameter is greater than zero, -1 if less than zero, 0 otherwise.

138 { return (0 < v) - (v < 0); };

Referenced by inet::visualizer::LineManager::getLineShift(), inet::MobilityBase::reflectIfOutside(), inet::TractorMobility::setTargetPosition(), and inet::Coord::sign().

◆ simplifyAndCall() [1/3]

template<typename R , typename D >
void inet::math::simplifyAndCall ( const typename D::I &  i,
const BilinearFunction< R, D > *  f,
const std::function< void(const typename D::I &, const IFunction< R, D > *)>  callback 
)
791  {
792  if (f->getRLowerLower() == f->getRLowerUpper() && f->getRLowerLower() == f->getRUpperLower() && f->getRLowerLower() == f->getRUpperUpper()) {
793  ConstantFunction<R, D> g(f->getRLowerLower());
794  callback(i, &g);
795  }
796  // TODO simplify to one dimensional linear functions?
797  else
798  callback(i, f);
799 }

◆ simplifyAndCall() [2/3]

template<typename R , typename D >
void inet::math::simplifyAndCall ( const typename D::I &  i,
const IFunction< R, D > *  f,
const std::function< void(const typename D::I &, const IFunction< R, D > *)>  callback 
)

◆ simplifyAndCall() [3/3]

template<typename R , typename D >
void inet::math::simplifyAndCall ( const typename D::I &  i,
const UnilinearFunction< R, D > *  f,
const std::function< void(const typename D::I &, const IFunction< R, D > *)>  callback 
)
781  {
782  if (f->getRLower() == f->getRUpper()) {
783  ConstantFunction<R, D> g(f->getRLower());
784  callback(i, &g);
785  }
786  else
787  callback(i, f);
788 }

◆ step()

◆ stepfunction()

int inet::math::stepfunction ( double  i)
inline

Returns 0 if i is close to 0, 1 if i is positive and greater than epsilon, or -1 if it is negative and less than epsilon.

129 { return (i > EPSILON) ? 1 : close(i, 0) ? 0 : -1; };

◆ tail()

template<typename T , typename... TS>
Point<TS ...> inet::math::tail ( const Point< T, TS ... > &  p)

Returns all but the first coordinate of p.

228  {
229  return internal::tailImpl(std::make_index_sequence<sizeof...(TS)>(), p);
230 }

Referenced by iterateCorners(), and inet::eigrp::EigrpDeviceConfigurator::Str2Int().

◆ toDouble() [1/4]

template<>
double inet::math::toDouble ( const double  v)
inline
32 { return v; }

◆ toDouble() [2/4]

template<>
double inet::math::toDouble ( const simsec  v)
inline
30 { return v.get().dbl(); }

◆ toDouble() [3/4]

template<>
double inet::math::toDouble ( const simtime_t  v)
inline
34 { return v.dbl(); }

◆ toDouble() [4/4]

template<typename T >
double inet::math::toDouble ( const T  v)
inline
28 { return v.get(); }

Referenced by inet::math::internal::copyTupleElements(), inet::math::UnilinearFunction< R, D >::getA(), inet::math::UnilinearFunction< R, D >::getB(), inet::math::Point< T ... >::getImpl(), inet::math::LinearInterpolator< X, Y >::getValue(), inet::math::LineardbInterpolator< X, Y >::getValue(), inet::math::ApproximatedFunction< R, D, DIMENSION, X >::getValue(), inet::math::GaussFunction< R, X >::getValue(), inet::math::SawtoothFunction< R, X >::getValue(), inet::math::PeriodicallyInterpolated1DFunction< R, X >::getValue(), inet::math::Rasterized2DFunction< R, X, Y >::getValue(), inet::math::PeriodicallyInterpolated2DFunction< R, X, Y >::getValue(), inet::math::IntegratedFunction< R, Domain< X, Y >, DIMS, RI, Domain< X > >::getValue(), inet::math::IntegratedFunction< R, D, DIMS, RI, DI >::getValue(), inet::math::Interval< R >::getVolumeImpl(), inet::math::ConstantFunction< R, D >::isFinite(), inet::math::UnilinearFunction< R, D >::isFinite(), inet::math::BilinearFunction< R, D >::isFinite(), inet::math::Boxcar1DFunction< R, X >::isFinite(), inet::math::Boxcar2DFunction< R, X, Y >::isFinite(), inet::Int128::operator double(), inet::math::AddedFunction< R, D >::partition(), inet::math::MultipliedFunction< R, D >::partition(), inet::math::DividedFunction< R, D >::partition(), inet::math::PeriodicallyInterpolated1DFunction< R, X >::partition(), inet::math::Rasterized2DFunction< R, X, Y >::partition(), inet::math::PeriodicallyInterpolated2DFunction< R, X, Y >::partition(), inet::math::IntegratedFunction< R, Domain< X, Y >, DIMS, RI, Domain< X > >::partition(), and inet::math::Point< T ... >::setImpl().

◆ wpHz2dBmWpMHz()

double inet::math::wpHz2dBmWpMHz ( double  wpHz)
inline

Convert a W/Hz value to dBmW/MHz.

178 { return 10.0 * log10(wpHz * 1000000.0 * 1000.0); }

Variable Documentation

◆ AddedFunction

template<typename R , typename D >
class INET_API inet::math::AddedFunction

◆ ConstantFunction

template<typename R , typename D >
class INET_API inet::math::ConstantFunction

◆ DividedFunction

template<typename R , typename D >
class INET_API inet::math::DividedFunction

◆ IntegratedFunction

template<typename R , typename D , int DIMS, typename RI , typename DI >
class INET_API inet::math::IntegratedFunction

◆ MultipliedFunction

template<typename R , typename D >
class INET_API inet::math::MultipliedFunction

◆ SubtractedFunction

template<typename R , typename D >
class INET_API inet::math::SubtractedFunction
inet::units::units::T
compose< Wb, pow< m, -2 > > T
Definition: Units.h:951
inet::units::values::simsec
value< simtime_t, units::s > simsec
Definition: Units.h:1236
inet::math::concat
Point< TS1 ..., TS2 ... > concat(const Point< TS1 ... > &p1, const Point< TS2 ... > &p2)
Returns a point by concatenating the coordinates of p1 and p2.
Definition: Point.h:234
inet::units::units::deg
fscale< rad, rad2degScale > deg
Definition: Units.h:1158
inet::math::internal::print
std::ostream & print(std::ostream &os, const Interval< T ... > &i, std::integer_sequence< size_t, IS... >)
Definition: Interval.h:202
EPSILON
#define EPSILON
Definition: INETMath.h:86
inet::units::units::mW
milli< W >::type mW
Definition: Units.h:1080
inet::math::head
T head(const Point< T, TS ... > &p)
Returns the first coordinate of p.
Definition: Point.h:222
inet::math::internal::tailImpl
Point< TS ... > tailImpl(std::index_sequence< NS ... >, const Point< T, TS ... > &p)
Definition: Point.h:203
inet::units::units::g
milli< kg >::type g
Definition: Units.h:1071
inet::math::internal::print
std::ostream & print(std::ostream &os, const Domain< T ... > &d, std::integer_sequence< size_t, IS... >)
Definition: Domain.h:34
INFINITY
#define INFINITY
Definition: Topology.h:20
NaN
#define NaN
Definition: INETMath.h:91
inet::math::close
bool close(double one, double two)
Tests whether two doubles are close enough to be declared equal.
Definition: INETMath.h:123
inet::units::values::b
value< int64_t, units::b > b
Definition: Units.h:1241
inet::math::internal::concatImpl
Point< TS1 ..., TS2 ... > concatImpl(const Point< TS1 ... > &p1, std::integer_sequence< size_t, IS1 ... >, const Point< TS2 ... > &p2, std::integer_sequence< size_t, IS2 ... >)
Definition: Point.h:208
inet::physicallayer::k
const double k
Definition: Qam1024Modulation.cc:14
inet::math::iterateCorners
void iterateCorners(const Interval< T0, TS ... > &i, const std::function< void(const Point< T0, TS ... > &)> f)
Definition: Interval.h:191
inet::math::internal::print
std::ostream & print(std::ostream &os, const Point< T ... > &p, std::integer_sequence< size_t, IS... >)
Definition: Point.h:213
inet::math::tail
Point< TS ... > tail(const Point< T, TS ... > &p)
Returns all but the first coordinate of p.
Definition: Point.h:228
inet::units::values::m
value< double, units::m > m
Definition: Units.h:1233
inet::units::values::rad
value< double, units::rad > rad
Definition: Units.h:1245
M_PI
#define M_PI
Definition: INETMath.h:52