Adam Ferestad Posted July 7, 2016 Share Posted July 7, 2016 (edited) Ok, so I trying to work up some tests on sorting methods in Houdini and the one that I am playing with right now is supposed to parallelize well and I really want to test it using VEX, but apparently snippets don't currently support recursive algorithms. This is unfortunate because from what I have seen, several of the methods I want to play with are based on recursives and that basically knocks all of them out unless I can come up with an iterative method of implementing them. I am working on a Merge Sort found here: https://en.wikipedia.org/wiki/Merge_sort#Top-down_implementation, though looking at the code for the bottom up method reveals that it does not contain any recursion, so I will try to get that one up and running, though the problem remains what ways you all use to get around recursion with iteration for VEX snippets. I want to get some practice with fractal geometry, and those are basically all recursive, so it is going to become important soon. Edited July 7, 2016 by Adam Ferestad Quote Link to comment Share on other sites More sharing options...
f1480187 Posted July 7, 2016 Share Posted July 7, 2016 You can use Solver SOP instead. In wrangles, you can use while loop and accumulate variables. VEX does not support recursion other than recursive shader calls. Quote Link to comment Share on other sites More sharing options...
Adam Ferestad Posted July 7, 2016 Author Share Posted July 7, 2016 1 minute ago, f1480187 said: You can use Solver SOP instead. In wrangles, you can use while loop and accumulate variables. VEX does not support recursion other than recursive shader calls. I saw someone mention the Solver SOP, but wouldn't that defeat the purpose of doing this in VEX and eliminate the parallel implementation that VEX brings? I also remember reading that Hscript supports it, as does Python, but do they support the parallel computing like VEX? Quote Link to comment Share on other sites More sharing options...
f1480187 Posted July 7, 2016 Share Posted July 7, 2016 If you use while loop in point wrangle, there won't be any difference except code structure. If you iterate over all points in Detail wrangle, the code does not run in parallel at all. Quote Link to comment Share on other sites More sharing options...
Malf Posted July 7, 2016 Share Posted July 7, 2016 What sort of fractal geometry are you referring to? I have implemented a number of algorithms and they did not involve function recursion, just simply iterating on a value. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.