annotate armadillo-3.900.4/include/armadillo_bits/fn_sort.hpp @ 76:a595de3e6f8d
Fix invalid call to parts.erase(parts.end()), which can crash and never does anything good. I think this is the intended behaviour.
author |
Chris Cannam |
date |
Thu, 24 Jan 2019 15:07:04 +0000 |
parents |
1ec0e2823891 |
children |
|
rev |
line source |
Chris@49
|
1 // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
|
Chris@49
|
2 // Copyright (C) 2008-2012 Conrad Sanderson
|
Chris@49
|
3 //
|
Chris@49
|
4 // This Source Code Form is subject to the terms of the Mozilla Public
|
Chris@49
|
5 // License, v. 2.0. If a copy of the MPL was not distributed with this
|
Chris@49
|
6 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
Chris@49
|
7
|
Chris@49
|
8
|
Chris@49
|
9 //! \addtogroup fn_sort
|
Chris@49
|
10 //! @{
|
Chris@49
|
11
|
Chris@49
|
12
|
Chris@49
|
13 template<typename T1>
|
Chris@49
|
14 arma_inline
|
Chris@49
|
15 typename
|
Chris@49
|
16 enable_if2
|
Chris@49
|
17 <
|
Chris@49
|
18 ( (is_arma_type<T1>::value == true) && (resolves_to_vector<T1>::value == false) ),
|
Chris@49
|
19 const Op<T1, op_sort>
|
Chris@49
|
20 >::result
|
Chris@49
|
21 sort
|
Chris@49
|
22 (
|
Chris@49
|
23 const T1& X,
|
Chris@49
|
24 const uword sort_type = 0,
|
Chris@49
|
25 const uword dim = 0
|
Chris@49
|
26 )
|
Chris@49
|
27 {
|
Chris@49
|
28 arma_extra_debug_sigprint();
|
Chris@49
|
29
|
Chris@49
|
30 return Op<T1, op_sort>(X, sort_type, dim);
|
Chris@49
|
31 }
|
Chris@49
|
32
|
Chris@49
|
33
|
Chris@49
|
34
|
Chris@49
|
35 template<typename T1>
|
Chris@49
|
36 arma_inline
|
Chris@49
|
37 typename
|
Chris@49
|
38 enable_if2
|
Chris@49
|
39 <
|
Chris@49
|
40 ( (is_arma_type<T1>::value == true) && (resolves_to_vector<T1>::value == true) ),
|
Chris@49
|
41 const Op<T1, op_sort>
|
Chris@49
|
42 >::result
|
Chris@49
|
43 sort
|
Chris@49
|
44 (
|
Chris@49
|
45 const T1& X,
|
Chris@49
|
46 const uword sort_type = 0
|
Chris@49
|
47 )
|
Chris@49
|
48 {
|
Chris@49
|
49 arma_extra_debug_sigprint();
|
Chris@49
|
50
|
Chris@49
|
51 const uword dim = (T1::is_col) ? 0 : 1;
|
Chris@49
|
52
|
Chris@49
|
53 return Op<T1, op_sort>(X, sort_type, dim);
|
Chris@49
|
54 }
|
Chris@49
|
55
|
Chris@49
|
56
|
Chris@49
|
57
|
Chris@49
|
58 //! @}
|