Fn_median


Functions

template<typename T1 >
const Op< T1, op_medianmedian (const Base< typename T1::elem_type, T1 > &X, const u32 dim=0)
template<typename eT >
eT median (const Row< eT > &A)
 Immediate 'find the median value of a row vector' operation.
template<typename eT >
eT median (const Col< eT > &A)
 Immediate 'find the median value of a column vector' operation.
template<typename T >
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 >
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 >
eT median (const subview_row< eT > &A)
 find the median value of a subview_row
template<typename eT >
eT median (const subview_col< eT > &A)
 find the median value of a subview_col
template<typename T >
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 >
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 >
eT median (const diagview< eT > &A)
template<typename T >
std::complex< T > median (const diagview< std::complex< T > > &A)

Function Documentation

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

Definition at line 23 of file fn_median.hpp.

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

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

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

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

Definition at line 35 of file fn_median.hpp.

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

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

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

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

Definition at line 50 of file fn_median.hpp.

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

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

template<typename T >
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 65 of file fn_median.hpp.

References op_median::direct_cx_median_index().

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

template<typename T >
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 84 of file fn_median.hpp.

References op_median::direct_cx_median_index().

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

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

find the median value of a subview_row

Definition at line 103 of file fn_median.hpp.

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

00104   {
00105   arma_extra_debug_sigprint();
00106   
00107   arma_debug_check( (A.n_elem == 0), "median(): given vector has no elements" );
00108   
00109   return op_median::direct_median(A);
00110   }

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

find the median value of a subview_col

Definition at line 118 of file fn_median.hpp.

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

00119   {
00120   arma_extra_debug_sigprint();
00121   
00122   arma_debug_check( (A.n_elem == 0), "median(): given vector has no elements" );
00123   
00124   return op_median::direct_median(A);
00125   }

template<typename T >
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 133 of file fn_median.hpp.

References op_median::direct_cx_median_index().

00134   {
00135   arma_extra_debug_sigprint();
00136   
00137   arma_debug_check( (A.n_elem == 0), "median(): given vector has no elements" );
00138   
00139   u32 index1;
00140   u32 index2;
00141   op_median::direct_cx_median_index(index1, index2, A);
00142   
00143   return (A[index1] + A[index2]) / T(2);
00144   }

template<typename T >
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 152 of file fn_median.hpp.

References op_median::direct_cx_median_index().

00153   {
00154   arma_extra_debug_sigprint();
00155   
00156   arma_debug_check( (A.n_elem == 0), "median(): given vector has no elements" );
00157   
00158   u32 index1;
00159   u32 index2;
00160   op_median::direct_cx_median_index(index1, index2, A);
00161   
00162   return (A[index1] + A[index2]) / T(2);
00163   }

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

Definition at line 170 of file fn_median.hpp.

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

00171   {
00172   arma_extra_debug_sigprint();
00173   
00174   arma_debug_check( (A.n_elem == 0), "median(): given vector has no elements" );
00175   
00176   return op_median::direct_median(A);
00177   }

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

Definition at line 184 of file fn_median.hpp.

References op_median::direct_cx_median_index().

00185   {
00186   arma_extra_debug_sigprint();
00187   
00188   arma_debug_check( (A.n_elem == 0), "median(): given vector has no elements" );
00189   
00190   u32 index1;
00191   u32 index2;
00192   op_median::direct_cx_median_index(index1, index2, A);
00193   
00194   return (A[index1] + A[index2]) / T(2);
00195   }