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 25 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 31 of file op_sort_meat.hpp.

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

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

Definition at line 55 of file op_sort_meat.hpp.

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