Fn_median

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)

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 
) [inline]

Definition at line 24 of file fn_median.hpp.

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

00025   {
00026   arma_extra_debug_sigprint();
00027   
00028   return Op<T1, op_median>(X.get_ref(), dim, 0);
00029   }

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.

00038   {
00039   arma_extra_debug_sigprint();
00040   
00041   arma_debug_check( (A.n_elem == 0), "median(): given vector has no elements" );
00042   
00043   return op_median::direct_median(A.mem, A.n_elem);
00044   }

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.

00054   {
00055   arma_extra_debug_sigprint();
00056   
00057   arma_debug_check( (A.n_elem == 0), "median(): given vector has no elements" );
00058   
00059   return op_median::direct_median(A.mem, A.n_elem);
00060   }

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().

00070   {
00071   arma_extra_debug_sigprint();
00072   
00073   arma_debug_check( (A.n_elem == 0), "median(): given vector has no elements" );
00074   
00075   u32 index1;
00076   u32 index2;
00077   op_median::direct_cx_median_index(index1, index2, A.mem, A.n_elem);
00078   
00079   return (A.mem[index1] + A.mem[index2]) / T(2);
00080   }

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().

00090   {
00091   arma_extra_debug_sigprint();
00092   
00093   arma_debug_check( (A.n_elem == 0), "median(): given vector has no elements" );
00094   
00095   u32 index1;
00096   u32 index2;
00097   op_median::direct_cx_median_index(index1, index2, A.mem, A.n_elem);
00098   
00099   return (A.mem[index1] + A.mem[index2]) / T(2);
00100   }

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.

00110   {
00111   arma_extra_debug_sigprint();
00112   
00113   arma_debug_check( (A.n_elem == 0), "median(): given vector has no elements" );
00114   
00115   return op_median::direct_median(A);
00116   }

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.

00126   {
00127   arma_extra_debug_sigprint();
00128   
00129   arma_debug_check( (A.n_elem == 0), "median(): given vector has no elements" );
00130   
00131   return op_median::direct_median(A);
00132   }

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().

00142   {
00143   arma_extra_debug_sigprint();
00144   
00145   arma_debug_check( (A.n_elem == 0), "median(): given vector has no elements" );
00146   
00147   u32 index1;
00148   u32 index2;
00149   op_median::direct_cx_median_index(index1, index2, A);
00150   
00151   return (A[index1] + A[index2]) / T(2);
00152   }

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().

00162   {
00163   arma_extra_debug_sigprint();
00164   
00165   arma_debug_check( (A.n_elem == 0), "median(): given vector has no elements" );
00166   
00167   u32 index1;
00168   u32 index2;
00169   op_median::direct_cx_median_index(index1, index2, A);
00170   
00171   return (A[index1] + A[index2]) / T(2);
00172   }

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.

00181   {
00182   arma_extra_debug_sigprint();
00183   
00184   arma_debug_check( (A.n_elem == 0), "median(): given vector has no elements" );
00185   
00186   return op_median::direct_median(A);
00187   }

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().

00196   {
00197   arma_extra_debug_sigprint();
00198   
00199   arma_debug_check( (A.n_elem == 0), "median(): given vector has no elements" );
00200   
00201   u32 index1;
00202   u32 index2;
00203   op_median::direct_cx_median_index(index1, index2, A);
00204   
00205   return (A[index1] + A[index2]) / T(2);
00206   }