LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Loading...
Searching...
No Matches
eig.h File Reference

Eigenvalues and singular values, backed by LAPACK. More...

#include <complex>
#include <cstddef>
#include <vector>
#include "line/util/error.h"
#include "line/util/matrix.h"
Include dependency graph for eig.h:

Go to the source code of this file.

Classes

struct  line::RealSchur
 Real Schur factorization A = Z T Z^T, with Z orthogonal and T upper quasi-triangular: 1 x 1 diagonal blocks for real eigenvalues and 2 x 2 blocks for complex conjugate pairs. More...

Namespaces

namespace  line

Functions

std::vector< std::complex< double > > line::eig_values (const Matrix< double > &A)
 Eigenvalues of a general real square matrix, in LAPACK's order.
double line::spectral_radius (const Matrix< double > &A)
 Largest modulus over the spectrum, i.e.
double line::subdominant_modulus (const Matrix< double > &A)
 Second largest modulus over the spectrum.
std::vector< double > line::svd_values (const Matrix< double > &A)
 Singular values in descending order.
RealSchur line::schur_decomposition (const Matrix< double > &A)
 Real Schur factorization of a general square matrix (LAPACK dgees, unsorted).
RealSchur line::schur_reorder (const RealSchur &s, const std::vector< double > &key)
 Reorder the diagonal blocks of a real Schur form into DESCENDING key order, stably, updating Z so that A = Z T Z^T still holds.
std::size_t line::matrix_rank (const Matrix< double > &A)
 Numerical rank at the standard max(m,n) eps sigma_1 threshold.

Detailed Description

Eigenvalues and singular values, backed by LAPACK.

LAPACK is BSD-3, so it is the one external numerical dependency that costs the port nothing in licensing terms: it links cleanly into a BSD-licensed binary and, unlike GMP or MPFR, imposes no relinking obligation. It is requested through the Fortran symbols directly (dgeev_, dgesvd_) rather than through LAPACKE, because the reference distribution ships the library without the C headers.

DOUBLE ONLY, and deliberately so. Eigenvalues of a rational matrix are algebraic numbers, not rationals: there is no exact instantiation to offer, and a high-precision one would need a multiprecision QR iteration that LAPACK cannot provide. Both entry points therefore take Matrix<double>, and callers templated on T must convert and document the precision loss at that point rather than pretending otherwise.

When the build is configured without LAPACK the entry points throw UnsupportedError naming the missing dependency, which is the same refuse-by-name policy the CLI uses for unported features: a caller learns what is missing instead of receiving a silently substituted answer.

Definition in file eig.h.