Special Matrices
Base Module

## Functions

ITPP_EXPORT vec | itpp::ones (int size)
| A float vector of ones.
ITPP_EXPORT bvec | itpp::ones_b (int size)
| A Binary vector of ones.
ITPP_EXPORT ivec | itpp::ones_i (int size)
| A Int vector of ones.
ITPP_EXPORT cvec | itpp::ones_c (int size)
| A float Complex vector of ones.
ITPP_EXPORT mat | itpp::ones (int rows, int cols)
| A float (rows,cols)-matrix of ones.
ITPP_EXPORT bmat | itpp::ones_b (int rows, int cols)
| A Binary (rows,cols)-matrix of ones.
ITPP_EXPORT imat | itpp::ones_i (int rows, int cols)
| A Int (rows,cols)-matrix of ones.
ITPP_EXPORT cmat | itpp::ones_c (int rows, int cols)
| A Double Complex (rows,cols)-matrix of ones.
ITPP_EXPORT vec | itpp::zeros (int size)
| A Double vector of zeros.
ITPP_EXPORT bvec | itpp::zeros_b (int size)
| A Binary vector of zeros.
ITPP_EXPORT ivec | itpp::zeros_i (int size)
| A Int vector of zeros.
ITPP_EXPORT cvec | itpp::zeros_c (int size)
| A Double Complex vector of zeros.
ITPP_EXPORT mat | itpp::zeros (int rows, int cols)
| A Double (rows,cols)-matrix of zeros.
ITPP_EXPORT bmat | itpp::zeros_b (int rows, int cols)
| A Binary (rows,cols)-matrix of zeros.
ITPP_EXPORT imat | itpp::zeros_i (int rows, int cols)
| A Int (rows,cols)-matrix of zeros.
ITPP_EXPORT cmat | itpp::zeros_c (int rows, int cols)
| A Double Complex (rows,cols)-matrix of zeros.
ITPP_EXPORT mat | itpp::eye (int size)
| A Double (size,size) unit matrix.
ITPP_EXPORT bmat | itpp::eye_b (int size)
| A Binary (size,size) unit matrix.
ITPP_EXPORT imat | itpp::eye_i (int size)
| A Int (size,size) unit matrix.
ITPP_EXPORT 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)
template<class T >
Vec< T > | itpp::linspace_fixed_step (T from, T to, T step=1)
| linspace_fixed_step (works in the same way as "from:step:to" in MATLAB)
vec | itpp::zigzag_space (double t0, double t1, int K=5)
| Zig-zag space function (variation on linspace) More...
imat | itpp::hadamard (int size)
| Hadamard matrix. More...
imat | itpp::jacobsthal (int p)
| Jacobsthal matrix. More...
imat | itpp::conference (int n)
| Conference matrix. More...
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`. More...
template<typename Num_T >
const Mat< Num_T > | itpp::toeplitz (const Vec< Num_T > &c)
| Generate symmetric Toeplitz matrix from vector `c`.
const cmat | itpp::toeplitz (const cvec &c)
| Generate symmetric Toeplitz matrix from vector `c` (complex valued)

## Detailed Description

## Function Documentation

ITPP_EXPORT 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)

gives the vector

[-5 5 0 -2.5 2.5 -3.75 -1.25 1.25 3.75]

and

zigzag_space(-5,5,4)

gives the vector

[-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]

and so on.

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.

Definition at line 125 of file specmat.cpp.

References itpp::concat(), it_assert, itpp::length(), itpp::linspace(), and itpp::zeros().

ITPP_EXPORT imat itpp::hadamard | ( | int | size | ) |

Hadamard matrix.

This function constructs a size by size Hadammard matrix, where size is a power of 2.

Definition at line 149 of file specmat.cpp.

References itpp::ceil_i(), it_assert, itpp::log2(), itpp::pow2(), and itpp::pow2i().

ITPP_EXPORT 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:

- X(x)=0 if x is a multiple of p,
- X(x)=1 if x is a quadratic residue modulo p,
- X(x)=-1 if x is a quadratic nonresidue modulo p.

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.

Definition at line 172 of file specmat.cpp.

Referenced by itpp::conference().

ITPP_EXPORT 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.

Definition at line 196 of file specmat.cpp.

References it_assert_debug, and itpp::jacobsthal().

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`.

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)
    *

Author
  Adam Piatyszek

Definition at line 229 of file specmat.h.

References itpp::min(), and itpp::Vec< Num_T >::size().

Generated on Thu Aug 20 2015 21:02:52 for IT++ by Doxygen 1.8.9.1