TBCI Numerical high perf. C++ Library 2.8.0
nsList< T, S > Class Template Reference

A numerically sortable List. More...

#include <list.h>

Inheritance diagram for nsList< T, S >:
Collaboration diagram for nsList< T, S >:

Public Member Functions

 nsList ()
 
void qsort (bool=false)
 Quicksort is really quick: sorts 1 000 000 records (int) in less than 50 secs on a 486DX4/100 under Linux (32 MB Ram)
 
Tsortin_r (T &, bool=false)
 
long move_window (const S &val) const
 
- Public Member Functions inherited from List< T >
 List ()
 
 List (const List< T > &)
 
List< T > & operator= (const List< T > &)
 
List< T > & alias (const List< T > &)
 
iterator begin () const
 
iterator end () const
 
riterator rbegin () const
 
riterator rend () const
 
Tappend ()
 
Tappend (T *)
 
void erase (T *)
 
void deltree (T *)
 Deletes List from item to end.
 
void deltree ()
 
 ~List ()
 
Tgetfirst () const
 
Tgetlast () const
 
Tgetcurr () const
 
Tgetnext () const
 
Tgetprev () const
 
Tsetfirst () const
 
Tsetlast () const
 
Tsetnext () const
 
Tsetprev () const
 
Tinscurr ()
 
Tinscurr (T *)
 
Tdelcurr ()
 
Tdetachcurr ()
 
unsigned long getlength () const
 
unsigned long size () const
 
unsigned long getcurrnr () const
 Note that the numbers are 1-based.
 
unsigned long getnr (const T *) const
 
unsigned long getnr () const
 
Tgetbynr (long) const
 
Tsetcurrnr (const unsigned long) const
 
Tsetcurr (const T *rec) const
 
void dumpList () const
 

Protected Member Functions

void quick (ListItem< T > *, ListItem< T > *)
 
- Protected Member Functions inherited from List< T >
void checklast ()
 
ListItem< T > * app ()
 

Protected Attributes

bool dir
 
- Protected Attributes inherited from List< T >
ListItem< T > * curr
 
unsigned long count
 
unsigned long currnr
 
unsigned long vers
 
ListItem< T > * root
 
ListItem< T > * last
 
ListItem< T > * detached
 

Additional Inherited Members

- Public Types inherited from List< T >
typedef ListIterator< Titerator
 
typedef ListRIterator< Triterator
 

Detailed Description

template<typename T, typename S = double>
class nsList< T, S >

A numerically sortable List.

ListItems have to def. a member function getval() which returns the value which is used to sort

Definition at line 770 of file list.h.

Constructor & Destructor Documentation

◆ nsList()

template<typename T, typename S = double>
nsList< T, S >::nsList ( )
inline

Definition at line 781 of file list.h.

References dir, List< T >::List(), and T.

Member Function Documentation

◆ move_window()

template<typename T, typename S>
long nsList< T, S >::move_window ( const S & val) const

◆ qsort()

template<typename T, typename S>
void nsList< T, S >::qsort ( bool desc = false)

Quicksort is really quick: sorts 1 000 000 records (int) in less than 50 secs on a 486DX4/100 under Linux (32 MB Ram)

Definition at line 854 of file list.h.

References dir, List< T >::last, NULL, quick(), and List< T >::root.

◆ quick()

template<typename T, typename S>
void nsList< T, S >::quick ( ListItem< T > * left,
ListItem< T > * right )
protected

Definition at line 788 of file list.h.

References ListItem< T >::data, dir, ListItem< T >::next, ListItem< T >::prev, quick(), right, and T.

Referenced by qsort(), and quick().

◆ sortin_r()

template<class T, class S>
T * nsList< T, S >::sortin_r ( T & dat,
bool frst = false )

Member Data Documentation

◆ dir

template<typename T, typename S = double>
bool nsList< T, S >::dir
protected

Definition at line 778 of file list.h.

Referenced by move_window(), nsList(), qsort(), quick(), and sortin_r().


The documentation for this class was generated from the following file: