annotate liboctave/CColVector.h @ 3582:a93683ccc9ba

[project @ 2000-02-05 10:00:49 by jwe]
author jwe
date Sat, 05 Feb 2000 10:00:51 +0000
parents 6ae6f1180e62
children d9803711e047
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
2847
8b262e771614 [project @ 1997-03-27 16:18:26 by jwe]
jwe
parents: 2676
diff changeset
3 Copyright (C) 1996, 1997 John W. Eaton
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
4
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
5 This file is part of Octave.
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
6
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
7 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
8 under the terms of the GNU General Public License as published by the
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
9 Free Software Foundation; either version 2, or (at your option) any
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
10 later version.
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
11
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
12 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
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
14 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
15 for more details.
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
16
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
17 You should have received a copy of the GNU General Public License
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
18 along with Octave; see the file COPYING. If not, write to the Free
1315
611d403c7f3d [project @ 1995-06-25 19:56:32 by jwe]
jwe
parents: 1296
diff changeset
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
20
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 #if !defined (octave_ComplexColumnVector_h)
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
24 #define octave_ComplexColumnVector_h 1
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
25
1296
f93b7fa5e113 [project @ 1995-05-01 18:30:08 by jwe]
jwe
parents: 1214
diff changeset
26 #if defined (__GNUG__)
f93b7fa5e113 [project @ 1995-05-01 18:30:08 by jwe]
jwe
parents: 1214
diff changeset
27 #pragma interface
f93b7fa5e113 [project @ 1995-05-01 18:30:08 by jwe]
jwe
parents: 1214
diff changeset
28 #endif
f93b7fa5e113 [project @ 1995-05-01 18:30:08 by jwe]
jwe
parents: 1214
diff changeset
29
1214
0bf4d2b7def4 [project @ 1995-04-06 02:33:59 by jwe]
jwe
parents: 1205
diff changeset
30 #include "MArray.h"
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
31
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
32 #include "mx-defs.h"
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
33
1214
0bf4d2b7def4 [project @ 1995-04-06 02:33:59 by jwe]
jwe
parents: 1205
diff changeset
34 class ComplexColumnVector : public MArray<Complex>
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
35 {
1205
8302fab9fe24 [project @ 1995-04-04 02:05:01 by jwe]
jwe
parents: 1011
diff changeset
36 friend class ComplexMatrix;
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
37 friend class ComplexRowVector;
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
1214
0bf4d2b7def4 [project @ 1995-04-06 02:33:59 by jwe]
jwe
parents: 1205
diff changeset
41 ComplexColumnVector (void) : MArray<Complex> () { }
0bf4d2b7def4 [project @ 1995-04-06 02:33:59 by jwe]
jwe
parents: 1205
diff changeset
42 ComplexColumnVector (int n) : MArray<Complex> (n) { }
0bf4d2b7def4 [project @ 1995-04-06 02:33:59 by jwe]
jwe
parents: 1205
diff changeset
43 ComplexColumnVector (int n, const Complex& val) : MArray<Complex> (n, val) { }
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
44 ComplexColumnVector (const ColumnVector& a);
1214
0bf4d2b7def4 [project @ 1995-04-06 02:33:59 by jwe]
jwe
parents: 1205
diff changeset
45 ComplexColumnVector (const MArray<Complex>& a) : MArray<Complex> (a) { }
0bf4d2b7def4 [project @ 1995-04-06 02:33:59 by jwe]
jwe
parents: 1205
diff changeset
46 ComplexColumnVector (const ComplexColumnVector& a) : MArray<Complex> (a) { }
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
47
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
48 ComplexColumnVector& operator = (const ComplexColumnVector& a)
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
49 {
1214
0bf4d2b7def4 [project @ 1995-04-06 02:33:59 by jwe]
jwe
parents: 1205
diff changeset
50 MArray<Complex>::operator = (a);
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
51 return *this;
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
52 }
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
53
2386
4fc9fd1424a9 [project @ 1996-10-12 18:31:34 by jwe]
jwe
parents: 1993
diff changeset
54 bool operator == (const ComplexColumnVector& a) const;
4fc9fd1424a9 [project @ 1996-10-12 18:31:34 by jwe]
jwe
parents: 1993
diff changeset
55 bool operator != (const ComplexColumnVector& a) const;
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
56
1359
a6994c934a50 [project @ 1995-09-05 21:30:26 by jwe]
jwe
parents: 1315
diff changeset
57 // destructive insert/delete/reorder operations
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
58
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
59 ComplexColumnVector& insert (const ColumnVector& a, int r);
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
60 ComplexColumnVector& insert (const ComplexColumnVector& a, int r);
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
61
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
62 ComplexColumnVector& fill (double val);
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
63 ComplexColumnVector& fill (const Complex& val);
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
64 ComplexColumnVector& fill (double val, int r1, int r2);
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
65 ComplexColumnVector& fill (const Complex& val, int r1, int r2);
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
66
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
67 ComplexColumnVector stack (const ColumnVector& a) const;
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
68 ComplexColumnVector stack (const ComplexColumnVector& a) const;
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
69
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
70 ComplexRowVector hermitian (void) const; // complex conjugate transpose.
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
71 ComplexRowVector transpose (void) const;
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 friend ComplexColumnVector conj (const ComplexColumnVector& a);
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
74
1359
a6994c934a50 [project @ 1995-09-05 21:30:26 by jwe]
jwe
parents: 1315
diff changeset
75 // resize is the destructive equivalent for this one
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 ComplexColumnVector extract (int r1, int r2) const;
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
78
1359
a6994c934a50 [project @ 1995-09-05 21:30:26 by jwe]
jwe
parents: 1315
diff changeset
79 // column vector by column vector -> column vector operations
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
80
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
81 ComplexColumnVector& operator += (const ColumnVector& a);
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
82 ComplexColumnVector& operator -= (const ColumnVector& a);
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
83
1359
a6994c934a50 [project @ 1995-09-05 21:30:26 by jwe]
jwe
parents: 1315
diff changeset
84 // matrix by column vector -> column vector operations
1205
8302fab9fe24 [project @ 1995-04-04 02:05:01 by jwe]
jwe
parents: 1011
diff changeset
85
8302fab9fe24 [project @ 1995-04-04 02:05:01 by jwe]
jwe
parents: 1011
diff changeset
86 friend ComplexColumnVector operator * (const ComplexMatrix& a,
8302fab9fe24 [project @ 1995-04-04 02:05:01 by jwe]
jwe
parents: 1011
diff changeset
87 const ColumnVector& b);
8302fab9fe24 [project @ 1995-04-04 02:05:01 by jwe]
jwe
parents: 1011
diff changeset
88
8302fab9fe24 [project @ 1995-04-04 02:05:01 by jwe]
jwe
parents: 1011
diff changeset
89 friend ComplexColumnVector operator * (const ComplexMatrix& a,
8302fab9fe24 [project @ 1995-04-04 02:05:01 by jwe]
jwe
parents: 1011
diff changeset
90 const ComplexColumnVector& b);
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
91
1359
a6994c934a50 [project @ 1995-09-05 21:30:26 by jwe]
jwe
parents: 1315
diff changeset
92 // column vector by column vector -> column vector operations
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
93
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
94 friend ComplexColumnVector operator + (const ComplexColumnVector& a,
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
95 const ColumnVector& b);
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
96 friend ComplexColumnVector operator - (const ComplexColumnVector& a,
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
97 const ColumnVector& b);
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
98
1205
8302fab9fe24 [project @ 1995-04-04 02:05:01 by jwe]
jwe
parents: 1011
diff changeset
99 friend ComplexColumnVector operator + (const ColumnVector& a,
8302fab9fe24 [project @ 1995-04-04 02:05:01 by jwe]
jwe
parents: 1011
diff changeset
100 const ComplexColumnVector& b);
8302fab9fe24 [project @ 1995-04-04 02:05:01 by jwe]
jwe
parents: 1011
diff changeset
101 friend ComplexColumnVector operator - (const ColumnVector& a,
8302fab9fe24 [project @ 1995-04-04 02:05:01 by jwe]
jwe
parents: 1011
diff changeset
102 const ComplexColumnVector& b);
8302fab9fe24 [project @ 1995-04-04 02:05:01 by jwe]
jwe
parents: 1011
diff changeset
103
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
104 friend ComplexColumnVector product (const ComplexColumnVector& a,
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
105 const ColumnVector& b);
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
106 friend ComplexColumnVector quotient (const ComplexColumnVector& a,
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
107 const ColumnVector& b);
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
108
1205
8302fab9fe24 [project @ 1995-04-04 02:05:01 by jwe]
jwe
parents: 1011
diff changeset
109 friend ComplexColumnVector product (const ColumnVector& a,
8302fab9fe24 [project @ 1995-04-04 02:05:01 by jwe]
jwe
parents: 1011
diff changeset
110 const ComplexColumnVector& b);
8302fab9fe24 [project @ 1995-04-04 02:05:01 by jwe]
jwe
parents: 1011
diff changeset
111 friend ComplexColumnVector quotient (const ColumnVector& a,
8302fab9fe24 [project @ 1995-04-04 02:05:01 by jwe]
jwe
parents: 1011
diff changeset
112 const ComplexColumnVector& b);
8302fab9fe24 [project @ 1995-04-04 02:05:01 by jwe]
jwe
parents: 1011
diff changeset
113
1359
a6994c934a50 [project @ 1995-09-05 21:30:26 by jwe]
jwe
parents: 1315
diff changeset
114 // matrix by column vector -> column vector operations
1205
8302fab9fe24 [project @ 1995-04-04 02:05:01 by jwe]
jwe
parents: 1011
diff changeset
115
8302fab9fe24 [project @ 1995-04-04 02:05:01 by jwe]
jwe
parents: 1011
diff changeset
116 friend ComplexColumnVector operator * (const Matrix& a,
8302fab9fe24 [project @ 1995-04-04 02:05:01 by jwe]
jwe
parents: 1011
diff changeset
117 const ComplexColumnVector& b);
8302fab9fe24 [project @ 1995-04-04 02:05:01 by jwe]
jwe
parents: 1011
diff changeset
118
1359
a6994c934a50 [project @ 1995-09-05 21:30:26 by jwe]
jwe
parents: 1315
diff changeset
119 // diagonal matrix by column vector -> column vector operations
1205
8302fab9fe24 [project @ 1995-04-04 02:05:01 by jwe]
jwe
parents: 1011
diff changeset
120
8302fab9fe24 [project @ 1995-04-04 02:05:01 by jwe]
jwe
parents: 1011
diff changeset
121 friend ComplexColumnVector operator * (const DiagMatrix& a,
8302fab9fe24 [project @ 1995-04-04 02:05:01 by jwe]
jwe
parents: 1011
diff changeset
122 const ComplexColumnVector& b);
8302fab9fe24 [project @ 1995-04-04 02:05:01 by jwe]
jwe
parents: 1011
diff changeset
123
8302fab9fe24 [project @ 1995-04-04 02:05:01 by jwe]
jwe
parents: 1011
diff changeset
124 friend ComplexColumnVector operator * (const ComplexDiagMatrix& a,
8302fab9fe24 [project @ 1995-04-04 02:05:01 by jwe]
jwe
parents: 1011
diff changeset
125 const ColumnVector& b);
8302fab9fe24 [project @ 1995-04-04 02:05:01 by jwe]
jwe
parents: 1011
diff changeset
126
8302fab9fe24 [project @ 1995-04-04 02:05:01 by jwe]
jwe
parents: 1011
diff changeset
127 friend ComplexColumnVector operator * (const ComplexDiagMatrix& a,
8302fab9fe24 [project @ 1995-04-04 02:05:01 by jwe]
jwe
parents: 1011
diff changeset
128 const ComplexColumnVector& b);
8302fab9fe24 [project @ 1995-04-04 02:05:01 by jwe]
jwe
parents: 1011
diff changeset
129
1359
a6994c934a50 [project @ 1995-09-05 21:30:26 by jwe]
jwe
parents: 1315
diff changeset
130 // other operations
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
131
2676
a5a300c61159 [project @ 1997-02-14 03:16:06 by jwe]
jwe
parents: 2386
diff changeset
132 ComplexColumnVector map (c_c_Mapper f) const;
a5a300c61159 [project @ 1997-02-14 03:16:06 by jwe]
jwe
parents: 2386
diff changeset
133 ColumnVector map (d_c_Mapper f) const;
a5a300c61159 [project @ 1997-02-14 03:16:06 by jwe]
jwe
parents: 2386
diff changeset
134
a5a300c61159 [project @ 1997-02-14 03:16:06 by jwe]
jwe
parents: 2386
diff changeset
135 ComplexColumnVector& apply (c_c_Mapper f);
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
136
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
137 Complex min (void) const;
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
138 Complex max (void) const;
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
139
1359
a6994c934a50 [project @ 1995-09-05 21:30:26 by jwe]
jwe
parents: 1315
diff changeset
140 // i/o
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
141
3504
5eef8a2294bd [project @ 2000-02-01 10:06:51 by jwe]
jwe
parents: 2847
diff changeset
142 friend std::ostream& operator << (std::ostream& os, const ComplexColumnVector& a);
5eef8a2294bd [project @ 2000-02-01 10:06:51 by jwe]
jwe
parents: 2847
diff changeset
143 friend std::istream& operator >> (std::istream& is, ComplexColumnVector& a);
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
144
1205
8302fab9fe24 [project @ 1995-04-04 02:05:01 by jwe]
jwe
parents: 1011
diff changeset
145 private:
8302fab9fe24 [project @ 1995-04-04 02:05:01 by jwe]
jwe
parents: 1011
diff changeset
146
1214
0bf4d2b7def4 [project @ 1995-04-06 02:33:59 by jwe]
jwe
parents: 1205
diff changeset
147 ComplexColumnVector (Complex *d, int l) : MArray<Complex> (d, l) { }
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
148 };
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
149
3573
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
150 MARRAY_FORWARD_DEFS (MArray, ComplexColumnVector, Complex)
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
151
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
152 #endif
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
153
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
154 /*
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
155 ;;; Local Variables: ***
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
156 ;;; mode: C++ ***
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
157 ;;; End: ***
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
158 */