Skip to main content

Module lpf

Module lpf 

Source
Expand description

Longest Previous Factor โ€” port of lz::utils::LPF from modules/core/src/lpf.cpp.

For each position i in the sequence, lpf[i] is the length of the longest factor starting at i that also occurs earlier in the sequence. The C++ implementation operates on the SA / LCP arrays via a stack of (len, pos).

Functionsยง

lpf
Compute the LPF array. lpf must already be sized to n.