The cur_ele is a pointer to the current element being addressed in the virtual vector. The cur_index is the index of the current index in the vector. Note the index is a long, so index operations must be cast on long integers. These two variables help control which buffer is stored in the vmem of the hdr. The member function val() returns the current value.
The static integer, nobj, counts the number of active vectors. If it is zero, then the vmm system is initialized in the constructors. The constructors increment nobj and the destructors decrement nobj.
The in-ram version also sets up a virtual vector structure, but its memory is allocated entirely on the heap. The structure is
typedef struct vdoub{ int nrefs; double HUGE_POINTER *mm; } vdoub;The variable, nrefs, stores the number of references to this vector. The vector pointer *mm is not freed until nrefs is zero. Note this is a typedef instead of class, so the in-ram virtual matrix is not derived from vdoub. Also note that mm is now a vector of huge double pointers. When using Microsoft C/C++ 7.0, HUGE_POINTER is replaced by __huge, and it is replaced by far in Borland C++. If you port the IN_RAM version to other compilers, HUGE_POINTER is defined as blank. You can redefine it if you compiler has problems releasing large blocks of memory when the pointer type of mm is undeclared. (This occured in an early release of MSC7.0).