The Matrix Stack

The matrix stack lets you return VMatrix references from other functions. It also keeps track of intermediate calcuations stored in the heap, and deletes them when necessary. The current version of YAMP uses a deep-copy technique to push matrices faster. Assembly language programmers should already be familiar with the method of using the stack for storing registers or data when jumping to other sections of code. The method used here is little bit simpler than the assembly stack methods. It also requires the least amount of data structure overhead that I could come up with to solve the problem of trapping allocations on the heap. Besides, to quote Knuth[#!Kn:fa!#], "A stack is the simplest kind of linked list."



Subsections