comparison armadillo-3.900.4/include/armadillo_bits/fn_cumsum.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) 2010-2012 NICTA (www.nicta.com.au)
2 // Copyright (C) 2010-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_cumsum
10 //! @{
11
12
13
14 template<typename T1>
15 arma_inline
16 const Op<T1, op_cumsum_mat>
17 cumsum
18 (
19 const T1& X,
20 const uword dim = 0,
21 const typename enable_if< is_arma_type<T1>::value == true >::result* junk1 = 0,
22 const typename enable_if< resolves_to_vector<T1>::value == false >::result* junk2 = 0
23 )
24 {
25 arma_extra_debug_sigprint();
26 arma_ignore(junk1);
27 arma_ignore(junk2);
28
29 return Op<T1, op_cumsum_mat>(X, dim, 0);
30 }
31
32
33
34 template<typename T1>
35 arma_inline
36 const Op<T1, op_cumsum_mat>
37 cumsum
38 (
39 const T1& X,
40 const uword dim,
41 const typename enable_if<resolves_to_vector<T1>::value == true>::result* junk = 0
42 )
43 {
44 arma_extra_debug_sigprint();
45 arma_ignore(junk);
46
47 return Op<T1, op_cumsum_mat>(X, dim, 0);
48 }
49
50
51
52 template<typename T1>
53 arma_inline
54 const Op<T1, op_cumsum_vec>
55 cumsum
56 (
57 const T1& X,
58 const arma_empty_class junk1 = arma_empty_class(),
59 const typename enable_if<resolves_to_vector<T1>::value == true>::result* junk2 = 0
60 )
61 {
62 arma_extra_debug_sigprint();
63 arma_ignore(junk1);
64 arma_ignore(junk2);
65
66 return Op<T1, op_cumsum_vec>(X);
67 }
68
69
70
71 template<typename T1>
72 arma_inline
73 const Op<Op<T1, op_cumsum_vec>, op_cumsum_mat>
74 cumsum
75 (
76 const Op<T1, op_cumsum_vec>& X,
77 const uword dim,
78 const typename enable_if<resolves_to_vector<T1>::value == true>::result* junk = 0
79 )
80 {
81 arma_extra_debug_sigprint();
82 arma_ignore(junk);
83
84 return Op<Op<T1, op_cumsum_vec>, op_cumsum_mat>(X, dim, 0);
85 }
86
87
88
89 template<typename T1>
90 arma_inline
91 const Op<Op<T1, op_cumsum_vec>, op_cumsum_vec>
92 cumsum
93 (
94 const Op<T1, op_cumsum_vec>& X,
95 const arma_empty_class junk1 = arma_empty_class(),
96 const typename enable_if<resolves_to_vector<T1>::value == true>::result* junk2 = 0
97 )
98 {
99 arma_extra_debug_sigprint();
100 arma_ignore(junk1);
101 arma_ignore(junk2);
102
103 return Op<Op<T1, op_cumsum_vec>, op_cumsum_vec>(X);
104 }
105
106
107
108 template<typename T>
109 arma_inline
110 arma_warn_unused
111 const typename arma_scalar_only<T>::result &
112 cumsum(const T& x)
113 {
114 return x;
115 }
116
117
118
119 //! @}