comparison armadillo-3.900.4/include/armadillo_bits/operator_cube_div.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) 2009-2010 NICTA (www.nicta.com.au)
2 // Copyright (C) 2009-2010 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 operator_cube_div
10 //! @{
11
12
13
14 //! BaseCube / scalar
15 template<typename T1>
16 arma_inline
17 const eOpCube<T1, eop_scalar_div_post>
18 operator/
19 (
20 const BaseCube<typename T1::elem_type,T1>& X,
21 const typename T1::elem_type k
22 )
23 {
24 arma_extra_debug_sigprint();
25
26 return eOpCube<T1, eop_scalar_div_post>(X.get_ref(), k);
27 }
28
29
30
31 //! scalar / BaseCube
32 template<typename T1>
33 arma_inline
34 const eOpCube<T1, eop_scalar_div_pre>
35 operator/
36 (
37 const typename T1::elem_type k,
38 const BaseCube<typename T1::elem_type,T1>& X
39 )
40 {
41 arma_extra_debug_sigprint();
42
43 return eOpCube<T1, eop_scalar_div_pre>(X.get_ref(), k);
44 }
45
46
47
48 //! complex scalar / non-complex BaseCube (experimental)
49 template<typename T1>
50 arma_inline
51 const mtOpCube<typename std::complex<typename T1::pod_type>, T1, op_cx_scalar_div_pre>
52 operator/
53 (
54 const std::complex<typename T1::pod_type>& k,
55 const BaseCube<typename T1::pod_type, T1>& X
56 )
57 {
58 arma_extra_debug_sigprint();
59
60 return mtOpCube<typename std::complex<typename T1::pod_type>, T1, op_cx_scalar_div_pre>('j', X.get_ref(), k);
61 }
62
63
64
65 //! non-complex BaseCube / complex scalar (experimental)
66 template<typename T1>
67 arma_inline
68 const mtOpCube<typename std::complex<typename T1::pod_type>, T1, op_cx_scalar_div_post>
69 operator/
70 (
71 const BaseCube<typename T1::pod_type, T1>& X,
72 const std::complex<typename T1::pod_type>& k
73 )
74 {
75 arma_extra_debug_sigprint();
76
77 return mtOpCube<typename std::complex<typename T1::pod_type>, T1, op_cx_scalar_div_post>('j', X.get_ref(), k);
78 }
79
80
81
82 //! element-wise division of BaseCube objects with same element type
83 template<typename T1, typename T2>
84 arma_inline
85 const eGlueCube<T1, T2, eglue_div>
86 operator/
87 (
88 const BaseCube<typename T1::elem_type,T1>& X,
89 const BaseCube<typename T1::elem_type,T2>& Y
90 )
91 {
92 arma_extra_debug_sigprint();
93
94 return eGlueCube<T1, T2, eglue_div>(X.get_ref(), Y.get_ref());
95 }
96
97
98
99 //! element-wise division of BaseCube objects with different element types
100 template<typename T1, typename T2>
101 inline
102 const mtGlueCube<typename promote_type<typename T1::elem_type, typename T2::elem_type>::result, T1, T2, glue_mixed_div>
103 operator/
104 (
105 const BaseCube< typename force_different_type<typename T1::elem_type, typename T2::elem_type>::T1_result, T1>& X,
106 const BaseCube< typename force_different_type<typename T1::elem_type, typename T2::elem_type>::T2_result, T2>& Y
107 )
108 {
109 arma_extra_debug_sigprint();
110
111 typedef typename T1::elem_type eT1;
112 typedef typename T2::elem_type eT2;
113
114 typedef typename promote_type<eT1,eT2>::result out_eT;
115
116 promote_type<eT1,eT2>::check();
117
118 return mtGlueCube<out_eT, T1, T2, glue_mixed_div>( X.get_ref(), Y.get_ref() );
119 }
120
121
122
123 //! @}