Jump to content

Wrangle Node Recursion Substitute


Adam Ferestad

Recommended Posts

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 by Adam Ferestad
Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...