ffldlFft function

FfTree ffldlFft(
  1. List<List<List<Complex>>> g
)

Build the ffLDL decomposition tree of the Gram matrix g (FFT representation). Corresponds to algorithm 9 (ffLDL).

Implementation

FfTree ffldlFft(List<List<List<Complex>>> g) {
  final n = g[0][0].length;
  final decomposition = ldlFft(g);
  final l10 = decomposition.l[1][0];
  final d = decomposition.d;

  if (n > 2) {
    final d0 = FalconFFT.splitFft(d[0][0]); // [d00, d01]
    final d1 = FalconFFT.splitFft(d[1][1]); // [d10, d11]
    final g0 = [
      [d0[0], d0[1]],
      [FalconFFT.adjFft(d0[1]), d0[0]],
    ];
    final g1 = [
      [d1[0], d1[1]],
      [FalconFFT.adjFft(d1[1]), d1[0]],
    ];
    return FfBranch(l10, ffldlFft(g0), ffldlFft(g1));
  }
  // n == 2: the diagonal entries are the (real) leaves.
  return FfBranch(l10, FfLeaf(d[0][0][0].real), FfLeaf(d[1][1][0].real));
}