annotate liboctave/dMatrix.h @ 7016:93c65f2a5668

[project @ 2007-10-12 06:40:56 by jwe]
author jwe
date Fri, 12 Oct 2007 06:41:26 +0000
parents 2883ea1c5c18
children a1dbe9d80eee
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: 2832
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
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6979
diff changeset
9 Free Software Foundation; either version 3 of the License, or (at your
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6979
diff changeset
10 option) any later version.
458
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
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6979
diff changeset
18 along with Octave; see the file COPYING. If not, see
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6979
diff changeset
19 <http://www.gnu.org/licenses/>.
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_Matrix_int_h)
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
24 #define octave_Matrix_int_h 1
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
25
1989
a4b0826e240c [project @ 1996-03-02 00:33:22 by jwe]
jwe
parents: 1963
diff changeset
26 #include "MArray2.h"
a4b0826e240c [project @ 1996-03-02 00:33:22 by jwe]
jwe
parents: 1963
diff changeset
27 #include "MDiagArray2.h"
5785
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5717
diff changeset
28 #include "MatrixType.h"
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
29
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
30 #include "mx-defs.h"
2870
3241d0057e78 [project @ 1997-04-19 01:21:29 by jwe]
jwe
parents: 2847
diff changeset
31 #include "mx-op-defs.h"
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
32
3585
d9803711e047 [project @ 2000-02-08 04:35:39 by jwe]
jwe
parents: 3580
diff changeset
33 class
6108
143b556ce725 [project @ 2006-10-27 01:45:54 by jwe]
jwe
parents: 5958
diff changeset
34 OCTAVE_API
3585
d9803711e047 [project @ 2000-02-08 04:35:39 by jwe]
jwe
parents: 3580
diff changeset
35 Matrix : public MArray2<double>
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
36 {
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
37 public:
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
38
3480
45742a3b1f7c [project @ 2000-01-26 06:16:41 by jwe]
jwe
parents: 3354
diff changeset
39 typedef void (*solve_singularity_handler) (double rcond);
45742a3b1f7c [project @ 2000-01-26 06:16:41 by jwe]
jwe
parents: 3354
diff changeset
40
1214
0bf4d2b7def4 [project @ 1995-04-06 02:33:59 by jwe]
jwe
parents: 1205
diff changeset
41 Matrix (void) : MArray2<double> () { }
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 Matrix (octave_idx_type r, octave_idx_type c) : MArray2<double> (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 Matrix (octave_idx_type r, octave_idx_type c, double val) : MArray2<double> (r, c, val) { }
3585
d9803711e047 [project @ 2000-02-08 04:35:39 by jwe]
jwe
parents: 3580
diff changeset
46
6979
2883ea1c5c18 [project @ 2007-10-08 20:23:48 by dbateman]
dbateman
parents: 6708
diff changeset
47 Matrix (const dim_vector& dv) : MArray2<double> (dv) { }
2883ea1c5c18 [project @ 2007-10-08 20:23:48 by dbateman]
dbateman
parents: 6708
diff changeset
48
2883ea1c5c18 [project @ 2007-10-08 20:23:48 by dbateman]
dbateman
parents: 6708
diff changeset
49 Matrix (const dim_vector& dv, double val) : MArray2<double> (dv, val) { }
2883ea1c5c18 [project @ 2007-10-08 20:23:48 by dbateman]
dbateman
parents: 6708
diff changeset
50
1214
0bf4d2b7def4 [project @ 1995-04-06 02:33:59 by jwe]
jwe
parents: 1205
diff changeset
51 Matrix (const Matrix& a) : MArray2<double> (a) { }
3585
d9803711e047 [project @ 2000-02-08 04:35:39 by jwe]
jwe
parents: 3580
diff changeset
52
d9803711e047 [project @ 2000-02-08 04:35:39 by jwe]
jwe
parents: 3580
diff changeset
53 Matrix (const MArray2<double>& a) : MArray2<double> (a) { }
d9803711e047 [project @ 2000-02-08 04:35:39 by jwe]
jwe
parents: 3580
diff changeset
54
d9803711e047 [project @ 2000-02-08 04:35:39 by jwe]
jwe
parents: 3580
diff changeset
55 explicit Matrix (const RowVector& rv);
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
56
3585
d9803711e047 [project @ 2000-02-08 04:35:39 by jwe]
jwe
parents: 3580
diff changeset
57 explicit Matrix (const ColumnVector& cv);
d9803711e047 [project @ 2000-02-08 04:35:39 by jwe]
jwe
parents: 3580
diff changeset
58
d9803711e047 [project @ 2000-02-08 04:35:39 by jwe]
jwe
parents: 3580
diff changeset
59 explicit Matrix (const DiagMatrix& a);
d9803711e047 [project @ 2000-02-08 04:35:39 by jwe]
jwe
parents: 3580
diff changeset
60
d9803711e047 [project @ 2000-02-08 04:35:39 by jwe]
jwe
parents: 3580
diff changeset
61 explicit Matrix (const boolMatrix& a);
d9803711e047 [project @ 2000-02-08 04:35:39 by jwe]
jwe
parents: 3580
diff changeset
62
d9803711e047 [project @ 2000-02-08 04:35:39 by jwe]
jwe
parents: 3580
diff changeset
63 explicit Matrix (const charMatrix& a);
1574
dd7d27461567 [project @ 1995-10-19 04:34:20 by jwe]
jwe
parents: 1366
diff changeset
64
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
65 Matrix& operator = (const Matrix& a)
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
66 {
1214
0bf4d2b7def4 [project @ 1995-04-06 02:33:59 by jwe]
jwe
parents: 1205
diff changeset
67 MArray2<double>::operator = (a);
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
68 return *this;
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
2385
170053c0f75e [project @ 1996-10-12 18:23:01 by jwe]
jwe
parents: 2354
diff changeset
71 bool operator == (const Matrix& a) const;
170053c0f75e [project @ 1996-10-12 18:23:01 by jwe]
jwe
parents: 2354
diff changeset
72 bool operator != (const Matrix& a) const;
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
73
3354
87721841efd7 [project @ 1999-11-17 19:06:11 by jwe]
jwe
parents: 3248
diff changeset
74 bool is_symmetric (void) const;
87721841efd7 [project @ 1999-11-17 19:06:11 by jwe]
jwe
parents: 3248
diff changeset
75
1359
a6994c934a50 [project @ 1995-09-05 21:30:26 by jwe]
jwe
parents: 1315
diff changeset
76 // destructive insert/delete/reorder operations
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
77
5275
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
78 Matrix& insert (const Matrix& a, octave_idx_type r, octave_idx_type c);
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
79 Matrix& insert (const RowVector& a, octave_idx_type r, octave_idx_type c);
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
80 Matrix& insert (const ColumnVector& a, octave_idx_type r, octave_idx_type c);
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
81 Matrix& insert (const DiagMatrix& a, octave_idx_type r, octave_idx_type c);
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
82
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
83 Matrix& fill (double val);
5275
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
84 Matrix& fill (double val, octave_idx_type r1, octave_idx_type c1, octave_idx_type r2, octave_idx_type c2);
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
85
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
86 Matrix append (const Matrix& a) const;
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
87 Matrix append (const RowVector& a) const;
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
88 Matrix append (const ColumnVector& a) const;
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
89 Matrix append (const DiagMatrix& a) const;
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
90
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
91 Matrix stack (const Matrix& a) const;
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
92 Matrix stack (const RowVector& a) const;
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
93 Matrix stack (const ColumnVector& a) const;
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
94 Matrix stack (const DiagMatrix& a) const;
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
95
6108
143b556ce725 [project @ 2006-10-27 01:45:54 by jwe]
jwe
parents: 5958
diff changeset
96 friend OCTAVE_API Matrix real (const ComplexMatrix& a);
143b556ce725 [project @ 2006-10-27 01:45:54 by jwe]
jwe
parents: 5958
diff changeset
97 friend OCTAVE_API Matrix imag (const ComplexMatrix& a);
1205
8302fab9fe24 [project @ 1995-04-04 02:05:01 by jwe]
jwe
parents: 1011
diff changeset
98
3225
7aae2c3636a7 [project @ 1998-12-04 23:20:12 by jwe]
jwe
parents: 3185
diff changeset
99 Matrix transpose (void) const { return MArray2<double>::transpose (); }
7aae2c3636a7 [project @ 1998-12-04 23:20:12 by jwe]
jwe
parents: 3185
diff changeset
100
1359
a6994c934a50 [project @ 1995-09-05 21:30:26 by jwe]
jwe
parents: 1315
diff changeset
101 // resize is the destructive equivalent for this one
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
102
5275
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
103 Matrix 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
104
5275
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
105 Matrix extract_n (octave_idx_type r1, octave_idx_type c1, octave_idx_type nr, octave_idx_type nc) const;
4316
236c10efcde2 [project @ 2003-02-10 21:57:15 by jwe]
jwe
parents: 4309
diff changeset
106
1359
a6994c934a50 [project @ 1995-09-05 21:30:26 by jwe]
jwe
parents: 1315
diff changeset
107 // extract row or column i.
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
108
5275
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
109 RowVector row (octave_idx_type i) const;
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
110
5275
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
111 ColumnVector column (octave_idx_type i) const;
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
112
6207
3c92b8d892dd [project @ 2006-12-06 20:19:14 by dbateman]
dbateman
parents: 6108
diff changeset
113 private:
3c92b8d892dd [project @ 2006-12-06 20:19:14 by dbateman]
dbateman
parents: 6108
diff changeset
114 Matrix tinverse (MatrixType &mattype, octave_idx_type& info, double& rcond,
3c92b8d892dd [project @ 2006-12-06 20:19:14 by dbateman]
dbateman
parents: 6108
diff changeset
115 int force, int calc_cond) const;
3c92b8d892dd [project @ 2006-12-06 20:19:14 by dbateman]
dbateman
parents: 6108
diff changeset
116
3c92b8d892dd [project @ 2006-12-06 20:19:14 by dbateman]
dbateman
parents: 6108
diff changeset
117 Matrix finverse (MatrixType &mattype, octave_idx_type& info, double& rcond,
3c92b8d892dd [project @ 2006-12-06 20:19:14 by dbateman]
dbateman
parents: 6108
diff changeset
118 int force, int calc_cond) const;
3c92b8d892dd [project @ 2006-12-06 20:19:14 by dbateman]
dbateman
parents: 6108
diff changeset
119
3c92b8d892dd [project @ 2006-12-06 20:19:14 by dbateman]
dbateman
parents: 6108
diff changeset
120 public:
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
121 Matrix inverse (void) const;
6479
2ee8293554a3 [project @ 2007-04-03 15:30:58 by jwe]
jwe
parents: 6207
diff changeset
122 Matrix inverse (octave_idx_type& info) const;
2ee8293554a3 [project @ 2007-04-03 15:30:58 by jwe]
jwe
parents: 6207
diff changeset
123 Matrix inverse (octave_idx_type& info, double& rcond, int force = 0,
2ee8293554a3 [project @ 2007-04-03 15:30:58 by jwe]
jwe
parents: 6207
diff changeset
124 int calc_cond = 1) const;
2ee8293554a3 [project @ 2007-04-03 15:30:58 by jwe]
jwe
parents: 6207
diff changeset
125
6207
3c92b8d892dd [project @ 2006-12-06 20:19:14 by dbateman]
dbateman
parents: 6108
diff changeset
126 Matrix inverse (MatrixType &mattype) const;
3c92b8d892dd [project @ 2006-12-06 20:19:14 by dbateman]
dbateman
parents: 6108
diff changeset
127 Matrix inverse (MatrixType &mattype, octave_idx_type& info) const;
3c92b8d892dd [project @ 2006-12-06 20:19:14 by dbateman]
dbateman
parents: 6108
diff changeset
128 Matrix inverse (MatrixType &mattype, octave_idx_type& info, double& rcond,
3c92b8d892dd [project @ 2006-12-06 20:19:14 by dbateman]
dbateman
parents: 6108
diff changeset
129 int force = 0, int calc_cond = 1) const;
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
130
4384
f1fcc371e5ef [project @ 2003-04-23 19:51:57 by jwe]
jwe
parents: 4329
diff changeset
131 Matrix pseudo_inverse (double tol = 0.0) const;
740
d8295febb0df [project @ 1994-09-30 14:42:37 by jwe]
jwe
parents: 677
diff changeset
132
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
133 ComplexMatrix fourier (void) const;
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
134 ComplexMatrix ifourier (void) const;
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
135
677
01da6806197b [project @ 1994-09-08 04:43:13 by jwe]
jwe
parents: 536
diff changeset
136 ComplexMatrix fourier2d (void) const;
01da6806197b [project @ 1994-09-08 04:43:13 by jwe]
jwe
parents: 536
diff changeset
137 ComplexMatrix ifourier2d (void) const;
01da6806197b [project @ 1994-09-08 04:43:13 by jwe]
jwe
parents: 536
diff changeset
138
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
139 DET determinant (void) const;
5275
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
140 DET determinant (octave_idx_type& info) const;
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
141 DET determinant (octave_idx_type& info, double& rcond, int calc_cond = 1) const;
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
142
5785
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5717
diff changeset
143 private:
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5717
diff changeset
144 // Upper triangular matrix solvers
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5717
diff changeset
145 Matrix utsolve (MatrixType &typ, const Matrix& b, octave_idx_type& info,
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5717
diff changeset
146 double& rcond, solve_singularity_handler sing_handler,
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5717
diff changeset
147 bool calc_cond = false) const;
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5717
diff changeset
148
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5717
diff changeset
149 // Lower triangular matrix solvers
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5717
diff changeset
150 Matrix ltsolve (MatrixType &typ, const Matrix& b, octave_idx_type& info,
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5717
diff changeset
151 double& rcond, solve_singularity_handler sing_handler,
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5717
diff changeset
152 bool calc_cond = false) const;
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5717
diff changeset
153
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5717
diff changeset
154 // Full matrix solvers (lu/cholesky)
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5717
diff changeset
155 Matrix fsolve (MatrixType &typ, const Matrix& b, octave_idx_type& info,
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5717
diff changeset
156 double& rcond, solve_singularity_handler sing_handler,
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5717
diff changeset
157 bool calc_cond = false) const;
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5717
diff changeset
158
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5717
diff changeset
159 public:
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5717
diff changeset
160 // Generic interface to solver with no probing of type
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5717
diff changeset
161 Matrix solve (MatrixType &typ, const Matrix& b) const;
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5717
diff changeset
162 Matrix solve (MatrixType &typ, const Matrix& b, octave_idx_type& info) const;
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5717
diff changeset
163 Matrix solve (MatrixType &typ, const Matrix& b, octave_idx_type& info,
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5717
diff changeset
164 double& rcond) const;
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5717
diff changeset
165 Matrix solve (MatrixType &typ, const Matrix& b, octave_idx_type& info,
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5717
diff changeset
166 double& rcond, solve_singularity_handler sing_handler,
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5717
diff changeset
167 bool singular_fallback = true) const;
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5717
diff changeset
168
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5717
diff changeset
169 ComplexMatrix solve (MatrixType &typ, const ComplexMatrix& b) const;
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5717
diff changeset
170 ComplexMatrix solve (MatrixType &typ, const ComplexMatrix& b,
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5717
diff changeset
171 octave_idx_type& info) const;
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5717
diff changeset
172 ComplexMatrix solve (MatrixType &typ, const ComplexMatrix& b,
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5717
diff changeset
173 octave_idx_type& info, double& rcond) const;
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5717
diff changeset
174 ComplexMatrix solve (MatrixType &typ, const ComplexMatrix& b,
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5717
diff changeset
175 octave_idx_type& info, double& rcond,
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5717
diff changeset
176 solve_singularity_handler sing_handler,
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5717
diff changeset
177 bool singular_fallback = true) const;
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5717
diff changeset
178
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5717
diff changeset
179 ColumnVector solve (MatrixType &typ, const ColumnVector& b) const;
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5717
diff changeset
180 ColumnVector solve (MatrixType &typ, const ColumnVector& b,
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5717
diff changeset
181 octave_idx_type& info) const;
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5717
diff changeset
182 ColumnVector solve (MatrixType &typ, const ColumnVector& b,
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5717
diff changeset
183 octave_idx_type& info, double& rcond) const;
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5717
diff changeset
184 ColumnVector solve (MatrixType &typ, const ColumnVector& b,
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5717
diff changeset
185 octave_idx_type& info, double& rcond,
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5717
diff changeset
186 solve_singularity_handler sing_handler) const;
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5717
diff changeset
187
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5717
diff changeset
188 ComplexColumnVector solve (MatrixType &typ,
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5717
diff changeset
189 const ComplexColumnVector& b) const;
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5717
diff changeset
190 ComplexColumnVector solve (MatrixType &typ, const ComplexColumnVector& b,
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5717
diff changeset
191 octave_idx_type& info) const;
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5717
diff changeset
192 ComplexColumnVector solve (MatrixType &typ, const ComplexColumnVector& b,
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5717
diff changeset
193 octave_idx_type& info, double& rcond) const;
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5717
diff changeset
194 ComplexColumnVector solve (MatrixType &typ, const ComplexColumnVector& b,
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5717
diff changeset
195 octave_idx_type& info, double& rcond,
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5717
diff changeset
196 solve_singularity_handler sing_handler) const;
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5717
diff changeset
197
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5717
diff changeset
198 // Generic interface to solver with probing of type
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
199 Matrix solve (const Matrix& b) const;
5275
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
200 Matrix solve (const Matrix& b, octave_idx_type& info) const;
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
201 Matrix solve (const Matrix& b, octave_idx_type& info, double& rcond) const;
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
202 Matrix solve (const Matrix& b, octave_idx_type& info, double& rcond,
3480
45742a3b1f7c [project @ 2000-01-26 06:16:41 by jwe]
jwe
parents: 3354
diff changeset
203 solve_singularity_handler sing_handler) const;
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
204
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
205 ComplexMatrix solve (const ComplexMatrix& b) const;
5275
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
206 ComplexMatrix solve (const ComplexMatrix& b, octave_idx_type& info) const;
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
207 ComplexMatrix solve (const ComplexMatrix& b, octave_idx_type& info, double& rcond) const;
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
208 ComplexMatrix solve (const ComplexMatrix& b, octave_idx_type& info, double& rcond,
3480
45742a3b1f7c [project @ 2000-01-26 06:16:41 by jwe]
jwe
parents: 3354
diff changeset
209 solve_singularity_handler sing_handler) const;
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
210
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
211 ColumnVector solve (const ColumnVector& b) const;
5275
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
212 ColumnVector solve (const ColumnVector& b, octave_idx_type& info) const;
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
213 ColumnVector solve (const ColumnVector& b, octave_idx_type& info, double& rcond) const;
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
214 ColumnVector solve (const ColumnVector& b, octave_idx_type& info, double& rcond,
3480
45742a3b1f7c [project @ 2000-01-26 06:16:41 by jwe]
jwe
parents: 3354
diff changeset
215 solve_singularity_handler sing_handler) const;
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
216
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
217 ComplexColumnVector solve (const ComplexColumnVector& b) const;
5275
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
218 ComplexColumnVector solve (const ComplexColumnVector& b, octave_idx_type& info) const;
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
219 ComplexColumnVector solve (const ComplexColumnVector& b, octave_idx_type& info,
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
220 double& rcond) const;
5275
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
221 ComplexColumnVector solve (const ComplexColumnVector& b, octave_idx_type& info,
3480
45742a3b1f7c [project @ 2000-01-26 06:16:41 by jwe]
jwe
parents: 3354
diff changeset
222 double& rcond,
45742a3b1f7c [project @ 2000-01-26 06:16:41 by jwe]
jwe
parents: 3354
diff changeset
223 solve_singularity_handler sing_handler) const;
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
224
5785
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5717
diff changeset
225 // Singular solvers
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
226 Matrix lssolve (const Matrix& b) const;
5275
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
227 Matrix lssolve (const Matrix& b, octave_idx_type& info) const;
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
228 Matrix lssolve (const Matrix& b, octave_idx_type& info, octave_idx_type& rank) const;
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
229
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
230 ComplexMatrix lssolve (const ComplexMatrix& b) const;
5275
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
231 ComplexMatrix lssolve (const ComplexMatrix& b, octave_idx_type& info) const;
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
232 ComplexMatrix lssolve (const ComplexMatrix& b, octave_idx_type& info,
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
233 octave_idx_type& rank) const;
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
234
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
235 ColumnVector lssolve (const ColumnVector& b) const;
5275
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
236 ColumnVector lssolve (const ColumnVector& b, octave_idx_type& info) const;
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
237 ColumnVector lssolve (const ColumnVector& b, octave_idx_type& info, octave_idx_type& rank) const;
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
238
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
239 ComplexColumnVector lssolve (const ComplexColumnVector& b) const;
5275
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
240 ComplexColumnVector lssolve (const ComplexColumnVector& b, octave_idx_type& info) const;
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
241 ComplexColumnVector lssolve (const ComplexColumnVector& b, octave_idx_type& info,
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
242 octave_idx_type& rank) const;
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
243
1819
8b8498bf8ec5 [project @ 1996-01-31 11:29:17 by jwe]
jwe
parents: 1656
diff changeset
244 Matrix expm (void) const;
8b8498bf8ec5 [project @ 1996-01-31 11:29:17 by jwe]
jwe
parents: 1656
diff changeset
245
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
246 Matrix& operator += (const DiagMatrix& a);
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
247 Matrix& operator -= (const DiagMatrix& a);
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
248
1359
a6994c934a50 [project @ 1995-09-05 21:30:26 by jwe]
jwe
parents: 1315
diff changeset
249 // unary operations
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
250
2964
0a2551ec7004 [project @ 1997-05-12 07:26:50 by jwe]
jwe
parents: 2870
diff changeset
251 boolMatrix operator ! (void) const;
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
252
1359
a6994c934a50 [project @ 1995-09-05 21:30:26 by jwe]
jwe
parents: 1315
diff changeset
253 // other operations
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
254
2676
a5a300c61159 [project @ 1997-02-14 03:16:06 by jwe]
jwe
parents: 2385
diff changeset
255 Matrix map (d_d_Mapper f) const;
3248
68259f410026 [project @ 1999-07-13 03:34:54 by jwe]
jwe
parents: 3225
diff changeset
256 boolMatrix map (b_d_Mapper f) const;
2676
a5a300c61159 [project @ 1997-02-14 03:16:06 by jwe]
jwe
parents: 2385
diff changeset
257
a5a300c61159 [project @ 1997-02-14 03:16:06 by jwe]
jwe
parents: 2385
diff changeset
258 Matrix& apply (d_d_Mapper f);
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
259
4431
c4bde1d5eb98 [project @ 2003-06-18 15:47:09 by jwe]
jwe
parents: 4384
diff changeset
260 bool any_element_is_negative (bool = false) const;
2385
170053c0f75e [project @ 1996-10-12 18:23:01 by jwe]
jwe
parents: 2354
diff changeset
261 bool any_element_is_inf_or_nan (void) const;
5943
c038c2947ee1 [project @ 2006-08-18 21:27:03 by jwe]
jwe
parents: 5785
diff changeset
262 bool any_element_not_one_or_zero (void) const;
2385
170053c0f75e [project @ 1996-10-12 18:23:01 by jwe]
jwe
parents: 2354
diff changeset
263 bool all_elements_are_int_or_inf_or_nan (void) const;
170053c0f75e [project @ 1996-10-12 18:23:01 by jwe]
jwe
parents: 2354
diff changeset
264 bool all_integers (double& max_val, double& min_val) const;
170053c0f75e [project @ 1996-10-12 18:23:01 by jwe]
jwe
parents: 2354
diff changeset
265 bool too_large_for_float (void) const;
1963
665a44bb6a56 [project @ 1996-02-16 04:34:40 by jwe]
jwe
parents: 1959
diff changeset
266
4017
0eb247b9cc9b [project @ 2002-08-03 04:07:14 by jwe]
jwe
parents: 4015
diff changeset
267 boolMatrix all (int dim = -1) const;
0eb247b9cc9b [project @ 2002-08-03 04:07:14 by jwe]
jwe
parents: 4015
diff changeset
268 boolMatrix any (int dim = -1) const;
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
269
4017
0eb247b9cc9b [project @ 2002-08-03 04:07:14 by jwe]
jwe
parents: 4015
diff changeset
270 Matrix cumprod (int dim = -1) const;
0eb247b9cc9b [project @ 2002-08-03 04:07:14 by jwe]
jwe
parents: 4015
diff changeset
271 Matrix cumsum (int dim = -1) const;
0eb247b9cc9b [project @ 2002-08-03 04:07:14 by jwe]
jwe
parents: 4015
diff changeset
272 Matrix prod (int dim = -1) const;
0eb247b9cc9b [project @ 2002-08-03 04:07:14 by jwe]
jwe
parents: 4015
diff changeset
273 Matrix sum (int dim = -1) const;
0eb247b9cc9b [project @ 2002-08-03 04:07:14 by jwe]
jwe
parents: 4015
diff changeset
274 Matrix sumsq (int dim = -1) const;
2385
170053c0f75e [project @ 1996-10-12 18:23:01 by jwe]
jwe
parents: 2354
diff changeset
275 Matrix abs (void) const;
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
276
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
277 ColumnVector diag (void) const;
5275
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
278 ColumnVector diag (octave_idx_type k) const;
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
279
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
280 ColumnVector row_min (void) const;
2354
2ce6e1ec9b53 [project @ 1996-08-20 22:44:25 by jwe]
jwe
parents: 2349
diff changeset
281 ColumnVector row_max (void) const;
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
282
5275
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
283 ColumnVector row_min (Array<octave_idx_type>& index) const;
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
284 ColumnVector row_max (Array<octave_idx_type>& index) const;
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
285
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
286 RowVector column_min (void) const;
2354
2ce6e1ec9b53 [project @ 1996-08-20 22:44:25 by jwe]
jwe
parents: 2349
diff changeset
287 RowVector column_max (void) const;
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
288
5275
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
289 RowVector column_min (Array<octave_idx_type>& index) const;
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
290 RowVector column_max (Array<octave_idx_type>& index) const;
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
291
1359
a6994c934a50 [project @ 1995-09-05 21:30:26 by jwe]
jwe
parents: 1315
diff changeset
292 // i/o
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
293
6108
143b556ce725 [project @ 2006-10-27 01:45:54 by jwe]
jwe
parents: 5958
diff changeset
294 friend OCTAVE_API std::ostream& operator << (std::ostream& os, const Matrix& a);
143b556ce725 [project @ 2006-10-27 01:45:54 by jwe]
jwe
parents: 5958
diff changeset
295 friend OCTAVE_API std::istream& operator >> (std::istream& is, Matrix& a);
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
296
3933
f9ea3dcf58ee [project @ 2002-05-15 03:21:00 by jwe]
jwe
parents: 3723
diff changeset
297 static double resize_fill_value (void) { return 0; }
f9ea3dcf58ee [project @ 2002-05-15 03:21:00 by jwe]
jwe
parents: 3723
diff changeset
298
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
299 private:
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
300
5275
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
301 Matrix (double *d, octave_idx_type r, octave_idx_type c) : MArray2<double> (d, r, c) { }
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
302 };
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
303
5508
7865515fc6c2 [project @ 2005-10-26 15:24:07 by jwe]
jwe
parents: 5307
diff changeset
304 // Publish externally used friend functions.
7865515fc6c2 [project @ 2005-10-26 15:24:07 by jwe]
jwe
parents: 5307
diff changeset
305
6108
143b556ce725 [project @ 2006-10-27 01:45:54 by jwe]
jwe
parents: 5958
diff changeset
306 extern OCTAVE_API Matrix real (const ComplexMatrix& a);
143b556ce725 [project @ 2006-10-27 01:45:54 by jwe]
jwe
parents: 5958
diff changeset
307 extern OCTAVE_API Matrix imag (const ComplexMatrix& a);
5508
7865515fc6c2 [project @ 2005-10-26 15:24:07 by jwe]
jwe
parents: 5307
diff changeset
308
7865515fc6c2 [project @ 2005-10-26 15:24:07 by jwe]
jwe
parents: 5307
diff changeset
309 // column vector by row vector -> matrix operations
7865515fc6c2 [project @ 2005-10-26 15:24:07 by jwe]
jwe
parents: 5307
diff changeset
310
6108
143b556ce725 [project @ 2006-10-27 01:45:54 by jwe]
jwe
parents: 5958
diff changeset
311 extern OCTAVE_API Matrix operator * (const ColumnVector& a, const RowVector& b);
5508
7865515fc6c2 [project @ 2005-10-26 15:24:07 by jwe]
jwe
parents: 5307
diff changeset
312
7865515fc6c2 [project @ 2005-10-26 15:24:07 by jwe]
jwe
parents: 5307
diff changeset
313 // Other functions.
7865515fc6c2 [project @ 2005-10-26 15:24:07 by jwe]
jwe
parents: 5307
diff changeset
314
6108
143b556ce725 [project @ 2006-10-27 01:45:54 by jwe]
jwe
parents: 5958
diff changeset
315 extern OCTAVE_API Matrix Givens (double, double);
1819
8b8498bf8ec5 [project @ 1996-01-31 11:29:17 by jwe]
jwe
parents: 1656
diff changeset
316
6108
143b556ce725 [project @ 2006-10-27 01:45:54 by jwe]
jwe
parents: 5958
diff changeset
317 extern OCTAVE_API Matrix Sylvester (const Matrix&, const Matrix&, const Matrix&);
1959
9fae6fc592f2 [project @ 1996-02-15 04:54:32 by jwe]
jwe
parents: 1882
diff changeset
318
6108
143b556ce725 [project @ 2006-10-27 01:45:54 by jwe]
jwe
parents: 5958
diff changeset
319 extern OCTAVE_API Matrix operator * (const Matrix& a, const Matrix& b);
2828
92826d6e8bd9 [project @ 1997-03-25 23:41:41 by jwe]
jwe
parents: 2676
diff changeset
320
6108
143b556ce725 [project @ 2006-10-27 01:45:54 by jwe]
jwe
parents: 5958
diff changeset
321 extern OCTAVE_API Matrix min (double d, const Matrix& m);
143b556ce725 [project @ 2006-10-27 01:45:54 by jwe]
jwe
parents: 5958
diff changeset
322 extern OCTAVE_API Matrix min (const Matrix& m, double d);
143b556ce725 [project @ 2006-10-27 01:45:54 by jwe]
jwe
parents: 5958
diff changeset
323 extern OCTAVE_API Matrix min (const Matrix& a, const Matrix& b);
4309
a9560cebae6e [project @ 2003-01-28 23:24:58 by jwe]
jwe
parents: 4192
diff changeset
324
6108
143b556ce725 [project @ 2006-10-27 01:45:54 by jwe]
jwe
parents: 5958
diff changeset
325 extern OCTAVE_API Matrix max (double d, const Matrix& m);
143b556ce725 [project @ 2006-10-27 01:45:54 by jwe]
jwe
parents: 5958
diff changeset
326 extern OCTAVE_API Matrix max (const Matrix& m, double d);
143b556ce725 [project @ 2006-10-27 01:45:54 by jwe]
jwe
parents: 5958
diff changeset
327 extern OCTAVE_API Matrix max (const Matrix& a, const Matrix& b);
4309
a9560cebae6e [project @ 2003-01-28 23:24:58 by jwe]
jwe
parents: 4192
diff changeset
328
6708
0ce71beb1cf3 [project @ 2007-06-13 06:40:48 by jwe]
jwe
parents: 6479
diff changeset
329 MS_CMP_OP_DECLS (Matrix, double, OCTAVE_API)
0ce71beb1cf3 [project @ 2007-06-13 06:40:48 by jwe]
jwe
parents: 6479
diff changeset
330 MS_BOOL_OP_DECLS (Matrix, double, OCTAVE_API)
2870
3241d0057e78 [project @ 1997-04-19 01:21:29 by jwe]
jwe
parents: 2847
diff changeset
331
6708
0ce71beb1cf3 [project @ 2007-06-13 06:40:48 by jwe]
jwe
parents: 6479
diff changeset
332 SM_CMP_OP_DECLS (double, Matrix, OCTAVE_API)
0ce71beb1cf3 [project @ 2007-06-13 06:40:48 by jwe]
jwe
parents: 6479
diff changeset
333 SM_BOOL_OP_DECLS (double, Matrix, OCTAVE_API)
2870
3241d0057e78 [project @ 1997-04-19 01:21:29 by jwe]
jwe
parents: 2847
diff changeset
334
6708
0ce71beb1cf3 [project @ 2007-06-13 06:40:48 by jwe]
jwe
parents: 6479
diff changeset
335 MM_CMP_OP_DECLS (Matrix, Matrix, OCTAVE_API)
0ce71beb1cf3 [project @ 2007-06-13 06:40:48 by jwe]
jwe
parents: 6479
diff changeset
336 MM_BOOL_OP_DECLS (Matrix, Matrix, OCTAVE_API)
2870
3241d0057e78 [project @ 1997-04-19 01:21:29 by jwe]
jwe
parents: 2847
diff changeset
337
3573
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
338 MARRAY_FORWARD_DEFS (MArray2, Matrix, double)
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
339
3689
9143cd2129c4 [project @ 2000-06-30 09:30:44 by jwe]
jwe
parents: 3585
diff changeset
340 template <class T>
9143cd2129c4 [project @ 2000-06-30 09:30:44 by jwe]
jwe
parents: 3585
diff changeset
341 void read_int (std::istream& is, bool swap_bytes, T& val);
9143cd2129c4 [project @ 2000-06-30 09:30:44 by jwe]
jwe
parents: 3585
diff changeset
342
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
343 #endif
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
344
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
345 /*
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
346 ;;; Local Variables: ***
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
347 ;;; mode: C++ ***
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
348 ;;; End: ***
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
349 */