comparison armadillo-3.900.4/include/armadillo_bits/fn_strans.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) 2011-2012 NICTA (www.nicta.com.au)
2 // Copyright (C) 2011-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 fn_strans
10 //! @{
11
12
13
14 template<typename T1>
15 arma_inline
16 const Op<T1, op_strans>
17 strans
18 (
19 const T1& X,
20 const typename enable_if< is_arma_type<T1>::value == true >::result* junk1 = 0,
21 const typename arma_cx_only<typename T1::elem_type>::result* junk2 = 0
22 )
23 {
24 arma_extra_debug_sigprint();
25 arma_ignore(junk1);
26 arma_ignore(junk2);
27
28 return Op<T1, op_strans>(X);
29 }
30
31
32
33 // NOTE: for non-complex objects, deliberately returning op_htrans instead of op_strans,
34 // NOTE: due to currently more optimisations available when using op_htrans, especially by glue_times
35 template<typename T1>
36 arma_inline
37 const Op<T1, op_htrans>
38 strans
39 (
40 const T1& X,
41 const typename enable_if< is_arma_type<T1>::value == true >::result* junk1 = 0,
42 const typename arma_not_cx<typename T1::elem_type>::result* junk2 = 0
43 )
44 {
45 arma_extra_debug_sigprint();
46 arma_ignore(junk1);
47 arma_ignore(junk2);
48
49 return Op<T1, op_htrans>(X);
50 }
51
52
53
54 //! two consecutive transpose operations cancel each other
55 template<typename T1>
56 arma_inline
57 const T1&
58 strans(const Op<T1, op_strans>& X)
59 {
60 arma_extra_debug_sigprint();
61 arma_extra_debug_print("strans(): removing op_strans");
62
63 return X.m;
64 }
65
66
67
68 //
69 // handling of sparse matrices
70
71
72 template<typename T1>
73 inline
74 typename
75 enable_if2
76 <
77 is_arma_sparse_type<T1>::value,
78 const SpOp<T1,spop_strans>
79 >::result
80 strans(const T1& x)
81 {
82 arma_extra_debug_sigprint();
83
84 return SpOp<T1,spop_strans>(x);
85 }
86
87
88
89 //! @}