Functions | |
vec | itpp::ones (int size) |
A float vector of ones. | |
bvec | itpp::ones_b (int size) |
A Binary vector of ones. | |
ivec | itpp::ones_i (int size) |
A Int vector of ones. | |
cvec | itpp::ones_c (int size) |
A float Complex vector of ones. | |
mat | itpp::ones (int rows, int cols) |
A float (rows,cols)-matrix of ones. | |
bmat | itpp::ones_b (int rows, int cols) |
A Binary (rows,cols)-matrix of ones. | |
imat | itpp::ones_i (int rows, int cols) |
A Int (rows,cols)-matrix of ones. | |
cmat | itpp::ones_c (int rows, int cols) |
A Double Complex (rows,cols)-matrix of ones. | |
vec | itpp::zeros (int size) |
A Double vector of zeros. | |
bvec | itpp::zeros_b (int size) |
A Binary vector of zeros. | |
ivec | itpp::zeros_i (int size) |
A Int vector of zeros. | |
cvec | itpp::zeros_c (int size) |
A Double Complex vector of zeros. | |
mat | itpp::zeros (int rows, int cols) |
A Double (rows,cols)-matrix of zeros. | |
bmat | itpp::zeros_b (int rows, int cols) |
A Binary (rows,cols)-matrix of zeros. | |
imat | itpp::zeros_i (int rows, int cols) |
A Int (rows,cols)-matrix of zeros. | |
cmat | itpp::zeros_c (int rows, int cols) |
A Double Complex (rows,cols)-matrix of zeros. | |
mat | itpp::eye (int size) |
A Double (size,size) unit matrix. | |
bmat | itpp::eye_b (int size) |
A Binary (size,size) unit matrix. | |
imat | itpp::eye_i (int size) |
A Int (size,size) unit matrix. | |
cmat | itpp::eye_c (int size) |
A Double Complex (size,size) unit matrix. | |
template<class T > | |
void | itpp::eye (int size, Mat< T > &m) |
A non-copying version of the eye function. | |
vec | itpp::impulse (int size) |
Impulse vector. | |
vec | itpp::linspace (double from, double to, int length=100) |
Linspace (works in the same way as the matlab version). | |
vec | itpp::zigzag_space (double t0, double t1, int K=5) |
Zig-zag space function (variation on linspace). | |
imat | itpp::hadamard (int size) |
Hadamard matrix. | |
imat | itpp::jacobsthal (int p) |
Jacobsthal matrix. | |
imat | itpp::conference (int n) |
Conference matrix. | |
template<typename Num_T > | |
const Mat< Num_T > | itpp::toeplitz (const Vec< Num_T > &c, const Vec< Num_T > &r) |
Generate Toeplitz matrix from two vectors c and r . | |
template<typename Num_T > | |
const Mat< Num_T > | itpp::toeplitz (const Vec< Num_T > &c) |
Generate symmetric Toeplitz matrix from vector c . | |
template<> | |
const cmat | itpp::toeplitz (const cvec &c) |
Generate symmetric Toeplitz matrix from vector c (complex valued). |
imat itpp::conference | ( | int | n | ) |
Conference matrix.
Constructs an n by n matrix C, where n=p^m+1=2 (mod 4) and p is a odd prime (not checked). This code only work with m=1, that is n=p+1 and p odd prime. The valid sizes of n is then n=6, 14, 18, 30, 38, ... (and not 10, 26, ...). C has the property that C*C'=(n-1)I, that is it has orthogonal rows and columns in the same way as Hadamard matricies. However, one element in each row (on the diagonal) is zeros. The others are {-1,+1}.
For more details see pp. 55-58 in MacWilliams & Sloane "The theory of error correcting codes", North-Holland, 1977.
References it_assert_debug, and itpp::jacobsthal().
imat itpp::hadamard | ( | int | size | ) |
Hadamard matrix.
This function constructs a size by size Hadammard matrix, where size is a power of 2.
References itpp::ceil_i(), it_assert, itpp::log2(), itpp::pow2(), and itpp::pow2i().
imat itpp::jacobsthal | ( | int | p | ) |
Jacobsthal matrix.
Constructs an p by p matrix Q where p is a prime (not checked). The elements in Q {qij} is given by qij=X(j-i), where X(x) is the Legendre symbol given as:
See Wicker "Error Control Systems for digital communication and storage", p. 134 for more information on these topics. Do not check that p is a prime.
Referenced by itpp::conference().
const Mat<Num_T> itpp::toeplitz | ( | const Vec< Num_T > & | c, | |
const Vec< Num_T > & | r | |||
) | [inline] |
Generate Toeplitz matrix from two vectors c
and r
.
Returns the Toeplitz matrix constructed given the first column C, and (optionally) the first row R. If the first element of C is not the same as the first element of R, the first element of C is used. If the second argument is omitted, the first row is taken to be the same as the first column and a symmetric (Hermitian) Toeplitz matrix is created.
An example square Toeplitz matrix has the form:
* c(0) r(1) r(2) ... r(n) * c(1) c(0) r(1) r(n-1) * c(2) c(1) c(0) r(n-2) * . . * . . * . . * * c(n) c(n-1) c(n-2) ... c(0) *
References itpp::min(), and itpp::Vec< Num_T >::size().
vec itpp::zigzag_space | ( | double | t0, | |
double | t1, | |||
int | K = 5 | |||
) |
Zig-zag space function (variation on linspace).
This function is a variation on linspace(). It traverses the points in different order. For example
zigzag_space(-5,5,3)
[-5 5 0 -2.5 2.5 -3.75 -1.25 1.25 3.75]
zigzag_space(-5,5,4)
[-5 5 0 -2.5 2.5 -3.75 -1.25 1.25 3.75 -4.375 -3.125 -1.875 -0.625 0.625 1.875 3.125 4.375]
I.e. the function samples the interval [t0,t1] with finer and finer density and with points uniformly distributed over the interval, rather than from left to right (as does linspace).
The result is a vector of length 1+2^K.
References it_assert, itpp::length(), itpp::linspace(), and itpp::zeros().