[53b1fd]: src / fixedCNDArray.h Maximize Restore History

Download this file

fixedCNDArray.h    339 lines (247 with data), 12.5 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
/*
Copyright (C) 2004 Motorola Inc
Copyright (C) 2004 David Bateman
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with this program; see the file COPYING. If not, see
<http://www.gnu.org/licenses/>.
In addition to the terms of the GPL, you are permitted to link
this program with any Open Source program, as defined by the
Open Source Initiative (www.opensource.org)
*/
#if !defined (octave_FixedCNDArray_h)
#define octave_FixedCNDArray_h 1
#include <octave/MArray.h>
#include <octave/dMatrix.h>
#include <octave/dNDArray.h>
#include <octave/CNDArray.h>
#include <octave/boolNDArray.h>
#include <octave/mx-defs.h>
#include <octave/mx-op-defs.h>
#include <octave/data-conv.h>
#include <octave/mach-info.h>
#include "int/fixed.h"
#include "fixedCMatrix.h"
#include "fixedComplex.h"
#include "fixedNDArray.h"
class
FixedComplexNDArray : public MArray<FixedPointComplex>
{
public:
FixedComplexNDArray (void) : MArray<FixedPointComplex> () { }
FixedComplexNDArray (const dim_vector& dv)
: MArray<FixedPointComplex> (dv) { }
FixedComplexNDArray (const dim_vector& dv, const FixedPointComplex val) :
MArray<FixedPointComplex> (dv, val) { }
FixedComplexNDArray (const MArray<int> &is, const MArray<int> &ds);
FixedComplexNDArray (const NDArray &is, const NDArray &ds);
FixedComplexNDArray (const ComplexNDArray &is, const ComplexNDArray &ds);
FixedComplexNDArray (unsigned int is, unsigned int ds,
const FixedComplexNDArray& a);
FixedComplexNDArray (Complex is, Complex ds,
const FixedComplexNDArray& a);
FixedComplexNDArray (const MArray<int> &is, const MArray<int> &ds,
const FixedComplexNDArray& a);
FixedComplexNDArray (const NDArray &is, const NDArray &ds,
const FixedComplexNDArray& a);
FixedComplexNDArray (const ComplexNDArray &is, const ComplexNDArray &ds,
const FixedComplexNDArray& a);
FixedComplexNDArray (unsigned int is, unsigned int ds,
const FixedNDArray& a);
FixedComplexNDArray (Complex is, Complex ds, const FixedNDArray& a);
FixedComplexNDArray (const MArray<int> &is, const MArray<int> &ds,
const FixedNDArray& a);
FixedComplexNDArray (const NDArray &is, const NDArray &ds,
const FixedNDArray& a);
FixedComplexNDArray (const ComplexNDArray &is, const ComplexNDArray &ds,
const FixedNDArray& a);
FixedComplexNDArray (unsigned int is, unsigned int ds,
const ComplexNDArray& a);
FixedComplexNDArray (Complex is, Complex ds, const ComplexNDArray& a);
FixedComplexNDArray (const MArray<int> &is, const MArray<int> & ds,
const ComplexNDArray& a);
FixedComplexNDArray (const NDArray &is, const NDArray & ds,
const ComplexNDArray& a);
FixedComplexNDArray (const ComplexNDArray &is,
const ComplexNDArray & ds,
const ComplexNDArray& a);
FixedComplexNDArray (unsigned int is, unsigned int ds, const NDArray& a);
FixedComplexNDArray (Complex is, Complex ds, const NDArray& a);
FixedComplexNDArray (const MArray<int> &is, const MArray<int> & ds,
const NDArray& a);
FixedComplexNDArray (const NDArray &is, const NDArray & ds,
const NDArray& a);
FixedComplexNDArray (const ComplexNDArray &is,
const ComplexNDArray & ds, const NDArray& a);
FixedComplexNDArray (unsigned int is, unsigned int ds,
const ComplexNDArray &a, const ComplexNDArray &b);
FixedComplexNDArray (Complex is, Complex ds, const ComplexNDArray &a,
const ComplexNDArray &b);
FixedComplexNDArray (const MArray<int> &is, const MArray<int> &ds,
const ComplexNDArray &a, const ComplexNDArray &b);
FixedComplexNDArray (const NDArray &is, const NDArray &ds,
const ComplexNDArray &a, const ComplexNDArray &b);
FixedComplexNDArray (const ComplexNDArray &is, const ComplexNDArray &ds,
const ComplexNDArray &a, const ComplexNDArray &b);
FixedComplexNDArray (const FixedNDArray& a);
FixedComplexNDArray (const FixedNDArray& a, const FixedNDArray& b);
FixedComplexNDArray (const FixedComplexNDArray& a)
: MArray<FixedPointComplex> (a) { }
FixedComplexNDArray (const MArray<FixedPointComplex>& a)
: MArray<FixedPointComplex> (a) { }
FixedComplexNDArray (const Array<FixedPointComplex>& a)
: MArray<FixedPointComplex> (a) { }
ComplexNDArray sign (void) const;
ComplexNDArray getdecsize (void) const;
ComplexNDArray getintsize (void) const;
ComplexNDArray getnumber (void) const;
ComplexNDArray fixedpoint (void) const;
FixedComplexNDArray chdecsize (const Complex n);
FixedComplexNDArray chdecsize (const ComplexNDArray &n);
FixedComplexNDArray chintsize (const Complex n);
FixedComplexNDArray chintsize (const ComplexNDArray &n);
FixedComplexNDArray incdecsize (const Complex n);
FixedComplexNDArray incdecsize (const ComplexNDArray &n);
FixedComplexNDArray incdecsize ();
FixedComplexNDArray incintsize (const Complex n);
FixedComplexNDArray incintsize (const ComplexNDArray &n);
FixedComplexNDArray incintsize ();
FixedComplexNDArray& operator = (const FixedComplexNDArray& a)
{
MArray<FixedPointComplex>::operator = (a);
return *this;
}
bool operator == (const FixedComplexNDArray& a) const;
bool operator != (const FixedComplexNDArray& a) const;
FixedComplexNDArray operator ! (void) const;
boolNDArray all (octave_idx_type dim = -1) const;
boolNDArray any (octave_idx_type dim = -1) const;
FixedComplexNDArray concat (const FixedComplexNDArray& rb,
const Array<octave_idx_type>& ra_idx);
FixedComplexNDArray concat (const FixedNDArray& rb,
const Array<octave_idx_type>& ra_idx);
FixedComplexNDArray& insert (const FixedComplexNDArray& a,
const Array<octave_idx_type>& ra_idx);
FixedComplexNDArray cumprod (octave_idx_type dim = -1) const;
FixedComplexNDArray cumsum (octave_idx_type dim = -1) const;
FixedComplexNDArray prod (octave_idx_type dim = -1) const;
FixedComplexNDArray sum (octave_idx_type dim = -1) const;
FixedComplexNDArray sumsq (octave_idx_type dim = -1) const;
FixedComplexNDArray max (octave_idx_type dim = 0) const;
FixedComplexNDArray max (Array<octave_idx_type>& index, octave_idx_type dim = 0) const;
FixedComplexNDArray min (octave_idx_type dim = 0) const;
FixedComplexNDArray min (Array<octave_idx_type>& index, octave_idx_type dim = 0) const;
FixedNDArray abs (void) const;
FixedComplexMatrix fixed_complex_matrix_value (void) const;
FixedComplexNDArray squeeze (void) const
{ return Array<FixedPointComplex>::squeeze (); }
static void increment_index (Array<octave_idx_type>& ra_idx,
const dim_vector& dimensions,
octave_idx_type start_dimension = 0);
static octave_idx_type compute_index (Array<octave_idx_type>& ra_idx,
const dim_vector& dimensions);
friend FixedNDArray real (const FixedComplexNDArray &x);
friend FixedNDArray imag (const FixedComplexNDArray &x);
friend FixedComplexNDArray conj (const FixedComplexNDArray &x);
friend FixedNDArray abs (const FixedComplexNDArray &x);
friend FixedNDArray norm (const FixedComplexNDArray &x);
friend FixedNDArray arg (const FixedComplexNDArray &x);
friend FixedComplexNDArray polar (const FixedNDArray &r, const FixedNDArray &p);
friend FixedComplexNDArray cos (const FixedComplexNDArray &x);
friend FixedComplexNDArray cosh (const FixedComplexNDArray &x);
friend FixedComplexNDArray sin (const FixedComplexNDArray &x);
friend FixedComplexNDArray sinh (const FixedComplexNDArray &x);
friend FixedComplexNDArray tan (const FixedComplexNDArray &x);
friend FixedComplexNDArray tanh (const FixedComplexNDArray &x);
friend FixedComplexNDArray sqrt (const FixedComplexNDArray &x);
friend FixedComplexNDArray exp (const FixedComplexNDArray &x);
friend FixedComplexNDArray log (const FixedComplexNDArray &x);
friend FixedComplexNDArray log10 (const FixedComplexNDArray &x);
friend FixedComplexNDArray round (const FixedComplexNDArray &x);
friend FixedComplexNDArray rint (const FixedComplexNDArray &x);
friend FixedComplexNDArray floor (const FixedComplexNDArray &x);
friend FixedComplexNDArray ceil (const FixedComplexNDArray &x);
friend ComplexNDArray fixedpoint (const FixedComplexNDArray& x);
friend ComplexNDArray sign (const FixedComplexNDArray& x);
friend ComplexNDArray getintsize (const FixedComplexNDArray& x);
friend ComplexNDArray getdecsize (const FixedComplexNDArray& x);
friend ComplexNDArray getnumber (const FixedComplexNDArray& x);
// i/o
friend std::ostream& operator << (std::ostream& os,
const FixedComplexNDArray& a);
friend std::istream& operator >> (std::istream& is, FixedComplexNDArray& a);
static FixedPointComplex resize_fill_value (void)
{ return FixedPointComplex(); }
};
FixedNDArray real (const FixedComplexNDArray &x);
FixedNDArray imag (const FixedComplexNDArray &x);
FixedComplexNDArray conj (const FixedComplexNDArray &x);
FixedNDArray abs (const FixedComplexNDArray &x);
FixedNDArray norm (const FixedComplexNDArray &x);
FixedNDArray arg (const FixedComplexNDArray &x);
FixedComplexNDArray polar (const FixedNDArray &r, const FixedNDArray &p);
FixedComplexNDArray cos (const FixedComplexNDArray &x);
FixedComplexNDArray cosh (const FixedComplexNDArray &x);
FixedComplexNDArray sin (const FixedComplexNDArray &x);
FixedComplexNDArray sinh (const FixedComplexNDArray &x);
FixedComplexNDArray tan (const FixedComplexNDArray &x);
FixedComplexNDArray tanh (const FixedComplexNDArray &x);
FixedComplexNDArray sqrt (const FixedComplexNDArray &x);
FixedComplexNDArray exp (const FixedComplexNDArray &x);
FixedComplexNDArray log (const FixedComplexNDArray &x);
FixedComplexNDArray log10 (const FixedComplexNDArray &x);
FixedComplexNDArray round (const FixedComplexNDArray &x);
FixedComplexNDArray rint (const FixedComplexNDArray &x);
FixedComplexNDArray floor (const FixedComplexNDArray &x);
FixedComplexNDArray ceil (const FixedComplexNDArray &x);
inline ComplexNDArray fixedpoint (const FixedComplexNDArray& x)
{ return x.fixedpoint(); }
inline ComplexNDArray sign (const FixedComplexNDArray& x)
{ return x.sign(); }
inline ComplexNDArray getintsize (const FixedComplexNDArray& x)
{ return x.getintsize(); }
inline ComplexNDArray getdecsize (const FixedComplexNDArray& x)
{ return x.getdecsize(); }
inline ComplexNDArray getnumber (const FixedComplexNDArray& x)
{ return x.getnumber(); }
std::ostream& operator << (std::ostream& os,
const FixedComplexNDArray& a);
std::istream& operator >> (std::istream& is, FixedComplexNDArray& a);
FixedComplexNDArray min (const FixedPointComplex& c,
const FixedComplexNDArray& m);
FixedComplexNDArray min (const FixedComplexNDArray& m,
const FixedPointComplex& c);
FixedComplexNDArray min (const FixedComplexNDArray& a,
const FixedComplexNDArray& b);
FixedComplexNDArray max (const FixedPointComplex& c,
const FixedComplexNDArray& m);
FixedComplexNDArray max (const FixedComplexNDArray& m,
const FixedPointComplex& c);
FixedComplexNDArray max (const FixedComplexNDArray& a,
const FixedComplexNDArray& b);
FixedComplexNDArray elem_pow (const FixedComplexNDArray &a,
const FixedComplexNDArray &b);
FixedComplexNDArray elem_pow (const FixedComplexNDArray &a,
const FixedPointComplex &b);
FixedComplexNDArray elem_pow (const FixedPointComplex &a,
const FixedComplexNDArray &b);
NDS_CMP_OP_DECLS (FixedComplexNDArray, FixedPointComplex, )
NDS_BOOL_OP_DECLS (FixedComplexNDArray, FixedPointComplex, )
SND_CMP_OP_DECLS (FixedPointComplex, FixedComplexNDArray, )
SND_BOOL_OP_DECLS (FixedPointComplex, FixedComplexNDArray, )
NDND_CMP_OP_DECLS (FixedComplexNDArray, FixedComplexNDArray, )
NDND_BOOL_OP_DECLS (FixedComplexNDArray, FixedComplexNDArray, )
MARRAY_FORWARD_DEFS (MArray, FixedComplexNDArray, FixedPointComplex)
#endif
/*
;;; Local Variables: ***
;;; mode: C++ ***
;;; End: ***
*/