00001
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00029 #ifndef MIMOLIB_ARITH_H
00030 #define MIMOLIB_ARITH_H
00031
00032 #include "basicdevicefactory.h"
00033 #include "basicdevice.h"
00034 #include "phbib.h"
00035 #include "signals.h"
00036 #include "matrix.h"
00037
00038
00039
00040 using namespace simth;
00041
00042 namespace mimo {
00043
00066 class Multiply : public Device
00067 {
00068 protected:
00069 Multiply(int deviceID, DeviceSystemIntf* system,
00070 const simth::PropertyList& pl,
00071 unsigned input_ports);
00072 unsigned iports;
00073
00074 public:
00075 virtual void updateInputLengths();
00076 virtual void updateOutputLengths();
00077
00078 void print(std::ostream &os) const;
00079
00080 static void init(const std::string& fileName,
00081 Device** dev,
00082 DeviceSystemIntf* sysPtr,
00083 int ID,
00084 const std::string& regionQualifier);
00085 };
00086
00087
00088
00106 template<class seqTM, class seqTV>
00107 class MultiplyTM : public Multiply
00108 {
00109 public:
00110 MultiplyTM(int deviceID, DeviceSystemIntf* system,
00111 const simth::PropertyList& pl,
00112 unsigned input_ports, size_t dimension);
00113
00114 void process();
00115 };
00116
00117
00134 template<class seqTM>
00135 class SquareTM : public Multiply
00136 {
00137 public:
00138 SquareTM(int deviceID, DeviceSystemIntf* system,
00139 const simth::PropertyList& pl,
00140 unsigned input_ports, size_t dimension);
00141
00142 void process();
00143 };
00144
00145
00167 template<class seqTM, class seqTV>
00168 class MultiplyInvTM : public Multiply
00169 {
00170 public:
00171 MultiplyInvTM(int deviceID, DeviceSystemIntf* system,
00172 const simth::PropertyList& pl,
00173 size_t dim_in, size_t dim_out);
00174
00175 void process();
00176 };
00177
00178
00181 template<class seqT_in, class seqT_out>
00182 class CalcCapacity : public Device
00183 {
00184 protected:
00185 unsigned int rows, cols;
00186
00187 private:
00188 double noise;
00189
00190 public:
00191 CalcCapacity(int deviceID, DeviceSystemIntf* system,
00192 const PropertyList& pl);
00193
00197 void setSNR(double snr);
00198 void setNoisePower(double n) { noise = n; };
00199
00200 void updateInputLengths()
00201 {
00202 setInputLength(outputLength());
00203 };
00204 void updateOutputLengths()
00205 {
00206 setOutputLength(inputLength());
00207 };
00208
00209 void process();
00210
00211 void print(std::ostream & os) const {Device::print(os);};
00212 };
00213
00214
00217 template<class seqT_in, class seqT_out>
00218 class CalcMax : public Device
00219 {
00220 protected:
00221 unsigned int length;
00222
00223 public:
00224 CalcMax(int deviceID, DeviceSystemIntf* system,
00225 const PropertyList& pl);
00226
00227 void updateInputLengths()
00228 {
00229 setInputLength(outputLength());
00230 };
00231 void updateOutputLengths()
00232 {
00233 setOutputLength(inputLength());
00234 };
00235
00236 void process();
00237
00238 void print(std::ostream & os) const {Device::print(os);};
00239 };
00240
00241
00242
00243
00244
00245
00246 namespace Invert {
00247 void init(const std::string& fileName,
00248 Device** dev,
00249 DeviceSystemIntf* sysPtr,
00250 int ID,
00251 const std::string& regionQualifier);
00252 }
00253
00254
00255
00270 template<class seqT>
00271 class InvertTM : public Multiply
00272 {
00273 public:
00274 InvertTM(int deviceID, DeviceSystemIntf* system,
00275 const simth::PropertyList& pl,
00276 size_t dim1, size_t dim2);
00277
00278 void process();
00279 };
00280
00281 }
00282
00283
00284 #endif