consteig
Compile-time eigenvalue and eigenvector computation for C++17
Loading...
Searching...
No Matches
Macros
Configuration Macros

Compile-time options for tuning solver behavior and precision. More...

Macros

#define CONSTEIG_MAX_ITER   500
 Maximum QR iterations per eigenvalue block.
 
#define CONSTEIG_DEFAULT_SYMMETRIC_TOLERANCE   1e-6
 Symmetry routing threshold for eigensolver selection.
 
#define CONSTEIG_BALANCE_CONVERGENCE_THRESHOLD   0.95
 Stopping criterion for the matrix balancing step.
 
#define E_CONST   2.71828182845904523536028747135266249775724709369995
 Euler's number e to 50 significant digits.
 
#define PI_CONST   3.14159265358979323846264338327950288419716939937510
 The constant π to 50 significant digits.
 
#define CONSTEIG_TRIG_MAX_ITER   20
 Maximum Taylor series iterations for trigonometric functions.
 

Detailed Description

Compile-time options for tuning solver behavior and precision.

All macros are guarded by #ifndef so they can be overridden by defining them before including consteig.hpp, or by passing -DMACRO=value to the compiler. The defaults are well-tested; change them only if you have a specific need (e.g., very large matrices or pathological inputs).

Macro Definition Documentation

◆ CONSTEIG_MAX_ITER

#define CONSTEIG_MAX_ITER   500

Maximum QR iterations per eigenvalue block.

The solver runs at most CONSTEIG_MAX_ITER * S total iterations for an S x S matrix. Increasing this may help difficult matrices converge at the cost of longer compile times and a higher risk of hitting compiler constexpr step limits.

◆ CONSTEIG_DEFAULT_SYMMETRIC_TOLERANCE

#define CONSTEIG_DEFAULT_SYMMETRIC_TOLERANCE   1e-6

Symmetry routing threshold for eigensolver selection.

If isSymmetric(thresh) returns true for the input matrix, the faster single-shift QR algorithm (eig_shifted_qr) is used instead of the double-shift variant. Tighten this value to force the double-shift solver on nearly-symmetric matrices; loosen it to accept more matrices as symmetric.

◆ CONSTEIG_BALANCE_CONVERGENCE_THRESHOLD

#define CONSTEIG_BALANCE_CONVERGENCE_THRESHOLD   0.95

Stopping criterion for the matrix balancing step.

A row/column scaling is applied only if it reduces the sum of the row and column norms by more than this factor. The default 0.95 is taken from Algorithm 2 of James, Langou & Lowery (2014). Increasing toward 1.0 runs more balancing iterations; decreasing it stops earlier.

◆ CONSTEIG_TRIG_MAX_ITER

#define CONSTEIG_TRIG_MAX_ITER   20

Maximum Taylor series iterations for trigonometric functions.

14 iterations suffice for double precision (worst case x=π: π^29/29! ≈ 3e-17 < machine epsilon). The default of 20 gives a comfortable margin. Increase only if using long double with extreme argument values.