comparison liboctave/dMatrix.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
36 36
37 typedef void (*solve_singularity_handler) (double rcond); 37 typedef void (*solve_singularity_handler) (double rcond);
38 38
39 Matrix (void) : MArray2<double> () { } 39 Matrix (void) : MArray2<double> () { }
40 40
41 Matrix (int r, int c) : MArray2<double> (r, c) { } 41 Matrix (octave_idx_type r, octave_idx_type c) : MArray2<double> (r, c) { }
42 42
43 Matrix (int r, int c, double val) : MArray2<double> (r, c, val) { } 43 Matrix (octave_idx_type r, octave_idx_type c, double val) : MArray2<double> (r, c, val) { }
44 44
45 Matrix (const Matrix& a) : MArray2<double> (a) { } 45 Matrix (const Matrix& a) : MArray2<double> (a) { }
46 46
47 Matrix (const MArray2<double>& a) : MArray2<double> (a) { } 47 Matrix (const MArray2<double>& a) : MArray2<double> (a) { }
48 48
67 67
68 bool is_symmetric (void) const; 68 bool is_symmetric (void) const;
69 69
70 // destructive insert/delete/reorder operations 70 // destructive insert/delete/reorder operations
71 71
72 Matrix& insert (const Matrix& a, int r, int c); 72 Matrix& insert (const Matrix& a, octave_idx_type r, octave_idx_type c);
73 Matrix& insert (const RowVector& a, int r, int c); 73 Matrix& insert (const RowVector& a, octave_idx_type r, octave_idx_type c);
74 Matrix& insert (const ColumnVector& a, int r, int c); 74 Matrix& insert (const ColumnVector& a, octave_idx_type r, octave_idx_type c);
75 Matrix& insert (const DiagMatrix& a, int r, int c); 75 Matrix& insert (const DiagMatrix& a, octave_idx_type r, octave_idx_type c);
76 76
77 Matrix& fill (double val); 77 Matrix& fill (double val);
78 Matrix& fill (double val, int r1, int c1, int r2, int c2); 78 Matrix& fill (double val, octave_idx_type r1, octave_idx_type c1, octave_idx_type r2, octave_idx_type c2);
79 79
80 Matrix append (const Matrix& a) const; 80 Matrix append (const Matrix& a) const;
81 Matrix append (const RowVector& a) const; 81 Matrix append (const RowVector& a) const;
82 Matrix append (const ColumnVector& a) const; 82 Matrix append (const ColumnVector& a) const;
83 Matrix append (const DiagMatrix& a) const; 83 Matrix append (const DiagMatrix& a) const;
92 92
93 Matrix transpose (void) const { return MArray2<double>::transpose (); } 93 Matrix transpose (void) const { return MArray2<double>::transpose (); }
94 94
95 // resize is the destructive equivalent for this one 95 // resize is the destructive equivalent for this one
96 96
97 Matrix extract (int r1, int c1, int r2, int c2) const; 97 Matrix extract (octave_idx_type r1, octave_idx_type c1, octave_idx_type r2, octave_idx_type c2) const;
98 98
99 Matrix extract_n (int r1, int c1, int nr, int nc) const; 99 Matrix extract_n (octave_idx_type r1, octave_idx_type c1, octave_idx_type nr, octave_idx_type nc) const;
100 100
101 // extract row or column i. 101 // extract row or column i.
102 102
103 RowVector row (int i) const; 103 RowVector row (octave_idx_type i) const;
104 RowVector row (char *s) const; 104 RowVector row (char *s) const;
105 105
106 ColumnVector column (int i) const; 106 ColumnVector column (octave_idx_type i) const;
107 ColumnVector column (char *s) const; 107 ColumnVector column (char *s) const;
108 108
109 Matrix inverse (void) const; 109 Matrix inverse (void) const;
110 Matrix inverse (int& info) const; 110 Matrix inverse (octave_idx_type& info) const;
111 Matrix inverse (int& info, double& rcond, int force = 0, 111 Matrix inverse (octave_idx_type& info, double& rcond, int force = 0,
112 int calc_cond = 1) const; 112 int calc_cond = 1) const;
113 113
114 Matrix pseudo_inverse (double tol = 0.0) const; 114 Matrix pseudo_inverse (double tol = 0.0) const;
115 115
116 ComplexMatrix fourier (void) const; 116 ComplexMatrix fourier (void) const;
118 118
119 ComplexMatrix fourier2d (void) const; 119 ComplexMatrix fourier2d (void) const;
120 ComplexMatrix ifourier2d (void) const; 120 ComplexMatrix ifourier2d (void) const;
121 121
122 DET determinant (void) const; 122 DET determinant (void) const;
123 DET determinant (int& info) const; 123 DET determinant (octave_idx_type& info) const;
124 DET determinant (int& info, double& rcond, int calc_cond = 1) const; 124 DET determinant (octave_idx_type& info, double& rcond, int calc_cond = 1) const;
125 125
126 Matrix solve (const Matrix& b) const; 126 Matrix solve (const Matrix& b) const;
127 Matrix solve (const Matrix& b, int& info) const; 127 Matrix solve (const Matrix& b, octave_idx_type& info) const;
128 Matrix solve (const Matrix& b, int& info, double& rcond) const; 128 Matrix solve (const Matrix& b, octave_idx_type& info, double& rcond) const;
129 Matrix solve (const Matrix& b, int& info, double& rcond, 129 Matrix solve (const Matrix& b, octave_idx_type& info, double& rcond,
130 solve_singularity_handler sing_handler) const; 130 solve_singularity_handler sing_handler) const;
131 131
132 ComplexMatrix solve (const ComplexMatrix& b) const; 132 ComplexMatrix solve (const ComplexMatrix& b) const;
133 ComplexMatrix solve (const ComplexMatrix& b, int& info) const; 133 ComplexMatrix solve (const ComplexMatrix& b, octave_idx_type& info) const;
134 ComplexMatrix solve (const ComplexMatrix& b, int& info, double& rcond) const; 134 ComplexMatrix solve (const ComplexMatrix& b, octave_idx_type& info, double& rcond) const;
135 ComplexMatrix solve (const ComplexMatrix& b, int& info, double& rcond, 135 ComplexMatrix solve (const ComplexMatrix& b, octave_idx_type& info, double& rcond,
136 solve_singularity_handler sing_handler) const; 136 solve_singularity_handler sing_handler) const;
137 137
138 ColumnVector solve (const ColumnVector& b) const; 138 ColumnVector solve (const ColumnVector& b) const;
139 ColumnVector solve (const ColumnVector& b, int& info) const; 139 ColumnVector solve (const ColumnVector& b, octave_idx_type& info) const;
140 ColumnVector solve (const ColumnVector& b, int& info, double& rcond) const; 140 ColumnVector solve (const ColumnVector& b, octave_idx_type& info, double& rcond) const;
141 ColumnVector solve (const ColumnVector& b, int& info, double& rcond, 141 ColumnVector solve (const ColumnVector& b, octave_idx_type& info, double& rcond,
142 solve_singularity_handler sing_handler) const; 142 solve_singularity_handler sing_handler) const;
143 143
144 ComplexColumnVector solve (const ComplexColumnVector& b) const; 144 ComplexColumnVector solve (const ComplexColumnVector& b) const;
145 ComplexColumnVector solve (const ComplexColumnVector& b, int& info) const; 145 ComplexColumnVector solve (const ComplexColumnVector& b, octave_idx_type& info) const;
146 ComplexColumnVector solve (const ComplexColumnVector& b, int& info, 146 ComplexColumnVector solve (const ComplexColumnVector& b, octave_idx_type& info,
147 double& rcond) const; 147 double& rcond) const;
148 ComplexColumnVector solve (const ComplexColumnVector& b, int& info, 148 ComplexColumnVector solve (const ComplexColumnVector& b, octave_idx_type& info,
149 double& rcond, 149 double& rcond,
150 solve_singularity_handler sing_handler) const; 150 solve_singularity_handler sing_handler) const;
151 151
152 Matrix lssolve (const Matrix& b) const; 152 Matrix lssolve (const Matrix& b) const;
153 Matrix lssolve (const Matrix& b, int& info) const; 153 Matrix lssolve (const Matrix& b, octave_idx_type& info) const;
154 Matrix lssolve (const Matrix& b, int& info, int& rank) const; 154 Matrix lssolve (const Matrix& b, octave_idx_type& info, octave_idx_type& rank) const;
155 155
156 ComplexMatrix lssolve (const ComplexMatrix& b) const; 156 ComplexMatrix lssolve (const ComplexMatrix& b) const;
157 ComplexMatrix lssolve (const ComplexMatrix& b, int& info) const; 157 ComplexMatrix lssolve (const ComplexMatrix& b, octave_idx_type& info) const;
158 ComplexMatrix lssolve (const ComplexMatrix& b, int& info, 158 ComplexMatrix lssolve (const ComplexMatrix& b, octave_idx_type& info,
159 int& rank) const; 159 octave_idx_type& rank) const;
160 160
161 ColumnVector lssolve (const ColumnVector& b) const; 161 ColumnVector lssolve (const ColumnVector& b) const;
162 ColumnVector lssolve (const ColumnVector& b, int& info) const; 162 ColumnVector lssolve (const ColumnVector& b, octave_idx_type& info) const;
163 ColumnVector lssolve (const ColumnVector& b, int& info, int& rank) const; 163 ColumnVector lssolve (const ColumnVector& b, octave_idx_type& info, octave_idx_type& rank) const;
164 164
165 ComplexColumnVector lssolve (const ComplexColumnVector& b) const; 165 ComplexColumnVector lssolve (const ComplexColumnVector& b) const;
166 ComplexColumnVector lssolve (const ComplexColumnVector& b, int& info) const; 166 ComplexColumnVector lssolve (const ComplexColumnVector& b, octave_idx_type& info) const;
167 ComplexColumnVector lssolve (const ComplexColumnVector& b, int& info, 167 ComplexColumnVector lssolve (const ComplexColumnVector& b, octave_idx_type& info,
168 int& rank) const; 168 octave_idx_type& rank) const;
169 169
170 Matrix expm (void) const; 170 Matrix expm (void) const;
171 171
172 Matrix& operator += (const DiagMatrix& a); 172 Matrix& operator += (const DiagMatrix& a);
173 Matrix& operator -= (const DiagMatrix& a); 173 Matrix& operator -= (const DiagMatrix& a);
202 Matrix sum (int dim = -1) const; 202 Matrix sum (int dim = -1) const;
203 Matrix sumsq (int dim = -1) const; 203 Matrix sumsq (int dim = -1) const;
204 Matrix abs (void) const; 204 Matrix abs (void) const;
205 205
206 ColumnVector diag (void) const; 206 ColumnVector diag (void) const;
207 ColumnVector diag (int k) const; 207 ColumnVector diag (octave_idx_type k) const;
208 208
209 ColumnVector row_min (void) const; 209 ColumnVector row_min (void) const;
210 ColumnVector row_max (void) const; 210 ColumnVector row_max (void) const;
211 211
212 ColumnVector row_min (Array<int>& index) const; 212 ColumnVector row_min (Array<octave_idx_type>& index) const;
213 ColumnVector row_max (Array<int>& index) const; 213 ColumnVector row_max (Array<octave_idx_type>& index) const;
214 214
215 RowVector column_min (void) const; 215 RowVector column_min (void) const;
216 RowVector column_max (void) const; 216 RowVector column_max (void) const;
217 217
218 RowVector column_min (Array<int>& index) const; 218 RowVector column_min (Array<octave_idx_type>& index) const;
219 RowVector column_max (Array<int>& index) const; 219 RowVector column_max (Array<octave_idx_type>& index) const;
220 220
221 // i/o 221 // i/o
222 222
223 friend std::ostream& operator << (std::ostream& os, const Matrix& a); 223 friend std::ostream& operator << (std::ostream& os, const Matrix& a);
224 friend std::istream& operator >> (std::istream& is, Matrix& a); 224 friend std::istream& operator >> (std::istream& is, Matrix& a);
225 225
226 static double resize_fill_value (void) { return 0; } 226 static double resize_fill_value (void) { return 0; }
227 227
228 private: 228 private:
229 229
230 Matrix (double *d, int r, int c) : MArray2<double> (d, r, c) { } 230 Matrix (double *d, octave_idx_type r, octave_idx_type c) : MArray2<double> (d, r, c) { }
231 }; 231 };
232 232
233 extern Matrix Givens (double, double); 233 extern Matrix Givens (double, double);
234 234
235 extern Matrix Sylvester (const Matrix&, const Matrix&, const Matrix&); 235 extern Matrix Sylvester (const Matrix&, const Matrix&, const Matrix&);