Eigen-Contrib  5.0.1
 
Loading...
Searching...
No Matches
Eigen::Vandermonde< Scalar_, Rows_, Cols_ > Class Template Reference

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

Detailed Description

template<typename Scalar_, int Rows_, int Cols_>
class Eigen::Vandermonde< Scalar_, Rows_, Cols_ >

An m x n Vandermonde matrix represented by its node vector.

A Vandermonde matrix has entry (i,j) equal to \( x_i^j \), where x is the node vector. Thus

\[ (Va)_i = \sum_{j=0}^{n-1} a_j x_i^j, \qquad p_{n-1}=a_{n-1},\quad p_j=a_j+x_i p_{j+1}. \]

The class stores only the m nodes; products evaluate this Horner recurrence at all nodes at once in O(mn) operations – the same cost as a dense product, but with O(m) storage and without ever forming the matrix.

Square systems are solved in O(n^2) by the Björck-Pereyra algorithm (class BjorckPereyra), whose transpose().solve() form covers the dual (moment) system. There is no fast transposed product, so the class is not closed under transposition and rectangular least-squares problems are best handled by a dense QR of the materialized matrix.

Because operator* returns an Eigen product expression, a Vandermonde 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. BiCGSTAB<Vandermonde<double>,IdentityPreconditioner>): the default preconditioners read individual coefficients through col() or InnerIterator, which the structured operators do not expose.

Warning
Vandermonde matrices with real nodes are exponentially ill-conditioned: the condition number grows at least like \( 2^n \) for any real node configuration (Beckermann, 2000). Solves remain surprisingly accurate for monotone node sets and sign-alternating right-hand sides (Björck-Pereyra's celebrated property, see Higham, ASNA ch. 22), but forward errors necessarily scale with the conditioning in general. Complex nodes on the unit circle are the well-conditioned case: for the n-th roots of unity, \( V/\sqrt{n} \) is unitary.
Template Parameters
Scalar_a floating-point-like real or complex scalar supporting Eigen's scalar math hooks, including isfinite, frexp and ldexp (and log for complex solver ordering). Integer types are rejected.
Rows_the number of rows (nodes) at compile time, or Dynamic.
Cols_the number of columns (powers) at compile time, or Dynamic.
See also
class BjorckPereyra, makeVandermonde()
+ Inheritance diagram for Eigen::Vandermonde< Scalar_, Rows_, Cols_ >:

Public Member Functions

Scalar coeff (Index row, Index col) const
 
Scalar determinant () const
 
const NodeVector & nodes () const
 
template<typename Rhs>
Product< Vandermonde, Rhs > operator* (const MatrixBase< Rhs > &a) const
 
template<typename Derived>
 Vandermonde (const MatrixBase< Derived > &nodes)
 
template<typename Derived>
 Vandermonde (const MatrixBase< Derived > &nodes, Index cols)
 

Constructor & Destructor Documentation

◆ Vandermonde() [1/2]

template<typename Scalar_, int Rows_, int Cols_>
template<typename Derived>
Eigen::Vandermonde< Scalar_, Rows_, Cols_ >::Vandermonde ( const MatrixBase< Derived > & nodes,
Index cols )
inline

Builds an m x cols Vandermonde matrix from the m nodes nodes.

◆ Vandermonde() [2/2]

template<typename Scalar_, int Rows_, int Cols_>
template<typename Derived>
Eigen::Vandermonde< Scalar_, Rows_, Cols_ >::Vandermonde ( const MatrixBase< Derived > & nodes)
inlineexplicit

Builds the square Vandermonde matrix of the nodes nodes.

Member Function Documentation

◆ coeff()

template<typename Scalar_, int Rows_, int Cols_>
Scalar Eigen::Vandermonde< Scalar_, Rows_, Cols_ >::coeff ( Index row,
Index col ) const
inline
Returns
the coefficient at row row and column col, \( x_i^j \).

◆ determinant()

template<typename Scalar_, int Rows_, int Cols_>
Scalar Eigen::Vandermonde< Scalar_, Rows_, Cols_ >::determinant ( ) const
inline
Returns
the determinant of a square Vandermonde matrix through the closed form \( \prod_{i<j} (x_j - x_i) \), in O(n^2) operations. The product is accumulated in the balanced form m * 2^e (the split fraction/exponent determinant convention of LINPACK's xGEDI [3]) – every factor and the running product are renormalized to unit magnitude with the power of two tracked separately, an exact rescaling [2] – so the partial products can neither overflow nor underflow when the determinant itself is representable, whatever the spread of the nodes. Zero factors (repeated nodes, giving an exactly singular matrix) and non-finite factors propagate exactly; a node difference that overflows makes the determinant infinite, or NaN when a zero factor is also present.

◆ nodes()

template<typename Scalar_, int Rows_, int Cols_>
const NodeVector & Eigen::Vandermonde< Scalar_, Rows_, Cols_ >::nodes ( ) const
inline
Returns
the node vector.

◆ operator*()

template<typename Scalar_, int Rows_, int Cols_>
template<typename Rhs>
Product< Vandermonde, Rhs > Eigen::Vandermonde< Scalar_, Rows_, Cols_ >::operator* ( const MatrixBase< Rhs > & a) const
inline
Returns
the product expression (*this) * a: the polynomial with ascending coefficients a (per column) evaluated at every node by Horner's rule, at O(mn) operations and O(m) extra storage. The expression carries the default product tag, so assigning it behaves like any dense product: a temporary resolves aliasing between the destination and a, and .noalias() skips it.

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