Chris@49
|
1 // Copyright (C) 2008-2013 NICTA (www.nicta.com.au)
|
Chris@49
|
2 // Copyright (C) 2008-2013 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 op_strans
|
Chris@49
|
10 //! @{
|
Chris@49
|
11
|
Chris@49
|
12
|
Chris@49
|
13 //! 'matrix transpose' operation (simple transpose, ie. without taking the conjugate of the elements)
|
Chris@49
|
14
|
Chris@49
|
15 class op_strans
|
Chris@49
|
16 {
|
Chris@49
|
17 public:
|
Chris@49
|
18
|
Chris@49
|
19 template<const bool do_flip, const uword row, const uword col>
|
Chris@49
|
20 struct pos
|
Chris@49
|
21 {
|
Chris@49
|
22 static const uword n2 = (do_flip == false) ? (row + col*2) : (col + row*2);
|
Chris@49
|
23 static const uword n3 = (do_flip == false) ? (row + col*3) : (col + row*3);
|
Chris@49
|
24 static const uword n4 = (do_flip == false) ? (row + col*4) : (col + row*4);
|
Chris@49
|
25 };
|
Chris@49
|
26
|
Chris@49
|
27 template<typename eT, typename TA>
|
Chris@49
|
28 arma_hot inline static void apply_noalias_tinysq(Mat<eT>& out, const TA& A);
|
Chris@49
|
29
|
Chris@49
|
30 template<typename eT, typename TA>
|
Chris@49
|
31 arma_hot inline static void apply_noalias(Mat<eT>& out, const TA& A);
|
Chris@49
|
32
|
Chris@49
|
33 template<typename eT, typename TA>
|
Chris@49
|
34 arma_hot inline static void apply(Mat<eT>& out, const TA& A);
|
Chris@49
|
35
|
Chris@49
|
36 template<typename T1>
|
Chris@49
|
37 arma_hot inline static void apply_proxy(Mat<typename T1::elem_type>& out, const T1& X);
|
Chris@49
|
38
|
Chris@49
|
39 template<typename T1>
|
Chris@49
|
40 arma_hot inline static void apply(Mat<typename T1::elem_type>& out, const Op<T1,op_strans>& in);
|
Chris@49
|
41 };
|
Chris@49
|
42
|
Chris@49
|
43
|
Chris@49
|
44
|
Chris@49
|
45 class op_strans2
|
Chris@49
|
46 {
|
Chris@49
|
47 public:
|
Chris@49
|
48
|
Chris@49
|
49 template<const bool do_flip, const uword row, const uword col>
|
Chris@49
|
50 struct pos
|
Chris@49
|
51 {
|
Chris@49
|
52 static const uword n2 = (do_flip == false) ? (row + col*2) : (col + row*2);
|
Chris@49
|
53 static const uword n3 = (do_flip == false) ? (row + col*3) : (col + row*3);
|
Chris@49
|
54 static const uword n4 = (do_flip == false) ? (row + col*4) : (col + row*4);
|
Chris@49
|
55 };
|
Chris@49
|
56
|
Chris@49
|
57 template<typename eT, typename TA>
|
Chris@49
|
58 arma_hot inline static void apply_noalias_tinysq(Mat<eT>& out, const TA& A, const eT val);
|
Chris@49
|
59
|
Chris@49
|
60 template<typename eT, typename TA>
|
Chris@49
|
61 arma_hot inline static void apply_noalias(Mat<eT>& out, const TA& A, const eT val);
|
Chris@49
|
62
|
Chris@49
|
63 template<typename eT, typename TA>
|
Chris@49
|
64 arma_hot inline static void apply(Mat<eT>& out, const TA& A, const eT val);
|
Chris@49
|
65
|
Chris@49
|
66 template<typename T1>
|
Chris@49
|
67 arma_hot inline static void apply_proxy(Mat<typename T1::elem_type>& out, const T1& X, const typename T1::elem_type val);
|
Chris@49
|
68
|
Chris@49
|
69 // NOTE: there is no direct handling of Op<T1,op_strans2>, as op_strans2::apply_proxy() is currently only called by op_htrans2 for non-complex numbers
|
Chris@49
|
70 };
|
Chris@49
|
71
|
Chris@49
|
72
|
Chris@49
|
73
|
Chris@49
|
74 //! @}
|