Merge pull request #6390 from RosettaCommons/roccomoretti/iterative_kinematic_clone
Convert kinematics::tree::Atom::clone() to use a non-recursive algorithm
The kinematics::tree::Atom::clone() is currently a recursive one, which looks to potentially have issues with stack size limits on certain machines for large proteins. (Well, possibly. That's the best tea-leaf reading we have for some issues we see on Foldit with M1 Macs.)
It looks rather straightforward to hold the "todo" list on the heap, and handle the parent/child reassignment non-recursively. This should avoid ultra-deep program stacks, and does not seem to affect program runtime.