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
.
A circulant matrix is a matrix of the form
and available in ViennaCL via
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.
A Hankel matrix is a matrix of the form
and available in ViennaCL via
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.
A Toeplitz matrix is a matrix of the form
and available in ViennaCL via
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.
A Vandermonde matrix is a matrix of the form
and available in ViennaCL via
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.