Chris@49
|
1 // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
|
Chris@49
|
2 // Copyright (C) 2008-2010 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
|
Chris@49
|
10
|
Chris@49
|
11 //! \addtogroup operator_cube_times
|
Chris@49
|
12 //! @{
|
Chris@49
|
13
|
Chris@49
|
14
|
Chris@49
|
15
|
Chris@49
|
16 //! BaseCube * scalar
|
Chris@49
|
17 template<typename T1>
|
Chris@49
|
18 arma_inline
|
Chris@49
|
19 const eOpCube<T1, eop_scalar_times>
|
Chris@49
|
20 operator*
|
Chris@49
|
21 (
|
Chris@49
|
22 const BaseCube<typename T1::elem_type,T1>& X,
|
Chris@49
|
23 const typename T1::elem_type k
|
Chris@49
|
24 )
|
Chris@49
|
25 {
|
Chris@49
|
26 arma_extra_debug_sigprint();
|
Chris@49
|
27
|
Chris@49
|
28 return eOpCube<T1, eop_scalar_times>(X.get_ref(), k);
|
Chris@49
|
29 }
|
Chris@49
|
30
|
Chris@49
|
31
|
Chris@49
|
32
|
Chris@49
|
33 //! scalar * BaseCube
|
Chris@49
|
34 template<typename T1>
|
Chris@49
|
35 arma_inline
|
Chris@49
|
36 const eOpCube<T1, eop_scalar_times>
|
Chris@49
|
37 operator*
|
Chris@49
|
38 (
|
Chris@49
|
39 const typename T1::elem_type k,
|
Chris@49
|
40 const BaseCube<typename T1::elem_type,T1>& X
|
Chris@49
|
41 )
|
Chris@49
|
42 {
|
Chris@49
|
43 arma_extra_debug_sigprint();
|
Chris@49
|
44
|
Chris@49
|
45 return eOpCube<T1, eop_scalar_times>(X.get_ref(), k);
|
Chris@49
|
46 }
|
Chris@49
|
47
|
Chris@49
|
48
|
Chris@49
|
49
|
Chris@49
|
50 //! non-complex BaseCube * complex scalar (experimental)
|
Chris@49
|
51 template<typename T1>
|
Chris@49
|
52 arma_inline
|
Chris@49
|
53 const mtOpCube<typename std::complex<typename T1::pod_type>, T1, op_cx_scalar_times>
|
Chris@49
|
54 operator*
|
Chris@49
|
55 (
|
Chris@49
|
56 const BaseCube<typename T1::pod_type, T1>& X,
|
Chris@49
|
57 const std::complex<typename T1::pod_type>& k
|
Chris@49
|
58 )
|
Chris@49
|
59 {
|
Chris@49
|
60 arma_extra_debug_sigprint();
|
Chris@49
|
61
|
Chris@49
|
62 return mtOpCube<typename std::complex<typename T1::pod_type>, T1, op_cx_scalar_times>('j', X.get_ref(), k);
|
Chris@49
|
63 }
|
Chris@49
|
64
|
Chris@49
|
65
|
Chris@49
|
66
|
Chris@49
|
67 //! complex scalar * non-complex BaseCube (experimental)
|
Chris@49
|
68 template<typename T1>
|
Chris@49
|
69 arma_inline
|
Chris@49
|
70 const mtOpCube<typename std::complex<typename T1::pod_type>, T1, op_cx_scalar_times>
|
Chris@49
|
71 operator*
|
Chris@49
|
72 (
|
Chris@49
|
73 const std::complex<typename T1::pod_type>& k,
|
Chris@49
|
74 const BaseCube<typename T1::pod_type, T1>& X
|
Chris@49
|
75 )
|
Chris@49
|
76 {
|
Chris@49
|
77 arma_extra_debug_sigprint();
|
Chris@49
|
78
|
Chris@49
|
79 return mtOpCube<typename std::complex<typename T1::pod_type>, T1, op_cx_scalar_times>('j', X.get_ref(), k);
|
Chris@49
|
80 }
|
Chris@49
|
81
|
Chris@49
|
82
|
Chris@49
|
83
|
Chris@49
|
84 //! @}
|