JKQTPlotter trunk/v5.0.0
an extensive Qt5+Qt6 Plotter framework (including a feature-richt plotter widget, a speed-optimized, but limited variant and a LaTeX equation renderer!), written fully in C/C++ and without external dependencies
Loading...
Searching...
No Matches
General Algorithms (Sorting ...)
Collaboration diagram for General Algorithms (Sorting ...):

Functions

template<class T >
void jkqtpQuicksort (const T *input, long long N, T *output)
 sort the given array and return the result in output (implies a copy!!!)
 
template<class T >
void jkqtpQuicksort (T *a, int l, int r)
 QuickSort (recursive implementation)
 
template<class T , class T2 >
void jkqtpQuicksortDual (const T *input, const T2 *input2, int N, T *output, T2 *output2)
 sort the given arrays, using input as sort criterion, returns the results in output and output2 (implied copies of the data!)
 
template<class T , class T2 >
void jkqtpQuicksortDual (T *a, T2 *a2, int l, int r)
 QuickSort (recursive implementation), sorts a2 alongside a, using a as sort criterion.
 
template<class T , class T2 >
void jkqtpQuicksortDual (T *input, T2 *input2, int N)
 sort the given arrays, using input as sort criterion
 
template<class T >
void jkqtpSwap (T *a, int l, int r)
 swap two elements l and r in an array a
 

Detailed Description

Function Documentation

◆ jkqtpQuicksort() [1/2]

template<class T >
void jkqtpQuicksort ( const T *  input,
long long  N,
T *  output 
)
inline

sort the given array and return the result in output (implies a copy!!!)

Parameters
inputarray to be sorted
Nsize of the array input
outputif !=nullptr data is written here (the memory location pointed at by output has to have at least the length N !!!), otherwise the array input is sorted inplace.

◆ jkqtpQuicksort() [2/2]

template<class T >
void jkqtpQuicksort ( T *  a,
int  l,
int  r 
)
inline

QuickSort (recursive implementation)

implementation from http://www.linux-related.de/index.html?/coding/sort/sort_quick.htm

◆ jkqtpQuicksortDual() [1/3]

template<class T , class T2 >
void jkqtpQuicksortDual ( const T *  input,
const T2 *  input2,
int  N,
T *  output,
T2 *  output2 
)
inline

sort the given arrays, using input as sort criterion, returns the results in output and output2 (implied copies of the data!)

Parameters
inputarray to be sorted (the sort criterion)
input2array to be sorted (sorted alongside input )
Nsize of the array input
outputresult is written here (the memory location pointed at by output has to have at least the length N !!!), otherwise the array input is sorted inplace.
output2result is written here (the memory location pointed at by output has to have at least the length N !!!), otherwise the array input is sorted inplace.

◆ jkqtpQuicksortDual() [2/3]

template<class T , class T2 >
void jkqtpQuicksortDual ( T *  a,
T2 *  a2,
int  l,
int  r 
)
inline

QuickSort (recursive implementation), sorts a2 alongside a, using a as sort criterion.

implementation from http://www.linux-related.de/index.html?/coding/sort/sort_quick.htm

◆ jkqtpQuicksortDual() [3/3]

template<class T , class T2 >
void jkqtpQuicksortDual ( T *  input,
T2 *  input2,
int  N 
)
inline

sort the given arrays, using input as sort criterion

Parameters
inputarray to be sorted (the sort criterion)
input2array to be sorted (sorted alongside input )
Nsize of the array input

◆ jkqtpSwap()

template<class T >
void jkqtpSwap ( T *  a,
int  l,
int  r 
)
inline

swap two elements l and r in an array a