auxlib_bones.hpp
Go to the documentation of this file.
1 // Copyright (C) 2008-2011 NICTA (www.nicta.com.au)
2 // Copyright (C) 2008-2011 Conrad Sanderson
3 // Copyright (C) 2009 Edmund Highcock
4 // Copyright (C) 2011 James Sanders
5 //
6 // This file is part of the Armadillo C++ library.
7 // It is provided without any warranty of fitness
8 // for any purpose. You can redistribute this file
9 // and/or modify it under the terms of the GNU
10 // Lesser General Public License (LGPL) as published
11 // by the Free Software Foundation, either version 3
12 // of the License or (at your option) any later version.
13 // (see http://www.opensource.org/licenses for more info)
14 
15 
18 
19 
21 class auxlib
22  {
23  public:
24 
25 
26  template<const uword row, const uword col>
27  struct pos
28  {
29  static const uword n2 = row + col*2;
30  static const uword n3 = row + col*3;
31  static const uword n4 = row + col*4;
32  };
33 
34 
35  //
36  // inv
37 
38  template<typename eT, typename T1>
39  inline static bool inv(Mat<eT>& out, const Base<eT,T1>& X, const bool slow = false);
40 
41  template<typename eT>
42  inline static bool inv(Mat<eT>& out, const Mat<eT>& A, const bool slow = false);
43 
44  template<typename eT>
45  inline static bool inv_noalias_tinymat(Mat<eT>& out, const Mat<eT>& X, const uword N);
46 
47  template<typename eT>
48  inline static bool inv_inplace_tinymat(Mat<eT>& out, const uword N);
49 
50  template<typename eT>
51  inline static bool inv_inplace_lapack(Mat<eT>& out);
52 
53 
54  //
55  // inv_tr
56 
57  template<typename eT, typename T1>
58  inline static bool inv_tr(Mat<eT>& out, const Base<eT,T1>& X, const uword layout);
59 
60 
61  //
62  // inv_sym
63 
64  template<typename eT, typename T1>
65  inline static bool inv_sym(Mat<eT>& out, const Base<eT,T1>& X, const uword layout);
66 
67 
68  //
69  // inv_sympd
70 
71  template<typename eT, typename T1>
72  inline static bool inv_sympd(Mat<eT>& out, const Base<eT,T1>& X, const uword layout);
73 
74 
75  //
76  // det
77 
78  template<typename eT, typename T1>
79  inline static eT det(const Base<eT,T1>& X, const bool slow = false);
80 
81  template<typename eT>
82  inline static eT det_tinymat(const Mat<eT>& X, const uword N);
83 
84  template<typename eT>
85  inline static eT det_lapack(const Mat<eT>& X, const bool make_copy);
86 
87 
88  //
89  // log_det
90 
91  template<typename eT, typename T1>
92  inline static bool log_det(eT& out_val, typename get_pod_type<eT>::result& out_sign, const Base<eT,T1>& X);
93 
94 
95  //
96  // lu
97 
98  template<typename eT, typename T1>
99  inline static bool lu(Mat<eT>& L, Mat<eT>& U, podarray<blas_int>& ipiv, const Base<eT,T1>& X);
100 
101  template<typename eT, typename T1>
102  inline static bool lu(Mat<eT>& L, Mat<eT>& U, Mat<eT>& P, const Base<eT,T1>& X);
103 
104  template<typename eT, typename T1>
105  inline static bool lu(Mat<eT>& L, Mat<eT>& U, const Base<eT,T1>& X);
106 
107 
108  //
109  // eig
110 
111  template<typename eT, typename T1>
112  inline static bool eig_sym(Col<eT>& eigval, const Base<eT,T1>& X);
113 
114  template<typename T, typename T1>
115  inline static bool eig_sym(Col<T>& eigval, const Base<std::complex<T>,T1>& X);
116 
117  template<typename eT, typename T1>
118  inline static bool eig_sym(Col<eT>& eigval, Mat<eT>& eigvec, const Base<eT,T1>& X);
119 
120  template<typename T, typename T1>
121  inline static bool eig_sym(Col<T>& eigval, Mat< std::complex<T> >& eigvec, const Base<std::complex<T>,T1>& X);
122 
123  template<typename T, typename T1>
124  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);
125 
126  template<typename T, typename T1>
127  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);
128 
129 
130  //
131  // chol
132 
133  template<typename eT, typename T1>
134  inline static bool chol(Mat<eT>& out, const Base<eT,T1>& X);
135 
136 
137  //
138  // qr
139 
140  template<typename eT, typename T1>
141  inline static bool qr(Mat<eT>& Q, Mat<eT>& R, const Base<eT,T1>& X);
142 
143 
144  //
145  // svd
146 
147  template<typename eT, typename T1>
148  inline static bool svd(Col<eT>& S, const Base<eT,T1>& X, uword& n_rows, uword& n_cols);
149 
150  template<typename T, typename T1>
151  inline static bool svd(Col<T>& S, const Base<std::complex<T>, T1>& X, uword& n_rows, uword& n_cols);
152 
153  template<typename eT, typename T1>
154  inline static bool svd(Col<eT>& S, const Base<eT,T1>& X);
155 
156  template<typename T, typename T1>
157  inline static bool svd(Col<T>& S, const Base<std::complex<T>, T1>& X);
158 
159  template<typename eT, typename T1>
160  inline static bool svd(Mat<eT>& U, Col<eT>& S, Mat<eT>& V, const Base<eT,T1>& X);
161 
162  template<typename T, typename T1>
163  inline static bool svd(Mat< std::complex<T> >& U, Col<T>& S, Mat< std::complex<T> >& V, const Base< std::complex<T>, T1>& X);
164 
165  template<typename eT, typename T1>
166  inline static bool svd_econ(Mat<eT>& U, Col<eT>& S, Mat<eT>& V, const Base<eT,T1>& X, const char mode);
167 
168  template<typename T, typename T1>
169  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);
170 
171 
172  //
173  // solve
174 
175  template<typename eT>
176  inline static bool solve (Mat<eT>& out, Mat<eT>& A, const Mat<eT>& B, const bool slow = false);
177 
178  template<typename eT>
179  inline static bool solve_od(Mat<eT>& out, Mat<eT>& A, const Mat<eT>& B);
180 
181  template<typename eT>
182  inline static bool solve_ud(Mat<eT>& out, Mat<eT>& A, const Mat<eT>& B);
183 
184 
185  //
186  // solve_tr
187 
188  template<typename eT>
189  inline static bool solve_tr(Mat<eT>& out, const Mat<eT>& A, const Mat<eT>& B, const uword layout);
190 
191 
192  //
193  // Schur decomposition
194 
195  template<typename eT>
196  inline static bool schur_dec(Mat<eT>& Z, Mat<eT>& T, const Mat<eT>& A);
197 
198  template<typename cT>
199  inline static bool schur_dec(Mat<std::complex<cT> >& Z, Mat<std::complex<cT> >& T, const Mat<std::complex<cT> >& A);
200 
201 
202  //
203  // syl (solution of the Sylvester equation AX + XB = C)
204 
205  template<typename eT>
206  inline static bool syl(Mat<eT>& X, const Mat<eT>& A, const Mat<eT>& B, const Mat<eT>& C);
207 
208 
209  //
210  // lyap (solution of the continuous Lyapunov equation AX + XA^H + Q = 0)
211 
212  template<typename eT>
213  inline static bool lyap(Mat<eT>& X, const Mat<eT>& A, const Mat<eT>& Q);
214 
215 
216  //
217  // dlyap (solution of the discrete Lyapunov equation AXA^H - X + Q = 0)
218 
219  template<typename eT>
220  inline static bool dlyap(Mat<eT>& X, const Mat<eT>& A, const Mat<eT>& Q);
221  };
222 
223 
A lightweight array for POD types. If the amount of memory requested is small, the stack is used...
static bool solve_tr(Mat< eT > &out, const Mat< eT > &A, const Mat< eT > &B, const uword layout)
static eT det_tinymat(const Mat< eT > &X, const uword N)
static bool lu(Mat< eT > &L, Mat< eT > &U, podarray< blas_int > &ipiv, const Base< eT, T1 > &X)
immediate LU decomposition of a matrix using ATLAS or LAPACK
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)
static bool lyap(Mat< eT > &X, const Mat< eT > &A, const Mat< eT > &Q)
static const uword n4
static bool eig_sym(Col< eT > &eigval, const Base< eT, T1 > &X)
immediate eigenvalues of a symmetric real matrix using LAPACK
static bool solve(Mat< eT > &out, Mat< eT > &A, const Mat< eT > &B, const bool slow=false)
static eT det_lapack(const Mat< eT > &X, const bool make_copy)
immediate determinant of a matrix using ATLAS or LAPACK
u32 uword
Definition: typedef.hpp:85
static bool inv_inplace_lapack(Mat< eT > &out)
Class for column vectors (matrices with only one column)
Definition: Col_bones.hpp:20
wrapper for accessing external functions defined in ATLAS, LAPACK or BLAS libraries ...
static bool schur_dec(Mat< eT > &Z, Mat< eT > &T, const Mat< eT > &A)
static bool inv_inplace_tinymat(Mat< eT > &out, const uword N)
static bool inv_sym(Mat< eT > &out, const Base< eT, T1 > &X, const uword layout)
static bool chol(Mat< eT > &out, const Base< eT, T1 > &X)
static bool inv(Mat< eT > &out, const Base< eT, T1 > &X, const bool slow=false)
immediate matrix inverse
Definition: auxlib_meat.hpp:26
static bool inv_noalias_tinymat(Mat< eT > &out, const Mat< eT > &X, const uword N)
Definition: auxlib_meat.hpp:85
static bool dlyap(Mat< eT > &X, const Mat< eT > &A, const Mat< eT > &Q)
static const uword n3
static bool log_det(eT &out_val, typename get_pod_type< eT >::result &out_sign, const Base< eT, T1 > &X)
immediate log determinant of a matrix using ATLAS or LAPACK
static bool solve_ud(Mat< eT > &out, Mat< eT > &A, const Mat< eT > &B)
static const uword n2
Dense matrix class.
static eT det(const Base< eT, T1 > &X, const bool slow=false)
static bool inv_sympd(Mat< eT > &out, const Base< eT, T1 > &X, const uword layout)
static bool solve_od(Mat< eT > &out, Mat< eT > &A, const Mat< eT > &B)
static bool syl(Mat< eT > &X, const Mat< eT > &A, const Mat< eT > &B, const Mat< eT > &C)
static bool inv_tr(Mat< eT > &out, const Base< eT, T1 > &X, const uword layout)
static bool svd(Col< eT > &S, const Base< eT, T1 > &X, uword &n_rows, uword &n_cols)
static bool svd_econ(Mat< eT > &U, Col< eT > &S, Mat< eT > &V, const Base< eT, T1 > &X, const char mode)
static bool qr(Mat< eT > &Q, Mat< eT > &R, const Base< eT, T1 > &X)


armadillo_matrix
Author(s):
autogenerated on Fri Apr 16 2021 02:31:56