Mercurial > hg > octave-nkf
annotate liboctave/array/CDiagMatrix.h @ 17795:0a8c35ae5ce1
maint: Fix various problems with GPL copyright statements.
* libgui/qterminal/libqterminal/QTerminal.cc,
libgui/qterminal/libqterminal/QTerminal.h,
libgui/qterminal/libqterminal/win32/QTerminalColors.cpp,
libgui/qterminal/libqterminal/win32/QTerminalColors.h,
libgui/qterminal/libqterminal/win32/QWinTerminalImpl.cpp,
libgui/qterminal/libqterminal/win32/QWinTerminalImpl.h:
Replace "Foobar" with "This program" in GPL statement.
* scripts/linear-algebra/linsolve.m: Replace "This program" with "Octave" in
* GPL statement.
* scripts/miscellaneous/getappdata.m, scripts/miscellaneous/isappdata.m,
scripts/miscellaneous/rmappdata.m, scripts/miscellaneous/setappdata.m:
Add "This file is part of Octave" line. Replace "This program" with "Octave"
in GPL statement. Update GPL version to 3.
* scripts/plot/util/copyobj.m, scripts/plot/util/hdl2struct.m,
scripts/plot/util/struct2hdl.m, scripts/polynomial/ppder.m,
scripts/polynomial/ppint.m, scripts/polynomial/ppjumps.m,
scripts/sparse/bicg.m, scripts/strings/untabify.m:
Replace "This program" with "Octave" in GPL statement.
author | Rik <rik@octave.org> |
---|---|
date | Tue, 29 Oct 2013 12:31:57 -0700 |
parents | 49a5a4be04a1 |
children | ebb3ef964372 |
rev | line source |
---|---|
458 | 1 /* |
2 | |
17744
d63878346099
maint: Update copyright notices for release.
John W. Eaton <jwe@octave.org>
parents:
15448
diff
changeset
|
3 Copyright (C) 1994-2013 John W. Eaton |
458 | 4 |
5 This file is part of Octave. | |
6 | |
7 Octave is free software; you can redistribute it and/or modify it | |
8 under the terms of the GNU General Public License as published by the | |
7016 | 9 Free Software Foundation; either version 3 of the License, or (at your |
10 option) any later version. | |
458 | 11 |
12 Octave is distributed in the hope that it will be useful, but WITHOUT | |
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
15 for more details. | |
16 | |
17 You should have received a copy of the GNU General Public License | |
7016 | 18 along with Octave; see the file COPYING. If not, see |
19 <http://www.gnu.org/licenses/>. | |
458 | 20 |
21 */ | |
22 | |
23 #if !defined (octave_ComplexDiagMatrix_h) | |
24 #define octave_ComplexDiagMatrix_h 1 | |
25 | |
1989 | 26 #include "MDiagArray2.h" |
458 | 27 |
28 #include "dRowVector.h" | |
29 #include "CRowVector.h" | |
30 #include "dColVector.h" | |
31 #include "CColVector.h" | |
8371
c3f7e2549abb
make det & inv aware of diagonal & permutation matrices
Jaroslav Hajek <highegg@gmail.com>
parents:
8366
diff
changeset
|
32 #include "DET.h" |
458 | 33 |
34 #include "mx-defs.h" | |
35 | |
3585 | 36 class |
9237
3c1762c7e787
Add missing xxx_API decoration and remove misplaced ones
Michael Goffioul <michael.goffioul@gmail.com>
parents:
8920
diff
changeset
|
37 OCTAVE_API |
3585 | 38 ComplexDiagMatrix : public MDiagArray2<Complex> |
458 | 39 { |
40 public: | |
41 | |
1989 | 42 ComplexDiagMatrix (void) : MDiagArray2<Complex> () { } |
3585 | 43 |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
44 ComplexDiagMatrix (octave_idx_type r, octave_idx_type c) |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
45 : MDiagArray2<Complex> (r, c) { } |
3585 | 46 |
5275 | 47 ComplexDiagMatrix (octave_idx_type r, octave_idx_type c, const Complex& val) |
1989 | 48 : MDiagArray2<Complex> (r, c, val) { } |
3585 | 49 |
10363
a0728e81ed25
improve diag matrix interface & implementation
Jaroslav Hajek <highegg@gmail.com>
parents:
10158
diff
changeset
|
50 explicit ComplexDiagMatrix (const Array<Complex>& a) |
3585 | 51 : MDiagArray2<Complex> (a) { } |
52 | |
10363
a0728e81ed25
improve diag matrix interface & implementation
Jaroslav Hajek <highegg@gmail.com>
parents:
10158
diff
changeset
|
53 explicit ComplexDiagMatrix (const Array<double>& a) |
a0728e81ed25
improve diag matrix interface & implementation
Jaroslav Hajek <highegg@gmail.com>
parents:
10158
diff
changeset
|
54 : MDiagArray2<Complex> (Array<Complex> (a)) { } |
3585 | 55 |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
56 ComplexDiagMatrix (const Array<Complex>& a, octave_idx_type r, |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
57 octave_idx_type c) |
10363
a0728e81ed25
improve diag matrix interface & implementation
Jaroslav Hajek <highegg@gmail.com>
parents:
10158
diff
changeset
|
58 : MDiagArray2<Complex> (a, r, c) { } |
3585 | 59 |
60 explicit ComplexDiagMatrix (const DiagMatrix& a); | |
61 | |
1989 | 62 ComplexDiagMatrix (const MDiagArray2<Complex>& a) |
63 : MDiagArray2<Complex> (a) { } | |
3585 | 64 |
65 ComplexDiagMatrix (const ComplexDiagMatrix& a) | |
66 : MDiagArray2<Complex> (a) { } | |
458 | 67 |
8366
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
7789
diff
changeset
|
68 template <class U> |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
69 ComplexDiagMatrix (const DiagArray2<U>& a) |
8366
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
7789
diff
changeset
|
70 : MDiagArray2<Complex> (a) { } |
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
7789
diff
changeset
|
71 |
458 | 72 ComplexDiagMatrix& operator = (const ComplexDiagMatrix& a) |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
73 { |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
74 MDiagArray2<Complex>::operator = (a); |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
75 return *this; |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
76 } |
458 | 77 |
2386 | 78 bool operator == (const ComplexDiagMatrix& a) const; |
79 bool operator != (const ComplexDiagMatrix& a) const; | |
458 | 80 |
81 ComplexDiagMatrix& fill (double val); | |
82 ComplexDiagMatrix& fill (const Complex& val); | |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
83 ComplexDiagMatrix& fill (double val, |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
84 octave_idx_type beg, octave_idx_type end); |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
85 ComplexDiagMatrix& fill (const Complex& val, |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
86 octave_idx_type beg, octave_idx_type end); |
458 | 87 ComplexDiagMatrix& fill (const ColumnVector& a); |
88 ComplexDiagMatrix& fill (const ComplexColumnVector& a); | |
89 ComplexDiagMatrix& fill (const RowVector& a); | |
90 ComplexDiagMatrix& fill (const ComplexRowVector& a); | |
5275 | 91 ComplexDiagMatrix& fill (const ColumnVector& a, octave_idx_type beg); |
92 ComplexDiagMatrix& fill (const ComplexColumnVector& a, octave_idx_type beg); | |
93 ComplexDiagMatrix& fill (const RowVector& a, octave_idx_type beg); | |
94 ComplexDiagMatrix& fill (const ComplexRowVector& a, octave_idx_type beg); | |
458 | 95 |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
96 ComplexDiagMatrix hermitian (void) const |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
97 { return MDiagArray2<Complex>::hermitian (std::conj); } |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
98 ComplexDiagMatrix transpose (void) const |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
99 { return MDiagArray2<Complex>::transpose (); } |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
100 DiagMatrix abs (void) const; |
458 | 101 |
9237
3c1762c7e787
Add missing xxx_API decoration and remove misplaced ones
Michael Goffioul <michael.goffioul@gmail.com>
parents:
8920
diff
changeset
|
102 friend OCTAVE_API ComplexDiagMatrix conj (const ComplexDiagMatrix& a); |
458 | 103 |
1359 | 104 // resize is the destructive analog for this one |
458 | 105 |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
106 ComplexMatrix extract (octave_idx_type r1, octave_idx_type c1, |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
107 octave_idx_type r2, octave_idx_type c2) const; |
458 | 108 |
1359 | 109 // extract row or column i |
458 | 110 |
5275 | 111 ComplexRowVector row (octave_idx_type i) const; |
458 | 112 ComplexRowVector row (char *s) const; |
113 | |
5275 | 114 ComplexColumnVector column (octave_idx_type i) const; |
458 | 115 ComplexColumnVector column (char *s) const; |
116 | |
8811 | 117 ComplexDiagMatrix inverse (octave_idx_type& info) const; |
458 | 118 ComplexDiagMatrix inverse (void) const; |
8840
c690e3772583
support diagonal matrices in pinv
Jaroslav Hajek <highegg@gmail.com>
parents:
8811
diff
changeset
|
119 ComplexDiagMatrix pseudo_inverse (void) const; |
458 | 120 |
8366
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
7789
diff
changeset
|
121 bool all_elements_are_real (void) const; |
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
7789
diff
changeset
|
122 |
1359 | 123 // diagonal matrix by diagonal matrix -> diagonal matrix operations |
458 | 124 |
125 ComplexDiagMatrix& operator += (const DiagMatrix& a); | |
126 ComplexDiagMatrix& operator -= (const DiagMatrix& a); | |
127 | |
1359 | 128 // other operations |
458 | 129 |
15448
0a0912a9ab6e
Replace deprecated DiagArray2<T>::diag calls with DiagArray2<T>::extract_diag
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
15271
diff
changeset
|
130 ComplexColumnVector extract_diag (octave_idx_type k = 0) const |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
131 { return MDiagArray2<Complex>::extract_diag (k); } |
458 | 132 |
8371
c3f7e2549abb
make det & inv aware of diagonal & permutation matrices
Jaroslav Hajek <highegg@gmail.com>
parents:
8366
diff
changeset
|
133 ComplexDET determinant (void) const; |
c3f7e2549abb
make det & inv aware of diagonal & permutation matrices
Jaroslav Hajek <highegg@gmail.com>
parents:
8366
diff
changeset
|
134 double rcond (void) const; |
c3f7e2549abb
make det & inv aware of diagonal & permutation matrices
Jaroslav Hajek <highegg@gmail.com>
parents:
8366
diff
changeset
|
135 |
1359 | 136 // i/o |
458 | 137 |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
138 friend std::ostream& operator << (std::ostream& os, |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
139 const ComplexDiagMatrix& a); |
458 | 140 |
141 }; | |
142 | |
9237
3c1762c7e787
Add missing xxx_API decoration and remove misplaced ones
Michael Goffioul <michael.goffioul@gmail.com>
parents:
8920
diff
changeset
|
143 OCTAVE_API ComplexDiagMatrix conj (const ComplexDiagMatrix& a); |
8366
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
7789
diff
changeset
|
144 |
3504 | 145 // diagonal matrix by diagonal matrix -> diagonal matrix operations |
146 | |
9237
3c1762c7e787
Add missing xxx_API decoration and remove misplaced ones
Michael Goffioul <michael.goffioul@gmail.com>
parents:
8920
diff
changeset
|
147 OCTAVE_API ComplexDiagMatrix |
3504 | 148 operator * (const ComplexDiagMatrix& a, const ComplexDiagMatrix& b); |
149 | |
9237
3c1762c7e787
Add missing xxx_API decoration and remove misplaced ones
Michael Goffioul <michael.goffioul@gmail.com>
parents:
8920
diff
changeset
|
150 OCTAVE_API ComplexDiagMatrix |
3504 | 151 operator * (const ComplexDiagMatrix& a, const DiagMatrix& b); |
152 | |
9237
3c1762c7e787
Add missing xxx_API decoration and remove misplaced ones
Michael Goffioul <michael.goffioul@gmail.com>
parents:
8920
diff
changeset
|
153 OCTAVE_API ComplexDiagMatrix |
3504 | 154 operator * (const DiagMatrix& a, const ComplexDiagMatrix& b); |
155 | |
3580 | 156 MDIAGARRAY2_FORWARD_DEFS (MDiagArray2, ComplexDiagMatrix, Complex) |
157 | |
458 | 158 #endif |