Revision 972, 1.5 kB
(checked in by smidl, 14 years ago)
|
class defaults updated
|
Rev | Line | |
---|
[790] | 1 | /*! |
---|
| 2 | \file |
---|
| 3 | \brief check how the structure is processed |
---|
| 4 | |
---|
| 5 | |
---|
| 6 | */ |
---|
| 7 | |
---|
| 8 | #include <stat/emix.h> |
---|
| 9 | #include <estim/particles.h> |
---|
| 10 | #include <estim/kalman.h> |
---|
| 11 | #include <mpdm/arx_agent.h> |
---|
| 12 | |
---|
| 13 | |
---|
| 14 | using namespace bdm; |
---|
| 15 | |
---|
| 16 | #ifdef MEX |
---|
| 17 | #include <mex/mex_parser.h> |
---|
[797] | 18 | #include <mex/mex_function.h> |
---|
[944] | 19 | #include <mex/mex_BM.h> |
---|
[790] | 20 | |
---|
| 21 | void mexFunction ( int n_output, mxArray *output[], int n_input, const mxArray *input[] ) { |
---|
| 22 | // Check the number of inputs and output arguments |
---|
| 23 | if ( n_input<1 ) mexErrMsgTxt ( "Usage:\n" |
---|
| 24 | "instance=class_defaults(struct)\n" |
---|
| 25 | " struct % configuration structure of a class\n" |
---|
| 26 | "output:\n" |
---|
| 27 | " the same structure filled with the defaults.\n\n" |
---|
[944] | 28 | "This operation is usefull for obtaining info about class defaults, or success of passing info to it" ); |
---|
[790] | 29 | |
---|
| 30 | RV::clear_all(); |
---|
| 31 | //CONFIG |
---|
| 32 | UImxArray Cfg(input[0]); |
---|
[962] | 33 | Cfg.writeFile("class_defaults.cfg"); |
---|
| 34 | if ( n_output<1 ) mexErrMsgTxt ( "No output - nothing to do!" ); |
---|
| 35 | |
---|
| 36 | #else |
---|
| 37 | int main ( int argc, char* argv[] ) { |
---|
| 38 | const char *fname; |
---|
| 39 | if ( argc>1 ) { |
---|
| 40 | fname = argv[1]; |
---|
| 41 | } else { |
---|
| 42 | fname="class_defaults.cfg"; |
---|
| 43 | } |
---|
| 44 | UIFile Cfg ( fname ); |
---|
| 45 | #endif |
---|
| 46 | |
---|
[790] | 47 | shared_ptr<root> r=UI::build<root>(Cfg); |
---|
[962] | 48 | |
---|
| 49 | #ifdef MEX |
---|
[790] | 50 | UImxArray Ret; |
---|
[972] | 51 | UI::save(r.get(), Ret); |
---|
| 52 | |
---|
| 53 | Ret.writeFile("cls_dflt.cfg"); |
---|
[790] | 54 | output[0] = Ret.create_mxArray(); |
---|
[962] | 55 | #else |
---|
| 56 | UIFile Out; |
---|
[972] | 57 | UI::save(r.get(),Out); |
---|
[962] | 58 | Out.writeFile("defaults"); |
---|
| 59 | #endif |
---|
[790] | 60 | } |
---|