Static Public Member Functions

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.

    {
    const eT& A = *(static_cast<const eT*>(A_orig));
    const eT& B = *(static_cast<const eT*>(B_orig));
    
    if(A < B)
      {
      return -1;
      }
    else
    if(A > B)
      {
      return +1;
      }
    else
      {
      return 0;
      }
    }

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.

    {
    const eT& A = *(static_cast<const eT*>(A_orig));
    const eT& B = *(static_cast<const eT*>(B_orig));
    
    if(A < B)
      {
      return +1;
      }
    else
    if(A > B)
      {
      return -1;
      }
    else
      {
      return 0;
      }
    }