IT++ Logo
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Namespaces | Functions
converters.h File Reference

Definitions of converters between different vector and matrix types. More...

#include <itpp/base/help_functions.h>
#include <itpp/base/math/misc.h>

Go to the source code of this file.

Namespaces

namespace  itpp
 itpp namespace

Functions

template<class T >
bvec itpp::to_bvec (const Vec< T > &v)
 Converts a Vec<T> to bvec.
template<class T >
svec itpp::to_svec (const Vec< T > &v)
 Converts a Vec<T> to svec.
template<class T >
ivec itpp::to_ivec (const Vec< T > &v)
 Converts a Vec<T> to ivec.
template<class T >
vec itpp::to_vec (const Vec< T > &v)
 Converts a Vec<T> to vec.
template<class T >
cvec itpp::to_cvec (const Vec< T > &v)
 Converts a Vec<T> to cvec.
template<class T >
cvec itpp::to_cvec (const Vec< T > &real, const Vec< T > &imag)
 Converts real and imaginary Vec<T> to cvec.
ivec itpp::to_ivec (int s)
 Converts an int to ivec.
vec itpp::to_vec (double s)
 Converts an double to vec.
cvec itpp::to_cvec (double real, double imag)
 Converts real and imaginary double to cvec.
template<class T >
bmat itpp::to_bmat (const Mat< T > &m)
 Converts a Mat<T> to bmat.
template<class T >
smat itpp::to_smat (const Mat< T > &m)
 Converts a Mat<T> to smat.
template<class T >
imat itpp::to_imat (const Mat< T > &m)
 Converts a Mat<T> to imat.
template<class T >
mat itpp::to_mat (const Mat< T > &m)
 Converts a Mat<T> to mat.
template<class T >
cmat itpp::to_cmat (const Mat< T > &m)
 Converts a Mat<T> to cmat.
template<class T >
cmat itpp::to_cmat (const Mat< T > &real, const Mat< T > &imag)
 Converts real and imaginary Mat<T> to cmat.
bvec itpp::dec2bin (int length, int index)
 Convert a decimal int index to bvec using length bits in the representation.
void itpp::dec2bin (int index, bvec &v)
 Convert a decimal int index to bvec. Value returned in v.
bvec itpp::dec2bin (int index, bool msb_first=true)
 Convert a decimal int index to bvec with the first bit as MSB if msb_first == true.
int itpp::bin2dec (const bvec &inbvec, bool msb_first=true)
 Convert a bvec to decimal int with the first bit as MSB if msb_first == true.
bvec itpp::oct2bin (const ivec &octalindex, short keepzeros=0)
 Convert ivec of octal form to bvec.
ivec itpp::bin2oct (const bvec &inbits)
 Convert bvec to octal ivec.
ivec itpp::bin2pol (const bvec &inbvec)
 Convert bvec to polar binary representation as ivec.
bvec itpp::pol2bin (const ivec &inpol)
 Convert binary polar ivec to bvec.
double itpp::rad_to_deg (double x)
 Convert radians to degrees.
double itpp::deg_to_rad (double x)
 Convert degrees to radians.
double itpp::round (double x)
 Round to nearest integer, return result in double.
vec itpp::round (const vec &x)
 Round to nearest integer.
mat itpp::round (const mat &x)
 Round to nearest integer.
int itpp::round_i (double x)
 Round to nearest integer.
ivec itpp::round_i (const vec &x)
 Round to nearest integer and return ivec.
imat itpp::round_i (const mat &x)
 Round to nearest integer and return imat.
vec itpp::ceil (const vec &x)
 Round to nearest upper integer.
mat itpp::ceil (const mat &x)
 Round to nearest upper integer.
int itpp::ceil_i (double x)
 The nearest larger integer.
ivec itpp::ceil_i (const vec &x)
 Round to nearest upper integer.
imat itpp::ceil_i (const mat &x)
 Round to nearest upper integer.
vec itpp::floor (const vec &x)
 Round to nearest lower integer.
mat itpp::floor (const mat &x)
 Round to nearest lower integer.
int itpp::floor_i (double x)
 The nearest smaller integer.
ivec itpp::floor_i (const vec &x)
 Round to nearest lower integer.
imat itpp::floor_i (const mat &x)
 Round to nearest lower integer.
double itpp::round_to_zero (double x, double threshold=1e-14)
 Round x to zero if abs(x) is smaller than threshold.
std::complex< double > itpp::round_to_zero (const std::complex< double > &x, double threshold=1e-14)
 Round each part of x smaller than threshold to zero.
vec itpp::round_to_zero (const vec &x, double threshold=1e-14)
 Round each element to zero if element < threshold.
mat itpp::round_to_zero (const mat &x, double threshold=1e-14)
 Round each element to zero if element < threshold.
cvec itpp::round_to_zero (const cvec &x, double threshold=1e-14)
 Round each element to zero if element < threshold.
cmat itpp::round_to_zero (const cmat &x, double threshold=1e-14)
 Round each element to zero if element < threshold.
double itpp::round_to_infty (const double in, const double threshold=1e9)
 Remove trailing digits, found after the decimal point, for numbers greater than threshold.
std::complex< double > itpp::round_to_infty (const std::complex< double > &in, const double threshold=1e9)
 Remove trailing digits, found after the decimal point, for complex numbers whose real and imaginary parts are greater than threshold.
vec itpp::round_to_infty (const vec &in, const double threshold=1e9)
 Remove trailing digits, found after the decimal point, for vectors greater than threshold.
mat itpp::round_to_infty (const mat &in, const double threshold=1e9)
 Remove trailing digits, found after the decimal point, for matrices greater than threshold.
cvec itpp::round_to_infty (const cvec &in, const double threshold=1e9)
 Remove trailing digits, found after the decimal point, for complex vectors greater than threshold.
cmat itpp::round_to_infty (const cmat &in, const double threshold=1e9)
 Remove trailing digits, found after the decimal point, for complex matrices greater than threshold.
int itpp::gray_code (int x)
 Convert to Gray Code.
template<typename T >
std::string itpp::to_str (const T &i)
 Convert anything to string.
std::string itpp::to_str (const double &i, const int precision)
 Convert double to string.

Detailed Description

Definitions of converters between different vector and matrix types.

Author
Tony Ottosson, Tobias Ringstrom, Pal Frenger and Adam Piatyszek

Copyright (C) 1995-2010 (see AUTHORS file for a list of contributors)

This file is part of IT++ - a C++ library of mathematical, signal processing, speech processing, and communications classes and functions.

IT++ is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

IT++ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with IT++. If not, see http://www.gnu.org/licenses/.


Definition in file converters.h.

SourceForge Logo

Generated on Fri Mar 21 2014 17:14:14 for IT++ by Doxygen 1.8.1.2