- Timestamp:
- 12/16/12 23:05:25 (11 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
applications/pmsm/simulator_zdenek/ekf_example/mpf_double.cpp
r1442 r1468 4 4 #include "fastexp.h" 5 5 #include "mpf_double.h" 6 #include "RArandn.h"7 6 8 7 static floatx om[N]; … … 21 20 static floatx rinv; 22 21 23 22 #if 1 23 #include "RArandn.h" 24 24 floatx qrandu() { 25 25 if ( randu_i==randu_last ) … … 39 39 return *randn_i; 40 40 } 41 42 void rng_init() 43 { 44 randu_i=&RArandu[0]; 45 randn_i=&RArandn[0]; 46 } 47 48 #else 49 50 #include "rnor.h" 51 floatx qrandu() { 52 return UNI; 53 } 54 55 floatx qrandn() { 56 return PolarRNG(); 57 } 58 59 void rng_init() 60 { 61 zigset(86947731 ); 62 } 63 64 65 #endif 66 41 67 42 68 void resample() { … … 213 239 214 240 void mpf_init(floatx qom0, floatx qth0, floatx r0) { 241 242 rng_init(); 243 215 244 int i; 216 245 r=r0; … … 252 281 for (i=0;i<N;i++) th1[i]=th[i]; 253 282 } 283 void mpf_om(floatx om1[N]){ 284 int i; 285 for (i=0;i<N;i++) om1[i]=om[i]; 286 } 254 287 255 288 floatx kalman_om( const floatx isa, const floatx isb , const floatx usa, const floatx usb, const floatx th ) {