comparison liboctave/dMatrix.h @ 1205:8302fab9fe24

[project @ 1995-04-04 02:05:01 by jwe]
author jwe
date Tue, 04 Apr 1995 02:05:01 +0000
parents 18933dbd5e43
children 0bf4d2b7def4
comparison
equal deleted inserted replaced
1204:68d147abe7ca 1205:8302fab9fe24
33 33
34 extern "C++" { 34 extern "C++" {
35 35
36 class Matrix : public Array2<double> 36 class Matrix : public Array2<double>
37 { 37 {
38 friend class ColumnVector; 38 friend class ComplexMatrix;
39 friend class AEPBAL; 39 friend class AEPBAL;
40 friend class CHOL; 40 friend class CHOL;
41 friend class GEPBAL; 41 friend class GEPBAL;
42 friend class HESS; 42 friend class HESS;
43 friend class LU; 43 friend class LU;
44 friend class QR; 44 friend class QR;
45 friend class QRP; 45 friend class QRP;
46 friend class SCHUR; 46 friend class SCHUR;
47 friend class SVD; 47 friend class SVD;
48 friend class ComplexMatrix;
49 48
50 public: 49 public:
51 50
52 Matrix (void) : Array2<double> () { } 51 Matrix (void) : Array2<double> () { }
53 Matrix (int r, int c) : Array2<double> (r, c) { } 52 Matrix (int r, int c) : Array2<double> (r, c) { }
54 Matrix (int r, int c, double val) : Array2<double> (r, c, val) { } 53 Matrix (int r, int c, double val) : Array2<double> (r, c, val) { }
55 Matrix (const Array2<double>& a) : Array2<double> (a) { } 54 Matrix (const Array2<double>& a) : Array2<double> (a) { }
56 Matrix (const Matrix& a) : Array2<double> (a) { } 55 Matrix (const Matrix& a) : Array2<double> (a) { }
57 Matrix (const DiagArray<double>& a) : Array2<double> (a) { } 56 Matrix (const DiagArray<double>& a) : Array2<double> (a) { }
58 Matrix (const DiagMatrix& a); 57 Matrix (const DiagMatrix& a);
59 // Matrix (double a) : Array2<double> (1, 1, a) { }
60 58
61 Matrix& operator = (const Matrix& a) 59 Matrix& operator = (const Matrix& a)
62 { 60 {
63 Array2<double>::operator = (a); 61 Array2<double>::operator = (a);
64 return *this; 62 return *this;
87 Matrix stack (const ColumnVector& a) const; 85 Matrix stack (const ColumnVector& a) const;
88 Matrix stack (const DiagMatrix& a) const; 86 Matrix stack (const DiagMatrix& a) const;
89 87
90 Matrix transpose (void) const; 88 Matrix transpose (void) const;
91 89
90 friend Matrix real (const ComplexMatrix& a);
91 friend Matrix imag (const ComplexMatrix& a);
92
92 // resize is the destructive equivalent for this one 93 // resize is the destructive equivalent for this one
93 94
94 Matrix extract (int r1, int c1, int r2, int c2) const; 95 Matrix extract (int r1, int c1, int r2, int c2) const;
95 96
96 // extract row or column i. 97 // extract row or column i.
160 161
161 // unary operations 162 // unary operations
162 163
163 Matrix operator ! (void) const; 164 Matrix operator ! (void) const;
164 165
165 // matrix by scalar -> matrix operations 166 // column vector by row vector -> matrix operations
166 167
167 friend ComplexMatrix operator + (const Matrix& a, const Complex& s); 168 friend Matrix operator * (const ColumnVector& a, const RowVector& a);
168 friend ComplexMatrix operator - (const Matrix& a, const Complex& s); 169
169 friend ComplexMatrix operator * (const Matrix& a, const Complex& s); 170 // diagonal matrix by scalar -> matrix operations
170 friend ComplexMatrix operator / (const Matrix& a, const Complex& s); 171
171 172 friend Matrix operator + (const DiagMatrix& a, double s);
172 // scalar by matrix -> matrix operations 173 friend Matrix operator - (const DiagMatrix& a, double s);
173 174
174 friend ComplexMatrix operator + (const Complex& s, const Matrix& a); 175 // scalar by diagonal matrix -> matrix operations
175 friend ComplexMatrix operator - (const Complex& s, const Matrix& a); 176
176 friend ComplexMatrix operator * (const Complex& s, const Matrix& a); 177 friend Matrix operator + (double s, const DiagMatrix& a);
177 friend ComplexMatrix operator / (const Complex& s, const Matrix& a); 178 friend Matrix operator - (double s, const DiagMatrix& a);
178
179 // matrix by column vector -> column vector operations
180
181 friend ColumnVector operator * (const Matrix& a, const ColumnVector& b);
182 friend ComplexColumnVector operator * (const Matrix& a,
183 const ComplexColumnVector& b);
184 179
185 // matrix by diagonal matrix -> matrix operations 180 // matrix by diagonal matrix -> matrix operations
186 181
187 friend Matrix operator + (const Matrix& a, const DiagMatrix& b); 182 friend Matrix operator + (const Matrix& a, const DiagMatrix& b);
188 friend Matrix operator - (const Matrix& a, const DiagMatrix& b); 183 friend Matrix operator - (const Matrix& a, const DiagMatrix& b);
189 friend Matrix operator * (const Matrix& a, const DiagMatrix& b); 184 friend Matrix operator * (const Matrix& a, const DiagMatrix& b);
190 185
191 friend ComplexMatrix operator + (const Matrix& a, 186 // diagonal matrix by matrix -> matrix operations
192 const ComplexDiagMatrix& b); 187
193 friend ComplexMatrix operator - (const Matrix& a, 188 friend Matrix operator + (const DiagMatrix& a, const Matrix& b);
194 const ComplexDiagMatrix& b); 189 friend Matrix operator - (const DiagMatrix& a, const Matrix& b);
195 friend ComplexMatrix operator * (const Matrix& a, 190 friend Matrix operator * (const DiagMatrix& a, const Matrix& b);
196 const ComplexDiagMatrix& b);
197 191
198 // matrix by matrix -> matrix operations 192 // matrix by matrix -> matrix operations
199 193
200 friend Matrix operator * (const Matrix& a, const Matrix& b); 194 friend Matrix operator * (const Matrix& a, const Matrix& b);
201 friend ComplexMatrix operator * (const Matrix& a, const ComplexMatrix& b);
202
203 friend ComplexMatrix operator + (const Matrix& a, const ComplexMatrix& b);
204 friend ComplexMatrix operator - (const Matrix& a, const ComplexMatrix& b);
205
206 friend ComplexMatrix product (const Matrix& a, const ComplexMatrix& b);
207 friend ComplexMatrix quotient (const Matrix& a, const ComplexMatrix& b);
208 195
209 // other operations 196 // other operations
210 197
211 friend Matrix map (d_d_Mapper f, const Matrix& a); 198 friend Matrix map (d_d_Mapper f, const Matrix& a);
199 friend Matrix map (d_c_Mapper f, const ComplexMatrix& a);
212 void map (d_d_Mapper f); 200 void map (d_d_Mapper f);
213 201
214 Matrix all (void) const; 202 Matrix all (void) const;
215 Matrix any (void) const; 203 Matrix any (void) const;
216 204