IT++ Logo Newcom Logo

vec.h File Reference

Templated Vector Class Definitions. More...

#include <itpp/config.h>
#include <itpp/itconfig.h>
#include <itpp/base/itassert.h>
#include <itpp/base/scalfunc.h>
#include <itpp/base/factory.h>
#include <itpp/base/copy_vector.h>
#include <itpp/base/mat.h>

Go to the source code of this file.

Namespaces

namespace  itpp

Classes

class  itpp::Vec< Num_T >
 Templated vectors. More...

Typedefs

typedef Vec< double > vec
 Definition of double vector type.
typedef Vec< std::complex<
double > > 
cvec
 Definition of complex<double> vector type.
typedef Vec< int > ivec
 Definition of integer vector type.
typedef Vec< short int > svec
 Definition of short vector type.
typedef Vec< bin > bvec
 Definition of binary vector type.

Functions

template<class Num_T>
const Vec< Num_T > operator+ (const Vec< Num_T > &v1, const Vec< Num_T > &v2)
 Addition of two vectors.
template<class Num_T>
const Vec< Num_T > operator+ (const Vec< Num_T > &v, const Num_T t)
 Addition of a vector and a scalar.
template<class Num_T>
const Vec< Num_T > operator+ (const Num_T t, const Vec< Num_T > &v)
 Addition of a scalar and a vector.
template<class Num_T>
const Vec< Num_T > operator- (const Vec< Num_T > &v1, const Vec< Num_T > &v2)
 Subtraction of v2 from v1.
template<class Num_T>
const Vec< Num_T > operator- (const Vec< Num_T > &v, const Num_T t)
 Subtraction of scalar from vector.
template<class Num_T>
const Vec< Num_T > operator- (const Num_T t, const Vec< Num_T > &v)
 Sutraction of vector from scalar.
template<class Num_T>
const Vec< Num_T > operator- (const Vec< Num_T > &v)
 Negation of vector.
template<class Num_T>
Num_T dot (const Vec< Num_T > &v1, const Vec< Num_T > &v2)
 Inner (dot) product.
template<class Num_T>
Num_T operator * (const Vec< Num_T > &v1, const Vec< Num_T > &v2)
 Inner (dot) product.
template<class Num_T>
const Mat< Num_T > outer_product (const Vec< Num_T > &v1, const Vec< Num_T > &v2)
 Outer product of two vectors v1 and v2.
template<class Num_T>
const Vec< Num_T > operator * (const Vec< Num_T > &v, const Num_T t)
 Elementwise multiplication of vector and scalar.
template<class Num_T>
const Vec< Num_T > operator * (const Num_T t, const Vec< Num_T > &v)
 Elementwise multiplication of vector and scalar.
template<class Num_T>
const Vec< Num_T > elem_mult (const Vec< Num_T > &v1, const Vec< Num_T > &v2)
 Elementwise multiplication.
template<class Num_T>
const Vec< Num_T > elem_mult (const Vec< Num_T > &v1, const Vec< Num_T > &v2, const Vec< Num_T > &v3)
 Elementwise multiplication of three vectors.
template<class Num_T>
const Vec< Num_T > elem_mult (const Vec< Num_T > &v1, const Vec< Num_T > &v2, const Vec< Num_T > &v3, const Vec< Num_T > &v4)
 Elementwise multiplication of four vectors.
template<class Num_T>
const Vec< Num_T > operator/ (const Vec< Num_T > &v, const Num_T t)
 Elementwise division.
template<class Num_T>
const Vec< Num_T > operator/ (const Num_T t, const Vec< Num_T > &v)
 Elementwise division.
template<class Num_T>
const Vec< Num_T > elem_div (const Vec< Num_T > &v1, const Vec< Num_T > &v2)
 Elementwise division.
template<class Num_T>
const Vec< Num_T > elem_div (const Num_T t, const Vec< Num_T > &v)
 Elementwise division.
template<class Num_T>
const Vec< Num_T > concat (const Vec< Num_T > &v, const Num_T a)
 Append element a to the end of the vector v.
template<class Num_T>
const Vec< Num_T > concat (const Num_T a, const Vec< Num_T > &v)
 Concat element a to the beginning of the vector v.
template<class Num_T>
const Vec< Num_T > concat (const Vec< Num_T > &v1, const Vec< Num_T > &v2)
 Concat vectors v1 and v2.
template<class Num_T>
const Vec< Num_T > concat (const Vec< Num_T > &v1, const Vec< Num_T > &v2, const Vec< Num_T > &v3)
 Concat vectors v1, v2 and v3.
template<class Num_T>
const Vec< Num_T > concat (const Vec< Num_T > &v1, const Vec< Num_T > &v2, const Vec< Num_T > &v3, const Vec< Num_T > &v4)
 Concat vectors v1, v2, v3 and v4.
template<class Num_T>
const 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)
 Concat vectors v1, v2 v3, v4 and v5.
template<class Num_T>
std::ostream & operator<< (std::ostream &os, const Vec< Num_T > &v)
template<class Num_T>
std::istream & operator>> (std::istream &is, Vec< Num_T > &v)


Detailed Description

Templated Vector Class Definitions.

Author:
Tony Ottosson and Tobias Ringstrom
Date
2007-07-12 14:48:07 +0200 (Thu, 12 Jul 2007)
Revision
1083

-------------------------------------------------------------------------

IT++ - C++ library of mathematical, signal processing, speech processing, and communications classes and functions

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

This program 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 2 of the License, or (at your option) any later version.

This program 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 this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

-------------------------------------------------------------------------

Definition in file vec.h.


Typedef Documentation

typedef Vec<double> itpp::vec
 

Definition of double vector type.

Definition at line 438 of file vec.h.

typedef Vec<std::complex<double> > itpp::cvec
 

Definition of complex<double> vector type.

Definition at line 444 of file vec.h.

typedef Vec<int> itpp::ivec
 

Definition of integer vector type.

Definition at line 450 of file vec.h.

typedef Vec<short int> itpp::svec
 

Definition of short vector type.

Definition at line 456 of file vec.h.

typedef Vec<bin> itpp::bvec
 

Definition of binary vector type.

Definition at line 462 of file vec.h.


Function Documentation

template<class Num_T>
const Vec< Num_T > itpp::operator+ const Vec< Num_T > &  v1,
const Vec< Num_T > &  v2
[inline]
 

Addition of two vectors.

Definition at line 687 of file vec.h.

template<class Num_T>
const Vec< Num_T > itpp::operator+ const Vec< Num_T > &  v,
const Num_T  t
[inline]
 

Addition of a vector and a scalar.

Definition at line 700 of file vec.h.

template<class Num_T>
const Vec< Num_T > itpp::operator+ const Num_T  t,
const Vec< Num_T > &  v
[inline]
 

Addition of a scalar and a vector.

Definition at line 712 of file vec.h.

template<class Num_T>
const Vec< Num_T > itpp::operator- const Vec< Num_T > &  v1,
const Vec< Num_T > &  v2
[inline]
 

Subtraction of v2 from v1.

Definition at line 749 of file vec.h.

template<class Num_T>
const Vec< Num_T > itpp::operator- const Vec< Num_T > &  v,
const Num_T  t
[inline]
 

Subtraction of scalar from vector.

Definition at line 762 of file vec.h.

template<class Num_T>
const Vec< Num_T > itpp::operator- const Num_T  t,
const Vec< Num_T > &  v
[inline]
 

Sutraction of vector from scalar.

Definition at line 774 of file vec.h.

template<class Num_T>
const Vec< Num_T > itpp::operator- const Vec< Num_T > &  v  )  [inline]
 

Negation of vector.

Definition at line 786 of file vec.h.

template<class Num_T>
Num_T itpp::dot const Vec< Num_T > &  v1,
const Vec< Num_T > &  v2
[inline]
 

Inner (dot) product.

Definition at line 811 of file vec.h.

template<class Num_T>
Num_T operator * const Vec< Num_T > &  v1,
const Vec< Num_T > &  v2
 

Inner (dot) product.

Definition at line 81 of file vec.h.

template<class Num_T>
const Mat< Num_T > itpp::outer_product const Vec< Num_T > &  v1,
const Vec< Num_T > &  v2
[inline]
 

Outer product of two vectors v1 and v2.

For complex arguments, v2 is a transposed vector only (not Hermitian transposed). This is equivalent to the Matlab's (v1 * v2.') operation. Please use outer_product(v1,conj(v2)) to get the same result as for Matlabs' (v1 * v2').

Definition at line 824 of file vec.h.

template<class Num_T>
const Vec< Num_T > itpp::operator * const Vec< Num_T > &  v,
const Num_T  t
[inline]
 

Elementwise multiplication of vector and scalar.

Definition at line 842 of file vec.h.

template<class Num_T>
const Vec< Num_T > itpp::operator * const Num_T  t,
const Vec< Num_T > &  v
[inline]
 

Elementwise multiplication of vector and scalar.

Definition at line 854 of file vec.h.

template<class Num_T>
const Vec< Num_T > itpp::elem_mult const Vec< Num_T > &  v1,
const Vec< Num_T > &  v2
[inline]
 

Elementwise multiplication.

Definition at line 866 of file vec.h.

template<class Num_T>
const Vec< Num_T > itpp::elem_mult const Vec< Num_T > &  v1,
const Vec< Num_T > &  v2,
const Vec< Num_T > &  v3
[inline]
 

Elementwise multiplication of three vectors.

Definition at line 879 of file vec.h.

template<class Num_T>
const Vec< Num_T > itpp::elem_mult const Vec< Num_T > &  v1,
const Vec< Num_T > &  v2,
const Vec< Num_T > &  v3,
const Vec< Num_T > &  v4
[inline]
 

Elementwise multiplication of four vectors.

Definition at line 893 of file vec.h.

template<class Num_T>
const Vec< Num_T > itpp::operator/ const Vec< Num_T > &  v,
const Num_T  t
[inline]
 

Elementwise division.

Definition at line 908 of file vec.h.

template<class Num_T>
const Vec< Num_T > itpp::operator/ const Num_T  t,
const Vec< Num_T > &  v
[inline]
 

Elementwise division.

Definition at line 920 of file vec.h.

template<class Num_T>
const Vec< Num_T > itpp::elem_div const Vec< Num_T > &  v1,
const Vec< Num_T > &  v2
[inline]
 

Elementwise division.

Definition at line 952 of file vec.h.

template<class Num_T>
const Vec< Num_T > itpp::elem_div const Num_T  t,
const Vec< Num_T > &  v
[inline]
 

Elementwise division.

Definition at line 965 of file vec.h.

template<class Num_T>
const Vec< Num_T > itpp::concat const Vec< Num_T > &  v,
const Num_T  a
 

Append element a to the end of the vector v.

Definition at line 1092 of file vec.h.

template<class Num_T>
const Vec< Num_T > itpp::concat const Num_T  a,
const Vec< Num_T > &  v
 

Concat element a to the beginning of the vector v.

Definition at line 1104 of file vec.h.

template<class Num_T>
const Vec< Num_T > itpp::concat const Vec< Num_T > &  v1,
const Vec< Num_T > &  v2
 

Concat vectors v1 and v2.

Definition at line 1117 of file vec.h.

template<class Num_T>
const Vec< Num_T > itpp::concat const Vec< Num_T > &  v1,
const Vec< Num_T > &  v2,
const Vec< Num_T > &  v3
 

Concat vectors v1, v2 and v3.

Definition at line 1132 of file vec.h.

template<class Num_T>
const Vec< Num_T > itpp::concat const Vec< Num_T > &  v1,
const Vec< Num_T > &  v2,
const Vec< Num_T > &  v3,
const Vec< Num_T > &  v4
 

Concat vectors v1, v2, v3 and v4.

Definition at line 1151 of file vec.h.

template<class Num_T>
const Vec< Num_T > itpp::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
 

Concat vectors v1, v2 v3, v4 and v5.

Definition at line 1173 of file vec.h.

SourceForge Logo

Generated on Fri Jan 11 08:51:39 2008 for IT++ by Doxygen 1.3.9.1