// Copyright (C) 2009-2012 National ICT Australia (NICTA) // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. // ------------------------------------------------------------------- // // Written by Conrad Sanderson - http://conradsanderson.id.au //! \addtogroup op_median //! @{ template struct arma_cx_median_packet { T val; uword index; }; template arma_inline bool operator< (const arma_cx_median_packet& A, const arma_cx_median_packet& B) { return A.val < B.val; } //! Class for finding median values of a matrix class op_median { public: template inline static void apply(Mat& out, const Op& in); template inline static void apply(Mat< std::complex >& out, const Op& in); // // template inline static typename T1::elem_type median_vec(const T1& X, const typename arma_not_cx::result* junk = 0); template inline static typename T1::elem_type median_vec(const T1& X, const typename arma_cx_only::result* junk = 0); // // template inline static eT direct_median(std::vector& X); template inline static void direct_cx_median_index(uword& out_index1, uword& out_index2, std::vector< arma_cx_median_packet >& X); }; //! @}