comparison armadillo-3.900.4/include/armadillo_bits/op_median_bones.hpp @ 49:1ec0e2823891

Switch to using subrepo copies of qm-dsp, nnls-chroma, vamp-plugin-sdk; update Armadillo version; assume build without external BLAS/LAPACK
author Chris Cannam
date Thu, 13 Jun 2013 10:25:24 +0100
parents
children
comparison
equal deleted inserted replaced
48:69251e11a913 49:1ec0e2823891
1 // Copyright (C) 2009-2012 NICTA (www.nicta.com.au)
2 // Copyright (C) 2009-2012 Conrad Sanderson
3 //
4 // This Source Code Form is subject to the terms of the Mozilla Public
5 // License, v. 2.0. If a copy of the MPL was not distributed with this
6 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
7
8
9 //! \addtogroup op_median
10 //! @{
11
12
13 template<typename T>
14 struct arma_cx_median_packet
15 {
16 T val;
17 uword index;
18 };
19
20
21
22 template<typename T>
23 arma_inline
24 bool
25 operator< (const arma_cx_median_packet<T>& A, const arma_cx_median_packet<T>& B)
26 {
27 return A.val < B.val;
28 }
29
30
31
32 //! Class for finding median values of a matrix
33 class op_median
34 {
35 public:
36
37 template<typename T1>
38 inline static void apply(Mat<typename T1::elem_type>& out, const Op<T1,op_median>& in);
39
40 template<typename T, typename T1>
41 inline static void apply(Mat< std::complex<T> >& out, const Op<T1,op_median>& in);
42
43 //
44 //
45
46 template<typename T1>
47 inline static typename T1::elem_type median_vec(const T1& X, const typename arma_not_cx<typename T1::elem_type>::result* junk = 0);
48
49 template<typename T1>
50 inline static typename T1::elem_type median_vec(const T1& X, const typename arma_cx_only<typename T1::elem_type>::result* junk = 0);
51
52 //
53 //
54
55 template<typename eT>
56 inline static eT direct_median(std::vector<eT>& X);
57
58 template<typename T>
59 inline static void direct_cx_median_index(uword& out_index1, uword& out_index2, std::vector< arma_cx_median_packet<T> >& X);
60 };
61
62
63
64 //! @}