SortableArray Class Template Reference
A sort-capable variant of the
ResizeArray template class. In addition to the methods provided there, this template also allows either quicksorting or insertion sorting of the elements in the array.
More...
#include <SortableArray.h>
List of all members.
Public Methods
largest number of elements that have been accessed. More...
[] operator version of the item() routine. More...
add a new element to the end of the array. Return index of new item. More...
return the nth item; assume N is >= 0. More...
void
remove (int m=-1, int n=-1)
remove the Mth ... Nth items: move all items lower in the array up to fill the empty slots. If both arguments are < 0, removes ALL items. If the second argument is < 0, just removes item m. More...
auxilliary function for qsort. More...
void
qsort (int left, int right)
sorts elements based on a specialied field. To change the sort, change the field which is used as a basis for comparison. The '>' and '<' symbols are overloaded. More...
Detailed Description
template<class T>
class SortableArray< T >
A sort-capable variant of the
ResizeArray template class. In addition to the methods provided there, this template also allows either quicksorting or insertion sorting of the elements in the array.
Definition at line 33 of file SortableArray.h.
Constructor & Destructor Documentation
template<class T>
SortableArray< T >::SortableArray
(
int
s = 10,
float
rsf = 2.0
)
[inline]
template<class T>
SortableArray< T >::~SortableArray
(
void
)
[inline]
Member Function Documentation
template<class T>
int SortableArray< T >::append
(
const T &
val
)
[inline]
add a new element to the end of the array. Return index of new item.
Definition at line 82 of file SortableArray.h.
template<class T>
void SortableArray< T >::isort
(
)
[inline]
template<class T>
T& SortableArray< T >::item
(
int
N
)
[inline]
template<class T>
int SortableArray< T >::num
(
void
)
[inline]
largest number of elements that have been accessed.
Definition at line 72 of file SortableArray.h.
template<class T>
T& SortableArray< T >::operator[]
(
int
N
)
[inline]
[] operator version of the item() routine.
Definition at line 79 of file SortableArray.h.
template<class T>
void SortableArray< T >::qsort
(
int
left,
int
right
)
[inline]
template<class T>
void SortableArray< T >::remove
(
int
m = -1,
int
n = -1
)
[inline]
remove the Mth ... Nth items: move all items lower in the array up to fill the empty slots. If both arguments are < 0, removes ALL items. If the second argument is < 0, just removes item m.
Definition at line 124 of file SortableArray.h.
template<class T>
void SortableArray< T >::swap
(
int
i,
int
j
)
[inline]
The documentation for this class was generated from the following file:
Generated on Sun Nov 16 02:47:37 2025 for VMD (current) by
doxygen1.2.14 written by Dimitri van Heesch,
© 1997-2002