annotate liboctave/CDiagMatrix.h @ 7334:274d9642ac10 release-3-0-0

[project @ 2007-12-22 01:42:45 by jwe]
author jwe
date Sat, 22 Dec 2007 01:42:46 +0000
parents a1dbe9d80eee
children 36594d5bbe13
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
1 /*
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
2
7017
a1dbe9d80eee [project @ 2007-10-12 21:27:11 by jwe]
jwe
parents: 7016
diff changeset
3 Copyright (C) 1994, 1995, 1996, 1997, 2000, 2002, 2004, 2005, 2007
a1dbe9d80eee [project @ 2007-10-12 21:27:11 by jwe]
jwe
parents: 7016
diff changeset
4 John W. Eaton
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
5
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
6 This file is part of Octave.
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
7
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
8 Octave is free software; you can redistribute it and/or modify it
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
9 under the terms of the GNU General Public License as published by the
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5307
diff changeset
10 Free Software Foundation; either version 3 of the License, or (at your
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5307
diff changeset
11 option) any later version.
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
12
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
13 Octave is distributed in the hope that it will be useful, but WITHOUT
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
16 for more details.
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
17
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
18 You should have received a copy of the GNU General Public License
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5307
diff changeset
19 along with Octave; see the file COPYING. If not, see
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5307
diff changeset
20 <http://www.gnu.org/licenses/>.
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
21
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
22 */
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
23
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
24 #if !defined (octave_ComplexDiagMatrix_h)
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
25 #define octave_ComplexDiagMatrix_h 1
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
26
1989
a4b0826e240c [project @ 1996-03-02 00:33:22 by jwe]
jwe
parents: 1882
diff changeset
27 #include "MDiagArray2.h"
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
28
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
29 #include "dRowVector.h"
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
30 #include "CRowVector.h"
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
31 #include "dColVector.h"
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
32 #include "CColVector.h"
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
33
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
34 #include "mx-defs.h"
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
35
3585
d9803711e047 [project @ 2000-02-08 04:35:39 by jwe]
jwe
parents: 3580
diff changeset
36 class
d9803711e047 [project @ 2000-02-08 04:35:39 by jwe]
jwe
parents: 3580
diff changeset
37 ComplexDiagMatrix : public MDiagArray2<Complex>
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
38 {
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
39 public:
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
40
1989
a4b0826e240c [project @ 1996-03-02 00:33:22 by jwe]
jwe
parents: 1882
diff changeset
41 ComplexDiagMatrix (void) : MDiagArray2<Complex> () { }
3585
d9803711e047 [project @ 2000-02-08 04:35:39 by jwe]
jwe
parents: 3580
diff changeset
42
5275
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
43 ComplexDiagMatrix (octave_idx_type r, octave_idx_type c) : MDiagArray2<Complex> (r, c) { }
3585
d9803711e047 [project @ 2000-02-08 04:35:39 by jwe]
jwe
parents: 3580
diff changeset
44
5275
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
45 ComplexDiagMatrix (octave_idx_type r, octave_idx_type c, const Complex& val)
1989
a4b0826e240c [project @ 1996-03-02 00:33:22 by jwe]
jwe
parents: 1882
diff changeset
46 : MDiagArray2<Complex> (r, c, val) { }
3585
d9803711e047 [project @ 2000-02-08 04:35:39 by jwe]
jwe
parents: 3580
diff changeset
47
d9803711e047 [project @ 2000-02-08 04:35:39 by jwe]
jwe
parents: 3580
diff changeset
48 explicit ComplexDiagMatrix (const RowVector& a)
1989
a4b0826e240c [project @ 1996-03-02 00:33:22 by jwe]
jwe
parents: 1882
diff changeset
49 : MDiagArray2<Complex> (ComplexRowVector (a)) { }
3585
d9803711e047 [project @ 2000-02-08 04:35:39 by jwe]
jwe
parents: 3580
diff changeset
50
d9803711e047 [project @ 2000-02-08 04:35:39 by jwe]
jwe
parents: 3580
diff changeset
51 explicit ComplexDiagMatrix (const ComplexRowVector& a)
d9803711e047 [project @ 2000-02-08 04:35:39 by jwe]
jwe
parents: 3580
diff changeset
52 : MDiagArray2<Complex> (a) { }
d9803711e047 [project @ 2000-02-08 04:35:39 by jwe]
jwe
parents: 3580
diff changeset
53
d9803711e047 [project @ 2000-02-08 04:35:39 by jwe]
jwe
parents: 3580
diff changeset
54 explicit ComplexDiagMatrix (const ColumnVector& a)
1989
a4b0826e240c [project @ 1996-03-02 00:33:22 by jwe]
jwe
parents: 1882
diff changeset
55 : MDiagArray2<Complex> (ComplexColumnVector (a)) { }
3585
d9803711e047 [project @ 2000-02-08 04:35:39 by jwe]
jwe
parents: 3580
diff changeset
56
d9803711e047 [project @ 2000-02-08 04:35:39 by jwe]
jwe
parents: 3580
diff changeset
57 explicit ComplexDiagMatrix (const ComplexColumnVector& a)
1989
a4b0826e240c [project @ 1996-03-02 00:33:22 by jwe]
jwe
parents: 1882
diff changeset
58 : MDiagArray2<Complex> (a) { }
3585
d9803711e047 [project @ 2000-02-08 04:35:39 by jwe]
jwe
parents: 3580
diff changeset
59
d9803711e047 [project @ 2000-02-08 04:35:39 by jwe]
jwe
parents: 3580
diff changeset
60 explicit ComplexDiagMatrix (const DiagMatrix& a);
d9803711e047 [project @ 2000-02-08 04:35:39 by jwe]
jwe
parents: 3580
diff changeset
61
1989
a4b0826e240c [project @ 1996-03-02 00:33:22 by jwe]
jwe
parents: 1882
diff changeset
62 ComplexDiagMatrix (const MDiagArray2<Complex>& a)
a4b0826e240c [project @ 1996-03-02 00:33:22 by jwe]
jwe
parents: 1882
diff changeset
63 : MDiagArray2<Complex> (a) { }
3585
d9803711e047 [project @ 2000-02-08 04:35:39 by jwe]
jwe
parents: 3580
diff changeset
64
d9803711e047 [project @ 2000-02-08 04:35:39 by jwe]
jwe
parents: 3580
diff changeset
65 ComplexDiagMatrix (const ComplexDiagMatrix& a)
d9803711e047 [project @ 2000-02-08 04:35:39 by jwe]
jwe
parents: 3580
diff changeset
66 : MDiagArray2<Complex> (a) { }
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
67
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
68 ComplexDiagMatrix& operator = (const ComplexDiagMatrix& a)
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
69 {
1989
a4b0826e240c [project @ 1996-03-02 00:33:22 by jwe]
jwe
parents: 1882
diff changeset
70 MDiagArray2<Complex>::operator = (a);
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
71 return *this;
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
72 }
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
73
2386
4fc9fd1424a9 [project @ 1996-10-12 18:31:34 by jwe]
jwe
parents: 1993
diff changeset
74 bool operator == (const ComplexDiagMatrix& a) const;
4fc9fd1424a9 [project @ 1996-10-12 18:31:34 by jwe]
jwe
parents: 1993
diff changeset
75 bool operator != (const ComplexDiagMatrix& a) const;
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
76
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
77 ComplexDiagMatrix& fill (double val);
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
78 ComplexDiagMatrix& fill (const Complex& val);
5275
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
79 ComplexDiagMatrix& fill (double val, octave_idx_type beg, octave_idx_type end);
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
80 ComplexDiagMatrix& fill (const Complex& val, octave_idx_type beg, octave_idx_type end);
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
81 ComplexDiagMatrix& fill (const ColumnVector& a);
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
82 ComplexDiagMatrix& fill (const ComplexColumnVector& a);
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
83 ComplexDiagMatrix& fill (const RowVector& a);
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
84 ComplexDiagMatrix& fill (const ComplexRowVector& a);
5275
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
85 ComplexDiagMatrix& fill (const ColumnVector& a, octave_idx_type beg);
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
86 ComplexDiagMatrix& fill (const ComplexColumnVector& a, octave_idx_type beg);
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
87 ComplexDiagMatrix& fill (const RowVector& a, octave_idx_type beg);
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
88 ComplexDiagMatrix& fill (const ComplexRowVector& a, octave_idx_type beg);
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
89
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
90 ComplexDiagMatrix hermitian (void) const; // complex conjugate transpose
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
91 ComplexDiagMatrix transpose (void) const;
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
92
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
93 friend ComplexDiagMatrix conj (const ComplexDiagMatrix& a);
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
94
1359
a6994c934a50 [project @ 1995-09-05 21:30:26 by jwe]
jwe
parents: 1315
diff changeset
95 // resize is the destructive analog for this one
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
96
5275
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
97 ComplexMatrix extract (octave_idx_type r1, octave_idx_type c1, octave_idx_type r2, octave_idx_type c2) const;
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
98
1359
a6994c934a50 [project @ 1995-09-05 21:30:26 by jwe]
jwe
parents: 1315
diff changeset
99 // extract row or column i
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
100
5275
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
101 ComplexRowVector row (octave_idx_type i) const;
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
102 ComplexRowVector row (char *s) const;
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
103
5275
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
104 ComplexColumnVector column (octave_idx_type i) const;
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
105 ComplexColumnVector column (char *s) const;
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
106
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
107 ComplexDiagMatrix inverse (int& info) const;
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
108 ComplexDiagMatrix inverse (void) const;
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
109
1359
a6994c934a50 [project @ 1995-09-05 21:30:26 by jwe]
jwe
parents: 1315
diff changeset
110 // diagonal matrix by diagonal matrix -> diagonal matrix operations
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
111
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
112 ComplexDiagMatrix& operator += (const DiagMatrix& a);
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
113 ComplexDiagMatrix& operator -= (const DiagMatrix& a);
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
114
1359
a6994c934a50 [project @ 1995-09-05 21:30:26 by jwe]
jwe
parents: 1315
diff changeset
115 // other operations
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
116
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
117 ComplexColumnVector diag (void) const;
5275
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
118 ComplexColumnVector diag (octave_idx_type k) const;
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
119
1359
a6994c934a50 [project @ 1995-09-05 21:30:26 by jwe]
jwe
parents: 1315
diff changeset
120 // i/o
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
121
3504
5eef8a2294bd [project @ 2000-02-01 10:06:51 by jwe]
jwe
parents: 2847
diff changeset
122 friend std::ostream& operator << (std::ostream& os, const ComplexDiagMatrix& a);
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
123
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
124 private:
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
125
5275
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
126 ComplexDiagMatrix (Complex *d, octave_idx_type nr, octave_idx_type nc)
1989
a4b0826e240c [project @ 1996-03-02 00:33:22 by jwe]
jwe
parents: 1882
diff changeset
127 : MDiagArray2<Complex> (d, nr, nc) { }
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
128 };
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
129
3504
5eef8a2294bd [project @ 2000-02-01 10:06:51 by jwe]
jwe
parents: 2847
diff changeset
130 // diagonal matrix by diagonal matrix -> diagonal matrix operations
5eef8a2294bd [project @ 2000-02-01 10:06:51 by jwe]
jwe
parents: 2847
diff changeset
131
5eef8a2294bd [project @ 2000-02-01 10:06:51 by jwe]
jwe
parents: 2847
diff changeset
132 ComplexDiagMatrix
5eef8a2294bd [project @ 2000-02-01 10:06:51 by jwe]
jwe
parents: 2847
diff changeset
133 operator * (const ComplexDiagMatrix& a, const ComplexDiagMatrix& b);
5eef8a2294bd [project @ 2000-02-01 10:06:51 by jwe]
jwe
parents: 2847
diff changeset
134
5eef8a2294bd [project @ 2000-02-01 10:06:51 by jwe]
jwe
parents: 2847
diff changeset
135 ComplexDiagMatrix
5eef8a2294bd [project @ 2000-02-01 10:06:51 by jwe]
jwe
parents: 2847
diff changeset
136 operator * (const ComplexDiagMatrix& a, const DiagMatrix& b);
5eef8a2294bd [project @ 2000-02-01 10:06:51 by jwe]
jwe
parents: 2847
diff changeset
137
5eef8a2294bd [project @ 2000-02-01 10:06:51 by jwe]
jwe
parents: 2847
diff changeset
138 ComplexDiagMatrix
5eef8a2294bd [project @ 2000-02-01 10:06:51 by jwe]
jwe
parents: 2847
diff changeset
139 operator * (const DiagMatrix& a, const ComplexDiagMatrix& b);
5eef8a2294bd [project @ 2000-02-01 10:06:51 by jwe]
jwe
parents: 2847
diff changeset
140
3580
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3504
diff changeset
141 MDIAGARRAY2_FORWARD_DEFS (MDiagArray2, ComplexDiagMatrix, Complex)
2923f52d8fda [project @ 2000-02-05 07:14:21 by jwe]
jwe
parents: 3504
diff changeset
142
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
143 #endif
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
144
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
145 /*
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
146 ;;; Local Variables: ***
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
147 ;;; mode: C++ ***
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
148 ;;; End: ***
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
149 */