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

Download this file

fixedRowVector.h    244 lines (178 with data), 7.9 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
/*
Copyright (C) 2003 Motorola Inc
Copyright (C) 2003 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_FixedRowVector_h)
#define octave_FixedRowVector_h 1
#include <octave/MArray.h>
#include <octave/dRowVector.h>
#include <octave/mx-defs.h>
#include <octave/mx-op-defs.h>
#include "int/fixed.h"
#if !defined(octave_FixedColVector_h)
class FixedColumnVector;
#endif
#if !defined(octave_FixedMatrix_h)
class FixedMatrix;
#endif
typedef FixedPoint (*fp_fp_Mapper)(FixedPoint);
class
OCTAVE_FIXED_API
FixedRowVector : public MArray<FixedPoint>
{
public:
FixedRowVector (void) : MArray<FixedPoint> () { }
explicit FixedRowVector (int n) : MArray<FixedPoint> (dim_vector (1,n)) { }
FixedRowVector (const MArray<int> &is, const MArray<int> &ds);
FixedRowVector (const RowVector &is, const RowVector &ds);
FixedRowVector (unsigned int is, unsigned int ds, const FixedRowVector& a);
FixedRowVector (const MArray<int> &is, const MArray<int> &ds,
const FixedRowVector& a);
FixedRowVector (const RowVector &is, const RowVector &ds,
const FixedRowVector& a);
FixedRowVector (unsigned int is, unsigned int ds, const RowVector& a);
FixedRowVector (const MArray<int> &is, const MArray<int> &ds,
const RowVector& a);
FixedRowVector (const RowVector &is, const RowVector &ds,
const RowVector& a);
FixedRowVector (unsigned int is, unsigned int ds, const RowVector& a,
const RowVector& b);
FixedRowVector (const MArray<int> &is, const MArray<int> &ds,
const RowVector& a, const RowVector& b);
FixedRowVector (const RowVector &is, const RowVector &ds,
const RowVector& a, const RowVector& b);
FixedRowVector (int n, FixedPoint val)
: MArray<FixedPoint> (dim_vector(1, n), val) { }
FixedRowVector (const FixedRowVector& a) : MArray<FixedPoint> (a) { }
FixedRowVector (const MArray<FixedPoint>& a) : MArray<FixedPoint> (a) { }
RowVector sign (void) const;
RowVector signbit (void) const;
RowVector getdecsize (void) const;
RowVector getintsize (void) const;
RowVector getnumber (void) const;
RowVector fixedpoint (void) const;
FixedRowVector chdecsize (const double n);
FixedRowVector chdecsize (const RowVector &n);
FixedRowVector chintsize (const double n);
FixedRowVector chintsize (const RowVector &n);
FixedRowVector incdecsize (const double n);
FixedRowVector incdecsize (const RowVector &n);
FixedRowVector incdecsize ();
FixedRowVector incintsize (const double n);
FixedRowVector incintsize (const RowVector &n);
FixedRowVector incintsize ();
FixedRowVector& operator = (const FixedRowVector& a)
{
MArray<FixedPoint>::operator = (a);
return *this;
}
bool operator == (const FixedRowVector& a) const;
bool operator != (const FixedRowVector& a) const;
// destructive insert/delete/reorder operations
FixedRowVector& insert (const FixedRowVector& a, int c);
FixedRowVector& fill (FixedPoint val);
FixedRowVector& fill (FixedPoint val, int c1, int c2);
FixedRowVector append (const FixedRowVector& a) const;
FixedColumnVector transpose (void) const;
// resize is the destructive equivalent for this one
FixedRowVector extract (int c1, int c2) const;
FixedRowVector extract_n (int c1, int n) const;
// other operations
FixedRowVector map (fp_fp_Mapper f) const;
FixedRowVector& apply (fp_fp_Mapper f);
FixedPoint min (void) const;
FixedPoint max (void) const;
friend FixedRowVector operator * (const FixedRowVector& a, const Matrix& b);
friend FixedRowVector real (const FixedRowVector &x);
friend FixedRowVector imag (const FixedRowVector &x);
friend FixedRowVector conj (const FixedRowVector &x);
friend FixedRowVector abs (const FixedRowVector &x);
friend FixedRowVector cos (const FixedRowVector &x);
friend FixedRowVector cosh (const FixedRowVector &x);
friend FixedRowVector sin (const FixedRowVector &x);
friend FixedRowVector sinh (const FixedRowVector &x);
friend FixedRowVector tan (const FixedRowVector &x);
friend FixedRowVector tanh (const FixedRowVector &x);
friend FixedRowVector sqrt (const FixedRowVector &x);
friend FixedRowVector exp (const FixedRowVector &x);
friend FixedRowVector log (const FixedRowVector &x);
friend FixedRowVector log10 (const FixedRowVector &x);
friend FixedRowVector round (const FixedRowVector &x);
friend FixedRowVector rint (const FixedRowVector &x);
friend FixedRowVector floor (const FixedRowVector &x);
friend FixedRowVector ceil (const FixedRowVector &x);
friend RowVector fixedpoint (const FixedRowVector& x);
friend RowVector sign (const FixedRowVector& x);
friend RowVector signbit (const FixedRowVector& x);
friend RowVector getdecsize (const FixedRowVector& x);
friend RowVector getintsize (const FixedRowVector& x);
friend RowVector getnumber (const FixedRowVector& x);
// i/o
friend std::ostream& operator << (std::ostream& os, const FixedRowVector& a);
friend std::istream& operator >> (std::istream& is, FixedRowVector& a);
void resize (octave_idx_type n,
const FixedPoint& rfv = Array<FixedPoint>::resize_fill_value ())
{
Array<FixedPoint>::resize (dim_vector (1, n), rfv);
}
};
FixedPoint operator * (const FixedRowVector& a, const FixedColumnVector& b);
FixedRowVector real (const FixedRowVector &x);
FixedRowVector imag (const FixedRowVector &x);
FixedRowVector conj (const FixedRowVector &x);
FixedRowVector abs (const FixedRowVector &x);
FixedRowVector cos (const FixedRowVector &x);
FixedRowVector cosh (const FixedRowVector &x);
FixedRowVector sin (const FixedRowVector &x);
FixedRowVector sinh (const FixedRowVector &x);
FixedRowVector tan (const FixedRowVector &x);
FixedRowVector tanh (const FixedRowVector &x);
FixedRowVector sqrt (const FixedRowVector &x);
FixedRowVector exp (const FixedRowVector &x);
FixedRowVector log (const FixedRowVector &x);
FixedRowVector log10 (const FixedRowVector &x);
FixedRowVector round (const FixedRowVector &x);
FixedRowVector rint (const FixedRowVector &x);
FixedRowVector floor (const FixedRowVector &x);
FixedRowVector ceil (const FixedRowVector &x);
inline RowVector fixedpoint (const FixedRowVector& x)
{ return x.fixedpoint(); }
inline RowVector sign (const FixedRowVector& x)
{ return x.sign(); }
inline RowVector signbit (const FixedRowVector& x)
{ return x.signbit(); }
inline RowVector getdecsize (const FixedRowVector& x)
{ return x.getdecsize(); }
inline RowVector getintsize (const FixedRowVector& x)
{ return x.getintsize(); }
inline RowVector getnumber (const FixedRowVector& x)
{ return x.getnumber(); }
std::ostream& operator << (std::ostream& os, const FixedRowVector& a);
std::istream& operator >> (std::istream& is, FixedRowVector& a);
FixedRowVector elem_pow (const FixedRowVector &a,
const FixedRowVector &b);
FixedRowVector elem_pow (const FixedRowVector &a,
const FixedPoint &b);
FixedRowVector elem_pow (const FixedPoint &a,
const FixedRowVector &b);
MARRAY_FORWARD_DEFS (MArray, FixedRowVector, FixedPoint)
#endif
/*
;;; Local Variables: ***
;;; mode: C++ ***
;;; End: ***
*/