arma_qsort_helper< eT > Class Template Reference
[Op_sort]

#include <op_sort_meat.hpp>

List of all members.

Static Public Member Functions

static int ascend_compare (const void *A_orig, const void *B_orig)
static int descend_compare (const void *A_orig, const void *B_orig)

Detailed Description

template<typename eT>
class arma_qsort_helper< eT >

Definition at line 26 of file op_sort_meat.hpp.


Member Function Documentation

template<typename eT >
static int arma_qsort_helper< eT >::ascend_compare ( const void *  A_orig,
const void *  B_orig 
) [inline, static]

Definition at line 32 of file op_sort_meat.hpp.

00033     {
00034     const eT& A = *(static_cast<const eT*>(A_orig));
00035     const eT& B = *(static_cast<const eT*>(B_orig));
00036     
00037     if(A < B)
00038       {
00039       return -1;
00040       }
00041     else
00042     if(A > B)
00043       {
00044       return +1;
00045       }
00046     else
00047       {
00048       return 0;
00049       }
00050     }

template<typename eT >
static int arma_qsort_helper< eT >::descend_compare ( const void *  A_orig,
const void *  B_orig 
) [inline, static]

Definition at line 56 of file op_sort_meat.hpp.

00057     {
00058     const eT& A = *(static_cast<const eT*>(A_orig));
00059     const eT& B = *(static_cast<const eT*>(B_orig));
00060     
00061     if(A < B)
00062       {
00063       return +1;
00064       }
00065     else
00066     if(A > B)
00067       {
00068       return -1;
00069       }
00070     else
00071       {
00072       return 0;
00073       }
00074     }