Functions | |
| Array< T > & | Array::transpose () |
| Returns the transposition of the current array. | |
| template<class T > | |
| Array< T > | innerProduct (const Array< T > &v, const Array< T > &w) |
| Returns the inner product of the two arrays "v" and "w". | |
| template<class T > | |
| Array< T > | outerProduct (const Array< T > &v, const Array< T > &w) |
| Returns the outer product of the two arrays "v" and "w". | |
| template<class T > | |
| T | scalarProduct (const Array< T > &v, const Array< T > &w) |
| Returns the scalar product of the two arrays "v" and "w". | |
| template<class T > | |
| T | sqrDistance (const Array< T > &v, const Array< T > &w) |
| Returns the square distance between the two arrays "v" and "w". | |
| template<class T > | |
| T | euclidianDistance (const Array< T > &v, const Array< T > &w) |
| Returns the euclidian distance between the two arrays "v" and "w". | |
| template<class T > | |
| T | sum (const Array< T > &v) |
| Returns the sum of all values in array "v". | |
| template<class T > | |
| T | sumOfAbs (const Array< T > &v) |
| Returns the sum of all absolute values in array "v". | |
| template<class T > | |
| T | sumOfSqr (const Array< T > &v) |
| Returns the sum of all square values in array "v". | |
| template<class T > | |
| T | product (const Array< T > &v) |
| Returns the product of all values in array "v". | |
Returns the euclidian distance between the two arrays "v" and "w".
The euclidian distance
is evaluated as

where
is the total number of elements in each array and the single elements are taken in the order as they are stored in the element vector Array::e.
Notice, that the two arrays must have the same number of elements.
| v | the first array. | |
| w | the second array. |
| check_exception | the type of the exception will be "size mismatch" and indicates that the two arrays v and w have different sizes |
Definition at line 859 of file ArrayOp.h.
References sqrDistance().
Returns the inner product of the two arrays "v" and "w".
The inner product, also known as the scalar product of two vectors
and
with dimension
is a scalar value
given as

You can also use this method for vectors as one-dimensional arrays, but this method is a generalization of the scalar product and is especially written for N-dimensional arrays with
.
Therefore the method will always return an array of scalar values. If you want to calculate the "original" scalar product for two vectors, it is more handy to use the method scalarProduct, because this method will return a single scalar value.
If you use arrays that represent two matrices
with dimensions
and
with dimensions
with
and
then the result is a matrix
with dimensions
. Each scalar value of
is calculated by multiplying each "row" of matrix
with each column of matrix
, where "row" means always the first dimension of a matrix and "column" the last dimension. The multiplication results are then added together.
| v | the first array. | |
| w | the second array. |
| check_exception | the type of the exception will be "size mismatch" and means that you've called the method with two one-dimensional arrays, but these vectors have different sizes |
Definition at line 575 of file ArrayOp.h.
References ArrayBase::dim(), Array< T >::elem(), ArrayBase::ndim(), ArrayBase::nelem(), ArrayBase::resize(), and scalarProduct().
Returns the outer product of the two arrays "v" and "w".
The outer product, also known as the dyadic product of a vector
with dimension
and a vector
with dimension
is a matrix
given as

where
is a
matrix with
for
and
.
This method is a generalization, it works not only for vectors as one-dimensional arrays, but also for N-dimensional arrays with
.
Given two matrices
with dimensions
and
with dimensions
the result is an matrix
with dimensions
, where
for 
| v | the first array. | |
| w | the second array. |
Definition at line 677 of file ArrayOp.h.
References ArrayBase::dim(), Array< T >::elem(), ArrayBase::ndim(), ArrayBase::nelem(), and ArrayBase::resize().
| T product | ( | const Array< T > & | v | ) | [inline] |
Returns the product of all values in array "v".
The product is evaluated as

where
is the total number of values in the array and the single values are taken in the order as they are stored in the element vector Array::e.
| v | the array of which the product will be calculated |

Definition at line 1004 of file ArrayOp.h.
References Array< T >::elem(), and ArrayBase::nelem().
Returns the scalar product of the two arrays "v" and "w".
The scalar product, also known as the inner product of two vectors
and
with dimension
is a scalar value
given as

Here, the two arrays v and w are interpreted as one-dimensional arrays, by using the element vectors Array::e of both. So you can use this method for two N-dimensional arrays with
, but will always receive a single scalar value.
If you want to calculate the inner product for those arrays with respect to the number of dimensions, use method innerProduct.
| v | the first array. | |
| w | the second array. |
of the element vectors of the two arrays | check_exception | the type of the exception will be "size mismatch" and means that the two vectors have different sizes |
Definition at line 767 of file ArrayOp.h.
References Array< T >::elem(), ArrayBase::nelem(), and ArrayBase::samedim().
Referenced by innerProduct().
Returns the square distance between the two arrays "v" and "w".
The square distance
is evaluated as

where
is the total number of elements in each array and the single elements are taken in the order as they are stored in the element vector Array::e.
Notice, that the two arrays must have the same number of elements.
| v | the first array. | |
| w | the second array. |
| check_exception | the type of the exception will be "size mismatch" and indicates that the two arrays v and w have different sizes |
Definition at line 811 of file ArrayOp.h.
References Array< T >::elem(), ArrayBase::nelem(), and ArrayBase::samedim().
Referenced by euclidianDistance().
| T sum | ( | const Array< T > & | v | ) | [inline] |
Returns the sum of all values in array "v".
The sum is evaluated as

where
is the total number of values in the array and the single values are taken in the order as they are stored in the element vector Array::e.
| v | the array of which the sum will be calculated |

Definition at line 894 of file ArrayOp.h.
References Array< T >::elem(), and ArrayBase::nelem().
| T sumOfAbs | ( | const Array< T > & | v | ) | [inline] |
Returns the sum of all absolute values in array "v".
The sum is evaluated as

where
is the total number of values in the array and the single values are taken in the order as they are stored in the element vector Array::e.
| v | the array of which the sum will be calculated |

Definition at line 930 of file ArrayOp.h.
References Array< T >::elem(), and ArrayBase::nelem().
| T sumOfSqr | ( | const Array< T > & | v | ) | [inline] |
Returns the sum of all square values in array "v".
The sum is evaluated as

where
is the total number of values in the array and the single values are taken in the order as they are stored in the element vector Array::e.
| v | the array of which the sum will be calculated |

Definition at line 967 of file ArrayOp.h.
References Array< T >::elem(), and ArrayBase::nelem().
Returns the transposition of the current array.
See the current array as matrix
, then the transposed matrix
is returned.

then the transposed array will be
