All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Structured Matrix Types

Warning
  Structured matrix types are experimental in ViennaCL. Interface changes as well as considerable performance improvements may be included in future releases!

There are a number of structured dense matrices for which some algorithms such as matrix-vector products can be computed with much lower computational effort than for the general dense matrix case. In the following, four structured dense matrix types included in ViennaCL are discussed. Example code can be found in `examples/tutorial/structured-matrices.cpp`.

# Circulant Matrix

A circulant matrix is a matrix of the form

and available in ViennaCL via

#include "viennacl/circulant_matrix.hpp"
std::size_t s = 42;
viennacl::circulant_matrix circ_mat(s, s);

The `circulant_matrix` type can be manipulated in the same way as the dense matrix type `matrix`. Note that writing to a single element of the matrix is structure-preserving, e.g. changing `circ_mat(1,2)` will automatically update `circ_mat(0,1)`, `circ_mat(2,3)` and so on.

# Hankel Matrix

A Hankel matrix is a matrix of the form

and available in ViennaCL via

#include "viennacl/hankel_matrix.hpp"
std::size_t s = 42;
viennacl::hankel_matrix hank_mat(s, s);

The `hankel_matrix` type can be manipulated in the same way as the dense matrix type `matrix`. Note that writing to a single element of the matrix is structure-preserving, e.g. changing `hank_mat(1,2)` in the example above will also update `hank_mat(0,3)`, `hank_mat(2,1)`, `hank_mat(3,0)`, etc.

# Toeplitz Matrix

A Toeplitz matrix is a matrix of the form

and available in ViennaCL via

#include "viennacl/toeplitz_matrix.hpp"
std::size_t s = 42;
viennacl::toeplitz_matrix toep_mat(s, s);

The `toeplitz_matrix` type can be manipulated in the same way as the dense matrix type `matrix`. Note that writing to a single element of the matrix is structure-preserving, e.g. changing `toep_mat(1,2)` in the example above will also update `toep_mat(0,1)`, `toep_mat(2,3)`, etc.

# Vandermonde Matrix

A Vandermonde matrix is a matrix of the form

and available in ViennaCL via

#include "viennacl/vandermonde_matrix.hpp"
std::size_t s = 42;
viennacl::vandermonde_matrix vand_mat(s, s);

The `vandermonde_matrix` type can be manipulated in the same way as the dense matrix type `matrix`, but restrictions apply. For example, the addition or subtraction of two Vandermonde matrices does not yield another Vandermonde matrix. Note that writing to a single element of the matrix is structure-preserving, e.g. changing `vand_mat(1,2)` in the example above will automatically update `vand_mat(1,3)`, `vand_mat(1,4)`, etc.