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>
where K: CentrosymmKernel + KernelProperties + Clone + 'static,
Expand description

Main SVE computation function for centrosymmetric kernels

Automatically chooses the appropriate SVE strategy based on kernel properties and working precision based on epsilon.

§Arguments

  • kernel - The centrosymmetric 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 even/odd 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.