IT++ Logo
Functions | Variables
Logarithmic and Exponential Functions

Functions

double itpp::logb (double b, double x)
 Base-b logarithm. More...
 
int itpp::pow2i (int x)
 Calculate two to the power of x (2^x); x is integer. More...
 
double itpp::pow2 (double x)
 Calculate two to the power of x (2^x) More...
 
double itpp::pow2 (int x)
 Calculate two to the power of x (2^x) for large integer x. More...
 
double itpp::pow10 (double x)
 Calculate ten to the power of x (10^x) More...
 
double itpp::dB (double x)
 Decibel of x (10*log10(x)) More...
 
double itpp::inv_dB (double x)
 Inverse of decibel of x. More...
 
int itpp::int2bits (int n)
 Calculate the number of bits needed to represent an integer n. More...
 
int itpp::levels2bits (int n)
 Calculate the number of bits needed to represent n different values (levels). More...
 
double itpp::trunc_log (double x)
 Truncated natural logarithm function. More...
 
double itpp::trunc_exp (double x)
 Truncated exponential function. More...
 
double itpp::log_add (double log_a, double log_b)
 Safe substitute for log(exp(log_a) + exp(log_b)) More...
 
vec itpp::exp (const vec &x)
 Exp of the elements of a vector x. More...
 
cvec itpp::exp (const cvec &x)
 Exp of the elements of a complex vector x. More...
 
mat itpp::exp (const mat &m)
 Exp of the elements of a matrix m. More...
 
cmat itpp::exp (const cmat &m)
 Exp of the elements of a complex matrix m. More...
 
vec itpp::pow (const double x, const vec &y)
 Calculates x to the power of y (x^y) More...
 
mat itpp::pow (const double x, const mat &y)
 Calculates x to the power of y (x^y) More...
 
vec itpp::pow (const vec &x, const double y)
 Calculates x to the power of y (x^y) More...
 
mat itpp::pow (const mat &x, const double y)
 Calculates x to the power of y (x^y) More...
 
vec itpp::pow2 (const vec &x)
 Calculates two to the power of x (2^x) More...
 
vec itpp::pow2 (const ivec &x)
 Calculates two to the power of x (2^x) for integer x. More...
 
mat itpp::pow2 (const mat &x)
 Calculates two to the power of x (2^x) More...
 
mat itpp::pow2 (const imat &x)
 Calculates two to the power of x (2^x) for integer x. More...
 
vec itpp::pow10 (const vec &x)
 Calculates ten to the power of x (10^x) More...
 
mat itpp::pow10 (const mat &x)
 Calculates ten to the power of x (10^x) More...
 
vec itpp::log (const vec &x)
 The natural logarithm of the elements. More...
 
mat itpp::log (const mat &x)
 The natural logarithm of the elements. More...
 
cvec itpp::log (const cvec &x)
 The natural logarithm of the elements. More...
 
cmat itpp::log (const cmat &x)
 The natural logarithm of the elements. More...
 
vec itpp::log2 (const vec &x)
 log-2 of the elements More...
 
mat itpp::log2 (const mat &x)
 log-2 of the elements More...
 
vec itpp::log10 (const vec &x)
 log-10 of the elements More...
 
mat itpp::log10 (const mat &x)
 log-10 of the elements More...
 
vec itpp::logb (double b, const vec &x)
 log-b of x More...
 
mat itpp::logb (double b, const mat &x)
 log-b of x More...
 
vec itpp::dB (const vec &x)
 Calculates 10*log10(x) More...
 
mat itpp::dB (const mat &x)
 Calculates 10*log10(x) More...
 
vec itpp::inv_dB (const vec &x)
 Calulates the inverse of dB, 10^(x/10) More...
 
mat itpp::inv_dB (const mat &x)
 Calculates the inverse of dB, 10^(x/10) More...
 
ivec itpp::int2bits (const ivec &v)
 Calculate the number of bits needed to represent each integer in a vector. More...
 
ivec itpp::levels2bits (const ivec &v)
 Calculate the number of bits needed to represent a numer of levels saved in a vector. More...
 

Variables

const double itpp::log_double_max = std::log(std::numeric_limits<double>::max())
 Constant definition to speed up trunc_log() and trunc_exp() More...
 
const double itpp::log_double_min = std::log(std::numeric_limits<double>::min())
 Constant definition to speed up trunc_log(), trunc_exp() and log_add() More...
 

Detailed Description

Function Documentation

◆ logb() [1/3]

double itpp::logb ( double  b,
double  x 
)
inline

Base-b logarithm.

Definition at line 47 of file log_exp.h.

References itpp::log().

Referenced by itpp::logb().

◆ pow2i()

int itpp::pow2i ( int  x)
inline

◆ pow2() [1/6]

double itpp::pow2 ( double  x)
inline

Calculate two to the power of x (2^x)

Definition at line 55 of file log_exp.h.

References itpp::pow().

Referenced by itpp::hadamard(), and itpp::pow2().

◆ pow2() [2/6]

double itpp::pow2 ( int  x)
inline

Calculate two to the power of x (2^x) for large integer x.

Definition at line 57 of file log_exp.h.

References itpp::pow().

◆ pow10() [1/3]

double itpp::pow10 ( double  x)
inline

Calculate ten to the power of x (10^x)

Definition at line 68 of file log_exp.h.

References itpp::pow().

Referenced by itpp::chebwin(), and itpp::pow10().

◆ dB() [1/3]

double itpp::dB ( double  x)
inline

Decibel of x (10*log10(x))

Definition at line 71 of file log_exp.h.

References itpp::log10().

Referenced by itpp::dB(), and itpp::TDL_Channel::set_channel_profile_exponential().

◆ inv_dB() [1/3]

double itpp::inv_dB ( double  x)
inline

◆ int2bits() [1/2]

int itpp::int2bits ( int  n)
inline

Calculate the number of bits needed to represent an integer n.

Definition at line 76 of file log_exp.h.

References it_assert.

Referenced by itpp::BCH::BCH(), itpp::int2bits(), and itpp::levels2bits().

◆ levels2bits() [1/2]

int itpp::levels2bits ( int  n)
inline

◆ trunc_log()

double itpp::trunc_log ( double  x)
inline

Truncated natural logarithm function.

This truncated function provides a solution in the cases when the logarithm argument is less or equal to zero or infinity. The function checks for such extreme values and use some kind of truncation (saturation) before calculating the logarithm.

The truncated logarithm function can be used for calculation of log-likelihood in soft demodulators, when numerical instability problem might occur.

Definition at line 115 of file log_exp.h.

References itpp::log(), itpp::log_double_max, and itpp::log_double_min.

Referenced by itpp::PAM_c::demodulate_soft_bits(), itpp::Modulator< T >::demodulate_soft_bits(), and itpp::Rec_Syst_Conv_Code::map_decode().

◆ trunc_exp()

double itpp::trunc_exp ( double  x)
inline

Truncated exponential function.

This truncated function provides a solution in the case when the exponent function results in infinity. The function checks for an extreme value and use truncation (saturation) before calculating the result.

The truncated exponential function can be used when numerical instability problem occurs for a standard exp function.

Definition at line 137 of file log_exp.h.

References itpp::exp(), itpp::log_double_max, and itpp::max().

Referenced by itpp::MOG_diag::lhood_internal(), itpp::MOG_generic::lhood_internal(), itpp::Rec_Syst_Conv_Code::map_decode(), and itpp::MOG_diag_EM_sup::ml_update_params().

◆ log_add()

ITPP_EXPORT double itpp::log_add ( double  log_a,
double  log_b 
)

◆ exp() [1/4]

vec itpp::exp ( const vec &  x)
inline

◆ exp() [2/4]

cvec itpp::exp ( const cvec &  x)
inline

Exp of the elements of a complex vector x.

Definition at line 160 of file log_exp.h.

References itpp::exp().

◆ exp() [3/4]

mat itpp::exp ( const mat &  m)
inline

Exp of the elements of a matrix m.

Definition at line 165 of file log_exp.h.

References itpp::exp().

◆ exp() [4/4]

cmat itpp::exp ( const cmat &  m)
inline

Exp of the elements of a complex matrix m.

Definition at line 170 of file log_exp.h.

References itpp::exp().

Referenced by itpp::exp(), and itpp::trunc_exp().

◆ pow() [1/4]

vec itpp::pow ( const double  x,
const vec &  y 
)
inline

◆ pow() [2/4]

mat itpp::pow ( const double  x,
const mat &  y 
)
inline

Calculates x to the power of y (x^y)

Definition at line 181 of file log_exp.h.

References itpp::pow().

◆ pow() [3/4]

vec itpp::pow ( const vec &  x,
const double  y 
)
inline

Calculates x to the power of y (x^y)

Definition at line 186 of file log_exp.h.

References itpp::pow().

◆ pow() [4/4]

mat itpp::pow ( const mat &  x,
const double  y 
)
inline

Calculates x to the power of y (x^y)

Definition at line 191 of file log_exp.h.

References itpp::pow().

Referenced by itpp::inv_dB(), itpp::pow(), itpp::pow10(), and itpp::pow2().

◆ pow2() [3/6]

vec itpp::pow2 ( const vec &  x)
inline

Calculates two to the power of x (2^x)

Definition at line 197 of file log_exp.h.

References itpp::pow2().

◆ pow2() [4/6]

vec itpp::pow2 ( const ivec &  x)
inline

Calculates two to the power of x (2^x) for integer x.

Definition at line 203 of file log_exp.h.

References itpp::pow2().

◆ pow2() [5/6]

mat itpp::pow2 ( const mat &  x)
inline

Calculates two to the power of x (2^x)

Definition at line 212 of file log_exp.h.

References itpp::pow2().

◆ pow2() [6/6]

mat itpp::pow2 ( const imat &  x)
inline

Calculates two to the power of x (2^x) for integer x.

Definition at line 218 of file log_exp.h.

References itpp::pow2().

◆ pow10() [2/3]

vec itpp::pow10 ( const vec &  x)
inline

Calculates ten to the power of x (10^x)

Definition at line 230 of file log_exp.h.

References itpp::pow10().

◆ pow10() [3/3]

mat itpp::pow10 ( const mat &  x)
inline

Calculates ten to the power of x (10^x)

Definition at line 235 of file log_exp.h.

References itpp::pow10().

◆ log() [1/4]

vec itpp::log ( const vec &  x)
inline

◆ log() [2/4]

mat itpp::log ( const mat &  x)
inline

The natural logarithm of the elements.

Definition at line 246 of file log_exp.h.

References itpp::log().

◆ log() [3/4]

cvec itpp::log ( const cvec &  x)
inline

The natural logarithm of the elements.

Definition at line 251 of file log_exp.h.

References itpp::log().

◆ log() [4/4]

cmat itpp::log ( const cmat &  x)
inline

The natural logarithm of the elements.

Definition at line 256 of file log_exp.h.

References itpp::log().

Referenced by itpp::log(), itpp::logb(), and itpp::trunc_log().

◆ log2() [1/2]

ITPP_EXPORT vec itpp::log2 ( const vec &  x)

◆ log2() [2/2]

ITPP_EXPORT mat itpp::log2 ( const mat &  x)

log-2 of the elements

Definition at line 37 of file log_exp.cpp.

References itpp::log2().

◆ log10() [1/2]

vec itpp::log10 ( const vec &  x)
inline

log-10 of the elements

Definition at line 271 of file log_exp.h.

References itpp::log10().

Referenced by itpp::TDL_Channel::get_avg_power_dB(), itpp::TDL_Channel::get_channel_profile(), and itpp::log_binom().

◆ log10() [2/2]

mat itpp::log10 ( const mat &  x)
inline

log-10 of the elements

Definition at line 276 of file log_exp.h.

References itpp::log10().

Referenced by itpp::dB(), and itpp::log10().

◆ logb() [2/3]

vec itpp::logb ( double  b,
const vec &  x 
)
inline

log-b of x

Definition at line 282 of file log_exp.h.

References itpp::logb().

◆ logb() [3/3]

mat itpp::logb ( double  b,
const mat &  x 
)
inline

log-b of x

Definition at line 287 of file log_exp.h.

References itpp::logb().

◆ dB() [2/3]

vec itpp::dB ( const vec &  x)
inline

Calculates 10*log10(x)

Definition at line 293 of file log_exp.h.

References itpp::dB().

◆ dB() [3/3]

mat itpp::dB ( const mat &  x)
inline

Calculates 10*log10(x)

Definition at line 298 of file log_exp.h.

References itpp::dB().

◆ inv_dB() [2/3]

vec itpp::inv_dB ( const vec &  x)
inline

Calulates the inverse of dB, 10^(x/10)

Definition at line 304 of file log_exp.h.

References itpp::inv_dB().

◆ inv_dB() [3/3]

mat itpp::inv_dB ( const mat &  x)
inline

Calculates the inverse of dB, 10^(x/10)

Definition at line 309 of file log_exp.h.

References itpp::inv_dB().

◆ int2bits() [2/2]

ivec itpp::int2bits ( const ivec &  v)
inline

Calculate the number of bits needed to represent each integer in a vector.

Definition at line 315 of file log_exp.h.

References itpp::int2bits().

◆ levels2bits() [2/2]

ivec itpp::levels2bits ( const ivec &  v)
inline

Calculate the number of bits needed to represent a numer of levels saved in a vector.

Definition at line 321 of file log_exp.h.

References itpp::levels2bits().

Variable Documentation

◆ log_double_max

const double itpp::log_double_max = std::log(std::numeric_limits<double>::max())

Constant definition to speed up trunc_log() and trunc_exp()

Definition at line 99 of file log_exp.h.

Referenced by itpp::trunc_exp(), and itpp::trunc_log().

◆ log_double_min

const double itpp::log_double_min = std::log(std::numeric_limits<double>::min())

Constant definition to speed up trunc_log(), trunc_exp() and log_add()

Definition at line 101 of file log_exp.h.

Referenced by itpp::log_add(), and itpp::trunc_log().

Generated on Tue Aug 17 2021 10:59:15 for IT++ by Doxygen 1.9.4