Miscellaneous Functions
Base Module » Basic and Miscellaneous Math Functions

## Functions

template<typename T, typename Ftn>
Vec< T > | itpp::apply_functor (Ftn f, const Vec< T > &v)
| Help function to apply function object to Vec<T>.
template<typename T>
Vec< T > | itpp::apply_function (T(*f)(T), const Vec< T > &v)
| Help function to call for a function: Vec<T> function(Vec<T>).
template<typename T>
Vec< T > | itpp::apply_function (T(*f)(const T &), const Vec< T > &v)
| Help function to call for a function: Vec<T> function(const Vec<T>&).
template<typename T, typename Ftn>
Mat< T > | itpp::apply_functor (Ftn f, const Mat< T > &m)
| Help function to apply function object to Mat<T>.
template<typename T>
Mat< T > | itpp::apply_function (T(*f)(T), const Mat< T > &m)
| Help function to call for a function: Mat<T> function(Mat<T>&).
template<typename T>
Mat< T > | itpp::apply_function (T(*f)(const T &), const Mat< T > &m)
| Help function to call for a function: Mat<T> function(const Mat<T>&).
template<typename T>
Vec< T > | itpp::apply_function (T(*f)(T, T), const T &x, const Vec< T > &v)
| Help function to call for a function: Vec<T> function(T, Vec<T>).
template<typename T>
Vec< T > | itpp::apply_function (T(*f)(const T &, const T &), const T &x, const Vec< T > &v)
| Help function to call for a function: Vec<T> function(const T&, const Vec<T>&).
template<typename T>
Mat< T > | itpp::apply_function (T(*f)(T, T), const T &x, const Mat< T > &m)
| Help function to call for a function: Mat<T> function(T, Mat<T>).
template<typename T>
Mat< T > | itpp::apply_function (T(*f)(const T &, const T &), const T &x, const Mat< T > &m)
| Help function to call for a function: Mat<T> function(const T&, const Mat<T>&).
template<typename T>
Vec< T > | itpp::apply_function (T(*f)(T, T), const Vec< T > &v, const T &x)
| Help function to call for a function: Vec<T> function(Vec<T>, T).
template<typename T>
Vec< T > | itpp::apply_function (T(*f)(const T &, const T &), const Vec< T > &v, const T &x)
| Help function to call for a function: Vec<T> function(const Vec<T>&, const T&).
template<typename T>
Mat< T > | itpp::apply_function (T(*f)(T, T), const Mat< T > &m, const T &x)
| Help function to call for a function: Mat<T> function(Mat<T>, T).
template<typename T>
Mat< T > | itpp::apply_function (T(*f)(const T &, const T &), const Mat< T > &m, const T &x)
| Help function to call for a function: Mat<T> function(const Mat<T>&, const T&).
ivec | itpp::find (const bvec &invector)
| Return a integer vector with indicies where bvec == 1.
mat | itpp::rotation_matrix (int dim, int plane1, int plane2, double angle)
| Create a rotation matrix that rotates the given plane `angle` radians. Note that the order of the planes are important!
void | itpp::house (const vec &x, vec &v, double &beta)
| Calcualte the Householder vector.
void | itpp::givens (double a, double b, double &c, double &s)
| Calculate the Givens rotation values.
void | itpp::givens (double a, double b, mat &m)
| Calculate the Givens rotation matrix.
mat | itpp::givens (double a, double b)
| Calculate the Givens rotation matrix.
void | itpp::givens_t (double a, double b, mat &m)
| Calculate the transposed Givens rotation matrix.
mat | itpp::givens_t (double a, double b)
| Calculate the transposed Givens rotation matrix.
double | itpp::sqr (double x)
| Square of x.
double | itpp::sqr (const std::complex< double > &x)
| Absolute square of complex-valued x, ||x||^2.
vec | itpp::sqr (const vec &x)
| Square of elements.
mat | itpp::sqr (const mat &x)
| Square of elements.
vec | itpp::sqr (const cvec &x)
| Absolute square of elements.
mat | itpp::sqr (const cmat &x)
| Absolute square of elements.
vec | itpp::abs (const vec &x)
| Absolute value.
mat | itpp::abs (const mat &x)
| Absolute value.
ivec | itpp::abs (const ivec &x)
| Absolute value.
imat | itpp::abs (const imat &x)
| Absolute value.
vec | itpp::abs (const cvec &x)
| Absolute value.
mat | itpp::abs (const cmat &x)
| Absolute value.
double | itpp::sign (double x)
| Signum function.
vec | itpp::sign (const vec &x)
| Signum function.
mat | itpp::sign (const mat &x)
| Signum function.
double | itpp::sgn (double x)
| Signum function.
vec | itpp::sgn (const vec &x)
| Signum function.
mat | itpp::sgn (const mat &x)
| Signum function.
int | itpp::sign_i (int x)
| Signum function.
ivec | itpp::sign_i (const ivec &x)
| Signum function.
imat | itpp::sign_i (const imat &x)
| Signum function.
int | itpp::sgn_i (int x)
| Signum function.
ivec | itpp::sgn_i (const ivec &x)
| Signum function.
imat | itpp::sgn_i (const imat &x)
| Signum function.
int | itpp::sign_i (double x)
| Signum function.
vec | itpp::sqrt (const vec &x)
| Square root of the elements.
mat | itpp::sqrt (const mat &x)
| Square root of the elements.
double | itpp::gamma (double x)
| Deprecated gamma function - please use tgamma() instead.
vec | itpp::gamma (const vec &x)
| Deprecated gamma function for vectors. Will be changed to tgamma().
mat | itpp::gamma (const mat &x)
| Deprecated gamma function for matrices. Will be changed to tgamma().
double | itpp::rem (double x, double y)
| The reminder of the division x/y.
vec | itpp::rem (const vec &x, double y)
| Elementwise reminder of the division x/y for vec and double.
vec | itpp::rem (double x, const vec &y)
| Elementwise reminder of the division x/y for double and vec.
mat | itpp::rem (const mat &x, double y)
| Elementwise reminder of the division x/y for mat and double.
mat | itpp::rem (double x, const mat &y)
| Elementwise reminder of the division x/y for double and mat.
int | itpp::mod (int k, int n)
| Calculates the modulus, i.e. the signed reminder after division.
double | itpp::fact (int index)
| Calculates factorial coefficient for index <= 170.
double | itpp::binom (int n, int k)
| Compute the binomial coefficient "n over k".
int | itpp::binom_i (int n, int k)
| Compute the binomial coefficient "n over k".
double | itpp::log_binom (int n, int k)
| Compute the base 10 logarithm of the binomial coefficient "n over k".
int | itpp::gcd (int a, int b)
| Compute the greatest common divisor (GCD) g of the elements a and b.
vec | itpp::real (const cvec &x)
| Real part of complex values.
mat | itpp::real (const cmat &x)
| Real part of complex values.
vec | itpp::imag (const cvec &x)
| Imaginary part of complex values.
mat | itpp::imag (const cmat &x)
| Imaginary part of complex values.
vec | itpp::arg (const cvec &x)
| Argument (angle).
mat | itpp::arg (const cmat &x)
| Argument (angle).
vec | itpp::angle (const cvec &x)
| Angle.
mat | itpp::angle (const cmat &x)
| Angle.
cvec | itpp::conj (const cvec &x)
| Conjugate of complex value.
cmat | itpp::conj (const cmat &x)
| Conjugate of complex value.
template<class T>
T | itpp::max (const Vec< T > &v)
| Maximum value of vector.
template<class T>
T | itpp::max (const Vec< T > &v, int &index)
| Maximum value of vector, also returns the index position of max value.
template<class T>
Vec< T > | itpp::max (const Mat< T > &m, int dim=1)
template<class T>
Vec< T > | itpp::max (const Mat< T > &m, ivec &index, int dim=1)
template<class T>
T | itpp::min (const Vec< T > &in)
| Minimum value of vector.
template<class T>
T | itpp::min (const Vec< T > &in, int &index)
| Minimum value of vector, also returns the index position of min value.
template<class T>
Vec< T > | itpp::min (const Mat< T > &m, int dim=1)
template<class T>
Vec< T > | itpp::min (const Mat< T > &m, ivec &index, int dim=1)
template<class T>
int | itpp::max_index (const Vec< T > &in)
| Return the postion of the maximum element in the vector.
template<class T>
void | itpp::max_index (const Mat< T > &m, int &row, int &col)
| Return the postion of the maximum element in the matrix.
template<class T>
int | itpp::min_index (const Vec< T > &in)
| Return the postion of the minimum element in the vector.
template<class T>
void | itpp::min_index (const Mat< T > &m, int &row, int &col)
| Return the postion of the minimum element in the matrix.
bool | itpp::is_int (double x)
| Return true if x is an integer.
bool | itpp::is_even (int x)
| Return true if x is an even integer.
std::string | itpp::itpp_version ()
| Returns IT++ library version number, e.g. "3.7.1".
bool | itpp::is_bigendian ()
| Returns true if machine endianness is BIG_ENDIAN.
bool | itpp::check_big_endianness ()
| This function is deprecated. Please use is_bigendian() instead.

## Detailed Description

## Function Documentation

## apply_functor() [1/2]

template<typename T, typename Ftn>

Vec< T > itpp::apply_functor | ( | Ftn | f,
|  | const Vec< T > & | v )

inline

Help function to apply function object to Vec<T>.

Definition at line 113 of file help_functions.h.

References itpp::Vec< Num_T >::length().

Referenced by apply_function(), apply_function(), apply_function(), apply_function(), apply_function(), apply_function(), apply_function(), apply_function(), apply_function(), apply_function(), apply_function(), apply_function(), quad(), and quadl().

## apply_function() [1/12]

template<typename T>

Vec< T > itpp::apply_function | ( | T(* | f )(T),
|  | const Vec< T > & | v )

inline

Help function to call for a function: Vec<T> function(Vec<T>).

Definition at line 124 of file help_functions.h.

References apply_functor().

Referenced by abs(), abs(), abs(), abs(), acos(), acos(), acosh(), acosh(), asin(), asin(), asinh(), asinh(), atan(), atan(), atanh(), atanh(), ceil(), ceil(), conj(), conj(), cos(), cos(), cosh(), cosh(), dB(), dB(), erf(), erf(), erf(), erf(), erfc(), erfc(), erfinv(), erfinv(), exp(), exp(), exp(), exp(), floor(), floor(), gamma(), gamma(), int2bits(), inv_dB(), inv_dB(), levels2bits(), log(), log(), log(), log(), log10(), log10(), log2(), log2(), logb(), logb(), pow(), pow(), pow(), pow(), pow10(), pow10(), pow2(), pow2(), Qfunc(), Qfunc(), rem(), rem(), rem(), rem(), round_to_infty(), round_to_infty(), round_to_zero(), round_to_zero(), sgn(), sgn(), sgn_i(), sgn_i(), sign(), sign(), sign_i(), sign_i(), sin(), sin(), sinc(), sinc(), sinh(), sinh(), sqr(), sqr(), sqrt(), sqrt(), tan(), tan(), tanh(), and tanh().

## apply_function() [2/12]

template<typename T>

Vec< T > itpp::apply_function | ( | T(* | f )(const T &),
|  | const Vec< T > & | v )

inline

Help function to call for a function: Vec<T> function(const Vec<T>&).

Definition at line 131 of file help_functions.h.

References apply_functor().

## apply_functor() [2/2]

template<typename T, typename Ftn>

Mat< T > itpp::apply_functor | ( | Ftn | f,
|  | const Mat< T > & | m )

inline

Help function to apply function object to Mat<T>.

Definition at line 138 of file help_functions.h.

References itpp::Mat< Num_T >::cols(), and itpp::Mat< Num_T >::rows().

## apply_function() [3/12]

template<typename T>

Mat< T > itpp::apply_function | ( | T(* | f )(T),
|  | const Mat< T > & | m )

inline

Help function to call for a function: Mat<T> function(Mat<T>&).

Definition at line 150 of file help_functions.h.

References apply_functor().

## apply_function() [4/12]

template<typename T>

Mat< T > itpp::apply_function | ( | T(* | f )(const T &),
|  | const Mat< T > & | m )

inline

Help function to call for a function: Mat<T> function(const Mat<T>&).

Definition at line 157 of file help_functions.h.

References apply_functor().

## apply_function() [5/12]

template<typename T>

Vec< T > itpp::apply_function | ( | T(* | f )(T, T),
|  | const T & | x,
|  | const Vec< T > & | v )

inline

Help function to call for a function: Vec<T> function(T, Vec<T>).

Definition at line 164 of file help_functions.h.

References apply_functor().

## apply_function() [6/12]

template<typename T>

Vec< T > itpp::apply_function | ( | T(* | f )(const T &, const T &),
|  | const T & | x,
|  | const Vec< T > & | v )

inline

Help function to call for a function: Vec<T> function(const T&, const Vec<T>&).

Definition at line 172 of file help_functions.h.

References apply_functor().

## apply_function() [7/12]

template<typename T>

Mat< T > itpp::apply_function | ( | T(* | f )(T, T),
|  | const T & | x,
|  | const Mat< T > & | m )

inline

Help function to call for a function: Mat<T> function(T, Mat<T>).

Definition at line 180 of file help_functions.h.

References apply_functor().

## apply_function() [8/12]

template<typename T>

Mat< T > itpp::apply_function | ( | T(* | f )(const T &, const T &),
|  | const T & | x,
|  | const Mat< T > & | m )

inline

Help function to call for a function: Mat<T> function(const T&, const Mat<T>&).

Definition at line 188 of file help_functions.h.

References apply_functor().

## apply_function() [9/12]

template<typename T>

Vec< T > itpp::apply_function | ( | T(* | f )(T, T),
|  | const Vec< T > & | v,
|  | const T & | x )

inline

Help function to call for a function: Vec<T> function(Vec<T>, T).

Definition at line 196 of file help_functions.h.

References apply_functor().

## apply_function() [10/12]

template<typename T>

Vec< T > itpp::apply_function | ( | T(* | f )(const T &, const T &),
|  | const Vec< T > & | v,
|  | const T & | x )

inline

Help function to call for a function: Vec<T> function(const Vec<T>&, const T&).

Definition at line 204 of file help_functions.h.

References apply_functor().

## apply_function() [11/12]

template<typename T>

Mat< T > itpp::apply_function | ( | T(* | f )(T, T),
|  | const Mat< T > & | m,
|  | const T & | x )

inline

Help function to call for a function: Mat<T> function(Mat<T>, T).

Definition at line 212 of file help_functions.h.

References apply_functor().

## apply_function() [12/12]

template<typename T>

Mat< T > itpp::apply_function | ( | T(* | f )(const T &, const T &),
|  | const Mat< T > & | m,
|  | const T & | x )

inline

Help function to call for a function: Mat<T> function(const Mat<T>&, const T&).

Definition at line 220 of file help_functions.h.

References apply_functor().

## find()

ITPP_EXPORT ivec itpp::find | ( | const bvec & | invector | ) |

Return a integer vector with indicies where bvec == 1.

Definition at line 40 of file specmat.cpp.

References it_assert.

Referenced by itpp::LDPC_Parity_Unstructured::compute_CR(), extrinsic_mutual_info(), and roots().

## rotation_matrix()

ITPP_EXPORT mat itpp::rotation_matrix | ( | int | dim,
|  | int | plane1,
|  | int | plane2,
|  | double | angle )

Create a rotation matrix that rotates the given plane `angle` radians. Note that the order of the planes are important!

Definition at line 229 of file specmat.cpp.

References angle(), and it_assert.

## house()

ITPP_EXPORT void itpp::house | ( | const vec & | x,
|  | vec & | v,
|  | double & | beta )

Calcualte the Householder vector.

Definition at line 251 of file specmat.cpp.

References sqr(), and sum().

## givens() [1/3]

ITPP_EXPORT void itpp::givens | ( | double | a,
|  | double | b,
|  | double & | c,
|  | double & | s )

Calculate the Givens rotation values.

Definition at line 277 of file specmat.cpp.

Referenced by givens().

## givens() [2/3]

ITPP_EXPORT void itpp::givens | ( | double | a,
|  | double | b,
|  | mat & | m )

Calculate the Givens rotation matrix.

Definition at line 299 of file specmat.cpp.

## givens() [3/3]

ITPP_EXPORT mat itpp::givens | ( | double | a,
|  | double | b )

Calculate the Givens rotation matrix.

Definition at line 329 of file specmat.cpp.

References givens().

## givens_t() [1/2]

ITPP_EXPORT void itpp::givens_t | ( | double | a,
|  | double | b,
|  | mat & | m )

Calculate the transposed Givens rotation matrix.

Definition at line 336 of file specmat.cpp.

Referenced by givens_t().

## givens_t() [2/2]

ITPP_EXPORT mat itpp::givens_t | ( | double | a,
|  | double | b )

Calculate the transposed Givens rotation matrix.

Definition at line 366 of file specmat.cpp.

References givens_t().

## sqr() [1/6]

double itpp::sqr | ( | double | x | ) |

inline

Square of x.

Definition at line 46 of file elem_math.h.

## sqr() [2/6]

double itpp::sqr | ( | const std::complex< double > & | x | ) |

inline

Absolute square of complex-valued x, ||x||^2.

Definition at line 48 of file elem_math.h.

## sqr() [3/6]

vec itpp::sqr | ( | const vec & | x | ) |

inline

Square of elements.

Definition at line 53 of file elem_math.h.

References apply_function(), and sqr().

## sqr() [4/6]

mat itpp::sqr | ( | const mat & | x | ) |

inline

Square of elements.

Definition at line 55 of file elem_math.h.

References apply_function(), and sqr().

## sqr() [5/6]

ITPP_EXPORT vec itpp::sqr | ( | const cvec & | data | ) |

Absolute square of elements.

Definition at line 36 of file elem_math.cpp.

References sqr().

Referenced by itpp::TDL_Channel::calc_mean_excess_delay(), itpp::Channel_Specification::calc_rms_delay_spread(), itpp::TDL_Channel::calc_rms_delay_spread(), itpp::Modulator< T >::demodulate_soft_bits(), itpp::Modulator< T >::demodulate_soft_bits(), itpp::Modulator_NCD::demodulate_soft_bits(), itpp::Modulator_NRD::demodulate_soft_bits(), itpp::PAM_c::demodulate_soft_bits(), itpp::PAM_c::demodulate_soft_bits(), itpp::TDL_Channel::discretize(), energy(), filter_design_autocorrelation(), filter_spectrum(), filter_spectrum(), itpp::AWGN_Channel::get_noise(), house(), norm(), norm(), itpp::Line_Search::search(), itpp::Channel_Specification::set_channel_profile(), itpp::PAM::set_M(), itpp::PAM_c::set_M(), itpp::Raised_Cosine< T1 >::set_pulse_shape(), itpp::Root_Raised_Cosine< T1 >::set_pulse_shape(), spectrum(), spectrum(), sqr(), sqr(), sqr(), and sqr().

## sqr() [6/6]

ITPP_EXPORT mat itpp::sqr | ( | const cmat & | data | ) |

Absolute square of elements.

Definition at line 44 of file elem_math.cpp.

References sqr().

## abs() [1/6]

vec itpp::abs | ( | const vec & | x | ) |

inline

Absolute value.

Definition at line 65 of file elem_math.h.

References apply_function().

## abs() [2/6]

mat itpp::abs | ( | const mat & | x | ) |

inline

Absolute value.

Definition at line 67 of file elem_math.h.

References apply_function().

## abs() [3/6]

ivec itpp::abs | ( | const ivec & | x | ) |

inline

Absolute value.

Definition at line 69 of file elem_math.h.

References std::abs(), and apply_function().

## abs() [4/6]

imat itpp::abs | ( | const imat & | x | ) |

inline

Absolute value.

Definition at line 71 of file elem_math.h.

References std::abs(), and apply_function().

## abs() [5/6]

ITPP_EXPORT vec itpp::abs | ( | const cvec & | data | ) |

Absolute value.

Definition at line 55 of file elem_math.cpp.

References std::abs().

## abs() [6/6]

ITPP_EXPORT mat itpp::abs | ( | const cmat & | data | ) |

Absolute value.

Definition at line 65 of file elem_math.cpp.

References std::abs().

## sign() [1/3]

double itpp::sign | ( | double | x | ) |

inline

Signum function.

Definition at line 81 of file elem_math.h.

Referenced by alaw_compress(), erfinv(), quadl(), itpp::Normal_RNG::sample(), sgn(), sgn(), sgn(), sign(), sign(), and ulaw_compress().

## sign() [2/3]

vec itpp::sign | ( | const vec & | x | ) |

inline

Signum function.

Definition at line 86 of file elem_math.h.

References apply_function(), and sign().

## sign() [3/3]

mat itpp::sign | ( | const mat & | x | ) |

inline

Signum function.

Definition at line 88 of file elem_math.h.

References apply_function(), and sign().

## sgn() [1/3]

double itpp::sgn | ( | double | x | ) |

inline

Signum function.

Definition at line 91 of file elem_math.h.

References sign().

## sgn() [2/3]

vec itpp::sgn | ( | const vec & | x | ) |

inline

Signum function.

Definition at line 93 of file elem_math.h.

References apply_function(), and sign().

## sgn() [3/3]

mat itpp::sgn | ( | const mat & | x | ) |

inline

Signum function.

Definition at line 95 of file elem_math.h.

References apply_function(), and sign().

## sign_i() [1/4]

int itpp::sign_i | ( | int | x | ) |

inline

Signum function.

Definition at line 98 of file elem_math.h.

Referenced by sgn_i(), sgn_i(), sgn_i(), sign_i(), and sign_i().

## sign_i() [2/4]

ivec itpp::sign_i | ( | const ivec & | x | ) |

inline

Signum function.

Definition at line 103 of file elem_math.h.

References apply_function(), and sign_i().

## sign_i() [3/4]

imat itpp::sign_i | ( | const imat & | x | ) |

inline

Signum function.

Definition at line 105 of file elem_math.h.

References apply_function(), and sign_i().

## sgn_i() [1/3]

int itpp::sgn_i | ( | int | x | ) |

inline

Signum function.

Definition at line 108 of file elem_math.h.

References sign_i().

## sgn_i() [2/3]

ivec itpp::sgn_i | ( | const ivec & | x | ) |

inline

Signum function.

Definition at line 110 of file elem_math.h.

References apply_function(), and sign_i().

## sgn_i() [3/3]

imat itpp::sgn_i | ( | const imat & | x | ) |

inline

Signum function.

Definition at line 112 of file elem_math.h.

References apply_function(), and sign_i().

## sign_i() [4/4]

int itpp::sign_i | ( | double | x | ) |

inline

Signum function.

Definition at line 115 of file elem_math.h.

## sqrt() [1/2]

vec itpp::sqrt | ( | const vec & | x | ) |

inline

Square root of the elements.

Definition at line 123 of file elem_math.h.

References apply_function().

Referenced by itpp::AWGN_Channel::AWGN_Channel(), itpp::Complex_Normal_RNG::Complex_Normal_RNG(), itpp::Complex_Normal_RNG::Complex_Normal_RNG(), itpp::TDL_Channel::discretize(), and itpp::Normal_RNG::Normal_RNG().

## sqrt() [2/2]

mat itpp::sqrt | ( | const mat & | x | ) |

inline

Square root of the elements.

Definition at line 125 of file elem_math.h.

References apply_function().

## gamma() [1/3]

ITPP_EXPORT double itpp::gamma | ( | double | x | ) |

Deprecated gamma function - please use tgamma() instead.

Definition at line 79 of file elem_math.cpp.

Referenced by itpp::Rec_Syst_Conv_Code::log_decode(), itpp::Rec_Syst_Conv_Code::log_decode_n2(), and itpp::Rec_Syst_Conv_Code::map_decode().

## gamma() [2/3]

ITPP_EXPORT vec itpp::gamma | ( | const vec & | x | ) |

Deprecated gamma function for vectors. Will be changed to tgamma().

Definition at line 80 of file elem_math.cpp.

References apply_function().

## gamma() [3/3]

ITPP_EXPORT mat itpp::gamma | ( | const mat & | x | ) |

Deprecated gamma function for matrices. Will be changed to tgamma().

Definition at line 81 of file elem_math.cpp.

References apply_function().

## rem() [1/5]

double itpp::rem | ( | double | x,
|  | double | y )

inline

The reminder of the division x/y.

Definition at line 141 of file elem_math.h.

Referenced by rem(), rem(), rem(), and rem().

## rem() [2/5]

vec itpp::rem | ( | const vec & | x,
|  | double | y )

inline

Elementwise reminder of the division x/y for vec and double.

Definition at line 143 of file elem_math.h.

References apply_function(), and rem().

## rem() [3/5]

vec itpp::rem | ( | double | x,
|  | const vec & | y )

inline

Elementwise reminder of the division x/y for double and vec.

Definition at line 148 of file elem_math.h.

References apply_function(), and rem().

## rem() [4/5]

mat itpp::rem | ( | const mat & | x,
|  | double | y )

inline

Elementwise reminder of the division x/y for mat and double.

Definition at line 153 of file elem_math.h.

References apply_function(), and rem().

## rem() [5/5]

mat itpp::rem | ( | double | x,
|  | const mat & | y )

inline

Elementwise reminder of the division x/y for double and mat.

Definition at line 158 of file elem_math.h.

References apply_function(), and rem().

## mod()

int itpp::mod | ( | int | k,
|  | int | n )

inline

Calculates the modulus, i.e. the signed reminder after division.

Definition at line 166 of file elem_math.h.

References floor_i().

Referenced by fpica(), itpp::Modulator_NCD::operator<<, itpp::Modulator_NRD::operator<<, and itpp::Turbo_Codec::wcdma_turbo_interleaver_sequence().

## fact()

ITPP_EXPORT double itpp::fact | ( | int | index | ) |

Calculates factorial coefficient for index <= 170.

Definition at line 84 of file elem_math.cpp.

References it_error_if, and prod().

## binom()

ITPP_EXPORT double itpp::binom | ( | int | n,
|  | int | k )

Compute the binomial coefficient "n over k".

Definition at line 95 of file elem_math.cpp.

References it_assert.

## binom_i()

ITPP_EXPORT int itpp::binom_i | ( | int | n,
|  | int | k )

Compute the binomial coefficient "n over k".

Definition at line 110 of file elem_math.cpp.

References it_assert.

## log_binom()

ITPP_EXPORT double itpp::log_binom | ( | int | n,
|  | int | k )

Compute the base 10 logarithm of the binomial coefficient "n over k".

Definition at line 125 of file elem_math.cpp.

References it_assert, and log10().

## gcd()

ITPP_EXPORT int itpp::gcd | ( | int | a,
|  | int | b )

Compute the greatest common divisor (GCD) g of the elements a and b.

a and b must be non-negative integers. gdc(0, 0) is 0 by convention; all other GCDs are positive integers.

Definition at line 140 of file elem_math.cpp.

References it_assert.

Referenced by itpp::Turbo_Codec::wcdma_turbo_interleaver_sequence().

## real() [1/2]

ITPP_EXPORT vec itpp::real | ( | const cvec & | data | ) |

Real part of complex values.

Definition at line 157 of file elem_math.cpp.

References real().

Referenced by arma_estimator(), itpp::CFix::CFix(), itpp::Modulator_NCD::demodulate_soft_bits(), itpp::Multicode_Spread_2d::despread(), itpp::Spread_2d::despread(), itpp::it_file::low_level_write(), itpp::it_file::low_level_write(), itpp::it_file::low_level_write(), itpp::it_file_old::low_level_write(), itpp::it_file_old::low_level_write(), itpp::it_file_old::low_level_write(), itpp::Vec< Num_T >::operator-(), itpp::CFixed< 1, TC, WRAP >::operator=(), polystab(), real(), itpp::CFix::set(), itpp::CFix::set(), set_fix(), set_fix(), set_fix(), set_fix(), set_fix(), set_fix(), set_fix(), set_fix(), set_fix(), set_fix(), set_fix(), set_fix(), set_fix(), set_fix(), itpp::Multicode_Spread_2d::spread(), itpp::Spread_2d::spread(), to(), to(), to(), to(), to(), itpp::Mat< double >::to_cmat(), itpp::Vec< double >::to_cvec(), itpp::Vec< double >::to_cvec(), xcorr(), xcorr(), and xcorr().

## real() [2/2]

ITPP_EXPORT mat itpp::real | ( | const cmat & | data | ) |

Real part of complex values.

Definition at line 167 of file elem_math.cpp.

## imag() [1/2]

ITPP_EXPORT vec itpp::imag | ( | const cvec & | data | ) |

Imaginary part of complex values.

Definition at line 180 of file elem_math.cpp.

References imag().

Referenced by itpp::CFix::CFix(), itpp::Multicode_Spread_2d::despread(), itpp::Spread_2d::despread(), imag(), itpp::it_file::low_level_write(), itpp::it_file::low_level_write(), itpp::it_file::low_level_write(), itpp::it_file_old::low_level_write(), itpp::it_file_old::low_level_write(), itpp::it_file_old::low_level_write(), itpp::Vec< Num_T >::operator-(), itpp::CFixed< 1, TC, WRAP >::operator=(), itpp::CFix::set(), itpp::CFix::set(), set_fix(), set_fix(), set_fix(), set_fix(), set_fix(), set_fix(), set_fix(), set_fix(), set_fix(), set_fix(), set_fix(), set_fix(), set_fix(), set_fix(), itpp::Multicode_Spread_2d::spread(), itpp::Spread_2d::spread(), to(), to(), to(), to(), to(), itpp::Mat< double >::to_cmat(), itpp::Vec< double >::to_cvec(), and itpp::Vec< double >::to_cvec().

## imag() [2/2]

ITPP_EXPORT mat itpp::imag | ( | const cmat & | data | ) |

Imaginary part of complex values.

Definition at line 189 of file elem_math.cpp.

## arg() [1/2]

ITPP_EXPORT vec itpp::arg | ( | const cvec & | data | ) |

Argument (angle).

Definition at line 202 of file elem_math.cpp.

Referenced by angle(), and angle().

## arg() [2/2]

ITPP_EXPORT mat itpp::arg | ( | const cmat & | data | ) |

Argument (angle).

Definition at line 212 of file elem_math.cpp.

## angle() [1/2]

vec itpp::angle | ( | const cvec & | x | ) |

inline

Angle.

Definition at line 218 of file elem_math.h.

References arg().

Referenced by rotation_matrix().

## angle() [2/2]

mat itpp::angle | ( | const cmat & | x | ) |

inline

Angle.

Definition at line 220 of file elem_math.h.

References arg().

## conj() [1/2]

cvec itpp::conj | ( | const cvec & | x | ) |

inline

Conjugate of complex value.

Definition at line 226 of file elem_math.h.

References apply_function().

Referenced by polystab(), polystab(), toeplitz(), and xcorr().

## conj() [2/2]

cmat itpp::conj | ( | const cmat & | x | ) |

inline

Conjugate of complex value.

Definition at line 231 of file elem_math.h.

References apply_function().

## max() [1/4]

template<class T>

T itpp::max | ( | const Vec< T > & | v | ) |

Maximum value of vector.

Definition at line 45 of file min_max.h.

References itpp::Vec< Num_T >::length().

Referenced by itpp::Sparse_Vec< T >::add(), itpp::LDPC_Parity_Unstructured::compute_CR(), itpp::Reed_Solomon::decode(), itpp::LDPC_Code::decoder_parameterization(), itpp::LDPC_Parity::display_stats(), extrinsic_mutual_info(), itpp::TDL_Channel::filter_known_channel(), itpp::TDL_Channel::filter_known_channel(), itpp::GF2mat_sparse_alist::from_sparse(), itpp::I_Uniform_RNG::get_setup(), itpp::Uniform_RNG::get_setup(), getSamples(), itpp::GF2mat::GF2mat(), itpp::I_Uniform_RNG::I_Uniform_RNG(), itpp::Rec_Syst_Conv_Code::log_decode(), itpp::Rec_Syst_Conv_Code::log_decode_n2(), max(), max(), norm(), norm(), itpp::LDPC_Code::operator<<, orth(), itpp::Newton_Search::search(), itpp::Modulator< T >::set(), itpp::Sparse_Vec< T >::set(), itpp::Sparse_Vec< T >::set_new(), itpp::I_Uniform_RNG::setup(), itpp::Uniform_RNG::setup(), itpp::LDPC_Code::setup_decoder(), itpp::Uniform_RNG::Uniform_RNG(), within_tolerance(), within_tolerance(), within_tolerance(), and within_tolerance().

## max() [2/4]

template<class T>

T itpp::max | ( | const Vec< T > & | v,
|  | int & | index )

Maximum value of vector, also returns the index position of max value.

Definition at line 56 of file min_max.h.

References itpp::Vec< Num_T >::length().

## max() [3/4]

template<class T>

Vec< T > itpp::max | ( | const Mat< T > & | m,
|  | int | dim = 1 )

Maximum values over each row/column in the matrix `m`

max(m) = max(m, 1) returns a vector where the elements are maximum over each column, whereas max(m, 2) returns a vector where the elements are maximum over each row.

Definition at line 76 of file min_max.h.

References itpp::Mat< Num_T >::cols(), itpp::Mat< Num_T >::get_col(), itpp::Mat< Num_T >::get_row(), it_assert, max(), itpp::Mat< Num_T >::rows(), and itpp::Vec< Num_T >::set_size().

## max() [4/4]

template<class T>

Vec< T > itpp::max | ( | const Mat< T > & | m,
|  | ivec & | index,
|  | int | dim = 1 )

Maximum values over each row/column in the matrix `m`

max(m) = max(m, 1) returns a vector where the elements are maximum over each column, whereas max(m, 2) returns a vector where the elements are maximum over each row.

Also returns a vector of indices with positions of maximum value within a column/row.

Definition at line 104 of file min_max.h.

References itpp::Mat< Num_T >::cols(), itpp::Mat< Num_T >::get_col(), itpp::Mat< Num_T >::get_row(), it_assert, max(), itpp::Mat< Num_T >::rows(), and itpp::Vec< Num_T >::set_size().

## min() [1/4]

template<class T>

T itpp::min | ( | const Vec< T > & | in | ) |

Minimum value of vector.

Definition at line 125 of file min_max.h.

References itpp::Vec< Num_T >::length().

Referenced by extrinsic_mutual_info(), fpica(), itpp::I_Uniform_RNG::get_setup(), itpp::Uniform_RNG::get_setup(), itpp::GF2mat::GF2mat(), itpp::I_Uniform_RNG::I_Uniform_RNG(), min(), min(), itpp::Modulator< T >::set(), itpp::Channel_Specification::set_channel_profile(), itpp::TDL_Channel::set_channel_profile(), itpp::ACK_Channel::set_errors(), itpp::Packet_Channel::set_errors(), itpp::Array< T >::set_size(), itpp::Stack< T >::set_size(), itpp::Vec< Num_T >::set_size(), itpp::I_Uniform_RNG::setup(), itpp::Uniform_RNG::setup(), and itpp::Uniform_RNG::Uniform_RNG().

## min() [2/4]

template<class T>

T itpp::min | ( | const Vec< T > & | in,
|  | int & | index )

Minimum value of vector, also returns the index position of min value.

Definition at line 136 of file min_max.h.

References itpp::Vec< Num_T >::length().

## min() [3/4]

template<class T>

Vec< T > itpp::min | ( | const Mat< T > & | m,
|  | int | dim = 1 )

Minimum values over each row/column in the matrix `m`

min(m) = min(m, 1) returns a vector where the elements are minimum over each column, whereas min(m, 2) returns a vector where the elements are minimum over each row.

Definition at line 157 of file min_max.h.

References itpp::Mat< Num_T >::cols(), itpp::Mat< Num_T >::get_col(), itpp::Mat< Num_T >::get_row(), it_assert, min(), itpp::Mat< Num_T >::rows(), and itpp::Vec< Num_T >::set_size().

## min() [4/4]

template<class T>

Vec< T > itpp::min | ( | const Mat< T > & | m,
|  | ivec & | index,
|  | int | dim = 1 )

Minimum values over each row/column in the matrix `m`

min(m) = min(m, 1) returns a vector where the elements are minimum over each column, whereas min(m, 2) returns a vector where the elements are minimum over each row.

Also returns a vector of indices with positions of minimum value within a column/row.

Definition at line 186 of file min_max.h.

References itpp::Mat< Num_T >::cols(), itpp::Mat< Num_T >::get_col(), itpp::Mat< Num_T >::get_row(), it_assert, min(), itpp::Mat< Num_T >::rows(), and itpp::Vec< Num_T >::set_size().

## max_index() [1/2]

template<class T>

int itpp::max_index | ( | const Vec< T > & | in | ) |

Return the postion of the maximum element in the vector.

Definition at line 208 of file min_max.h.

References itpp::Vec< Num_T >::length().

Referenced by itpp::Fast_ICA::separate().

## max_index() [2/2]

template<class T>

void itpp::max_index | ( | const Mat< T > & | m,
|  | int & | row,
|  | int & | col )

Return the postion of the maximum element in the matrix.

Definition at line 219 of file min_max.h.

References itpp::Mat< Num_T >::cols(), and itpp::Mat< Num_T >::rows().

## min_index() [1/2]

template<class T>

int itpp::min_index | ( | const Vec< T > & | in | ) |

Return the postion of the minimum element in the vector.

Definition at line 234 of file min_max.h.

References itpp::Vec< Num_T >::length().

Referenced by itpp::Convolutional_Code::decode_trunc().

## min_index() [2/2]

template<class T>

void itpp::min_index | ( | const Mat< T > & | m,
|  | int & | row,
|  | int & | col )

Return the postion of the minimum element in the matrix.

Definition at line 245 of file min_max.h.

References itpp::Mat< Num_T >::cols(), and itpp::Mat< Num_T >::rows().

## is_int()

bool itpp::is_int | ( | double | x | ) |

inline

Return true if x is an integer.

Definition at line 115 of file misc.h.

## is_even()

bool itpp::is_even | ( | int | x | ) |

inline

Return true if x is an even integer.

Definition at line 122 of file misc.h.

Referenced by cheb(), chebwin(), itpp::Modulator< T >::set(), itpp::ND_UQAM::set_constellation_points(), itpp::QAM::set_M(), itpp::Raised_Cosine< T1 >::set_pulse_shape(), and itpp::Root_Raised_Cosine< T1 >::set_pulse_shape().

## itpp_version()

ITPP_EXPORT std::string itpp::itpp_version | ( | void |  | ) |

Returns IT++ library version number, e.g. "3.7.1".

Definition at line 41 of file misc.cpp.

## is_bigendian()

ITPP_EXPORT bool itpp::is_bigendian | ( |  | ) |

Returns true if machine endianness is BIG_ENDIAN.

Definition at line 50 of file misc.cpp.

Referenced by itpp::bfstream_base::bfstream_base(), and check_big_endianness().

## check_big_endianness()

bool itpp::check_big_endianness | ( |  | ) |

inline

This function is deprecated. Please use is_bigendian() instead.

Definition at line 131 of file misc.h.

References is_bigendian().

Generated on for IT++ by Doxygen 1.15.0