1 | /*! |
---|
2 | * \file |
---|
3 | * \brief Definitions of determinant calculations |
---|
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 DET_H |
---|
31 | #define DET_H |
---|
32 | |
---|
33 | #include <itpp/base/mat.h> |
---|
34 | |
---|
35 | |
---|
36 | namespace itpp { |
---|
37 | |
---|
38 | /*! |
---|
39 | \brief Determinant of real square matrix. |
---|
40 | \ingroup determinant |
---|
41 | |
---|
42 | Calculate determinant of the real matrix \f$\mathbf{X}\f$ |
---|
43 | |
---|
44 | Uses LU-factorisation. |
---|
45 | \f[ |
---|
46 | \det(\mathbf{X}) = \det(\mathbf{P}^T \mathbf{L}) \det(\mathbf{U}) = \det(\mathbf{P}^T) \prod(\mathrm{diag}(\mathbf{U})) |
---|
47 | \f] |
---|
48 | and the determinant of the permuation matrix is \f$ \pm 1\f$ dependening on the number of row permuations |
---|
49 | */ |
---|
50 | double det(const mat &X); |
---|
51 | |
---|
52 | |
---|
53 | /*! |
---|
54 | \brief Determinant of complex square matrix. |
---|
55 | \ingroup determinant |
---|
56 | |
---|
57 | Calculate determinant of the complex matrix \f$\mathbf{X}\f$ |
---|
58 | |
---|
59 | Uses LU-factorisation. |
---|
60 | \f[ |
---|
61 | \det(\mathbf{X}) = \det(\mathbf{P}^T \mathbf{L}) \det(\mathbf{U}) = \det(\mathbf{P}^T) \prod(\mathrm{diag}(\mathbf{U})) |
---|
62 | \f] |
---|
63 | and the determinant of the permuation matrix is \f$ \pm 1\f$ dependening on the number of row permuations |
---|
64 | */ |
---|
65 | std::complex<double> det(const cmat &X); |
---|
66 | |
---|
67 | |
---|
68 | } // namespace itpp |
---|
69 | |
---|
70 | #endif // #ifndef DET_H |
---|