1 | /*! |
---|
2 | * \file |
---|
3 | * \brief Definitions of QR factorisation functions |
---|
4 | * \author Tony Ottosson |
---|
5 | * |
---|
6 | * ------------------------------------------------------------------------- |
---|
7 | * |
---|
8 | * IT++ - C++ library of mathematical, signal processing, speech processing, |
---|
9 | * and communications classes and functions |
---|
10 | * |
---|
11 | * Copyright (C) 1995-2007 (see AUTHORS file for a list of contributors) |
---|
12 | * |
---|
13 | * This program is free software; you can redistribute it and/or modify |
---|
14 | * it under the terms of the GNU General Public License as published by |
---|
15 | * the Free Software Foundation; either version 2 of the License, or |
---|
16 | * (at your option) any later version. |
---|
17 | * |
---|
18 | * This program is distributed in the hope that it will be useful, |
---|
19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
21 | * GNU General Public License for more details. |
---|
22 | * |
---|
23 | * You should have received a copy of the GNU General Public License |
---|
24 | * along with this program; if not, write to the Free Software |
---|
25 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
---|
26 | * |
---|
27 | * ------------------------------------------------------------------------- |
---|
28 | */ |
---|
29 | |
---|
30 | #ifndef QR_H |
---|
31 | #define QR_H |
---|
32 | |
---|
33 | #include <itpp/base/mat.h> |
---|
34 | |
---|
35 | |
---|
36 | namespace itpp { |
---|
37 | |
---|
38 | |
---|
39 | /*! \addtogroup matrixdecomp |
---|
40 | */ |
---|
41 | //!@{ |
---|
42 | /*! |
---|
43 | \brief QR factorisation of real matrix |
---|
44 | |
---|
45 | The QR factorization of the real matrix \f$\mathbf{A}\f$ of size \f$m \times n\f$ is given |
---|
46 | by |
---|
47 | \f[ |
---|
48 | \mathbf{A} = \mathbf{Q} \mathbf{R} , |
---|
49 | \f] |
---|
50 | where \f$\mathbf{Q}\f$ is an \f$m \times m\f$ orthogonal matrix and \f$\mathbf{R}\f$ is an \f$m \times n\f$ upper triangular matrix. |
---|
51 | |
---|
52 | Returns true is calculation succeeds. False otherwise. |
---|
53 | Uses the LAPACK routine DGEQRF and DORGQR. |
---|
54 | */ |
---|
55 | bool qr(const mat &A, mat &Q, mat &R); |
---|
56 | |
---|
57 | /*! |
---|
58 | \brief QR factorisation of real matrix with pivoting |
---|
59 | |
---|
60 | The QR factorization of the real matrix \f$\mathbf{A}\f$ of size \f$m \times n\f$ is given |
---|
61 | by |
---|
62 | \f[ |
---|
63 | \mathbf{A} \mathbf{P} = \mathbf{Q} \mathbf{R} , |
---|
64 | \f] |
---|
65 | where \f$\mathbf{Q}\f$ is an \f$m \times m\f$ orthogonal matrix, \f$\mathbf{R}\f$ is an \f$m \times n\f$ upper triangular matrix |
---|
66 | and \f$\mathbf{P}\f$ is an \f$n \times n\f$ permutation matrix. |
---|
67 | |
---|
68 | Returns true is calculation succeeds. False otherwise. |
---|
69 | Uses the LAPACK routines DGEQP3 and DORGQR. |
---|
70 | */ |
---|
71 | bool qr(const mat &A, mat &Q, mat &R, bmat &P); |
---|
72 | |
---|
73 | /*! |
---|
74 | \brief QR factorisation of a complex matrix |
---|
75 | |
---|
76 | The QR factorization of the complex matrix \f$\mathbf{A}\f$ of size \f$m \times n\f$ is given |
---|
77 | by |
---|
78 | \f[ |
---|
79 | \mathbf{A} = \mathbf{Q} \mathbf{R} , |
---|
80 | \f] |
---|
81 | where \f$\mathbf{Q}\f$ is an \f$m \times m\f$ unitary matrix and \f$\mathbf{R}\f$ is an \f$m \times n\f$ upper triangular matrix. |
---|
82 | |
---|
83 | Returns true is calculation succeeds. False otherwise. |
---|
84 | Uses the LAPACK routines ZGEQRF and ZUNGQR. |
---|
85 | */ |
---|
86 | bool qr(const cmat &A, cmat &Q, cmat &R); |
---|
87 | |
---|
88 | /*! |
---|
89 | \brief QR factorisation of a complex matrix with pivoting |
---|
90 | |
---|
91 | The QR factorization of the complex matrix \f$\mathbf{A}\f$ of size \f$m \times n\f$ is given |
---|
92 | by |
---|
93 | \f[ |
---|
94 | \mathbf{A} \mathbf{P} = \mathbf{Q} \mathbf{R} , |
---|
95 | \f] |
---|
96 | where \f$\mathbf{Q}\f$ is an \f$m \times m\f$ unitary matrix, \f$\mathbf{R}\f$ is an \f$m \times n\f$ upper triangular matrix |
---|
97 | and \f$\mathbf{P}\f$ is an \f$n \times n\f$ permutation matrix. |
---|
98 | |
---|
99 | Returns true is calculation succeeds. False otherwise. |
---|
100 | Uses the LAPACK routines ZGEQP3 and ZUNGQR. |
---|
101 | */ |
---|
102 | bool qr(const cmat &A, cmat &Q, cmat &R, bmat &P); |
---|
103 | |
---|
104 | //!@} |
---|
105 | |
---|
106 | |
---|
107 | } // namespace itpp |
---|
108 | |
---|
109 | #endif // #ifndef QR_H |
---|