Vector Class (Templated) More...
#include <itpp/base/vec.h>
Public Types | |
typedef Num_T | value_type |
The type of the vector values. More... | |
Public Member Functions | |
Vec (const Factory &f=DEFAULT_FACTORY) | |
Default constructor. An element factory f can be specified. More... | |
Vec (int size, const Factory &f=DEFAULT_FACTORY) | |
Constructor with size parameter. An element factory f can be specified. More... | |
Vec (const Vec< Num_T > &v) | |
Copy constructor. More... | |
Vec (const Vec< Num_T > &v, const Factory &f) | |
Copy constructor, which takes an element factory f as an additional argument. More... | |
Vec (const char *str, const Factory &f=DEFAULT_FACTORY) | |
Constructor taking a char string as input. An element factory f can be specified. More... | |
Vec (const std::string &str, const Factory &f=DEFAULT_FACTORY) | |
Constructor taking a string as input. An element factory f can be specified. More... | |
Vec (const Num_T *c_array, int size, const Factory &f=DEFAULT_FACTORY) | |
Constructor taking a C-array as input. Copies all data. An element factory f can be specified. More... | |
~Vec () | |
Destructor. More... | |
int | length () const |
The size of the vector. More... | |
int | size () const |
The size of the vector. More... | |
void | set_size (int size, bool copy=false) |
Set length of vector. if copy = true then keeping the old values. More... | |
void | set_length (int size, bool copy=false) |
Set length of vector. if copy = true then keeping the old values. More... | |
void | zeros () |
Set the vector to the all zero vector. More... | |
void | clear () |
Set the vector to the all zero vector. More... | |
void | ones () |
Set the vector to the all one vector. More... | |
void | set (const char *str) |
Set the vector equal to the values in the str string. More... | |
void | set (const std::string &str) |
Set the vector equal to the values in the str string. More... | |
const Num_T & | operator[] (int i) const |
C-style index operator. First element is 0. More... | |
const Num_T & | operator() (int i) const |
Index operator. First element is 0. More... | |
Num_T & | operator[] (int i) |
C-style index operator. First element is 0. More... | |
Num_T & | operator() (int i) |
Index operator. First element is 0. More... | |
Vec< Num_T > | operator() (int i1, int i2) const |
Sub-vector with elements from i1 to i2 . Index -1 indicates the last element. More... | |
Vec< Num_T > | operator() (const Vec< int > &indexlist) const |
Sub-vector with elements given by the list of indices indexlist . More... | |
Vec< Num_T > | operator() (const Vec< bin > &binlist) const |
Sub-vector with elements with indexes where binlist is 1 . More... | |
const Num_T & | get (int i) const |
Accessor-style method. First element is 0. More... | |
Vec< Num_T > | get (int i1, int i2) const |
Get the elements from i1 to i2 . Index -1 indicates the last element. More... | |
Vec< Num_T > | get (const Vec< int > &indexlist) const |
Get the elements given by the list of indices indexlist . More... | |
Vec< Num_T > | get (const Vec< bin > &binlist) const |
Get the elements with indexes where binlist is 1 . More... | |
void | set (int i, Num_T t) |
Modifier-style method. First element is 0. More... | |
Mat< Num_T > | transpose () const |
Matrix transpose. Converts to a matrix with the vector in the first row. More... | |
Mat< Num_T > | T () const |
Matrix transpose. Converts to a matrix with the vector in the first row. More... | |
Mat< Num_T > | hermitian_transpose () const |
Hermitian matrix transpose. Converts to a matrix with the conjugate of the vector in the first row. More... | |
Mat< Num_T > | H () const |
Hermitian matrix transpose. Converts to a matrix with the conjugate of the vector in the first row. More... | |
Vec< Num_T > & | operator+= (const Vec< Num_T > &v) |
Addition of vector. More... | |
Vec< Num_T > & | operator+= (Num_T t) |
Addition of scalar. More... | |
Vec< Num_T > & | operator-= (const Vec< Num_T > &v) |
Subtraction of vector. More... | |
Vec< Num_T > & | operator-= (Num_T t) |
Subtraction of scalar. More... | |
Vec< Num_T > & | operator*= (Num_T t) |
Multiply with a scalar. More... | |
Vec< Num_T > & | operator/= (Num_T t) |
Elementwise division. More... | |
Vec< Num_T > & | operator/= (const Vec< Num_T > &v) |
Elementwise division. More... | |
Vec< Num_T > | right (int nr) const |
Get the right nr elements from the vector. More... | |
Vec< Num_T > | left (int nr) const |
Get the left nr elements from the vector. More... | |
Vec< Num_T > | mid (int start, int nr) const |
Get the middle part of vector from start including nr elements. More... | |
Vec< Num_T > | split (int pos) |
Split the vector into two parts at element pos . More... | |
void | shift_right (Num_T t, int n=1) |
Shift in element t at position 0 n times. More... | |
void | shift_right (const Vec< Num_T > &v) |
Shift in vector v at position 0. More... | |
void | shift_left (Num_T t, int n=1) |
Shift out the n left elements and at the same time shift in the element t at last position n times. More... | |
void | shift_left (const Vec< Num_T > &v) |
Shift in vector v at last positions. More... | |
void | set_subvector (int i1, int i2, const Vec< Num_T > &v) |
This function is deprecated. Please use set_subvector(i, v) instead. More... | |
void | set_subvector (int i, const Vec< Num_T > &v) |
Set subvector to elements of vector v starting from element i . More... | |
void | set_subvector (int i1, int i2, Num_T t) |
Set subvector defined by indices i1 and i2 to t . More... | |
void | replace_mid (int i, const Vec< Num_T > &v) |
An alias function of set_subvector(i, &v) More... | |
void | del (int i) |
Delete element number i . More... | |
void | del (int i1, int i2) |
Delete elements from i1 to i2 . More... | |
void | ins (int i, Num_T t) |
Insert element t before element with index i (0 <= i <= datasize) More... | |
void | ins (int i, const Vec< Num_T > &v) |
Insert vector v before element with index i (0 <= i <= datasize) More... | |
Vec< Num_T > & | operator= (Num_T t) |
Assign all elements in vector to t . More... | |
Vec< Num_T > & | operator= (const Vec< Num_T > &v) |
Assign vector the value and length of v . More... | |
Vec< Num_T > & | operator= (const Mat< Num_T > &m) |
Assign vector equal to the 1-dimensional matrix m . More... | |
Vec< Num_T > & | operator= (const char *str) |
Assign vector the values in the string str . More... | |
Vec< Num_T > & | operator= (const std::string &str) |
Assign vector the values in the string str . More... | |
Vec< bin > | operator== (Num_T t) const |
Elementwise equal to the scalar t . More... | |
Vec< bin > | operator!= (Num_T t) const |
Elementwise not-equal to the scalar t . More... | |
Vec< bin > | operator< (Num_T t) const |
Elementwise less than the scalar t . More... | |
Vec< bin > | operator<= (Num_T t) const |
Elementwise less than and equal to the scalar t . More... | |
Vec< bin > | operator> (Num_T t) const |
Elementwise greater than the scalar t . More... | |
Vec< bin > | operator>= (Num_T t) const |
Elementwise greater than and equal to the scalar t . More... | |
bool | operator== (const Vec< Num_T > &v) const |
Compare with vector v . Return false if sizes or values differ. More... | |
bool | operator!= (const Vec< Num_T > &v) const |
Compare with vector v . Return true if sizes or values differ. More... | |
Num_T & | _elem (int i) |
Index operator without boundary check. Not recommended for use. More... | |
const Num_T & | _elem (int i) const |
Index operator without boundary check. Not recommended for use. More... | |
Num_T * | _data () |
Get the pointer to the internal structure. Not recommended for use. More... | |
const Num_T * | _data () const |
Get the pointer to the internal structure. Not recommended for use. More... | |
Protected Member Functions | |
void | alloc (int size) |
Allocate storage for a vector of length size . More... | |
void | free () |
Free the storage space allocated by the vector. More... | |
Protected Attributes | |
int | datasize |
The current number of elements in the vector. More... | |
Num_T * | data |
A pointer to the data area. More... | |
const Factory & | factory |
Element factory (set to DEFAULT_FACTORY to use Num_T default constructors only) More... | |
Friends | |
Vec< Num_T > | operator+ (const Vec< Num_T > &v1, const Vec< Num_T > &v2) |
Addition of two vectors. More... | |
Vec< Num_T > | operator+ (const Vec< Num_T > &v, Num_T t) |
Addition of a vector and a scalar. More... | |
Vec< Num_T > | operator+ (Num_T t, const Vec< Num_T > &v) |
Addition of a scalar and a vector. More... | |
Vec< Num_T > | operator- (const Vec< Num_T > &v1, const Vec< Num_T > &v2) |
Subtraction of v2 from v1 . More... | |
Vec< Num_T > | operator- (const Vec< Num_T > &v, Num_T t) |
Subtraction of scalar from vector. More... | |
Vec< Num_T > | operator- (Num_T t, const Vec< Num_T > &v) |
Subtraction of vector from scalar. More... | |
Vec< Num_T > | operator- (const Vec< Num_T > &v) |
Negation of vector. More... | |
Vec< Num_T > | operator* (const Vec< Num_T > &v, Num_T t) |
Elementwise multiplication of vector and scalar. More... | |
Vec< Num_T > | operator* (Num_T t, const Vec< Num_T > &v) |
Elementwise multiplication of vector and scalar. More... | |
Vec< Num_T > | elem_mult (const Vec< Num_T > &a, const Vec< Num_T > &b) |
Elementwise multiplication. More... | |
Vec< Num_T > | elem_mult (const Vec< Num_T > &a, const Vec< Num_T > &b, const Vec< Num_T > &c) |
Elementwise multiplication of three vectors. More... | |
Vec< Num_T > | elem_mult (const Vec< Num_T > &a, const Vec< Num_T > &b, const Vec< Num_T > &c, const Vec< Num_T > &d) |
Elementwise multiplication of four vectors. More... | |
void | elem_mult_out (const Vec< Num_T > &a, const Vec< Num_T > &b, Vec< Num_T > &out) |
Elementwise multiplication, storing the result in vector out . More... | |
void | elem_mult_out (const Vec< Num_T > &a, const Vec< Num_T > &b, const Vec< Num_T > &c, Vec< Num_T > &out) |
Elementwise multiplication of three vectors, storing the result in vector out . More... | |
void | elem_mult_out (const Vec< Num_T > &a, const Vec< Num_T > &b, const Vec< Num_T > &c, const Vec< Num_T > &d, Vec< Num_T > &out) |
Elementwise multiplication of four vectors, storing the result in vector out . More... | |
void | elem_mult_inplace (const Vec< Num_T > &a, Vec< Num_T > &b) |
In-place element-wise multiplication of two vectors. Fast version of b = elem_mult(a,b). More... | |
Num_T | elem_mult_sum (const Vec< Num_T > &a, const Vec< Num_T > &b) |
Element-wise multiplication of two vectors, followed by summation of the resultant elements. Fast version of sum(elem_mult(a,b)) More... | |
Vec< Num_T > | operator/ (const Vec< Num_T > &v, Num_T t) |
Elementwise division. More... | |
Vec< Num_T > | operator/ (Num_T t, const Vec< Num_T > &v) |
Elementwise division. More... | |
Vec< Num_T > | elem_div (const Vec< Num_T > &v1, const Vec< Num_T > &v2) |
Elementwise division. More... | |
Vec< Num_T > | elem_div (Num_T t, const Vec< Num_T > &v) |
This function is deprecated. Please use operator/(Num_T, const Vec<Num_T> &) instead. More... | |
void | elem_div_out (const Vec< Num_T > &v1, const Vec< Num_T > &v2, Vec< Num_T > &out) |
Elementwise division. More... | |
Num_T | elem_div_sum (const Vec< Num_T > &a, const Vec< Num_T > &b) |
Elementwise division, followed by summation of the resultant elements. Fast version of sum(elem_mult(a,b)) More... | |
Vec< Num_T > | concat (const Vec< Num_T > &v, Num_T t) |
Append element t to the end of the vector v . More... | |
Vec< Num_T > | concat (Num_T t, const Vec< Num_T > &v) |
Insert element t at the beginning of the vector v . More... | |
Vec< Num_T > | concat (const Vec< Num_T > &v1, const Vec< Num_T > &v2) |
Concatenate vectors v1 and v2 . More... | |
Vec< Num_T > | concat (const Vec< Num_T > &v1, const Vec< Num_T > &v2, const Vec< Num_T > &v3) |
Concatenate vectors v1 , v2 and v3 . More... | |
Vec< Num_T > | concat (const Vec< Num_T > &v1, const Vec< Num_T > &v2, const Vec< Num_T > &v3, const Vec< Num_T > &v4) |
Concatenate vectors v1 , v2 , v3 and v4 . More... | |
Vec< Num_T > | concat (const Vec< Num_T > &v1, const Vec< Num_T > &v2, const Vec< Num_T > &v3, const Vec< Num_T > &v4, const Vec< Num_T > &v5) |
Concatenate vectors v1 , v2 , v3 , v4 and v5 . More... | |
Related Functions | |
(Note that these are not member functions.) | |
typedef Vec< double > | vec |
Definition of double vector type. More... | |
typedef Vec< std::complex< double > > | cvec |
Definition of complex<double> vector type. More... | |
typedef Vec< int > | ivec |
Definition of integer vector type. More... | |
typedef Vec< short int > | svec |
Definition of short vector type. More... | |
typedef Vec< bin > | bvec |
Definition of binary vector type. More... | |
template<class T > | |
bvec | to_bvec (const Vec< T > &v) |
Converts a Vec<T> to bvec. More... | |
template<class T > | |
svec | to_svec (const Vec< T > &v) |
Converts a Vec<T> to svec. More... | |
template<class T > | |
ivec | to_ivec (const Vec< T > &v) |
Converts a Vec<T> to ivec. More... | |
template<class T > | |
vec | to_vec (const Vec< T > &v) |
Converts a Vec<T> to vec. More... | |
template<class T > | |
cvec | to_cvec (const Vec< T > &v) |
Converts a Vec<T> to cvec. More... | |
template<class T > | |
cvec | to_cvec (const Vec< T > &real, const Vec< T > &imag) |
Converts real and imaginary Vec<T> to cvec. More... | |
ivec | to_ivec (int s) |
Converts an int to ivec. | |
vec | to_vec (double s) |
Converts an double to vec. | |
cvec | to_cvec (double real, double imag) |
Converts real and imaginary double to cvec. | |
template<class T > | |
Vec< T > | repmat (const Vec< T > &v, int n) |
Creates a vector with n copies of the vector v . More... | |
vec | operator+ (const float &s, const vec &v) |
Addition operator for float and vec. More... | |
vec | operator+ (const short &s, const vec &v) |
Addition operator for short and vec. More... | |
vec | operator+ (const int &s, const vec &v) |
Addition operator for int and vec. More... | |
vec | operator+ (const vec &v, const float &s) |
Addition operator for vec and float. More... | |
vec | operator+ (const vec &v, const short &s) |
Addition operator for vec and short. More... | |
vec | operator+ (const vec &v, const int &s) |
Addition operator for vec and int. More... | |
vec | operator- (const float &s, const vec &v) |
Subtraction operator for float and vec. More... | |
vec | operator- (const short &s, const vec &v) |
Subtraction operator for short and vec. More... | |
vec | operator- (const int &s, const vec &v) |
Subtraction operator for int and vec. More... | |
vec | operator- (const vec &v, const float &s) |
Subtraction operator for vec and float. More... | |
vec | operator- (const vec &v, const short &s) |
Subtraction operator for vec and short. More... | |
vec | operator- (const vec &v, const int &s) |
Subtraction operator for vec and int. More... | |
vec | operator* (const float &s, const vec &v) |
Multiplication operator for float and vec. More... | |
vec | operator* (const short &s, const vec &v) |
Multiplication operator for short and vec. More... | |
vec | operator* (const int &s, const vec &v) |
Multiplication operator for int and vec. More... | |
cvec | operator* (const std::complex< double > &s, const vec &v) |
Multiplication operator for complex<double> and vec. More... | |
vec | operator* (const vec &v, const float &s) |
Multiplication operator for vec and float. More... | |
vec | operator* (const vec &v, const short &s) |
Multiplication operator for vec and short. More... | |
vec | operator* (const vec &v, const int &s) |
Multiplication operator for vec and int. More... | |
cvec | operator* (const vec &v, const std::complex< double > &s) |
Multiplication operator for vec and complex<double> More... | |
vec | operator/ (const vec &v, const float &s) |
Division operator for vec and float. More... | |
vec | operator/ (const vec &v, const short &s) |
Division operator for vec and short. More... | |
vec | operator/ (const vec &v, const int &s) |
Division operator for vec and int. More... | |
ITPP_EXPORT vec | operator+ (const double &s, const ivec &v) |
Addition operator for double and ivec. More... | |
vec | operator+ (const ivec &v, const double &s) |
Addition operator for ivec and double. More... | |
ITPP_EXPORT vec | operator- (const double &s, const ivec &v) |
Subtraction operator for double and ivec. More... | |
vec | operator- (const ivec &v, const double &s) |
Subtraction operator for ivec and double. More... | |
ITPP_EXPORT vec | operator* (const double &s, const ivec &v) |
Multiplication operator for double and ivec. More... | |
vec | operator* (const ivec &v, const double &s) |
Multiplication operator for ivec and double. More... | |
ITPP_EXPORT vec | operator/ (const double &s, const ivec &v) |
Division operator for double and ivec. More... | |
ITPP_EXPORT vec | operator/ (const ivec &v, const double &s) |
Division operator for ivec and double. More... | |
ITPP_EXPORT cvec | operator+ (const std::complex< double > &s, const ivec &v) |
Addition operator for complex<double> and ivec. More... | |
cvec | operator+ (const ivec &v, const std::complex< double > &s) |
Addition operator for ivec and complex<double> More... | |
ITPP_EXPORT cvec | operator- (const std::complex< double > &s, const ivec &v) |
Subtraction operator for complex<double> and ivec. More... | |
cvec | operator- (const ivec &v, const std::complex< double > &s) |
Subtraction operator for ivec and complex<double> More... | |
ITPP_EXPORT cvec | operator* (const std::complex< double > &s, const ivec &v) |
Multiplication operator for complex<double> and ivec. More... | |
cvec | operator* (const ivec &v, const std::complex< double > &s) |
Multiplication operator for ivec and complex<double> More... | |
ITPP_EXPORT cvec | operator/ (const std::complex< double > &s, const ivec &v) |
Division operator for complex<double> and ivec. More... | |
ITPP_EXPORT cvec | operator/ (const ivec &v, const std::complex< double > &s) |
Division operator for ivec and complex<double> More... | |
ITPP_EXPORT cvec | operator+ (const double &s, const cvec &v) |
Addition operator for double and cvec. More... | |
cvec | operator+ (const float &s, const cvec &v) |
Addition operator for float and cvec. More... | |
cvec | operator+ (const short &s, const cvec &v) |
Addition operator for short and cvec. More... | |
cvec | operator+ (const int &s, const cvec &v) |
Addition operator for int and cvec. More... | |
cvec | operator+ (const cvec &v, const float &s) |
Addition operator for cvec and float. More... | |
cvec | operator+ (const cvec &v, const double &s) |
Addition operator for cvec and double. More... | |
cvec | operator+ (const cvec &v, const short &s) |
Addition operator for cvec and short. More... | |
cvec | operator+ (const cvec &v, const int &s) |
Addition operator for cvec and int. More... | |
ITPP_EXPORT cvec | operator- (const double &s, const cvec &v) |
Subtraction operator for double and cvec. More... | |
cvec | operator- (const float &s, const cvec &v) |
Subtraction operator for float and cvec. More... | |
cvec | operator- (const short &s, const cvec &v) |
Subtraction operator for short and cvec. More... | |
cvec | operator- (const int &s, const cvec &v) |
Subtraction operator for int and cvec. More... | |
cvec | operator- (const cvec &v, const float &s) |
Subtraction operator for cvec and float. More... | |
cvec | operator- (const cvec &v, const double &s) |
Subtraction operator for cvec and double. More... | |
cvec | operator- (const cvec &v, const short &s) |
Subtraction operator for cvec and short. More... | |
cvec | operator- (const cvec &v, const int &s) |
Subtraction operator for cvec and int. More... | |
ITPP_EXPORT cvec | operator* (const double &s, const cvec &v) |
Multiplication operator for double and cvec. More... | |
cvec | operator* (const float &s, const cvec &v) |
Multiplication operator for float and cvec. More... | |
cvec | operator* (const short &s, const cvec &v) |
Multiplication operator for short and cvec. More... | |
cvec | operator* (const int &s, const cvec &v) |
Multiplication operator for int and cvec. More... | |
cvec | operator* (const cvec &v, const float &s) |
Multiplication operator for cvec and float. More... | |
cvec | operator* (const cvec &v, const double &s) |
Multiplication operator for cvec and double. More... | |
cvec | operator* (const cvec &v, const short &s) |
Multiplication operator for cvec and short. More... | |
cvec | operator* (const cvec &v, const int &s) |
Multiplication operator for cvec and int. More... | |
ITPP_EXPORT cvec | operator/ (const cvec &v, const double &s) |
Division operator for cvec and double. More... | |
ITPP_EXPORT cvec | operator/ (const double &s, const cvec &v) |
Division operator for double and cvec. More... | |
cvec | operator/ (const cvec &v, const float &s) |
Division operator for cvec and float. More... | |
cvec | operator/ (const cvec &v, const short &s) |
Division operator for cvec and short. More... | |
cvec | operator/ (const cvec &v, const int &s) |
Division operator for cvec and int. More... | |
ITPP_EXPORT vec | operator+ (const bvec &a, const vec &b) |
Addition operator for bvec and vec. More... | |
ITPP_EXPORT vec | operator+ (const svec &a, const vec &b) |
Addition operator for svec and vec. More... | |
ITPP_EXPORT vec | operator+ (const ivec &a, const vec &b) |
Addition operator for ivec and vec. More... | |
vec | operator+ (const vec &a, const bvec &b) |
Addition operator for vec and bvec. More... | |
vec | operator+ (const vec &a, const svec &b) |
Addition operator for vec and svec. More... | |
vec | operator+ (const vec &a, const ivec &b) |
Addition operator for vec and ivec. More... | |
vec | operator- (const bvec &a, const vec &b) |
Subtraction operator for bvec and vec. More... | |
vec | operator- (const svec &a, const vec &b) |
Subtraction operator for svec and vec. More... | |
vec | operator- (const ivec &a, const vec &b) |
Subtraction operator for ivec and vec. More... | |
vec | operator- (const vec &a, const bvec &b) |
Subtraction operator for vec and bvec. More... | |
vec | operator- (const vec &a, const svec &b) |
Subtraction operator for vec and svec. More... | |
vec | operator- (const vec &a, const ivec &b) |
Subtraction operator for vec and ivec. More... | |
ITPP_EXPORT double | operator* (const bvec &a, const vec &b) |
Multiplication operator for bvec and vec. More... | |
ITPP_EXPORT double | operator* (const svec &a, const vec &b) |
Multiplication operator for svec and vec. More... | |
ITPP_EXPORT double | operator* (const ivec &a, const vec &b) |
Multiplication operator for ivec and vec. More... | |
double | operator* (const vec &a, const bvec &b) |
Multiplication operator for vec and bvec. More... | |
double | operator* (const vec &a, const svec &b) |
Multiplication operator for vec and svec. More... | |
double | operator* (const vec &a, const ivec &b) |
Multiplication operator for vec and ivec. More... | |
ITPP_EXPORT cvec | operator+ (const bvec &a, const cvec &b) |
Addition operator for bvec and cvec. More... | |
ITPP_EXPORT cvec | operator+ (const svec &a, const cvec &b) |
Addition operator for svec and cvec. More... | |
ITPP_EXPORT cvec | operator+ (const ivec &a, const cvec &b) |
Addition operator for ivec and cvec. More... | |
cvec | operator+ (const cvec &a, const bvec &b) |
Addition operator for cvec and bvec. More... | |
cvec | operator+ (const cvec &a, const svec &b) |
Addition operator for cvec and svec. More... | |
cvec | operator+ (const cvec &a, const ivec &b) |
Addition operator for cvec and ivec. More... | |
cvec | operator- (const bvec &a, const cvec &b) |
Subtraction operator for bvec and cvec. More... | |
cvec | operator- (const svec &a, const cvec &b) |
Subtraction operator for svec and cvec. More... | |
cvec | operator- (const ivec &a, const cvec &b) |
Subtraction operator for ivec and cvec. More... | |
cvec | operator- (const cvec &a, const bvec &b) |
Subtraction operator for cvec and bvec. More... | |
cvec | operator- (const cvec &a, const svec &b) |
Subtraction operator for cvec and svec. More... | |
cvec | operator- (const cvec &a, const ivec &b) |
Subtraction operator for cvec and ivec. More... | |
ITPP_EXPORT std::complex< double > | operator* (const bvec &a, const cvec &b) |
Multiplication operator for bvec and cvec. More... | |
ITPP_EXPORT std::complex< double > | operator* (const svec &a, const cvec &b) |
Multiplication operator for svec and cvec. More... | |
ITPP_EXPORT std::complex< double > | operator* (const ivec &a, const cvec &b) |
Multiplication operator for ivec and cvec. More... | |
std::complex< double > | operator* (const cvec &a, const bvec &b) |
Multiplication operator for cvec and bvec. More... | |
std::complex< double > | operator* (const cvec &a, const svec &b) |
Multiplication operator for cvec and svec. More... | |
std::complex< double > | operator* (const cvec &a, const ivec &b) |
Multiplication operator for cvec and ivec. More... | |
template<class T > | |
void | sort (Vec< T > &data, SORTING_METHOD method=INTROSORT) |
Sort the data vector in increasing order. More... | |
template<class T > | |
ivec | sort_index (const Vec< T > &data, SORTING_METHOD method=INTROSORT) |
Return an index vector corresponding to a sorted vector data in increasing order. More... | |
template<class T > | |
Vec< T > | vec_1 (T v0) |
Vector of length 1. More... | |
template<class T > | |
Vec< T > | vec_2 (T v0, T v1) |
Vector of length 2. More... | |
template<class T > | |
Vec< T > | vec_3 (T v0, T v1, T v2) |
Vector of length 3. More... | |
template<class Num_T > | |
std::ostream & | operator<< (std::ostream &os, const Vec< Num_T > &v) |
Stream output of vector. More... | |
template<class Num_T > | |
std::istream & | operator>> (std::istream &is, Vec< Num_T > &v) |
Stream input of vector. More... | |
Vector Class (Templated)
Vectors can be of arbitrary types, but conversions and functions are prepared for bin
, short
, int
, double
, and complex<double>
vectors and these are predefined as: bvec
, svec
, ivec
, vec
, and cvec
. double
and complex<double>
are double
and complex<double>
respectively.
Examples:
Vector Constructors: When constructing a vector without a length (memory) use
For construction of a vector of a given length use
It is also possible to assign the constructed vector the value and size of another vector by
If you have explicit values you would like to assign to the vector it is possible to do this using strings as:
It is also possible to change length by
where false
is used to indicate that the old values in temp
are not copied. If you would like to preserve the values, use true
.
There are a number of methods to access parts of a vector. Examples are
It is also possible to modify parts of a vector, as in e.g.
It is, of course, also possible to perform common linear algebra operations, such as addition, subtraction, and scalar product (*). Observe though, that vectors are assumed to be column-vectors in operations with matrices.
Most elementary functions such as sin(), cosh(), log(), abs(), ..., are also available as operations on the individual elements of the vectors. Please see the individual functions for more details.
By default, the Vec elements are created using the default constructor for the element type. This can be changed by specifying a suitable Factory in the Vec constructor call; see Detailed Description for Factory.
typedef Num_T itpp::Vec< Num_T >::value_type |
|
inlineexplicit |
|
inlineexplicit |
Constructor with size parameter. An element factory f
can be specified.
Definition at line 617 of file vec.h.
References itpp::Vec< Num_T >::alloc(), it_assert_debug, and itpp::Vec< Num_T >::size().
Copy constructor.
Definition at line 624 of file vec.h.
References itpp::Vec< Num_T >::alloc(), itpp::Vec< Num_T >::data, and itpp::Vec< Num_T >::datasize.
Copy constructor, which takes an element factory f
as an additional argument.
Definition at line 631 of file vec.h.
References itpp::Vec< Num_T >::alloc(), itpp::Vec< Num_T >::data, and itpp::Vec< Num_T >::datasize.
|
inline |
Constructor taking a char string as input. An element factory f
can be specified.
Definition at line 638 of file vec.h.
References itpp::Vec< Num_T >::set().
|
inline |
Constructor taking a string as input. An element factory f
can be specified.
Definition at line 644 of file vec.h.
References itpp::Vec< Num_T >::set().
|
inline |
Constructor taking a C-array as input. Copies all data. An element factory f
can be specified.
Definition at line 650 of file vec.h.
References itpp::Vec< Num_T >::alloc(), itpp::Vec< Num_T >::data, and itpp::Vec< Num_T >::size().
|
inline |
The size of the vector.
Definition at line 269 of file vec.h.
References itpp::Vec< Num_T >::datasize.
Referenced by itpp::apply_functor(), itpp::Block_Interleaver< T >::deinterleave(), itpp::Cross_Interleaver< T >::deinterleave(), itpp::Sequence_Interleaver< T >::deinterleave(), itpp::Modulator< T >::demodulate(), itpp::dot(), itpp::Freq_Filt< Num_T >::filter(), itpp::geometric_mean(), itpp::Vec< Num_T >::ins(), itpp::Block_Interleaver< T >::interleave(), itpp::Cross_Interleaver< T >::interleave(), itpp::Sequence_Interleaver< T >::interleave(), itpp::length(), itpp::lininterp(), itpp::max(), itpp::max_index(), itpp::median(), itpp::min(), itpp::min_index(), itpp::Filter< T1, T2, T3 >::operator()(), itpp::Vec< double >::operator*(), itpp::Vec< Num_T >::operator<<(), itpp::outer_product(), itpp::repeat(), itpp::Vec< Num_T >::repmat(), itpp::reverse(), itpp::size(), itpp::sum(), itpp::sum_sqr(), itpp::to(), itpp::Vec< Num_T >::to_bvec(), itpp::to_cvec(), itpp::Vec< Num_T >::to_cvec(), itpp::Vec< Num_T >::to_ivec(), itpp::Vec< Num_T >::to_svec(), itpp::to_vec(), itpp::Vec< Num_T >::to_vec(), itpp::Histogram< Num_T >::update(), and itpp::upsample().
|
inline |
The size of the vector.
Definition at line 271 of file vec.h.
References itpp::Vec< Num_T >::datasize.
Referenced by itpp::Sparse_Vec< T >::add(), itpp::bidiag(), itpp::bitrv(), itpp::cross(), itpp::cumsum(), itpp::Modulator< T >::demodulate(), itpp::Modulator< T >::demodulate_bits(), itpp::Modulator< T >::demodulate_soft_bits(), itpp::dht(), itpp::diag(), itpp::dwht(), itpp::Mat< Num_T >::get_cols(), itpp::Mat< Num_T >::get_rows(), itpp::index_zero_pad(), itpp::Vec< Num_T >::ins(), itpp::Mat< Num_T >::ins_col(), itpp::Mat< Num_T >::ins_row(), itpp::Sort< T >::intro_sort(), itpp::Sort< T >::intro_sort_index(), itpp::lshift_fix(), itpp::Mat< Num_T >::Mat(), itpp::norm(), itpp::Vec< Num_T >::operator()(), itpp::Vec< Num_T >::operator*(), itpp::operator*(), itpp::Vec< double >::operator*(), itpp::Vec< Num_T >::operator+(), itpp::operator+(), itpp::Sparse_Vec< T >::operator+=(), itpp::Vec< Num_T >::operator-(), itpp::Sparse_Vec< T >::operator-=(), itpp::Vec< Num_T >::operator/(), itpp::Mat< Num_T >::operator=(), itpp::Sparse_Vec< T >::operator=(), itpp::prod(), itpp::Circular_Buffer< T >::put(), itpp::reshape(), itpp::rshift_fix(), itpp::self_dht(), itpp::Mat< Num_T >::set(), itpp::Modulator< T >::set(), itpp::AR_Filter< T1, T2, T3 >::set_coeffs(), itpp::MA_Filter< T1, T2, T3 >::set_coeffs(), itpp::ARMA_Filter< T1, T2, T3 >::set_coeffs(), itpp::Mat< Num_T >::set_col(), itpp::set_fix(), itpp::Vec< Num_T >::set_length(), itpp::Sparse_Vec< T >::set_new(), itpp::Pulse_Shape< T1, T2, T3 >::set_pulse_shape(), itpp::Mat< Num_T >::set_row(), itpp::MA_Filter< T1, T2, T3 >::set_state(), itpp::AR_Filter< T1, T2, T3 >::set_state(), itpp::ARMA_Filter< T1, T2, T3 >::set_state(), itpp::Pulse_Shape< T1, T2, T3 >::shape_samples(), itpp::Pulse_Shape< T1, T2, T3 >::shape_symbols(), itpp::Sort< T >::sort(), itpp::Vec< Num_T >::sort(), itpp::Vec< Num_T >::sort_index(), itpp::Sort< T >::sort_index(), itpp::Sparse_Vec< T >::Sparse_Vec(), itpp::toeplitz(), itpp::tridiag(), itpp::variance(), itpp::Vec< Num_T >::Vec(), and itpp::zero_pad().
void itpp::Vec< Num_T >::set_size | ( | int | size, |
bool | copy = false |
||
) |
Set length of vector. if copy = true then keeping the old values.
Definition at line 663 of file vec.h.
References itpp::destroy_elements(), it_assert_debug, itpp::min(), and itpp::size().
Referenced by itpp::bidiag(), itpp::Block_Interleaver< T >::deinterleave(), itpp::Cross_Interleaver< T >::deinterleave(), itpp::Sequence_Interleaver< T >::deinterleave(), itpp::dht(), itpp::Freq_Filt< Num_T >::filter(), itpp::Sparse_Vec< T >::full(), itpp::Circular_Buffer< T >::get(), itpp::Sequence_Interleaver< T >::interleave(), itpp::lininterp(), itpp::max(), itpp::min(), itpp::Modulator< T >::modulate(), itpp::Modulator< T >::modulate_bits(), itpp::Vec< Num_T >::operator()(), itpp::Vec< Num_T >::operator>>(), itpp::Circular_Buffer< T >::peek(), itpp::Circular_Buffer< T >::peek_reverse(), itpp::prod(), itpp::Mat< Num_T >::set(), itpp::MA_Filter< T1, T2, T3 >::set_coeffs(), itpp::set_fix(), itpp::Vec< Num_T >::set_length(), itpp::QAM::set_M(), itpp::PSK::set_M(), itpp::PAM_c::set_M(), itpp::PAM::set_M(), itpp::sum(), itpp::sum_sqr(), itpp::tridiag(), and itpp::upsample().
|
inline |
Set length of vector. if copy = true then keeping the old values.
Definition at line 276 of file vec.h.
References itpp::Vec< Num_T >::set_size(), and itpp::Vec< Num_T >::size().
Referenced by itpp::Sequence_Interleaver< T >::deinterleave(), itpp::Block_Interleaver< T >::interleave(), and itpp::Cross_Interleaver< T >::interleave().
|
inline |
Set the vector to the all zero vector.
Definition at line 786 of file vec.h.
Referenced by itpp::Vec< Num_T >::clear(), and itpp::Freq_Filt< Num_T >::filter().
|
inline |
Set the vector to the all zero vector.
Definition at line 280 of file vec.h.
References itpp::Vec< Num_T >::zeros().
Referenced by itpp::MA_Filter< T1, T2, T3 >::clear(), itpp::AR_Filter< T1, T2, T3 >::clear(), itpp::ARMA_Filter< T1, T2, T3 >::clear(), itpp::Block_Interleaver< T >::deinterleave(), itpp::Sequence_Interleaver< T >::deinterleave(), itpp::Block_Interleaver< T >::interleave(), itpp::Sequence_Interleaver< T >::interleave(), itpp::Pulse_Shape< T1, T2, T3 >::set_pulse_shape(), and itpp::upsample().
|
inline |
|
inline |
|
inline |
C-style index operator. First element is 0.
Definition at line 692 of file vec.h.
References it_assert_debug.
|
inline |
|
inline |
C-style index operator. First element is 0.
Definition at line 705 of file vec.h.
References it_assert_debug.
|
inline |
Sub-vector with elements from i1
to i2
. Index -1 indicates the last element.
Definition at line 718 of file vec.h.
References itpp::Vec< Num_T >::data, itpp::Vec< Num_T >::datasize, and it_assert_debug.
Vec< Num_T > itpp::Vec< Num_T >::operator() | ( | const Vec< int > & | indexlist | ) | const |
Sub-vector with elements given by the list of indices indexlist
.
Definition at line 733 of file vec.h.
References it_assert_debug, itpp::Vec< Num_T >::size(), and itpp::size().
Vec< Num_T > itpp::Vec< Num_T >::operator() | ( | const Vec< bin > & | binlist | ) | const |
Sub-vector with elements with indexes where binlist
is 1
.
Definition at line 746 of file vec.h.
References it_assert_debug, itpp::Vec< Num_T >::set_size(), itpp::Vec< Num_T >::size(), and itpp::size().
|
inline |
|
inline |
Modifier-style method. First element is 0.
Definition at line 800 of file vec.h.
References it_assert_debug.
Matrix transpose. Converts to a matrix with the vector in the first row.
Definition at line 833 of file vec.h.
References itpp::Mat< Num_T >::_data().
Referenced by itpp::Vec< Num_T >::T().
Matrix transpose. Converts to a matrix with the vector in the first row.
Definition at line 318 of file vec.h.
References itpp::Vec< Num_T >::transpose().
Referenced by itpp::Mat< Num_T >::repmat().
Hermitian matrix transpose. Converts to a matrix with the conjugate of the vector in the first row.
Definition at line 841 of file vec.h.
References itpp::Mat< Num_T >::_data().
Referenced by itpp::Vec< Num_T >::H().
Hermitian matrix transpose. Converts to a matrix with the conjugate of the vector in the first row.
Definition at line 322 of file vec.h.
References itpp::Vec< Num_T >::hermitian_transpose().
Addition of vector.
Definition at line 855 of file vec.h.
References itpp::Vec< Num_T >::data, itpp::Vec< Num_T >::datasize, and it_assert_debug.
Subtraction of vector.
Definition at line 917 of file vec.h.
References itpp::Vec< Num_T >::data, itpp::Vec< Num_T >::datasize, and it_assert_debug.
|
inline |
Elementwise division.
Definition at line 1186 of file vec.h.
References itpp::Vec< Num_T >::data, itpp::Vec< Num_T >::datasize, and it_assert_debug.
Get the right nr
elements from the vector.
Definition at line 1228 of file vec.h.
References itpp::Vec< Num_T >::data, and it_assert_debug.
Referenced by itpp::chebwin(), itpp::Turbo_Codec::decode_block(), itpp::Block_Interleaver< T >::deinterleave(), itpp::Cross_Interleaver< T >::deinterleave(), itpp::Sequence_Interleaver< T >::deinterleave(), itpp::Block_Interleaver< T >::interleave(), itpp::Cross_Interleaver< T >::interleave(), and itpp::Sequence_Interleaver< T >::interleave().
Get the left nr
elements from the vector.
Definition at line 1239 of file vec.h.
References itpp::Vec< Num_T >::data, and it_assert_debug.
Referenced by itpp::Turbo_Codec::decode_block(), itpp::Turbo_Codec::decode_n3(), itpp::Cross_Interleaver< T >::deinterleave(), and itpp::Cross_Interleaver< T >::interleave().
Get the middle part of vector from start
including nr
elements.
Definition at line 1250 of file vec.h.
References itpp::Vec< Num_T >::data, and it_assert_debug.
Referenced by itpp::Cross_Interleaver< T >::deinterleave(), and itpp::Cross_Interleaver< T >::interleave().
Split the vector into two parts at element pos
.
Return the first part containing elements 0 to pos-1
, and keep the second part containing the remaining elements starting from pos
(empty vector if pos
is equal to the length of the vector).
Definition at line 1262 of file vec.h.
References itpp::Vec< Num_T >::data, and it_assert_debug.
void itpp::Vec< Num_T >::shift_right | ( | Num_T | t, |
int | n = 1 |
||
) |
Shift in element t
at position 0 n
times.
Definition at line 1282 of file vec.h.
References it_assert_debug.
Shift in vector v
at position 0.
Definition at line 1294 of file vec.h.
References itpp::Vec< Num_T >::datasize.
void itpp::Vec< Num_T >::shift_left | ( | Num_T | t, |
int | n = 1 |
||
) |
Shift out the n
left elements and at the same time shift in the element t
at last position n
times.
Definition at line 1303 of file vec.h.
References it_assert_debug.
Shift in vector v
at last positions.
Definition at line 1315 of file vec.h.
References itpp::Vec< Num_T >::datasize.
void itpp::Vec< Num_T >::set_subvector | ( | int | i1, |
int | i2, | ||
const Vec< Num_T > & | v | ||
) |
This function is deprecated. Please use set_subvector(i, v) instead.
Definition at line 1404 of file vec.h.
References it_warning.
Referenced by itpp::Vec< Num_T >::repmat(), and itpp::zero_pad().
|
inline |
Set subvector to elements of vector v
starting from element i
.
Definition at line 1413 of file vec.h.
References itpp::Vec< Num_T >::data, itpp::Vec< Num_T >::datasize, and it_assert_debug.
|
inline |
Set subvector defined by indices i1
and i2
to t
.
Definition at line 1422 of file vec.h.
References it_assert_debug.
|
inline |
An alias function of set_subvector(i, &v)
Definition at line 1434 of file vec.h.
Referenced by itpp::Turbo_Codec::decode_n3().
void itpp::Vec< Num_T >::del | ( | int | i | ) |
Delete element number i
.
Definition at line 1440 of file vec.h.
References itpp::Vec< Num_T >::data, and it_assert_debug.
void itpp::Vec< Num_T >::del | ( | int | i1, |
int | i2 | ||
) |
Delete elements from i1
to i2
.
Definition at line 1450 of file vec.h.
References itpp::Vec< Num_T >::data, and it_assert_debug.
void itpp::Vec< Num_T >::ins | ( | int | i, |
Num_T | t | ||
) |
Insert element t
before element with index i
(0 <= i <= datasize)
Definition at line 1464 of file vec.h.
References itpp::Vec< Num_T >::data, itpp::Vec< Num_T >::datasize, and it_assert_debug.
Insert vector v
before element with index i
(0 <= i <= datasize)
Definition at line 1477 of file vec.h.
References itpp::Vec< Num_T >::data, itpp::Vec< Num_T >::datasize, it_assert_debug, itpp::Vec< Num_T >::length(), and itpp::Vec< Num_T >::size().
|
inline |
Assign vector the value and length of v
.
Definition at line 1498 of file vec.h.
References itpp::Vec< Num_T >::data, and itpp::Vec< Num_T >::datasize.
Assign vector equal to the 1-dimensional matrix m
.
Definition at line 1508 of file vec.h.
References itpp::Mat< Num_T >::_data(), itpp::Mat< Num_T >::cols(), it_error, and itpp::Mat< Num_T >::rows().
Elementwise equal to the scalar t
.
Definition at line 1538 of file vec.h.
References it_assert_debug.
Elementwise not-equal to the scalar t
.
Definition at line 1548 of file vec.h.
References it_assert_debug.
Elementwise less than the scalar t
.
Definition at line 1563 of file vec.h.
References it_assert_debug.
Elementwise less than and equal to the scalar t
.
Definition at line 1573 of file vec.h.
References it_assert_debug.
Elementwise greater than the scalar t
.
Definition at line 1588 of file vec.h.
References it_assert_debug.
Elementwise greater than and equal to the scalar t
.
Definition at line 1603 of file vec.h.
References it_assert_debug.
Compare with vector v
. Return false if sizes or values differ.
Definition at line 1618 of file vec.h.
References itpp::Vec< Num_T >::data, and itpp::Vec< Num_T >::datasize.
Compare with vector v
. Return true if sizes or values differ.
Definition at line 1629 of file vec.h.
References itpp::Vec< Num_T >::data, and itpp::Vec< Num_T >::datasize.
|
inline |
Index operator without boundary check. Not recommended for use.
Definition at line 487 of file vec.h.
References itpp::Vec< Num_T >::data.
|
inline |
Index operator without boundary check. Not recommended for use.
Definition at line 489 of file vec.h.
References itpp::Vec< Num_T >::data.
|
inline |
Get the pointer to the internal structure. Not recommended for use.
Definition at line 492 of file vec.h.
References itpp::Vec< Num_T >::data.
Referenced by itpp::dot(), itpp::Mat< Num_T >::get_col(), itpp::Mat< Num_T >::get_row(), itpp::Mat< Num_T >::ins_col(), itpp::Mat< Num_T >::ins_row(), itpp::Sort< T >::intro_sort(), itpp::Sort< T >::intro_sort_index(), itpp::Mat< Num_T >::Mat(), itpp::Mat< Num_T >::operator=(), itpp::outer_product(), itpp::Mat< Num_T >::set_col(), itpp::Mat< Num_T >::set_row(), itpp::Sort< T >::sort(), itpp::Sort< T >::sort_index(), and itpp::variance().
|
inline |
Get the pointer to the internal structure. Not recommended for use.
Definition at line 494 of file vec.h.
References itpp::Vec< Num_T >::data.
|
inlineprotected |
Allocate storage for a vector of length size
.
Definition at line 593 of file vec.h.
References itpp::create_elements(), and itpp::size().
Referenced by itpp::Vec< Num_T >::Vec().
|
inlineprotected |
Free the storage space allocated by the vector.
Definition at line 606 of file vec.h.
References itpp::destroy_elements().
This function is deprecated. Please use operator/(Num_T, const Vec<Num_T> &) instead.
Converts a Vec<T> to bvec.
Definition at line 51 of file converters.h.
References itpp::Vec< Num_T >::length().
Converts a Vec<T> to svec.
Definition at line 65 of file converters.h.
References itpp::Vec< Num_T >::length().
Converts a Vec<T> to ivec.
Definition at line 79 of file converters.h.
References itpp::Vec< Num_T >::length().
Referenced by getSamples().
Converts a Vec<T> to vec.
Definition at line 93 of file converters.h.
References itpp::Vec< Num_T >::length().
Converts a Vec<T> to cvec.
Definition at line 107 of file converters.h.
References itpp::Vec< Num_T >::length().
Converts real and imaginary Vec<T> to cvec.
Definition at line 129 of file converters.h.
References itpp::imag(), it_assert, and itpp::real().
Addition operator for float and vec.
Definition at line 81 of file operators.h.
Addition operator for short and vec.
Definition at line 87 of file operators.h.
Addition operator for int and vec.
Definition at line 93 of file operators.h.
Addition operator for vec and float.
Definition at line 99 of file operators.h.
Addition operator for vec and short.
Definition at line 105 of file operators.h.
Addition operator for vec and int.
Definition at line 111 of file operators.h.
Subtraction operator for float and vec.
Definition at line 117 of file operators.h.
Subtraction operator for short and vec.
Definition at line 123 of file operators.h.
Subtraction operator for int and vec.
Definition at line 129 of file operators.h.
Subtraction operator for vec and float.
Definition at line 135 of file operators.h.
Subtraction operator for vec and short.
Definition at line 141 of file operators.h.
Subtraction operator for vec and int.
Definition at line 147 of file operators.h.
Multiplication operator for float and vec.
Definition at line 153 of file operators.h.
Multiplication operator for short and vec.
Definition at line 159 of file operators.h.
Multiplication operator for int and vec.
Definition at line 165 of file operators.h.
Multiplication operator for complex<double> and vec.
Definition at line 267 of file operators.cpp.
References itpp::Vec< Num_T >::size().
Multiplication operator for vec and float.
Definition at line 177 of file operators.h.
Multiplication operator for vec and short.
Definition at line 183 of file operators.h.
Multiplication operator for vec and int.
Definition at line 189 of file operators.h.
Multiplication operator for vec and complex<double>
Definition at line 276 of file operators.cpp.
References itpp::Vec< Num_T >::size().
Division operator for vec and float.
Definition at line 201 of file operators.h.
Division operator for vec and short.
Definition at line 207 of file operators.h.
Division operator for vec and int.
Definition at line 213 of file operators.h.
Addition operator for double and ivec.
Definition at line 38 of file operators.cpp.
References it_assert_debug, and itpp::Vec< Num_T >::size().
Addition operator for ivec and double.
Definition at line 228 of file operators.h.
Subtraction operator for double and ivec.
Definition at line 49 of file operators.cpp.
References it_assert_debug, and itpp::Vec< Num_T >::size().
Subtraction operator for ivec and double.
Definition at line 240 of file operators.h.
Multiplication operator for double and ivec.
Definition at line 60 of file operators.cpp.
References it_assert_debug, and itpp::Vec< Num_T >::size().
Multiplication operator for ivec and double.
Definition at line 252 of file operators.h.
Division operator for double and ivec.
Definition at line 71 of file operators.cpp.
References it_assert_debug, and itpp::Vec< Num_T >::size().
Division operator for ivec and double.
Definition at line 82 of file operators.cpp.
References it_assert_debug, and itpp::Vec< Num_T >::size().
|
related |
Addition operator for complex<double> and ivec.
Definition at line 93 of file operators.cpp.
References it_assert_debug, and itpp::Vec< Num_T >::size().
Addition operator for ivec and complex<double>
Definition at line 276 of file operators.h.
|
related |
Subtraction operator for complex<double> and ivec.
Definition at line 104 of file operators.cpp.
References it_assert_debug, and itpp::Vec< Num_T >::size().
Subtraction operator for ivec and complex<double>
Definition at line 288 of file operators.h.
|
related |
Multiplication operator for complex<double> and ivec.
Definition at line 115 of file operators.cpp.
References it_assert_debug, and itpp::Vec< Num_T >::size().
Multiplication operator for ivec and complex<double>
Definition at line 300 of file operators.h.
|
related |
Division operator for complex<double> and ivec.
Definition at line 126 of file operators.cpp.
References it_assert_debug, and itpp::Vec< Num_T >::size().
|
related |
Division operator for ivec and complex<double>
Definition at line 137 of file operators.cpp.
References it_assert_debug, and itpp::Vec< Num_T >::size().
Addition operator for double and cvec.
Definition at line 150 of file operators.cpp.
References it_assert_debug, and itpp::Vec< Num_T >::size().
Addition operator for float and cvec.
Definition at line 326 of file operators.h.
Addition operator for short and cvec.
Definition at line 332 of file operators.h.
Addition operator for int and cvec.
Definition at line 338 of file operators.h.
Addition operator for cvec and float.
Definition at line 344 of file operators.h.
Addition operator for cvec and double.
Definition at line 350 of file operators.h.
Addition operator for cvec and short.
Definition at line 356 of file operators.h.
Addition operator for cvec and int.
Definition at line 362 of file operators.h.
Subtraction operator for double and cvec.
Definition at line 161 of file operators.cpp.
References itpp::imag(), it_assert_debug, itpp::real(), and itpp::Vec< Num_T >::size().
Subtraction operator for float and cvec.
Definition at line 374 of file operators.h.
Subtraction operator for short and cvec.
Definition at line 380 of file operators.h.
Subtraction operator for int and cvec.
Definition at line 386 of file operators.h.
Subtraction operator for cvec and float.
Definition at line 392 of file operators.h.
Subtraction operator for cvec and double.
Definition at line 398 of file operators.h.
Subtraction operator for cvec and short.
Definition at line 404 of file operators.h.
Subtraction operator for cvec and int.
Definition at line 410 of file operators.h.
Multiplication operator for double and cvec.
Definition at line 172 of file operators.cpp.
References it_assert_debug, and itpp::Vec< Num_T >::size().
Multiplication operator for float and cvec.
Definition at line 422 of file operators.h.
Multiplication operator for short and cvec.
Definition at line 428 of file operators.h.
Multiplication operator for int and cvec.
Definition at line 434 of file operators.h.
Multiplication operator for cvec and float.
Definition at line 440 of file operators.h.
Multiplication operator for cvec and double.
Definition at line 446 of file operators.h.
Multiplication operator for cvec and short.
Definition at line 452 of file operators.h.
Multiplication operator for cvec and int.
Definition at line 458 of file operators.h.
Division operator for cvec and double.
Definition at line 183 of file operators.cpp.
References it_assert_debug, and itpp::Vec< Num_T >::size().
Division operator for double and cvec.
Definition at line 194 of file operators.cpp.
Division operator for cvec and float.
Definition at line 476 of file operators.h.
Division operator for cvec and short.
Definition at line 482 of file operators.h.
Division operator for cvec and int.
Definition at line 488 of file operators.h.
Addition operator for bvec and vec.
Definition at line 290 of file operators.cpp.
References it_assert_debug, and itpp::Vec< Num_T >::size().
Addition operator for svec and vec.
Definition at line 298 of file operators.cpp.
References it_assert_debug, and itpp::Vec< Num_T >::size().
Addition operator for ivec and vec.
Definition at line 306 of file operators.cpp.
References it_assert_debug, and itpp::Vec< Num_T >::size().
Addition operator for vec and bvec.
Definition at line 680 of file operators.h.
Addition operator for vec and svec.
Definition at line 686 of file operators.h.
Addition operator for vec and ivec.
Definition at line 692 of file operators.h.
Subtraction operator for bvec and vec.
Definition at line 698 of file operators.h.
Subtraction operator for svec and vec.
Definition at line 704 of file operators.h.
Subtraction operator for ivec and vec.
Definition at line 710 of file operators.h.
Subtraction operator for vec and bvec.
Definition at line 716 of file operators.h.
Subtraction operator for vec and svec.
Definition at line 722 of file operators.h.
Subtraction operator for vec and ivec.
Definition at line 728 of file operators.h.
Multiplication operator for bvec and vec.
Definition at line 340 of file operators.cpp.
References it_assert_debug, and itpp::Vec< Num_T >::size().
Multiplication operator for svec and vec.
Definition at line 348 of file operators.cpp.
References it_assert_debug, and itpp::Vec< Num_T >::size().
Multiplication operator for ivec and vec.
Definition at line 356 of file operators.cpp.
References it_assert_debug, and itpp::Vec< Num_T >::size().
Multiplication operator for vec and bvec.
Definition at line 752 of file operators.h.
Multiplication operator for vec and svec.
Definition at line 758 of file operators.h.
Multiplication operator for vec and ivec.
Definition at line 764 of file operators.h.
Addition operator for bvec and cvec.
Definition at line 314 of file operators.cpp.
References it_assert_debug, and itpp::Vec< Num_T >::size().
Addition operator for svec and cvec.
Definition at line 322 of file operators.cpp.
References it_assert_debug, and itpp::Vec< Num_T >::size().
Addition operator for ivec and cvec.
Definition at line 330 of file operators.cpp.
References it_assert_debug, and itpp::Vec< Num_T >::size().
Addition operator for cvec and bvec.
Definition at line 790 of file operators.h.
Addition operator for cvec and svec.
Definition at line 796 of file operators.h.
Addition operator for cvec and ivec.
Definition at line 802 of file operators.h.
Subtraction operator for bvec and cvec.
Definition at line 808 of file operators.h.
Subtraction operator for svec and cvec.
Definition at line 814 of file operators.h.
Subtraction operator for ivec and cvec.
Definition at line 820 of file operators.h.
Subtraction operator for cvec and bvec.
Definition at line 826 of file operators.h.
Subtraction operator for cvec and svec.
Definition at line 832 of file operators.h.
Subtraction operator for cvec and ivec.
Definition at line 838 of file operators.h.
|
related |
Multiplication operator for bvec and cvec.
Definition at line 364 of file operators.cpp.
References it_assert_debug, and itpp::Vec< Num_T >::size().
|
related |
Multiplication operator for svec and cvec.
Definition at line 372 of file operators.cpp.
References it_assert_debug, and itpp::Vec< Num_T >::size().
|
related |
Multiplication operator for ivec and cvec.
Definition at line 380 of file operators.cpp.
References it_assert_debug, and itpp::Vec< Num_T >::size().
Multiplication operator for cvec and bvec.
Definition at line 862 of file operators.h.
Multiplication operator for cvec and svec.
Definition at line 868 of file operators.h.
Multiplication operator for cvec and ivec.
Definition at line 874 of file operators.h.
|
related |
Sort the data vector in increasing order.
data | Vector to be sorted |
method | Sorting method: INTROSORT (default), QUICKSORT, HEAPSORT or INSERTSORT |
Definition at line 187 of file sort.h.
References itpp::Vec< Num_T >::size(), and itpp::Sort< T >::sort().
Referenced by pcamat().
|
related |
Return an index vector corresponding to a sorted vector data in increasing order.
data | Vector for which to return a sorted index vector |
method | Sorting method: INTROSORT (default), QUICKSORT, HEAPSORT or INSERTSORT |
Definition at line 203 of file sort.h.
References itpp::Vec< Num_T >::size(), and itpp::Sort< T >::sort_index().
|
related |
Stream output of vector.
Definition at line 1640 of file vec.h.
References itpp::Vec< Num_T >::length().
|
related |
Stream input of vector.
The input can be on the form "1 2 3" or "[1 2 3]", i.e. with or without brackets. The first form is compatible with the set method, while the second form is compatible with the ostream operator. The elements can be separated by blank space or commas. "[]" means an empty vector. "1:4" means "1 2 3 4". "1:3:10" means every third integer from 1 to 10, i.e. "1 4 7 10".
Definition at line 1657 of file vec.h.
References itpp::Vec< Num_T >::set(), and itpp::Vec< Num_T >::set_size().
|
protected |
The current number of elements in the vector.
Definition at line 503 of file vec.h.
Referenced by itpp::Vec< Num_T >::ins(), itpp::Vec< Num_T >::length(), itpp::Vec< Num_T >::operator!=(), itpp::Vec< Num_T >::operator()(), itpp::Vec< Num_T >::operator+=(), itpp::Vec< Num_T >::operator-=(), itpp::Vec< Num_T >::operator/=(), itpp::Vec< Num_T >::operator=(), itpp::Vec< Num_T >::operator==(), itpp::Vec< Num_T >::set_subvector(), itpp::Vec< Num_T >::shift_left(), itpp::Vec< Num_T >::shift_right(), itpp::Vec< Num_T >::size(), and itpp::Vec< Num_T >::Vec().
|
protected |
A pointer to the data area.
Definition at line 505 of file vec.h.
Referenced by itpp::Vec< Num_T >::_data(), itpp::Vec< Num_T >::_elem(), itpp::Vec< Num_T >::del(), itpp::Vec< Num_T >::ins(), itpp::Vec< Num_T >::left(), itpp::Vec< Num_T >::mid(), itpp::Vec< Num_T >::operator!=(), itpp::Vec< Num_T >::operator()(), itpp::Vec< Num_T >::operator+=(), itpp::Vec< Num_T >::operator-=(), itpp::Vec< Num_T >::operator/=(), itpp::Vec< Num_T >::operator=(), itpp::Vec< Num_T >::operator==(), itpp::Vec< Num_T >::right(), itpp::Vec< Num_T >::set_subvector(), itpp::Vec< Num_T >::split(), and itpp::Vec< Num_T >::Vec().
Generated on Sun Jun 5 2022 21:26:42 for IT++ by Doxygen 1.9.3