HepPile |
This file contains an attempt to make the template pile. A pile is a finite size LIFO stack. When a element is pushed on that increases the stack beyond its maximum size, the oldest element is deleted from the stack. A subroutine can be used on that oldest element first.
The orginal use of this stack was to store old HepDouble arrays. When a new array is needed, we can simply pull one off the pile. However, we don't want to keep too many old array's around, after a while we just want to start getting rid of them. When the pile gets too large, or when the pile is destroyed, we want to call subroutines to get rid of some of these arrays.
Unfortunately, in version 2.2 of g++ templates don't seem to work unless they are declared inline. So this class has ridiculously long inline functions. Also, g++ doesn't seem to allow multiple arguements to templates, so the size of the pile is hardwired in. To change the size, change the value of the const int sz.
#include "CLHEP/Matrix/Pile.h" template<class T> class HepPile