Mercurial > hg > octave-nkf
annotate liboctave/array/CDiagMatrix.h @ 20762:f90c8372b7ba
eliminate many more simple uses of error_state
* Cell.cc, __ichol__.cc, __ilu__.cc, balance.cc, bsxfun.cc, colloc.cc,
det.cc, dlmread.cc, dynamic-ld.cc, eig.cc, fft.cc, fft2.cc, fftn.cc,
gcd.cc, getgrent.cc, getpwent.cc, givens.cc, hess.cc, input.cc,
levenshtein.cc, load-path.cc, lookup.cc, ls-mat-ascii.cc, ls-mat4.cc,
lsode.cc, lu.cc, max.cc, md5sum.cc, mex.cc, pager.cc, pinv.cc,
pr-output.cc, qz.cc, schur.cc, sparse.cc, sqrtm.cc, str2double.cc,
strfns.cc, sub2ind.cc, sysdep.cc, time.cc, toplev.cc, tril.cc,
tsearch.cc, typecast.cc, __init_gnuplot__.cc, __magick_read__.cc,
__osmesa_print__.cc, amd.cc, audiodevinfo.cc, dmperm.cc, fftw.cc,
symrcm.cc, ov-base-diag.cc, ov-base-sparse.cc, ov-base.cc,
ov-bool-sparse.cc, ov-builtin.cc, ov-complex.cc, ov-cx-diag.cc,
ov-cx-mat.cc, ov-cx-sparse.cc, ov-fcn-handle.cc, ov-fcn-inline.cc,
ov-float.cc, ov-flt-complex.cc, ov-flt-cx-diag.cc, ov-flt-cx-mat.cc,
ov-flt-re-diag.cc, ov-flt-re-mat.cc, ov-lazy-idx.cc, ov-mex-fcn.cc,
ov-perm.cc, ov-range.cc, ov-re-diag.cc, ov-re-mat.cc, ov-re-sparse.cc,
ov-scalar.cc, ov-str-mat.cc, op-bm-b.cc, op-bm-bm.cc, op-sbm-b.cc,
op-sbm-bm.cc, op-str-m.cc, op-str-s.cc, oct-parse.in.yy, pt-cbinop.cc,
pt-colon.cc, pt-decl.cc, pt-exp.cc, pt-id.cc, pt-misc.cc,
pt-select.cc, pt-unop.cc: Eliminate simple uses of error_state.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 05 Oct 2015 19:29:36 -0400 |
parents | 4197fc428c7d |
children |
rev | line source |
---|---|
458 | 1 /* |
2 | |
19898
4197fc428c7d
maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents:
18535
diff
changeset
|
3 Copyright (C) 1994-2015 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 | |
17822
ebb3ef964372
maint: Use common #define syntax "octave_filename_h" in h_files.
Rik <rik@octave.org>
parents:
17769
diff
changeset
|
23 #if !defined (octave_CDiagMatrix_h) |
ebb3ef964372
maint: Use common #define syntax "octave_filename_h" in h_files.
Rik <rik@octave.org>
parents:
17769
diff
changeset
|
24 #define octave_CDiagMatrix_h 1 |
458 | 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; |
18535
c5a101de2d88
Allow pinv to work on Diagonal Matrices with a tolerance (bug #41546).
Rik <rik@octave.org>
parents:
17822
diff
changeset
|
119 ComplexDiagMatrix pseudo_inverse (double tol = 0.0) 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 |