root/library/tests/stresssuite/particle_stress.cpp @ 1409

Revision 1064, 0.8 kB (checked in by mido, 14 years ago)

astyle applied all over the library

Line 
1#include <estim/particles.h>
2#include <math/square_mat.h>
3#include "stat/exp_family.h"
4#include "../mat_checks.h"
5
6using namespace bdm;
7
8//These lines are needed for use of cout and endl
9using std::cout;
10using std::endl;
11
12TEST ( particle_stress ) {
13    RV x ( "1" );
14    RV xm = x;
15    xm.t_plus ( -1 );
16    const
17    RV y ( "2" );
18
19    mat A = "1";
20    vec vR = "1";
21    ldmat R ( vR );
22
23    eEmp emp;
24    euni eun;
25    eun.set_parameters ( "0", "1" );
26    emp.set_statistics ( ones ( 10 ), eun );
27    vec &v = emp._w();
28    Array<vec> &S = emp._samples();
29
30    for ( int i = 0; i < 10; i++ ) {
31        v ( i ) = exp ( -0.5 * sum ( pow ( S ( i ) - 1, 2.0 ) ) * 10 );
32    }
33    v /= sum ( v );
34
35    cout << "p:" << S << endl;
36    cout << "w:" << v << endl;
37
38    ivec ind;
39    resample ( v, ind );
40
41    cout << ind << endl;
42}
Note: See TracBrowser for help on using the browser.