Eigen-Contrib  5.0.1
 
Loading...
Searching...
No Matches
Eigen::Circulant< Scalar_, Size_ > Class Template Reference

#include <contrib/Eigen/src/StructuredMatrices/Circulant.h>

Detailed Description

template<typename Scalar_, int Size_>
class Eigen::Circulant< Scalar_, Size_ >

An n x n circulant matrix represented by its first column.

For first column \(c\) and unitary DFT matrix \(F\),

\[ C_{ij}=c_{(i-j)\bmod n}, \qquad C=F^*\operatorname{diag}(Fc)F. \]

Thus its eigenvalues – the operator's symbol – are \(Fc\), computed once at construction and reused by every product. This yields an O(n log n) matrix-vector product (operator*), an O(n log n) direct (pseudo-inverse) solve (solve), and closed-form factorizations: the eigendecomposition (eigenvalues, eigenvectors) and the SVD (singularValues, matrixU, matrixV) in the Fourier basis, plus rank, inverse and determinant. The class is closed under transpose, conjugate and adjoint, which reuse the cached symbol instead of recomputing FFTs.

The operator stores its own copy of the generating column and derives from EigenBase. Because operator* returns an Eigen product expression, a Circulant also drops into the matrix-free iterative solvers, and it can be assigned to a dense matrix when an explicit representation is needed. As with any matrix-free operator, the iterative solvers must be instantiated with IdentityPreconditioner (e.g. ConjugateGradient<Circulant<double>,Lower|Upper,IdentityPreconditioner>): the default preconditioners read individual coefficients through col() or InnerIterator, which the structured operators do not expose.

Template Parameters
Scalar_the scalar type, real or complex.
Size_the dimension at compile time, or Dynamic (the default).
See also
class Toeplitz, makeCirculant()
+ Inheritance diagram for Eigen::Circulant< Scalar_, Size_ >:

Public Member Functions

Circulant adjoint () const
 
template<typename Derived>
 Circulant (const MatrixBase< Derived > &col)
 
Scalar coeff (Index row, Index col) const
 
const GeneratorType & column () const
 
Circulant conjugate () const
 
Scalar determinant () const
 
ComplexVector eigenvalues () const
 
ComplexMatrix eigenvectors () const
 
Circulant inverse () const
 
ComplexMatrix matrixU () const
 
ComplexMatrix matrixV () const
 
template<typename Rhs>
Product< Circulant, Rhs > operator* (const MatrixBase< Rhs > &x) const
 
Index rank () const
 
RealVector singularValues () const
 
template<typename Rhs>
Matrix< Scalar, Size_, Rhs::ColsAtCompileTime > solve (const MatrixBase< Rhs > &b) const
 
ComplexVector symbol () const
 
Circulant transpose () const
 

Constructor & Destructor Documentation

◆ Circulant()

template<typename Scalar_, int Size_>
template<typename Derived>
Eigen::Circulant< Scalar_, Size_ >::Circulant ( const MatrixBase< Derived > & col)
inlineexplicit

Builds a circulant matrix from its first column col.

When the matrix is large enough for products to take the FFT path, the DFT of col – the eigenvalues of the matrix – is computed here, once, and reused by every subsequent product and solve.

Member Function Documentation

◆ adjoint()

template<typename Scalar_, int Size_>
Circulant Eigen::Circulant< Scalar_, Size_ >::adjoint ( ) const
inline
Returns
the adjoint of *this, itself a Circulant operator. The cached symbols, when present, are reused: the symbols of the adjoint are the elementwise conjugates of the symbols (the eigenvalues conjugate while the Fourier eigenbasis stays fixed).

◆ coeff()

template<typename Scalar_, int Size_>
Scalar Eigen::Circulant< Scalar_, Size_ >::coeff ( Index row,
Index col ) const
inline
Returns
the coefficient at row row and column col.

◆ column()

template<typename Scalar_, int Size_>
const GeneratorType & Eigen::Circulant< Scalar_, Size_ >::column ( ) const
inline
Returns
the generating first column.

◆ conjugate()

template<typename Scalar_, int Size_>
Circulant Eigen::Circulant< Scalar_, Size_ >::conjugate ( ) const
inline
Returns
the complex conjugate of *this, itself a Circulant operator. The cached symbols, when present, are reused: the symbols of the conjugate are the conjugated index reversals of the symbols.

◆ determinant()

template<typename Scalar_, int Size_>
Scalar Eigen::Circulant< Scalar_, Size_ >::determinant ( ) const
inline
Returns
the determinant, i.e. the product of the eigenvalues (the symbol entries). The product is accumulated in the balanced form m * 2^e (the split fraction/exponent determinant convention of LINPACK's xGEDI [4]) – every factor and the running product are renormalized to unit magnitude with the power of two tracked separately – so the partial products can neither overflow nor underflow when the determinant itself is representable, whatever the ordering of large and small eigenvalues. For a real operator the product is real up to roundoff, and its real part is returned.

◆ eigenvalues()

template<typename Scalar_, int Size_>
ComplexVector Eigen::Circulant< Scalar_, Size_ >::eigenvalues ( ) const
inline
Returns
the eigenvalues: eigenvalue k is symbol()[k], and its (unit-norm) eigenvector is the Fourier vector f_k with \( (f_k)_j = e^{2\pi i j k / n} / \sqrt{n} \), see eigenvectors. Every circulant matrix is diagonalized by this same Fourier basis.

◆ eigenvectors()

template<typename Scalar_, int Size_>
ComplexMatrix Eigen::Circulant< Scalar_, Size_ >::eigenvectors ( ) const
inline
Returns
the unitary matrix of eigenvectors: column k is the Fourier vector f_k matching eigenvalues()[k].
Note
The eigenvector matrix is materialized as a dense n x n matrix; unlike the other methods of this class this costs O(n^2) storage.

◆ inverse()

template<typename Scalar_, int Size_>
Circulant Eigen::Circulant< Scalar_, Size_ >::inverse ( ) const
inline
Returns
the inverse of *this, itself a Circulant operator: the one generated by ifft(1 ./ symbol), the first column of the inverse matrix.
Warning
The operator must be non-singular; use solve for a pseudo-inverse solve of a rank-deficient operator.

◆ matrixU()

template<typename Scalar_, int Size_>
ComplexMatrix Eigen::Circulant< Scalar_, Size_ >::matrixU ( ) const
inline
Returns
the matrix of left singular vectors U: column t is the Fourier vector of the t-th largest symbol entry, scaled by its phase (phase 1 for a zero entry). Dense n x n, see the note in eigenvectors.

◆ matrixV()

template<typename Scalar_, int Size_>
ComplexMatrix Eigen::Circulant< Scalar_, Size_ >::matrixV ( ) const
inline
Returns
the matrix of right singular vectors V: column t is the Fourier vector of the t-th largest symbol entry. Dense n x n, see the note in eigenvectors.

◆ operator*()

template<typename Scalar_, int Size_>
template<typename Rhs>
Product< Circulant, Rhs > Eigen::Circulant< Scalar_, Size_ >::operator* ( const MatrixBase< Rhs > & x) const
inline
Returns
the product expression (*this) * x, evaluated through a fast FFT-based matrix-vector product. The expression carries the default product tag, so assigning it behaves like any dense product: a temporary resolves aliasing between the destination and x, and .noalias() skips it.

◆ rank()

template<typename Scalar_, int Size_>
Index Eigen::Circulant< Scalar_, Size_ >::rank ( ) const
inline
Returns
the numerical rank: the number of symbol entries whose modulus is no smaller than the threshold n * epsilon * max_k|symbol[k]|, clamped from below by the smallest normal number. This is the same threshold solve uses to decide which Fourier components to invert, and the comparison is strict like SVDBase's, so an entry sitting exactly on the threshold still counts as non-zero.

◆ singularValues()

template<typename Scalar_, int Size_>
RealVector Eigen::Circulant< Scalar_, Size_ >::singularValues ( ) const
inline
Returns
the singular values, sorted in decreasing order: the moduli of the symbol entries. The ordering is shared with matrixU and matrixV, so together they form the SVD *this = U * singularValues().asDiagonal() * V^H. A real operator has a conjugate-symmetric symbol, so the two modes of a conjugate pair carry exactly equal singular values.

◆ solve()

template<typename Scalar_, int Size_>
template<typename Rhs>
Matrix< Scalar, Size_, Rhs::ColsAtCompileTime > Eigen::Circulant< Scalar_, Size_ >::solve ( const MatrixBase< Rhs > & b) const
inline
Returns
the minimum-norm least-squares solution of (*this) * x = b, computed directly in the Fourier domain. Symbol entries whose modulus reaches the rank threshold (see rank) are inverted; the remaining ones are treated as exact zeros, so the result is the pseudo-inverse applied to b. For a non-singular operator this is the exact solution x = ifft( fft(b) ./ fft(c) ). Supports multiple right-hand sides.

◆ symbol()

template<typename Scalar_, int Size_>
ComplexVector Eigen::Circulant< Scalar_, Size_ >::symbol ( ) const
inline
Returns
the symbol of the operator, i.e. the DFT of the generating column. Its entries are the eigenvalues of the matrix. Cached when the operator is large enough for products to take the FFT path, computed on the fly for small operators.

◆ transpose()

template<typename Scalar_, int Size_>
Circulant Eigen::Circulant< Scalar_, Size_ >::transpose ( ) const
inline
Returns
the transpose of *this, itself a Circulant operator: the one generated by the index-reversed column. The cached symbols, when present, are reused – the symbols of the transpose are the index reversals of the symbols – so no FFT is recomputed.

The documentation for this class was generated from the following file: