thijsjanzen / nLTT

Repository for the R nLTT package
GNU General Public License v2.0
6 stars 4 forks source link

Decrease big-O for nltt_diff_exact_norm_brts #30

Closed richelbilderbeek closed 6 years ago

richelbilderbeek commented 7 years ago

The function nltt_diff_exact_norm_brts may have O(n^2) complexity, as:

  for (k in 2:length(all_b_times)) {
      tim <- all_b_times[k]
      #find the index of the first branching time
      #that is up to the focal branching time
      index1 <- max(which(b_times_N < tim))
      index2 <- max(which(b_times2_N < tim))  #same for the other tree
      # ...
  }

Options to explore are:

TODO:

richelbilderbeek commented 6 years ago

Lost interest, closing Issue for now.