IT++
4.3.1
Toggle main menu visibility
itpp
fixed
cfixed.h
Go to the documentation of this file.
1
28
29
#ifndef CFIXED_H
30
#define CFIXED_H
31
32
#include <
itpp/fixed/cfix.h
>
33
#include <itpp/itexports.h>
34
35
36
namespace
itpp
37
{
38
43
49
template
<
int
w, e_mode e = TC, o_mode o = WRAP, q_mode q = TRN >
50
class
CFixed
:
public
CFix
51
{
52
public
:
54
CFixed
(
double
r = 0.0,
double
i = 0.0,
int
s = 0,
Stat
*ptr = 0)
55
:
CFix
(r, i, s, w, e, o, q, ptr) {}
56
57
CFixed
(std::complex<double> x,
double
,
int
s = 0,
Stat
*ptr = 0)
58
:
CFix
(x, 0.0, s, w, e, o, q, ptr) {}
59
60
explicit
CFixed
(
Stat
*ptr)
61
:
CFix
(0.0, 0.0, 0, w, e, o, q, ptr) {}
62
63
CFixed
(
const
Fix
&r,
const
Fix
&i = 0.0,
Stat
*ptr = 0)
64
:
CFix
(r, i, w, e, o, q, ptr) {}
65
66
CFixed
(
const
CFix
&x,
double
,
Stat
*ptr = 0)
67
:
CFix
(x, 0.0, w, e, o, q, ptr) {}
68
69
virtual
~CFixed
() {}
70
72
CFixed
&
operator=
(
const
CFix
&x) {
73
shift
= x.
shift
;
74
re
=
apply_o_mode
(x.
re
);
75
im
=
apply_o_mode
(x.
im
);
76
return
*
this
;
77
}
78
79
CFixed
&
operator=
(
const
Fix
&x) {
80
shift
= x.
shift
;
81
re
=
apply_o_mode
(x.
re
);
82
im
= 0;
83
return
*
this
;
84
}
85
86
CFixed
&
operator=
(
const
std::complex<double> &x) {
87
shift
= 0;
88
re
=
apply_o_mode
(
fixrep
(
real
(x)));
89
im
=
apply_o_mode
(
fixrep
(
imag
(x)));
90
return
*
this
;
91
}
92
93
CFixed
&
operator=
(
int
x) {
94
shift
= 0;
95
re
=
apply_o_mode
(x);
96
im
= 0;
97
return
*
this
;
98
}
99
protected
:
100
};
101
103
105
typedef
CFixed<1, TC, WRAP>
cfixed1
;
107
typedef
CFixed<2, TC, WRAP>
cfixed2;
108
typedef
CFixed<3, TC, WRAP>
cfixed3;
109
typedef
CFixed<4, TC, WRAP>
cfixed4;
110
typedef
CFixed<5, TC, WRAP>
cfixed5;
111
typedef
CFixed<6, TC, WRAP>
cfixed6;
112
typedef
CFixed<7, TC, WRAP>
cfixed7;
113
typedef
CFixed<8, TC, WRAP>
cfixed8;
114
typedef
CFixed<9, TC, WRAP>
cfixed9;
115
typedef
CFixed<10, TC, WRAP>
cfixed10;
116
typedef
CFixed<11, TC, WRAP>
cfixed11;
117
typedef
CFixed<12, TC, WRAP>
cfixed12;
118
typedef
CFixed<13, TC, WRAP>
cfixed13;
119
typedef
CFixed<14, TC, WRAP>
cfixed14;
120
typedef
CFixed<15, TC, WRAP>
cfixed15;
121
typedef
CFixed<16, TC, WRAP>
cfixed16;
122
typedef
CFixed<17, TC, WRAP>
cfixed17;
123
typedef
CFixed<18, TC, WRAP>
cfixed18;
124
typedef
CFixed<19, TC, WRAP>
cfixed19;
125
typedef
CFixed<20, TC, WRAP>
cfixed20;
126
typedef
CFixed<21, TC, WRAP>
cfixed21;
127
typedef
CFixed<22, TC, WRAP>
cfixed22;
128
typedef
CFixed<23, TC, WRAP>
cfixed23;
129
typedef
CFixed<24, TC, WRAP>
cfixed24;
130
typedef
CFixed<25, TC, WRAP>
cfixed25;
131
typedef
CFixed<26, TC, WRAP>
cfixed26;
132
typedef
CFixed<27, TC, WRAP>
cfixed27;
133
typedef
CFixed<28, TC, WRAP>
cfixed28;
134
typedef
CFixed<29, TC, WRAP>
cfixed29;
135
typedef
CFixed<30, TC, WRAP>
cfixed30;
136
typedef
CFixed<31, TC, WRAP>
cfixed31;
137
typedef
CFixed<32, TC, WRAP>
cfixed32;
138
typedef
CFixed<33, TC, WRAP>
cfixed33;
139
typedef
CFixed<34, TC, WRAP>
cfixed34;
140
typedef
CFixed<35, TC, WRAP>
cfixed35;
141
typedef
CFixed<36, TC, WRAP>
cfixed36;
142
typedef
CFixed<37, TC, WRAP>
cfixed37;
143
typedef
CFixed<38, TC, WRAP>
cfixed38;
144
typedef
CFixed<39, TC, WRAP>
cfixed39;
145
typedef
CFixed<40, TC, WRAP>
cfixed40;
146
typedef
CFixed<41, TC, WRAP>
cfixed41;
147
typedef
CFixed<42, TC, WRAP>
cfixed42;
148
typedef
CFixed<43, TC, WRAP>
cfixed43;
149
typedef
CFixed<44, TC, WRAP>
cfixed44;
150
typedef
CFixed<45, TC, WRAP>
cfixed45;
151
typedef
CFixed<46, TC, WRAP>
cfixed46;
152
typedef
CFixed<47, TC, WRAP>
cfixed47;
153
typedef
CFixed<48, TC, WRAP>
cfixed48;
154
typedef
CFixed<49, TC, WRAP>
cfixed49;
155
typedef
CFixed<50, TC, WRAP>
cfixed50;
156
typedef
CFixed<51, TC, WRAP>
cfixed51;
157
typedef
CFixed<52, TC, WRAP>
cfixed52;
158
typedef
CFixed<53, TC, WRAP>
cfixed53;
159
typedef
CFixed<54, TC, WRAP>
cfixed54;
160
typedef
CFixed<55, TC, WRAP>
cfixed55;
161
typedef
CFixed<56, TC, WRAP>
cfixed56;
162
typedef
CFixed<57, TC, WRAP>
cfixed57;
163
typedef
CFixed<58, TC, WRAP>
cfixed58;
164
typedef
CFixed<59, TC, WRAP>
cfixed59;
165
typedef
CFixed<60, TC, WRAP>
cfixed60;
166
typedef
CFixed<61, TC, WRAP>
cfixed61;
167
typedef
CFixed<62, TC, WRAP>
cfixed62;
168
typedef
CFixed<63, TC, WRAP>
cfixed63;
169
typedef
CFixed<64, TC, WRAP>
cfixed64;
171
173
typedef
CFixed<1, TC, WRAP>
cfixed1
;
175
typedef
CFixed<1, TC, SAT>
scfixed1;
176
typedef
CFixed<2, TC, SAT>
scfixed2;
177
typedef
CFixed<3, TC, SAT>
scfixed3;
178
typedef
CFixed<4, TC, SAT>
scfixed4;
179
typedef
CFixed<5, TC, SAT>
scfixed5;
180
typedef
CFixed<6, TC, SAT>
scfixed6;
181
typedef
CFixed<7, TC, SAT>
scfixed7;
182
typedef
CFixed<8, TC, SAT>
scfixed8;
183
typedef
CFixed<9, TC, SAT>
scfixed9;
184
typedef
CFixed<10, TC, SAT>
scfixed10;
185
typedef
CFixed<11, TC, SAT>
scfixed11;
186
typedef
CFixed<12, TC, SAT>
scfixed12;
187
typedef
CFixed<13, TC, SAT>
scfixed13;
188
typedef
CFixed<14, TC, SAT>
scfixed14;
189
typedef
CFixed<15, TC, SAT>
scfixed15;
190
typedef
CFixed<16, TC, SAT>
scfixed16;
191
typedef
CFixed<17, TC, SAT>
scfixed17;
192
typedef
CFixed<18, TC, SAT>
scfixed18;
193
typedef
CFixed<19, TC, SAT>
scfixed19;
194
typedef
CFixed<20, TC, SAT>
scfixed20;
195
typedef
CFixed<21, TC, SAT>
scfixed21;
196
typedef
CFixed<22, TC, SAT>
scfixed22;
197
typedef
CFixed<23, TC, SAT>
scfixed23;
198
typedef
CFixed<24, TC, SAT>
scfixed24;
199
typedef
CFixed<25, TC, SAT>
scfixed25;
200
typedef
CFixed<26, TC, SAT>
scfixed26;
201
typedef
CFixed<27, TC, SAT>
scfixed27;
202
typedef
CFixed<28, TC, SAT>
scfixed28;
203
typedef
CFixed<29, TC, SAT>
scfixed29;
204
typedef
CFixed<30, TC, SAT>
scfixed30;
205
typedef
CFixed<31, TC, SAT>
scfixed31;
206
typedef
CFixed<32, TC, SAT>
scfixed32;
207
typedef
CFixed<33, TC, SAT>
scfixed33;
208
typedef
CFixed<34, TC, SAT>
scfixed34;
209
typedef
CFixed<35, TC, SAT>
scfixed35;
210
typedef
CFixed<36, TC, SAT>
scfixed36;
211
typedef
CFixed<37, TC, SAT>
scfixed37;
212
typedef
CFixed<38, TC, SAT>
scfixed38;
213
typedef
CFixed<39, TC, SAT>
scfixed39;
214
typedef
CFixed<40, TC, SAT>
scfixed40;
215
typedef
CFixed<41, TC, SAT>
scfixed41;
216
typedef
CFixed<42, TC, SAT>
scfixed42;
217
typedef
CFixed<43, TC, SAT>
scfixed43;
218
typedef
CFixed<44, TC, SAT>
scfixed44;
219
typedef
CFixed<45, TC, SAT>
scfixed45;
220
typedef
CFixed<46, TC, SAT>
scfixed46;
221
typedef
CFixed<47, TC, SAT>
scfixed47;
222
typedef
CFixed<48, TC, SAT>
scfixed48;
223
typedef
CFixed<49, TC, SAT>
scfixed49;
224
typedef
CFixed<50, TC, SAT>
scfixed50;
225
typedef
CFixed<51, TC, SAT>
scfixed51;
226
typedef
CFixed<52, TC, SAT>
scfixed52;
227
typedef
CFixed<53, TC, SAT>
scfixed53;
228
typedef
CFixed<54, TC, SAT>
scfixed54;
229
typedef
CFixed<55, TC, SAT>
scfixed55;
230
typedef
CFixed<56, TC, SAT>
scfixed56;
231
typedef
CFixed<57, TC, SAT>
scfixed57;
232
typedef
CFixed<58, TC, SAT>
scfixed58;
233
typedef
CFixed<59, TC, SAT>
scfixed59;
234
typedef
CFixed<60, TC, SAT>
scfixed60;
235
typedef
CFixed<61, TC, SAT>
scfixed61;
236
typedef
CFixed<62, TC, SAT>
scfixed62;
237
typedef
CFixed<63, TC, SAT>
scfixed63;
238
typedef
CFixed<64, TC, SAT>
scfixed64;
239
240
// ----------------------------------------------------------------------
241
// Instantiations
242
// ----------------------------------------------------------------------
243
ITPP_EXPORT_TEMPLATE
template
class
ITPP_EXPORT
CFixed<64, TC, WRAP>
;
244
246
247
}
// namespace itpp
248
249
#endif
// #ifndef CFIXED_H
cfix.h
Definitions of a complex fixed-point data type CFix.
itpp::CFix::CFix
CFix(double r=0.0, double i=0.0, int s=0, int w=MAX_WORDLEN, e_mode e=TC, o_mode o=WRAP, q_mode q=TRN, Stat *ptr=0)
Default constructor.
Definition
cfix.h:56
itpp::CFixed< 1, TC, WRAP >::im
fixrep im
Definition
cfix.h:162
itpp::CFixed< 1, TC, WRAP >::re
fixrep re
Definition
cfix.h:161
itpp::CFixed
Templated complex fixed-point data type.
Definition
cfixed.h:51
itpp::CFixed::CFixed
CFixed(std::complex< double > x, double, int s=0, Stat *ptr=0)
Constructor.
Definition
cfixed.h:57
itpp::CFixed::~CFixed
virtual ~CFixed()
Destructor.
Definition
cfixed.h:69
itpp::CFixed::CFixed
CFixed(const CFix &x, double, Stat *ptr=0)
Constructor.
Definition
cfixed.h:66
itpp::CFixed::CFixed
CFixed(const Fix &r, const Fix &i=0.0, Stat *ptr=0)
Constructor.
Definition
cfixed.h:63
itpp::CFixed::CFixed
CFixed(Stat *ptr)
Constructor.
Definition
cfixed.h:60
itpp::CFixed::operator=
CFixed & operator=(const CFix &x)
Assignment from CFix.
Definition
cfixed.h:72
itpp::CFixed::operator=
CFixed & operator=(const Fix &x)
Assignment from Fix.
Definition
cfixed.h:79
itpp::CFixed::CFixed
CFixed(double r=0.0, double i=0.0, int s=0, Stat *ptr=0)
Default constructor.
Definition
cfixed.h:54
itpp::CFixed::operator=
CFixed & operator=(const std::complex< double > &x)
Assignment from complex<double>. Fractional part is truncated.
Definition
cfixed.h:86
itpp::CFixed::operator=
CFixed & operator=(int x)
Assignment from int.
Definition
cfixed.h:93
itpp::Fix_Base::apply_o_mode
fixrep apply_o_mode(fixrep x) const
Handle overflows using overflow mode omode and make call to statistics object (if any).
Definition
fix_base.cpp:88
itpp::CFixed< 1, TC, WRAP >::shift
int shift
Definition
fix_base.h:1021
itpp::Fix
Fixed-point data type.
Definition
fix.h:52
itpp::Fix::re
fixrep re
Data representation.
Definition
fix.h:137
itpp::Stat
A class for sampling a signal and calculating statistics.
Definition
misc_stat.h:49
itpp::fixrep
int64_t fixrep
Representation for fixed-point data types.
Definition
fix_base.h:884
itpp::imag
vec imag(const cvec &data)
Imaginary part of complex values.
Definition
elem_math.cpp:180
itpp::real
vec real(const cvec &data)
Real part of complex values.
Definition
elem_math.cpp:157
itpp
itpp namespace
Definition
itmex.h:37
itpp::cfixed1
CFixed< 1, TC, WRAP > cfixed1
Typedefs for CFixed (cfixed1, cfixed2, ..., cfixed64).
Definition
cfixed.h:105
Generated by
1.17.0