annotate main/fixed/src/fixedMatrix.h @ 2383:d1930f8af7ca octave-forge

Changed the directory structure of fixed to match the package system
author hauberg
date Sun, 20 Aug 2006 14:43:38 +0000
parents
children 1728eb2120ef
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2383
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
1 /*
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
2
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
3 Copyright (C) 2003 Motorola Inc
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
4 Copyright (C) 2003 David Bateman
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
5
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
6 This program is free software; you can redistribute it and/or modify it
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
7 under the terms of the GNU General Public License as published by the
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
8 Free Software Foundation; either version 2, or (at your option) any
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
9 later version.
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
10
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
11 This program is distributed in the hope that it will be useful, but WITHOUT
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
14 for more details.
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
15
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
17 along with this program; see the file COPYING. If not, write to the Free
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
18 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
19
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
20 In addition to the terms of the GPL, you are permitted to link
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
21 this program with any Open Source program, as defined by the
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
22 Open Source Initiative (www.opensource.org)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
23
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
24 */
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
25
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
26 #if !defined (octave_FixedMatrix_h)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
27 #define octave_FixedMatrix_h 1
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
28
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
29 #if defined (__GNUG__) && defined (USE_PRAGMA_INTERFACE_IMPLEMENTATION)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
30 #pragma interface
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
31 #endif
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
32
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
33 #include <octave/MArray2.h>
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
34
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
35 #include <octave/mx-defs.h>
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
36 #include <octave/mx-op-defs.h>
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
37 #include <octave/data-conv.h>
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
38 #include <octave/mach-info.h>
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
39 #include <octave/boolMatrix.h>
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
40 #include <octave/dMatrix.h>
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
41
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
42 #include "int/fixed.h"
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
43
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
44 class FixedComplexMatrix;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
45
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
46 #if !defined(octave_FixedColVector_h)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
47 class FixedColumnVector;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
48 #endif
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
49 #if !defined(octave_FixedRowVector_h)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
50 class FixedRowVector;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
51 #endif
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
52
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
53 typedef FixedPoint (*f_f_Mapper)(FixedPoint);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
54
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
55 class
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
56 FixedMatrix : public MArray2<FixedPoint>
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
57 {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
58 public:
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
59
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
60 FixedMatrix (void) : MArray2<FixedPoint> () { }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
61
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
62 FixedMatrix (int r, int c) : MArray2<FixedPoint> (r, c) { }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
63
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
64 FixedMatrix (int r, int c, const FixedPoint val) : MArray2<FixedPoint> (r, c, val) { }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
65
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
66 FixedMatrix (const MArray2<int> &is, const MArray2<int> &ds);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
67
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
68 FixedMatrix (const Matrix &is, const Matrix &ds);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
69
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
70 FixedMatrix (unsigned int is, unsigned int ds, const FixedMatrix& a);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
71
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
72 FixedMatrix (const MArray2<int> &is, const MArray2<int> &ds,
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
73 const FixedMatrix& a);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
74
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
75 FixedMatrix (const Matrix &is, const Matrix &ds, const FixedMatrix& a);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
76
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
77 FixedMatrix (unsigned int is, unsigned int ds, const Matrix& a);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
78
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
79 FixedMatrix (const MArray2<int> &is, const MArray2<int> &ds,
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
80 const Matrix& a);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
81
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
82 FixedMatrix (const Matrix &is, const Matrix &ds, const Matrix& a);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
83
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
84 FixedMatrix (unsigned int is, unsigned int ds, const Matrix& a,
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
85 const Matrix& b);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
86
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
87 FixedMatrix (const MArray2<int> &is, const MArray2<int> &ds,
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
88 const Matrix& a, const Matrix& b);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
89
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
90 FixedMatrix (const Matrix &is, const Matrix &ds, const Matrix& a,
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
91 const Matrix& b);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
92
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
93 FixedMatrix (const MArray2<int> &a);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
94
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
95 FixedMatrix (const Matrix &a);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
96
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
97 FixedMatrix (const FixedMatrix& a) : MArray2<FixedPoint> (a) { }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
98 FixedMatrix (const MArray2<FixedPoint>& a) : MArray2<FixedPoint> (a) { }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
99
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
100 explicit FixedMatrix (const FixedRowVector& rv);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
101
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
102 explicit FixedMatrix (const FixedColumnVector& cv);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
103
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
104 Matrix sign (void) const;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
105 Matrix signbit (void) const;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
106 Matrix getdecsize (void) const;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
107 Matrix getintsize (void) const;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
108 Matrix getnumber (void) const;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
109 Matrix fixedpoint (void) const;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
110 FixedMatrix chdecsize (const double n);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
111 FixedMatrix chdecsize (const Matrix &n);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
112 FixedMatrix chintsize (const double n);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
113 FixedMatrix chintsize (const Matrix &n);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
114 FixedMatrix incdecsize (const double n);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
115 FixedMatrix incdecsize (const Matrix &n);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
116 FixedMatrix incdecsize ();
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
117 FixedMatrix incintsize (const double n);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
118 FixedMatrix incintsize (const Matrix &n);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
119 FixedMatrix incintsize ();
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
120
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
121 FixedMatrix& operator = (const FixedMatrix& a)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
122 {
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
123 MArray2<FixedPoint>::operator = (a);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
124 return *this;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
125 }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
126
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
127 bool operator == (const FixedMatrix& a) const;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
128 bool operator != (const FixedMatrix& a) const;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
129
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
130 bool is_symmetric (void) const;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
131
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
132 #ifdef HAVE_OLD_OCTAVE_CONCAT
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
133 friend FixedMatrix concat (const FixedMatrix& ra, const FixedMatrix& rb,
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
134 const Array<int>& ra_idx);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
135 #endif
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
136
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
137 #ifdef HAVE_OCTAVE_CONCAT
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
138 FixedMatrix concat (const FixedMatrix& rb, const Array<int>& ra_idx);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
139 FixedComplexMatrix concat (const FixedComplexMatrix& rb,
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
140 const Array<int>& ra_idx);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
141 #endif
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
142
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
143 // destructive insert/delete/reorder operations
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
144
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
145 FixedMatrix& insert (const FixedMatrix& a, int r, int c);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
146 FixedMatrix& insert (const FixedRowVector& a, int r, int c);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
147 FixedMatrix& insert (const FixedColumnVector& a, int r, int c);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
148
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
149 FixedMatrix& fill (FixedPoint val);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
150 FixedMatrix& fill (FixedPoint val, int r1, int c1, int r2, int c2);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
151
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
152 FixedMatrix append (const FixedMatrix& a) const;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
153 FixedMatrix append (const FixedRowVector& a) const;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
154 FixedMatrix append (const FixedColumnVector& a) const;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
155
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
156 FixedMatrix stack (const FixedMatrix& a) const;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
157 FixedMatrix stack (const FixedRowVector& a) const;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
158 FixedMatrix stack (const FixedColumnVector& a) const;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
159
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
160 FixedMatrix transpose (void) const
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
161 { return MArray2<FixedPoint>::transpose (); }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
162
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
163 // resize is the destructive equivalent for this one
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
164
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
165 FixedMatrix extract (int r1, int c1, int r2, int c2) const;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
166
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
167 FixedMatrix extract_n (int r1, int c1, int nr, int nc) const;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
168
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
169 // extract row or column i.
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
170
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
171 FixedRowVector row (int i) const;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
172 FixedRowVector row (char *s) const;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
173
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
174 FixedColumnVector column (int i) const;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
175 FixedColumnVector column (char *s) const;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
176
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
177 // unary operations
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
178
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
179 FixedMatrix operator ! (void) const;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
180
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
181 // other operations
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
182
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
183 FixedMatrix map (f_f_Mapper f) const;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
184 FixedMatrix& apply (f_f_Mapper f);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
185
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
186 boolMatrix all (int dim = -1) const;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
187 boolMatrix any (int dim = -1) const;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
188
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
189 FixedMatrix cumprod (int dim = -1) const;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
190 FixedMatrix cumsum (int dim = -1) const;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
191 FixedMatrix prod (int dim = -1) const;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
192 FixedMatrix sum (int dim = -1) const;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
193 FixedMatrix sumsq (int dim = -1) const;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
194 FixedMatrix abs (void) const;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
195
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
196 FixedColumnVector diag (void) const;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
197 FixedColumnVector diag (int k) const;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
198
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
199 FixedColumnVector row_min (void) const;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
200 FixedColumnVector row_max (void) const;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
201
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
202 FixedColumnVector row_min (Array<int>& index) const;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
203 FixedColumnVector row_max (Array<int>& index) const;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
204
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
205 FixedRowVector column_min (void) const;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
206 FixedRowVector column_max (void) const;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
207
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
208 FixedRowVector column_min (Array<int>& index) const;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
209 FixedRowVector column_max (Array<int>& index) const;
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
210
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
211 friend FixedMatrix operator * (const FixedColumnVector& a, const FixedRowVector& b);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
212 friend FixedMatrix operator * (const FixedMatrix& a, const FixedMatrix& b);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
213
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
214 friend FixedMatrix real (const FixedMatrix &x);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
215 friend FixedMatrix imag (const FixedMatrix &x);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
216 friend FixedMatrix conj (const FixedMatrix &x);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
217
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
218 friend FixedMatrix abs (const FixedMatrix &x);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
219 friend FixedMatrix cos (const FixedMatrix &x);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
220 friend FixedMatrix cosh (const FixedMatrix &x);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
221 friend FixedMatrix sin (const FixedMatrix &x);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
222 friend FixedMatrix sinh (const FixedMatrix &x);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
223 friend FixedMatrix tan (const FixedMatrix &x);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
224 friend FixedMatrix tanh (const FixedMatrix &x);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
225
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
226 friend FixedMatrix sqrt (const FixedMatrix &x);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
227 friend FixedMatrix pow (const FixedMatrix &a, const int b);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
228 friend FixedMatrix pow (const FixedMatrix &a, const double b);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
229 friend FixedMatrix pow (const FixedMatrix &a, const FixedPoint &b);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
230 friend FixedMatrix pow (const FixedMatrix &a, const FixedMatrix &b);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
231 friend FixedMatrix exp (const FixedMatrix &x);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
232 friend FixedMatrix log (const FixedMatrix &x);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
233 friend FixedMatrix log10 (const FixedMatrix &x);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
234
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
235 friend FixedMatrix atan2 (const FixedMatrix &x, const FixedMatrix &y);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
236
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
237 friend FixedMatrix round (const FixedMatrix &x);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
238 friend FixedMatrix rint (const FixedMatrix &x);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
239 friend FixedMatrix floor (const FixedMatrix &x);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
240 friend FixedMatrix ceil (const FixedMatrix &x);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
241
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
242 friend Matrix fixedpoint (const FixedMatrix& x);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
243 friend Matrix sign (const FixedMatrix& x);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
244 friend Matrix signbit (const FixedMatrix& x);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
245 friend Matrix getdecsize (const FixedMatrix& x);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
246 friend Matrix getintsize (const FixedMatrix& x);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
247 friend Matrix getnumber (const FixedMatrix& x);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
248
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
249 // i/o
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
250
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
251 friend std::ostream& operator << (std::ostream& os, const FixedMatrix& a);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
252 friend std::istream& operator >> (std::istream& is, FixedMatrix& a);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
253
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
254 static FixedPoint resize_fill_value (void) { return FixedPoint(); }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
255
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
256 private:
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
257
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
258 FixedMatrix (FixedPoint *d, int r, int c) : MArray2<FixedPoint> (d, r, c) { }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
259 };
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
260
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
261 FixedMatrix operator * (const FixedColumnVector& a, const FixedRowVector& b);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
262 FixedMatrix operator * (const FixedMatrix& a, const FixedMatrix& b);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
263
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
264 FixedMatrix real (const FixedMatrix &x);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
265 FixedMatrix imag (const FixedMatrix &x);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
266 FixedMatrix conj (const FixedMatrix &x);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
267
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
268 FixedMatrix abs (const FixedMatrix &x);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
269 FixedMatrix cos (const FixedMatrix &x);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
270 FixedMatrix cosh (const FixedMatrix &x);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
271 FixedMatrix sin (const FixedMatrix &x);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
272 FixedMatrix sinh (const FixedMatrix &x);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
273 FixedMatrix tan (const FixedMatrix &x);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
274 FixedMatrix tanh (const FixedMatrix &x);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
275
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
276 FixedMatrix sqrt (const FixedMatrix &x);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
277 FixedMatrix pow (const FixedMatrix &a, const int b);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
278 FixedMatrix pow (const FixedMatrix &a, const double b);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
279 FixedMatrix pow (const FixedMatrix &a, const FixedPoint &b);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
280 FixedMatrix pow (const FixedMatrix &a, const FixedMatrix &b);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
281 FixedMatrix exp (const FixedMatrix &x);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
282 FixedMatrix log (const FixedMatrix &x);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
283 FixedMatrix log10 (const FixedMatrix &x);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
284
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
285 FixedMatrix atan2 (const FixedMatrix &x, const FixedMatrix &y);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
286
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
287 FixedMatrix round (const FixedMatrix &x);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
288 FixedMatrix rint (const FixedMatrix &x);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
289 FixedMatrix floor (const FixedMatrix &x);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
290 FixedMatrix ceil (const FixedMatrix &x);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
291
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
292 inline Matrix fixedpoint (const FixedMatrix& x) { return x.fixedpoint(); }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
293 inline Matrix sign (const FixedMatrix& x) { return x.sign(); }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
294 inline Matrix signbit (const FixedMatrix& x) { return x.signbit(); }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
295 inline Matrix getdecsize (const FixedMatrix& x) { return x.getdecsize(); }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
296 inline Matrix getintsize (const FixedMatrix& x) { return x.getintsize(); }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
297 inline Matrix getnumber (const FixedMatrix& x) { return x.getnumber(); }
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
298
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
299 std::ostream& operator << (std::ostream& os, const FixedMatrix& a);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
300 std::istream& operator >> (std::istream& is, FixedMatrix& a);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
301
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
302 FixedMatrix min (FixedPoint d, const FixedMatrix& m);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
303 FixedMatrix min (const FixedMatrix& m, FixedPoint d);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
304 FixedMatrix min (const FixedMatrix& a, const FixedMatrix& b);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
305
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
306 FixedMatrix max (FixedPoint d, const FixedMatrix& m);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
307 FixedMatrix max (const FixedMatrix& m, FixedPoint d);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
308 FixedMatrix max (const FixedMatrix& a, const FixedMatrix& b);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
309
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
310 FixedMatrix elem_pow (const FixedMatrix &a, const FixedMatrix &b);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
311 FixedMatrix elem_pow (const FixedMatrix &a, const FixedPoint &b);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
312 FixedMatrix elem_pow (const FixedPoint &a, const FixedMatrix &b);
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
313
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
314
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
315 MS_CMP_OP_DECLS (FixedMatrix, FixedPoint)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
316 MS_BOOL_OP_DECLS (FixedMatrix, FixedPoint)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
317
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
318 SM_CMP_OP_DECLS (FixedPoint, FixedMatrix)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
319 SM_BOOL_OP_DECLS (FixedPoint, FixedMatrix)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
320
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
321 MM_CMP_OP_DECLS (FixedMatrix, FixedMatrix)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
322 MM_BOOL_OP_DECLS (FixedMatrix, FixedMatrix)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
323
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
324 MARRAY_FORWARD_DEFS (MArray2, FixedMatrix, FixedPoint)
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
325
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
326 #endif
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
327
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
328 /*
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
329 ;;; Local Variables: ***
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
330 ;;; mode: C++ ***
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
331 ;;; End: ***
d1930f8af7ca Changed the directory structure of fixed to match the package system
hauberg
parents:
diff changeset
332 */