Revision 11, 0.6 kB
(checked in by smidl, 16 years ago)
|
resampling in PF + initial port of functions
|
Rev | Line | |
---|
[8] | 1 | #include <itpp/itbase.h> |
---|
| 2 | #include "libPF.h" |
---|
| 3 | #include "libDC.h" |
---|
| 4 | #include "libEF.h" |
---|
| 5 | |
---|
| 6 | using namespace itpp; |
---|
| 7 | |
---|
| 8 | //These lines are needed for use of cout and endl |
---|
| 9 | using std::cout; |
---|
| 10 | using std::endl; |
---|
| 11 | |
---|
| 12 | int main() { |
---|
| 13 | |
---|
| 14 | RV x("1"); |
---|
| 15 | RV xm=x; xm.t(-1); |
---|
| 16 | RV y("2"); |
---|
| 17 | |
---|
| 18 | mat A = "1"; |
---|
| 19 | ldmat R("1"); |
---|
| 20 | |
---|
[11] | 21 | |
---|
| 22 | vec ptc = randn(10); |
---|
| 23 | vec w = exp(-0.5*(pow(ptc,2))/0.2); |
---|
| 24 | |
---|
| 25 | cout << "p:" << ptc << endl; |
---|
| 26 | cout << "w:" << w << endl; |
---|
| 27 | |
---|
| 28 | PF pf(w); |
---|
| 29 | ivec ind = pf.resample(); |
---|
| 30 | |
---|
| 31 | cout << ind << endl; |
---|
| 32 | /* |
---|
[8] | 33 | mlnorm<ldmat> obs(x,xm,A,R); |
---|
| 34 | mlnorm<ldmat> par(y,x,A,R); |
---|
| 35 | |
---|
| 36 | TrivialPF TPF(obs,par,10); |
---|
[11] | 37 | */ |
---|
[8] | 38 | //Exit program: |
---|
| 39 | return 0; |
---|
| 40 | |
---|
| 41 | } |
---|