Mercurial > hg > segmenter-vamp-plugin
comparison armadillo-3.900.4/include/armadillo_bits/fn_var.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-2012 NICTA (www.nicta.com.au) | |
2 // Copyright (C) 2009-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_var | |
10 //! @{ | |
11 | |
12 | |
13 | |
14 template<typename T1> | |
15 inline | |
16 const mtOp<typename T1::pod_type, T1, op_var> | |
17 var | |
18 ( | |
19 const T1& X, | |
20 const uword norm_type = 0, | |
21 const uword dim = 0, | |
22 const typename enable_if< is_arma_type<T1>::value == true >::result* junk1 = 0, | |
23 const typename enable_if< resolves_to_vector<T1>::value == false >::result* junk2 = 0 | |
24 ) | |
25 { | |
26 arma_extra_debug_sigprint(); | |
27 arma_ignore(junk1); | |
28 arma_ignore(junk2); | |
29 | |
30 return mtOp<typename T1::pod_type, T1, op_var>(X, norm_type, dim); | |
31 } | |
32 | |
33 | |
34 | |
35 template<typename T1> | |
36 inline | |
37 const mtOp<typename T1::pod_type, T1, op_var> | |
38 var | |
39 ( | |
40 const T1& X, | |
41 const uword norm_type, | |
42 const uword dim, | |
43 const typename enable_if<resolves_to_vector<T1>::value == true>::result* junk = 0 | |
44 ) | |
45 { | |
46 arma_extra_debug_sigprint(); | |
47 arma_ignore(junk); | |
48 | |
49 return mtOp<typename T1::pod_type, T1, op_var>(X, norm_type, dim); | |
50 } | |
51 | |
52 | |
53 | |
54 template<typename T1> | |
55 inline | |
56 arma_warn_unused | |
57 typename T1::pod_type | |
58 var | |
59 ( | |
60 const T1& X, | |
61 const uword norm_type = 0, | |
62 const arma_empty_class junk1 = arma_empty_class(), | |
63 const typename enable_if<resolves_to_vector<T1>::value == true>::result* junk2 = 0 | |
64 ) | |
65 { | |
66 arma_extra_debug_sigprint(); | |
67 arma_ignore(junk1); | |
68 arma_ignore(junk2); | |
69 | |
70 return op_var::var_vec( X, norm_type ); | |
71 } | |
72 | |
73 | |
74 | |
75 template<typename T> | |
76 arma_inline | |
77 arma_warn_unused | |
78 const typename arma_scalar_only<T>::result | |
79 var(const T&) | |
80 { | |
81 return T(0); | |
82 } | |
83 | |
84 | |
85 | |
86 template<typename T1> | |
87 inline | |
88 const mtSpOp<typename T1::pod_type, T1, spop_var> | |
89 var | |
90 ( | |
91 const T1& X, | |
92 const uword norm_type = 0, | |
93 const uword dim = 0, | |
94 const typename enable_if< is_arma_sparse_type<T1>::value == true >::result* junk1 = 0, | |
95 const typename enable_if< resolves_to_sparse_vector<T1>::value == false >::result* junk2 = 0 | |
96 ) | |
97 { | |
98 arma_extra_debug_sigprint(); | |
99 arma_ignore(junk1); | |
100 arma_ignore(junk2); | |
101 | |
102 return mtSpOp<typename T1::pod_type, T1, spop_var>(X, norm_type, dim); | |
103 } | |
104 | |
105 | |
106 | |
107 template<typename T1> | |
108 inline | |
109 const mtSpOp<typename T1::pod_type, T1, spop_var> | |
110 var | |
111 ( | |
112 const T1& X, | |
113 const uword norm_type, | |
114 const uword dim = 0, | |
115 const typename enable_if<resolves_to_sparse_vector<T1>::value == true>::result* junk1 = 0 | |
116 ) | |
117 { | |
118 arma_extra_debug_sigprint(); | |
119 arma_ignore(junk1); | |
120 | |
121 return mtSpOp<typename T1::pod_type, T1, spop_var>(X, norm_type, dim); | |
122 } | |
123 | |
124 | |
125 | |
126 template<typename T1> | |
127 inline | |
128 typename T1::pod_type | |
129 var | |
130 ( | |
131 const T1& X, | |
132 const uword norm_type = 0, | |
133 const arma_empty_class junk1 = arma_empty_class(), | |
134 const typename enable_if<resolves_to_sparse_vector<T1>::value == true>::result* junk2 = 0 | |
135 ) | |
136 { | |
137 arma_extra_debug_sigprint(); | |
138 arma_ignore(junk1); | |
139 arma_ignore(junk2); | |
140 | |
141 return spop_var::var_vec(X, norm_type); | |
142 } | |
143 | |
144 | |
145 | |
146 //! @} |