- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

# libDS_ui.h

Go to the documentation of this file.

    00001
    00013 #ifndef DS_UI_H
    00014 #define DS_UI_H
    00015
    00016
    00017 #include "libDS.h"
    00018 #include "stat/loggers_ui.h"
    00019
    00051 class UIArxDS : public UIbuilder {
    00052 public:
    00053         UIArxDS() :UIbuilder ( "ArxDS" ) {};
    00054         bdmroot* build ( Setting &S ) const {
    00055                 int ych = S["ychns"];
    00056                 int uch = S["uchns"];
    00057                 RV yrv;
    00058                 RV urv;
    00059                 RV rrv;
    00060                 int i,j;
    00061                 for ( i=0;i<ych; i++ ) {yrv.add ( RV ( "y"+num2str(i),i+1 ));}
    00062                 for ( j=0;j<uch; j++ ) {urv.add ( RV ( "u"+num2str(i),j+i+1 ));}
    00063
    00064                 RV drv=concat ( yrv,urv );
    00065                 //build regressor
    00066                 Setting& ids=S["ids"];
    00067                 Setting& del=S["delays"];
    00068
    00069                 for ( int i=0;i<ids.getLength(); i++ ) {
    00070                         RV tmp=drv.subselect ( vec_1 ( int ( ids[i] )-1 ) );
    00071                         tmp.t ( int ( del[i] ) );
    00072                         rrv.add ( tmp );
    00073                 }
    00074
    00075                 ARXDS* tmp = new ARXDS ( yrv, urv, rrv );
    00076                 mat Th=getmat ( S["theta"],rrv.count() );
    00077                 vec mu0;
    00078                 if ( S.exists ( "offset" ) ) {
    00079                         mu0=getvec ( S["offset"] );
    00080                 }
    00081                 else {
    00082                         mu0=zeros ( yrv.count() );
    00083                 }
    00084                 chmat sqR ( getmat ( S["r"],yrv.count() ) );
    00085                 tmp->set_parameters ( Th,mu0,sqR );
    00086                 if (S.exists("opt")){tmp->set_options(S["opt"]);}
    00087                 return tmp;
    00088         };
    00089 };
    00090
    00091 UIREGISTER ( UIArxDS );
    00092
    00123 class UIstateDS : public UIbuilder {
    00124         public:
    00125                 UIstateDS() :UIbuilder ( "stateDS" ) {};
    00126                 bdmroot* build ( Setting &S ) const {
    00127                         RV* rvtmp;
    00128                         UIbuild(S["IM"]["rvu"], rvtmp);
    00129                         mpdf* IM;
    00130                         UIbuild(S["IM"],IM);
    00131                         mpdf* OM;
    00132                         UIbuild(S["OM"],OM);
    00133                         return new stateDS(IM,OM,*rvtmp);
    00134                 }
    00135 };
    00136 UIREGISTER ( UIstateDS );
    00137 #endif // DS_UI_H