Mercurial > octave-nkf
comparison liboctave/CMatrix.h @ 5275:23b37da9fd5b
[project @ 2005-04-08 16:07:35 by jwe]
author | jwe |
---|---|
date | Fri, 08 Apr 2005 16:07:37 +0000 |
parents | e35b034d3523 |
children | 4c8a2e4e0717 |
comparison
equal
deleted
inserted
replaced
5274:eae7b40388e9 | 5275:23b37da9fd5b |
---|---|
37 | 37 |
38 typedef void (*solve_singularity_handler) (double rcond); | 38 typedef void (*solve_singularity_handler) (double rcond); |
39 | 39 |
40 ComplexMatrix (void) : MArray2<Complex> () { } | 40 ComplexMatrix (void) : MArray2<Complex> () { } |
41 | 41 |
42 ComplexMatrix (int r, int c) : MArray2<Complex> (r, c) { } | 42 ComplexMatrix (octave_idx_type r, octave_idx_type c) : MArray2<Complex> (r, c) { } |
43 | 43 |
44 ComplexMatrix (int r, int c, const Complex& val) | 44 ComplexMatrix (octave_idx_type r, octave_idx_type c, const Complex& val) |
45 : MArray2<Complex> (r, c, val) { } | 45 : MArray2<Complex> (r, c, val) { } |
46 | 46 |
47 ComplexMatrix (const ComplexMatrix& a) : MArray2<Complex> (a) { } | 47 ComplexMatrix (const ComplexMatrix& a) : MArray2<Complex> (a) { } |
48 | 48 |
49 ComplexMatrix (const MArray2<Complex>& a) : MArray2<Complex> (a) { } | 49 ComplexMatrix (const MArray2<Complex>& a) : MArray2<Complex> (a) { } |
77 | 77 |
78 bool is_hermitian (void) const; | 78 bool is_hermitian (void) const; |
79 | 79 |
80 // destructive insert/delete/reorder operations | 80 // destructive insert/delete/reorder operations |
81 | 81 |
82 ComplexMatrix& insert (const Matrix& a, int r, int c); | 82 ComplexMatrix& insert (const Matrix& a, octave_idx_type r, octave_idx_type c); |
83 ComplexMatrix& insert (const RowVector& a, int r, int c); | 83 ComplexMatrix& insert (const RowVector& a, octave_idx_type r, octave_idx_type c); |
84 ComplexMatrix& insert (const ColumnVector& a, int r, int c); | 84 ComplexMatrix& insert (const ColumnVector& a, octave_idx_type r, octave_idx_type c); |
85 ComplexMatrix& insert (const DiagMatrix& a, int r, int c); | 85 ComplexMatrix& insert (const DiagMatrix& a, octave_idx_type r, octave_idx_type c); |
86 | 86 |
87 ComplexMatrix& insert (const ComplexMatrix& a, int r, int c); | 87 ComplexMatrix& insert (const ComplexMatrix& a, octave_idx_type r, octave_idx_type c); |
88 ComplexMatrix& insert (const ComplexRowVector& a, int r, int c); | 88 ComplexMatrix& insert (const ComplexRowVector& a, octave_idx_type r, octave_idx_type c); |
89 ComplexMatrix& insert (const ComplexColumnVector& a, int r, int c); | 89 ComplexMatrix& insert (const ComplexColumnVector& a, octave_idx_type r, octave_idx_type c); |
90 ComplexMatrix& insert (const ComplexDiagMatrix& a, int r, int c); | 90 ComplexMatrix& insert (const ComplexDiagMatrix& a, octave_idx_type r, octave_idx_type c); |
91 | 91 |
92 ComplexMatrix& fill (double val); | 92 ComplexMatrix& fill (double val); |
93 ComplexMatrix& fill (const Complex& val); | 93 ComplexMatrix& fill (const Complex& val); |
94 ComplexMatrix& fill (double val, int r1, int c1, int r2, int c2); | 94 ComplexMatrix& fill (double val, octave_idx_type r1, octave_idx_type c1, octave_idx_type r2, octave_idx_type c2); |
95 ComplexMatrix& fill (const Complex& val, int r1, int c1, int r2, int c2); | 95 ComplexMatrix& fill (const Complex& val, octave_idx_type r1, octave_idx_type c1, octave_idx_type r2, octave_idx_type c2); |
96 | 96 |
97 ComplexMatrix append (const Matrix& a) const; | 97 ComplexMatrix append (const Matrix& a) const; |
98 ComplexMatrix append (const RowVector& a) const; | 98 ComplexMatrix append (const RowVector& a) const; |
99 ComplexMatrix append (const ColumnVector& a) const; | 99 ComplexMatrix append (const ColumnVector& a) const; |
100 ComplexMatrix append (const DiagMatrix& a) const; | 100 ComplexMatrix append (const DiagMatrix& a) const; |
120 | 120 |
121 friend ComplexMatrix conj (const ComplexMatrix& a); | 121 friend ComplexMatrix conj (const ComplexMatrix& a); |
122 | 122 |
123 // resize is the destructive equivalent for this one | 123 // resize is the destructive equivalent for this one |
124 | 124 |
125 ComplexMatrix extract (int r1, int c1, int r2, int c2) const; | 125 ComplexMatrix extract (octave_idx_type r1, octave_idx_type c1, octave_idx_type r2, octave_idx_type c2) const; |
126 | 126 |
127 ComplexMatrix extract_n (int r1, int c1, int nr, int nc) const; | 127 ComplexMatrix extract_n (octave_idx_type r1, octave_idx_type c1, octave_idx_type nr, octave_idx_type nc) const; |
128 | 128 |
129 // extract row or column i. | 129 // extract row or column i. |
130 | 130 |
131 ComplexRowVector row (int i) const; | 131 ComplexRowVector row (octave_idx_type i) const; |
132 ComplexRowVector row (char *s) const; | 132 ComplexRowVector row (char *s) const; |
133 | 133 |
134 ComplexColumnVector column (int i) const; | 134 ComplexColumnVector column (octave_idx_type i) const; |
135 ComplexColumnVector column (char *s) const; | 135 ComplexColumnVector column (char *s) const; |
136 | 136 |
137 ComplexMatrix inverse (void) const; | 137 ComplexMatrix inverse (void) const; |
138 ComplexMatrix inverse (int& info) const; | 138 ComplexMatrix inverse (octave_idx_type& info) const; |
139 ComplexMatrix inverse (int& info, double& rcond, int force = 0, | 139 ComplexMatrix inverse (octave_idx_type& info, double& rcond, int force = 0, |
140 int calc_cond = 1) const; | 140 int calc_cond = 1) const; |
141 | 141 |
142 ComplexMatrix pseudo_inverse (double tol = 0.0) const; | 142 ComplexMatrix pseudo_inverse (double tol = 0.0) const; |
143 | 143 |
144 ComplexMatrix fourier (void) const; | 144 ComplexMatrix fourier (void) const; |
146 | 146 |
147 ComplexMatrix fourier2d (void) const; | 147 ComplexMatrix fourier2d (void) const; |
148 ComplexMatrix ifourier2d (void) const; | 148 ComplexMatrix ifourier2d (void) const; |
149 | 149 |
150 ComplexDET determinant (void) const; | 150 ComplexDET determinant (void) const; |
151 ComplexDET determinant (int& info) const; | 151 ComplexDET determinant (octave_idx_type& info) const; |
152 ComplexDET determinant (int& info, double& rcond, int calc_cond = 1) const; | 152 ComplexDET determinant (octave_idx_type& info, double& rcond, int calc_cond = 1) const; |
153 | 153 |
154 ComplexMatrix solve (const Matrix& b) const; | 154 ComplexMatrix solve (const Matrix& b) const; |
155 ComplexMatrix solve (const Matrix& b, int& info) const; | 155 ComplexMatrix solve (const Matrix& b, octave_idx_type& info) const; |
156 ComplexMatrix solve (const Matrix& b, int& info, double& rcond) const; | 156 ComplexMatrix solve (const Matrix& b, octave_idx_type& info, double& rcond) const; |
157 ComplexMatrix solve (const Matrix& b, int& info, double& rcond, | 157 ComplexMatrix solve (const Matrix& b, octave_idx_type& info, double& rcond, |
158 solve_singularity_handler sing_handler) const; | 158 solve_singularity_handler sing_handler) const; |
159 | 159 |
160 ComplexMatrix solve (const ComplexMatrix& b) const; | 160 ComplexMatrix solve (const ComplexMatrix& b) const; |
161 ComplexMatrix solve (const ComplexMatrix& b, int& info) const; | 161 ComplexMatrix solve (const ComplexMatrix& b, octave_idx_type& info) const; |
162 ComplexMatrix solve (const ComplexMatrix& b, int& info, double& rcond) const; | 162 ComplexMatrix solve (const ComplexMatrix& b, octave_idx_type& info, double& rcond) const; |
163 ComplexMatrix solve (const ComplexMatrix& b, int& info, double& rcond, | 163 ComplexMatrix solve (const ComplexMatrix& b, octave_idx_type& info, double& rcond, |
164 solve_singularity_handler sing_handler) const; | 164 solve_singularity_handler sing_handler) const; |
165 | 165 |
166 ComplexColumnVector solve (const ColumnVector& b) const; | 166 ComplexColumnVector solve (const ColumnVector& b) const; |
167 ComplexColumnVector solve (const ColumnVector& b, int& info) const; | 167 ComplexColumnVector solve (const ColumnVector& b, octave_idx_type& info) const; |
168 ComplexColumnVector solve (const ColumnVector& b, int& info, | 168 ComplexColumnVector solve (const ColumnVector& b, octave_idx_type& info, |
169 double& rcond) const; | 169 double& rcond) const; |
170 ComplexColumnVector solve (const ColumnVector& b, int& info, double& rcond, | 170 ComplexColumnVector solve (const ColumnVector& b, octave_idx_type& info, double& rcond, |
171 solve_singularity_handler sing_handler) const; | 171 solve_singularity_handler sing_handler) const; |
172 | 172 |
173 ComplexColumnVector solve (const ComplexColumnVector& b) const; | 173 ComplexColumnVector solve (const ComplexColumnVector& b) const; |
174 ComplexColumnVector solve (const ComplexColumnVector& b, int& info) const; | 174 ComplexColumnVector solve (const ComplexColumnVector& b, octave_idx_type& info) const; |
175 ComplexColumnVector solve (const ComplexColumnVector& b, int& info, | 175 ComplexColumnVector solve (const ComplexColumnVector& b, octave_idx_type& info, |
176 double& rcond) const; | 176 double& rcond) const; |
177 ComplexColumnVector solve (const ComplexColumnVector& b, int& info, | 177 ComplexColumnVector solve (const ComplexColumnVector& b, octave_idx_type& info, |
178 double& rcond, | 178 double& rcond, |
179 solve_singularity_handler sing_handler) const; | 179 solve_singularity_handler sing_handler) const; |
180 | 180 |
181 ComplexMatrix lssolve (const Matrix& b) const; | 181 ComplexMatrix lssolve (const Matrix& b) const; |
182 ComplexMatrix lssolve (const Matrix& b, int& info) const; | 182 ComplexMatrix lssolve (const Matrix& b, octave_idx_type& info) const; |
183 ComplexMatrix lssolve (const Matrix& b, int& info, int& rank) const; | 183 ComplexMatrix lssolve (const Matrix& b, octave_idx_type& info, octave_idx_type& rank) const; |
184 | 184 |
185 ComplexMatrix lssolve (const ComplexMatrix& b) const; | 185 ComplexMatrix lssolve (const ComplexMatrix& b) const; |
186 ComplexMatrix lssolve (const ComplexMatrix& b, int& info) const; | 186 ComplexMatrix lssolve (const ComplexMatrix& b, octave_idx_type& info) const; |
187 ComplexMatrix lssolve (const ComplexMatrix& b, int& info, | 187 ComplexMatrix lssolve (const ComplexMatrix& b, octave_idx_type& info, |
188 int& rank) const; | 188 octave_idx_type& rank) const; |
189 | 189 |
190 ComplexColumnVector lssolve (const ColumnVector& b) const; | 190 ComplexColumnVector lssolve (const ColumnVector& b) const; |
191 ComplexColumnVector lssolve (const ColumnVector& b, int& info) const; | 191 ComplexColumnVector lssolve (const ColumnVector& b, octave_idx_type& info) const; |
192 ComplexColumnVector lssolve (const ColumnVector& b, int& info, | 192 ComplexColumnVector lssolve (const ColumnVector& b, octave_idx_type& info, |
193 int& rank) const; | 193 octave_idx_type& rank) const; |
194 | 194 |
195 ComplexColumnVector lssolve (const ComplexColumnVector& b) const; | 195 ComplexColumnVector lssolve (const ComplexColumnVector& b) const; |
196 ComplexColumnVector lssolve (const ComplexColumnVector& b, int& info) const; | 196 ComplexColumnVector lssolve (const ComplexColumnVector& b, octave_idx_type& info) const; |
197 ComplexColumnVector lssolve (const ComplexColumnVector& b, int& info, | 197 ComplexColumnVector lssolve (const ComplexColumnVector& b, octave_idx_type& info, |
198 int& rank) const; | 198 octave_idx_type& rank) const; |
199 | 199 |
200 ComplexMatrix expm (void) const; | 200 ComplexMatrix expm (void) const; |
201 | 201 |
202 // column vector by row vector -> matrix operations | 202 // column vector by row vector -> matrix operations |
203 | 203 |
249 ComplexMatrix sum (int dim = -1) const; | 249 ComplexMatrix sum (int dim = -1) const; |
250 ComplexMatrix sumsq (int dim = -1) const; | 250 ComplexMatrix sumsq (int dim = -1) const; |
251 Matrix abs (void) const; | 251 Matrix abs (void) const; |
252 | 252 |
253 ComplexColumnVector diag (void) const; | 253 ComplexColumnVector diag (void) const; |
254 ComplexColumnVector diag (int k) const; | 254 ComplexColumnVector diag (octave_idx_type k) const; |
255 | 255 |
256 bool row_is_real_only (int) const; | 256 bool row_is_real_only (octave_idx_type) const; |
257 bool column_is_real_only (int) const; | 257 bool column_is_real_only (octave_idx_type) const; |
258 | 258 |
259 ComplexColumnVector row_min (void) const; | 259 ComplexColumnVector row_min (void) const; |
260 ComplexColumnVector row_max (void) const; | 260 ComplexColumnVector row_max (void) const; |
261 | 261 |
262 ComplexColumnVector row_min (Array<int>& index) const; | 262 ComplexColumnVector row_min (Array<octave_idx_type>& index) const; |
263 ComplexColumnVector row_max (Array<int>& index) const; | 263 ComplexColumnVector row_max (Array<octave_idx_type>& index) const; |
264 | 264 |
265 ComplexRowVector column_min (void) const; | 265 ComplexRowVector column_min (void) const; |
266 ComplexRowVector column_max (void) const; | 266 ComplexRowVector column_max (void) const; |
267 | 267 |
268 ComplexRowVector column_min (Array<int>& index) const; | 268 ComplexRowVector column_min (Array<octave_idx_type>& index) const; |
269 ComplexRowVector column_max (Array<int>& index) const; | 269 ComplexRowVector column_max (Array<octave_idx_type>& index) const; |
270 | 270 |
271 // i/o | 271 // i/o |
272 | 272 |
273 friend std::ostream& operator << (std::ostream& os, const ComplexMatrix& a); | 273 friend std::ostream& operator << (std::ostream& os, const ComplexMatrix& a); |
274 friend std::istream& operator >> (std::istream& is, ComplexMatrix& a); | 274 friend std::istream& operator >> (std::istream& is, ComplexMatrix& a); |
275 | 275 |
276 static Complex resize_fill_value (void) { return Complex (0.0, 0.0); } | 276 static Complex resize_fill_value (void) { return Complex (0.0, 0.0); } |
277 | 277 |
278 private: | 278 private: |
279 | 279 |
280 ComplexMatrix (Complex *d, int r, int c) : MArray2<Complex> (d, r, c) { } | 280 ComplexMatrix (Complex *d, octave_idx_type r, octave_idx_type c) : MArray2<Complex> (d, r, c) { } |
281 }; | 281 }; |
282 | 282 |
283 ComplexMatrix Givens (const Complex&, const Complex&); | 283 ComplexMatrix Givens (const Complex&, const Complex&); |
284 | 284 |
285 ComplexMatrix Sylvester (const ComplexMatrix&, const ComplexMatrix&, | 285 ComplexMatrix Sylvester (const ComplexMatrix&, const ComplexMatrix&, |