Need help for faster processing


RE: Need help for faster processing
#3
(2023-11-02, 21:26)Travis Cobbs Wrote: LDView has a custom vertex key class that it uses specifically for merging vertices. The class converts the coordinate values from floats to long (with a scale factor that represents how close together they need to be in each axis) and implements the less than operator. I then use std :: set and std :: map with these vertex keys, and nearby points automatically get merged. I'm not sure if this would be faster than what you're doing or not. Something similar could be done without conversion from float to long. On modern CPUs, I'm honestly not sure how much that conversion helps.

Note: I'm not sure what programming language you're using, but as long as it allows for values to be placed in maps and sets with custom comparison functions, you can create a comparison function that includes your merge threshold and then use that. I think that any map or set type should be at worst around O(log base2 n) for insertion, vs your O(n squared). So, you would look up the new value in the set. If it is found with your custom comparison function that allows for a merge threshold, you would assign the values equal to each other.
Reply
« Next Oldest | Next Newest »



Messages In This Thread
RE: Need help for faster processing - by Travis Cobbs - 2023-11-02, 21:40

Forum Jump:


Users browsing this thread: 1 Guest(s)