IT++ Logo

Miscellaneous Functions
[Basic and Miscellaneous Math Functions]


Functions

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>
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 tgamma (double x)
 True gamma function.
double lgamma (double x)
 Lograrithm of an absolute gamma function.
double cbrt (double x)
 Cubic root.
double itpp::sqr (double x)
 Square of x.
double itpp::sqr (const std::complex< double > &x)
 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)
 Square of elements.
mat itpp::sqr (const cmat &x)
 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>
itpp::max (const Vec< T > &v)
 Maximum value of vector.
template<class 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>
itpp::min (const Vec< T > &in)
 Minimum value of vector.
template<class 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::check_big_endianness ()
 Returns machine endianness: big-endian = true; little-endian = false.

Variables

int signgam
 Global variable needed by lgamma function.


Function Documentation

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 169 of file elem_math.cpp.

References it_assert.

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

template<class T>
Vec<T> itpp::max ( const Mat< T > &  m,
int  dim = 1 
) [inline]

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, itpp::max(), itpp::Mat< Num_T >::rows(), and itpp::Vec< Num_T >::set_size().

template<class T>
Vec<T> itpp::max ( const Mat< T > &  m,
ivec index,
int  dim = 1 
) [inline]

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, itpp::max(), itpp::Mat< Num_T >::rows(), and itpp::Vec< Num_T >::set_size().

template<class T>
Vec<T> itpp::min ( const Mat< T > &  m,
int  dim = 1 
) [inline]

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, itpp::min(), itpp::Mat< Num_T >::rows(), and itpp::Vec< Num_T >::set_size().

template<class T>
Vec<T> itpp::min ( const Mat< T > &  m,
ivec index,
int  dim = 1 
) [inline]

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, itpp::min(), itpp::Mat< Num_T >::rows(), and itpp::Vec< Num_T >::set_size().

SourceForge Logo

Generated on Thu Apr 24 13:39:03 2008 for IT++ by Doxygen 1.5.5