Brief Introduction to Some Simple Classes: General Copy Functions
From DSL
Operator =
This creates an exact copy of the object. After the call A=B, the contents of A will be the same as those of B. If the object has any pointers, the actual data pointed to will also be duplicated.
Clone
Some objects, like node definitions and values, allow cloning between different types of objects. When node A clones node B, A will rebuild itself trying to be as similar to node B as possible, given the limitation that node A and node B can be of different types.
As an example, imagine we have a node A, of type DSL_CPT, and node B, of type DSL_LIST. After the call B.Clone(A), B will still be a decision node but it will have as many choices as A states and they will be named the same way. The probability distribution of A will be lost on B because it is meaningless for a decision node. If, on the other hand, the call is A.Clone(B), A will recreate itself to contain as many states as B choices, with the same names, and a uniform probability distribution (because B, being a decision node, does not have information about that).
Swap
DSL_intArray and DSL_doubleArray provide Swap methods, which replace internal representation of two objects in constant time. This is equivalent of exchanging all array elements.
FillFrom
This is the "weakest" form of copying in the sense that the call A.FillFrom(B) will not change the "structure" and "state" of A in any way. So A will simply try to fill itself with whatever information it may find useful in B. This is usually used with arrays. After the previous call, A will not modify any of its members (not even numitems!) but it will try to fill its contents (the items member) with as many elements from B as possible.
