Mercurial > hg > segmenter-vamp-plugin
comparison armadillo-3.900.4/include/armadillo_bits/auxlib_bones.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) 2008-2012 NICTA (www.nicta.com.au) | |
2 // Copyright (C) 2008-2012 Conrad Sanderson | |
3 // Copyright (C) 2009 Edmund Highcock | |
4 // Copyright (C) 2011 James Sanders | |
5 // Copyright (C) 2012 Eric Jon Sundstrom | |
6 // | |
7 // This Source Code Form is subject to the terms of the Mozilla Public | |
8 // License, v. 2.0. If a copy of the MPL was not distributed with this | |
9 // file, You can obtain one at http://mozilla.org/MPL/2.0/. | |
10 | |
11 | |
12 //! \addtogroup auxlib | |
13 //! @{ | |
14 | |
15 | |
16 //! wrapper for accessing external functions defined in ATLAS, LAPACK or BLAS libraries | |
17 class auxlib | |
18 { | |
19 public: | |
20 | |
21 | |
22 template<const uword row, const uword col> | |
23 struct pos | |
24 { | |
25 static const uword n2 = row + col*2; | |
26 static const uword n3 = row + col*3; | |
27 static const uword n4 = row + col*4; | |
28 }; | |
29 | |
30 | |
31 // | |
32 // inv | |
33 | |
34 template<typename eT, typename T1> | |
35 inline static bool inv(Mat<eT>& out, const Base<eT,T1>& X, const bool slow = false); | |
36 | |
37 template<typename eT> | |
38 inline static bool inv(Mat<eT>& out, const Mat<eT>& A, const bool slow = false); | |
39 | |
40 template<typename eT> | |
41 inline static bool inv_noalias_tinymat(Mat<eT>& out, const Mat<eT>& X, const uword N); | |
42 | |
43 template<typename eT> | |
44 inline static bool inv_inplace_tinymat(Mat<eT>& out, const uword N); | |
45 | |
46 template<typename eT> | |
47 inline static bool inv_inplace_lapack(Mat<eT>& out); | |
48 | |
49 | |
50 // | |
51 // inv_tr | |
52 | |
53 template<typename eT, typename T1> | |
54 inline static bool inv_tr(Mat<eT>& out, const Base<eT,T1>& X, const uword layout); | |
55 | |
56 | |
57 // | |
58 // inv_sym | |
59 | |
60 template<typename eT, typename T1> | |
61 inline static bool inv_sym(Mat<eT>& out, const Base<eT,T1>& X, const uword layout); | |
62 | |
63 | |
64 // | |
65 // inv_sympd | |
66 | |
67 template<typename eT, typename T1> | |
68 inline static bool inv_sympd(Mat<eT>& out, const Base<eT,T1>& X, const uword layout); | |
69 | |
70 | |
71 // | |
72 // det | |
73 | |
74 template<typename eT, typename T1> | |
75 inline static eT det(const Base<eT,T1>& X, const bool slow = false); | |
76 | |
77 template<typename eT> | |
78 inline static eT det_tinymat(const Mat<eT>& X, const uword N); | |
79 | |
80 template<typename eT> | |
81 inline static eT det_lapack(const Mat<eT>& X, const bool make_copy); | |
82 | |
83 | |
84 // | |
85 // log_det | |
86 | |
87 template<typename eT, typename T1> | |
88 inline static bool log_det(eT& out_val, typename get_pod_type<eT>::result& out_sign, const Base<eT,T1>& X); | |
89 | |
90 | |
91 // | |
92 // lu | |
93 | |
94 template<typename eT, typename T1> | |
95 inline static bool lu(Mat<eT>& L, Mat<eT>& U, podarray<blas_int>& ipiv, const Base<eT,T1>& X); | |
96 | |
97 template<typename eT, typename T1> | |
98 inline static bool lu(Mat<eT>& L, Mat<eT>& U, Mat<eT>& P, const Base<eT,T1>& X); | |
99 | |
100 template<typename eT, typename T1> | |
101 inline static bool lu(Mat<eT>& L, Mat<eT>& U, const Base<eT,T1>& X); | |
102 | |
103 | |
104 // | |
105 // eig | |
106 | |
107 template<typename eT, typename T1> | |
108 inline static bool eig_sym(Col<eT>& eigval, const Base<eT,T1>& X); | |
109 | |
110 template<typename T, typename T1> | |
111 inline static bool eig_sym(Col<T>& eigval, const Base<std::complex<T>,T1>& X); | |
112 | |
113 template<typename eT, typename T1> | |
114 inline static bool eig_sym(Col<eT>& eigval, Mat<eT>& eigvec, const Base<eT,T1>& X); | |
115 | |
116 template<typename T, typename T1> | |
117 inline static bool eig_sym(Col<T>& eigval, Mat< std::complex<T> >& eigvec, const Base<std::complex<T>,T1>& X); | |
118 | |
119 template<typename eT, typename T1> | |
120 inline static bool eig_sym_dc(Col<eT>& eigval, Mat<eT>& eigvec, const Base<eT,T1>& X); | |
121 | |
122 template<typename T, typename T1> | |
123 inline static bool eig_sym_dc(Col<T>& eigval, Mat< std::complex<T> >& eigvec, const Base<std::complex<T>,T1>& X); | |
124 | |
125 template<typename T, typename T1> | |
126 inline static bool eig_gen(Col< std::complex<T> >& eigval, Mat<T>& l_eigvec, Mat<T>& r_eigvec, const Base<T,T1>& X, const char side); | |
127 | |
128 template<typename T, typename T1> | |
129 inline static bool eig_gen(Col< std::complex<T> >& eigval, Mat< std::complex<T> >& l_eigvec, Mat< std::complex<T> >& r_eigvec, const Base< std::complex<T>, T1 >& X, const char side); | |
130 | |
131 | |
132 // | |
133 // chol | |
134 | |
135 template<typename eT, typename T1> | |
136 inline static bool chol(Mat<eT>& out, const Base<eT,T1>& X); | |
137 | |
138 | |
139 // | |
140 // qr | |
141 | |
142 template<typename eT, typename T1> | |
143 inline static bool qr(Mat<eT>& Q, Mat<eT>& R, const Base<eT,T1>& X); | |
144 | |
145 template<typename eT, typename T1> | |
146 inline static bool qr_econ(Mat<eT>& Q, Mat<eT>& R, const Base<eT,T1>& X); | |
147 | |
148 | |
149 // | |
150 // svd | |
151 | |
152 template<typename eT, typename T1> | |
153 inline static bool svd(Col<eT>& S, const Base<eT,T1>& X, uword& n_rows, uword& n_cols); | |
154 | |
155 template<typename T, typename T1> | |
156 inline static bool svd(Col<T>& S, const Base<std::complex<T>, T1>& X, uword& n_rows, uword& n_cols); | |
157 | |
158 template<typename eT, typename T1> | |
159 inline static bool svd(Col<eT>& S, const Base<eT,T1>& X); | |
160 | |
161 template<typename T, typename T1> | |
162 inline static bool svd(Col<T>& S, const Base<std::complex<T>, T1>& X); | |
163 | |
164 template<typename eT, typename T1> | |
165 inline static bool svd(Mat<eT>& U, Col<eT>& S, Mat<eT>& V, const Base<eT,T1>& X); | |
166 | |
167 template<typename T, typename T1> | |
168 inline static bool svd(Mat< std::complex<T> >& U, Col<T>& S, Mat< std::complex<T> >& V, const Base< std::complex<T>, T1>& X); | |
169 | |
170 template<typename eT, typename T1> | |
171 inline static bool svd_econ(Mat<eT>& U, Col<eT>& S, Mat<eT>& V, const Base<eT,T1>& X, const char mode); | |
172 | |
173 template<typename T, typename T1> | |
174 inline static bool svd_econ(Mat< std::complex<T> >& U, Col<T>& S, Mat< std::complex<T> >& V, const Base< std::complex<T>, T1>& X, const char mode); | |
175 | |
176 template<typename eT, typename T1> | |
177 inline static bool svd_dc(Mat<eT>& U, Col<eT>& S, Mat<eT>& V, const Base<eT,T1>& X); | |
178 | |
179 template<typename T, typename T1> | |
180 inline static bool svd_dc(Mat< std::complex<T> >& U, Col<T>& S, Mat< std::complex<T> >& V, const Base< std::complex<T>, T1>& X); | |
181 | |
182 | |
183 // | |
184 // solve | |
185 | |
186 template<typename eT, typename T1> | |
187 inline static bool solve (Mat<eT>& out, Mat<eT>& A, const Base<eT,T1>& X, const bool slow = false); | |
188 | |
189 template<typename eT, typename T1> | |
190 inline static bool solve_od(Mat<eT>& out, Mat<eT>& A, const Base<eT,T1>& X); | |
191 | |
192 template<typename eT, typename T1> | |
193 inline static bool solve_ud(Mat<eT>& out, Mat<eT>& A, const Base<eT,T1>& X); | |
194 | |
195 | |
196 // | |
197 // solve_tr | |
198 | |
199 template<typename eT> | |
200 inline static bool solve_tr(Mat<eT>& out, const Mat<eT>& A, const Mat<eT>& B, const uword layout); | |
201 | |
202 | |
203 // | |
204 // Schur decomposition | |
205 | |
206 template<typename eT> | |
207 inline static bool schur_dec(Mat<eT>& Z, Mat<eT>& T, const Mat<eT>& A); | |
208 | |
209 template<typename cT> | |
210 inline static bool schur_dec(Mat<std::complex<cT> >& Z, Mat<std::complex<cT> >& T, const Mat<std::complex<cT> >& A); | |
211 | |
212 | |
213 // | |
214 // syl (solution of the Sylvester equation AX + XB = C) | |
215 | |
216 template<typename eT> | |
217 inline static bool syl(Mat<eT>& X, const Mat<eT>& A, const Mat<eT>& B, const Mat<eT>& C); | |
218 | |
219 | |
220 // | |
221 // lyap (solution of the continuous Lyapunov equation AX + XA^H + Q = 0) | |
222 | |
223 template<typename eT> | |
224 inline static bool lyap(Mat<eT>& X, const Mat<eT>& A, const Mat<eT>& Q); | |
225 | |
226 | |
227 // | |
228 // dlyap (solution of the discrete Lyapunov equation AXA^H - X + Q = 0) | |
229 | |
230 template<typename eT> | |
231 inline static bool dlyap(Mat<eT>& X, const Mat<eT>& A, const Mat<eT>& Q); | |
232 }; | |
233 | |
234 | |
235 //! @} |