hoesler / kdtree

A Scala k-d tree library
Apache License 2.0
4 stars 2 forks source link

requesting mutable tree #2

Open ehartford opened 7 years ago

ehartford commented 7 years ago

if I have 5 million points i don't want to read the whole file into memory, I'd rather read line by line... but this will force me to recreate the tree from scratch with each new point added. is it possible to have a mutable tree where I can add points one at a time?

hoesler commented 7 years ago

Sorry, I don't have time for this project at the moment, but pull requests are welcome. I'm not sure, however, if a mutable tree will get you any performance benefits.

Furthermore, I don't understand what keeps you from constructing the tree line by line like this:

val nodes: Seq[(HyperPoint, String)] = List()
for (line <- Source.fromFile(filename).getLines) {
   // create and add entry to nodes
}

This iterates over the file line by line.