Views
Graph Layout Package API Reference Guide
Product Documentation:
Views Documentation Home
List of all members | Public Member Functions | Protected Member Functions
IlvQuickSort Class Referenceabstract

A generic quick sort algorithm. More...

#include <ilviews/layout/util/quicksort.h>

Inherited by IlvIncidentLinksSorter.

Public Member Functions

 IlvQuickSort (IlInt size=0)
 
void sort (IlInt=-1)
 

Protected Member Functions

virtual IlBoolean compare (IlUInt loc1, IlUInt loc2)=0
 
virtual void swap (IlUInt, IlUInt)=0
 

Detailed Description

A generic quick sort algorithm.

Library: ilvlayout

Constructor & Destructor Documentation

◆ IlvQuickSort()

IlvQuickSort::IlvQuickSort ( IlInt  size = 0)

Creates a new instance of the quicksort.

Parameters
sizeThe number of elements to be sorted.

Member Function Documentation

◆ compare()

virtual IlBoolean IlvQuickSort::compare ( IlUInt  loc1,
IlUInt  loc2 
)
protectedpure virtual

Compares two elements. For ascendant sort, must return IlTrue if element(loc1) <= element(loc2), IlFalse otherwise. For descendent sort, must return IlTrue if element(loc1) >= element(loc2), IlFalse otherwise.

◆ sort()

void IlvQuickSort::sort ( IlInt  = -1)

Performs the quicksort.

◆ swap()

virtual void IlvQuickSort::swap ( IlUInt  ,
IlUInt   
)
protectedpure virtual

Swaps two elements.