SyTen

◆ invertDiagonal() [3/3]

SRDef syten::invertDiagonal ( Tensor< 2 > &  m)

Inverts a rank-two tensor in-place by inverting all reduced dense and CGC-space sparse blocks.

Only makes sense for diagonal tensors. The broadening \( \varepsilon \) is calculated as SYTEN_BROADENING_EPSILON multiplied by the largest dense diagonal entry. If the smallest dense diagonal entry is larger than this broadening, the ratio of largest and smallest is returned. Otherwise, the inverse of SYTEN_BROADENING_EPSILON is returned.

Remarks
The used invertDiagonal() function for dense blocks employs a broadening \( x_{i,i} \to \frac{x_{i,i}}{x_{i,i}^2 + \varepsilon} \) to ensure acceptable results with small diagonals.

References abs(), invertDiagonal(), std::max(), std::min(), std::move(), overThreshold(), std::swap(), and SYTEN_BROADENING_EPSILON.

+ Here is the call graph for this function: