comparison armadillo-2.4.4/include/armadillo_bits/operator_cube_times.hpp @ 0:8b6102e2a9b0

Armadillo Library
author maxzanoni76 <max.zanoni@eecs.qmul.ac.uk>
date Wed, 11 Apr 2012 09:27:06 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:8b6102e2a9b0
1 // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
2 // Copyright (C) 2008-2010 Conrad Sanderson
3 //
4 // This file is part of the Armadillo C++ library.
5 // It is provided without any warranty of fitness
6 // for any purpose. You can redistribute this file
7 // and/or modify it under the terms of the GNU
8 // Lesser General Public License (LGPL) as published
9 // by the Free Software Foundation, either version 3
10 // of the License or (at your option) any later version.
11 // (see http://www.opensource.org/licenses for more info)
12
13
14
15
16 //! \addtogroup operator_cube_times
17 //! @{
18
19
20
21 //! BaseCube * scalar
22 template<typename T1>
23 arma_inline
24 const eOpCube<T1, eop_scalar_times>
25 operator*
26 (
27 const BaseCube<typename T1::elem_type,T1>& X,
28 const typename T1::elem_type k
29 )
30 {
31 arma_extra_debug_sigprint();
32
33 return eOpCube<T1, eop_scalar_times>(X.get_ref(), k);
34 }
35
36
37
38 //! scalar * BaseCube
39 template<typename T1>
40 arma_inline
41 const eOpCube<T1, eop_scalar_times>
42 operator*
43 (
44 const typename T1::elem_type k,
45 const BaseCube<typename T1::elem_type,T1>& X
46 )
47 {
48 arma_extra_debug_sigprint();
49
50 return eOpCube<T1, eop_scalar_times>(X.get_ref(), k);
51 }
52
53
54
55 //! non-complex BaseCube * complex scalar (experimental)
56 template<typename T1>
57 arma_inline
58 const mtOpCube<typename std::complex<typename T1::pod_type>, T1, op_cx_scalar_times>
59 operator*
60 (
61 const BaseCube<typename T1::pod_type, T1>& X,
62 const std::complex<typename T1::pod_type>& k
63 )
64 {
65 arma_extra_debug_sigprint();
66
67 return mtOpCube<typename std::complex<typename T1::pod_type>, T1, op_cx_scalar_times>('j', X.get_ref(), k);
68 }
69
70
71
72 //! complex scalar * non-complex BaseCube (experimental)
73 template<typename T1>
74 arma_inline
75 const mtOpCube<typename std::complex<typename T1::pod_type>, T1, op_cx_scalar_times>
76 operator*
77 (
78 const std::complex<typename T1::pod_type>& k,
79 const BaseCube<typename T1::pod_type, T1>& X
80 )
81 {
82 arma_extra_debug_sigprint();
83
84 return mtOpCube<typename std::complex<typename T1::pod_type>, T1, op_cx_scalar_times>('j', X.get_ref(), k);
85 }
86
87
88
89 //! @}