Functions

Fn_median

//! More...

Functions

template<typename T1 >
arma_inline const Op< T1,
op_median
median (const Base< typename T1::elem_type, T1 > &X, const u32 dim=0)
template<typename eT >
arma_warn_unused eT median (const Row< eT > &A)
 Immediate 'find the median value of a row vector' operation.
template<typename eT >
arma_warn_unused eT median (const Col< eT > &A)
 Immediate 'find the median value of a column vector' operation.
template<typename T >
arma_warn_unused std::complex< T > median (const Row< std::complex< T > > &A)
 Immediate 'find the median value of a row vector' operation (complex number version).
template<typename T >
arma_warn_unused std::complex< T > median (const Col< std::complex< T > > &A)
 Immediate 'find the median value of a column vector' operation (complex number version).
template<typename eT >
arma_warn_unused eT median (const subview_row< eT > &A)
 find the median value of a subview_row
template<typename eT >
arma_warn_unused eT median (const subview_col< eT > &A)
 find the median value of a subview_col
template<typename T >
arma_warn_unused std::complex< T > median (const subview_row< std::complex< T > > &A)
 find the median value of a subview_row (complex number version)
template<typename T >
arma_warn_unused std::complex< T > median (const subview_col< std::complex< T > > &A)
 find the median value of a subview_col (complex number version)
template<typename eT >
arma_warn_unused eT median (const diagview< eT > &A)
template<typename T >
arma_warn_unused std::complex< T > median (const diagview< std::complex< T > > &A)

Detailed Description

//!


Function Documentation

template<typename T1 >
arma_inline const Op<T1, op_median> median ( const Base< typename T1::elem_type, T1 > &  X,
const u32  dim = 0 
)

Definition at line 24 of file fn_median.hpp.

References Base< elem_type, derived >::get_ref().

  {
  arma_extra_debug_sigprint();
  
  return Op<T1, op_median>(X.get_ref(), dim, 0);
  }

template<typename eT >
arma_warn_unused eT median ( const Row< eT > &  A  )  [inline]

Immediate 'find the median value of a row vector' operation.

Definition at line 37 of file fn_median.hpp.

References op_median::direct_median(), Mat< eT >::mem, and Mat< eT >::n_elem.

  {
  arma_extra_debug_sigprint();
  
  arma_debug_check( (A.n_elem == 0), "median(): given vector has no elements" );
  
  return op_median::direct_median(A.mem, A.n_elem);
  }

template<typename eT >
arma_warn_unused eT median ( const Col< eT > &  A  )  [inline]

Immediate 'find the median value of a column vector' operation.

Definition at line 53 of file fn_median.hpp.

References op_median::direct_median(), Mat< eT >::mem, and Mat< eT >::n_elem.

  {
  arma_extra_debug_sigprint();
  
  arma_debug_check( (A.n_elem == 0), "median(): given vector has no elements" );
  
  return op_median::direct_median(A.mem, A.n_elem);
  }

template<typename T >
arma_warn_unused std::complex<T> median ( const Row< std::complex< T > > &  A  )  [inline]

Immediate 'find the median value of a row vector' operation (complex number version).

Definition at line 69 of file fn_median.hpp.

References op_median::direct_cx_median_index().

  {
  arma_extra_debug_sigprint();
  
  arma_debug_check( (A.n_elem == 0), "median(): given vector has no elements" );
  
  u32 index1;
  u32 index2;
  op_median::direct_cx_median_index(index1, index2, A.mem, A.n_elem);
  
  return (A.mem[index1] + A.mem[index2]) / T(2);
  }

template<typename T >
arma_warn_unused std::complex<T> median ( const Col< std::complex< T > > &  A  )  [inline]

Immediate 'find the median value of a column vector' operation (complex number version).

Definition at line 89 of file fn_median.hpp.

References op_median::direct_cx_median_index().

  {
  arma_extra_debug_sigprint();
  
  arma_debug_check( (A.n_elem == 0), "median(): given vector has no elements" );
  
  u32 index1;
  u32 index2;
  op_median::direct_cx_median_index(index1, index2, A.mem, A.n_elem);
  
  return (A.mem[index1] + A.mem[index2]) / T(2);
  }

template<typename eT >
arma_warn_unused eT median ( const subview_row< eT > &  A  )  [inline]

find the median value of a subview_row

Definition at line 109 of file fn_median.hpp.

References op_median::direct_median(), and subview< eT >::n_elem.

  {
  arma_extra_debug_sigprint();
  
  arma_debug_check( (A.n_elem == 0), "median(): given vector has no elements" );
  
  return op_median::direct_median(A);
  }

template<typename eT >
arma_warn_unused eT median ( const subview_col< eT > &  A  )  [inline]

find the median value of a subview_col

Definition at line 125 of file fn_median.hpp.

References op_median::direct_median(), and subview< eT >::n_elem.

  {
  arma_extra_debug_sigprint();
  
  arma_debug_check( (A.n_elem == 0), "median(): given vector has no elements" );
  
  return op_median::direct_median(A);
  }

template<typename T >
arma_warn_unused std::complex<T> median ( const subview_row< std::complex< T > > &  A  )  [inline]

find the median value of a subview_row (complex number version)

Definition at line 141 of file fn_median.hpp.

References op_median::direct_cx_median_index().

  {
  arma_extra_debug_sigprint();
  
  arma_debug_check( (A.n_elem == 0), "median(): given vector has no elements" );
  
  u32 index1;
  u32 index2;
  op_median::direct_cx_median_index(index1, index2, A);
  
  return (A[index1] + A[index2]) / T(2);
  }

template<typename T >
arma_warn_unused std::complex<T> median ( const subview_col< std::complex< T > > &  A  )  [inline]

find the median value of a subview_col (complex number version)

Definition at line 161 of file fn_median.hpp.

References op_median::direct_cx_median_index().

  {
  arma_extra_debug_sigprint();
  
  arma_debug_check( (A.n_elem == 0), "median(): given vector has no elements" );
  
  u32 index1;
  u32 index2;
  op_median::direct_cx_median_index(index1, index2, A);
  
  return (A[index1] + A[index2]) / T(2);
  }

template<typename eT >
arma_warn_unused eT median ( const diagview< eT > &  A  )  [inline]

Definition at line 180 of file fn_median.hpp.

References op_median::direct_median(), and diagview< eT >::n_elem.

  {
  arma_extra_debug_sigprint();
  
  arma_debug_check( (A.n_elem == 0), "median(): given vector has no elements" );
  
  return op_median::direct_median(A);
  }

template<typename T >
arma_warn_unused std::complex<T> median ( const diagview< std::complex< T > > &  A  )  [inline]

Definition at line 195 of file fn_median.hpp.

References op_median::direct_cx_median_index().

  {
  arma_extra_debug_sigprint();
  
  arma_debug_check( (A.n_elem == 0), "median(): given vector has no elements" );
  
  u32 index1;
  u32 index2;
  op_median::direct_cx_median_index(index1, index2, A);
  
  return (A[index1] + A[index2]) / T(2);
  }