Skip to main content

compute_sve

Function compute_sve 

Source
pub fn compute_sve<K>(
    kernel: K,
    epsilon: Option<f64>,
    cutoff: Option<f64>,
    max_num_svals: Option<usize>,
    twork: TworkType,
) -> Result<SVEResult, Error>
Expand description

Main SVE computation function

Chooses the SVE strategy from the kernel (ExpandableKernel) and the working precision from epsilon. A centrosymmetric kernel (ReducedKernel) is block-diagonalized into its even and odd reduced kernels (CentrosymmSVE), whose singular functions have definite parity; any other kernel is expanded over its full domain [xmin, xmax] × [ymin, ymax] (NonCentrosymmSVE). This is compute_sve_with with these options; the others are those of SVEOptions::new.

§Arguments

  • kernel - The kernel to expand
  • epsilon - Required accuracy, in (0, 1). None selects the best accuracy of the working precision (about 1.6e-16 in Float64X2).
  • cutoff - Relative tolerance for singular value truncation: singular values smaller than cutoff times the largest singular value are discarded. None selects 2 * machine epsilon of the working precision, about 4.44e-16 for Float64 and 4.93e-32 for Float64X2 (the libsparseir default). The SVD of each block already discards singular values below 2 * machine epsilon times that block’s largest singular value, so a smaller cutoff has little effect. Must be in [0, 1].
  • max_num_svals - Maximum number of singular values to keep
  • twork - Working precision type (Auto for automatic selection)

§Returns

SVEResult containing singular functions and values

§Errors

§FPU State Warning

This function checks for dangerous FPU settings (Flush-to-Zero and Denormals-Are-Zero) that can cause incorrect results. If detected, it temporarily corrects the FPU state and prints a warning. If you see this warning, add -fp-model precise flag when compiling with Intel Fortran.