Changeset 18

Show
Ignore:
Timestamp:
02/01/08 10:49:29 (16 years ago)
Author:
smidl
Message:

update

Files:
2 added
13 modified

Legend:

Unmodified
Added
Removed
  • Makefile

    r17 r18  
    1 export LDFLAGS=-Ldebug/usr/lib/ -litpp  
     1export LDLIBS=-litpp_debug 
    22export CPPFLAGS=-g 
    33 
  • bdm/Makefile

    r17 r18  
    1 CPPFLAGS = -g 
    2  
    3  
    4 export CPPFLAGS 
    5  
    61all: subsystem libbdm.a 
    72 
     
    138 
    149clean: 
     10        $(RM) *.o *.a 
    1511        cd stat && $(MAKE) clean 
    1612        cd estim && $(MAKE) clean 
    17         cd design && $(MAKE) clean 
     13#       cd design && $(MAKE) clean 
    1814        cd math && $(MAKE) clean 
    1915 
    20 libbdm.a: itpp_ext.o 
     16libbdm.a: itpp_ext.o subsystem 
    2117        $(AR) rvus $@ ./stat/*.o ./estim/*.o  ./math/*.o itpp_ext.o 
  • bdm/design/Makefile

    r15 r18  
    11all: 
     2 
     3clean: 
     4        $(RM) *.o 
  • bdm/estim/Makefile

    r15 r18  
    22 
    33clean: 
    4         rm *.o 
     4        $(RM) *.o 
  • bdm/math/Makefile

    r15 r18  
    22 
    33clean: 
    4         rm *.o 
     4        $(RM) *.o 
  • bdm/math/libDC.cpp

    r14 r18  
    3131 
    3232        dim = V.cols(); 
     33        mat F; 
     34        vec D0; 
    3335        it_assert_debug( dim == V.rows(),"ldmat::ldmat matrix V is not square!" ); 
    34  
    3536         
     37        //decompose V in cholesky 
     38        D0 = ones(dim); 
     39         
     40 
     41        using std::cout; 
     42        cout<<V; 
     43        chol(V,F); 
     44        // L and D will be allocated by ldform() 
     45        this->ldform(F,D0);      
    3646} 
    3747 
     
    194204 
    195205        it_assert_debug( A.cols()==dim,"ldmat::ldform A is not compatible" ); 
    196         it_assert_debug( D.length()==A.rows(),"ldmat::ldform Vector D must have the length as row count of A" ); 
     206        it_assert_debug( D0.length()==A.rows(),"ldmat::ldform Vector D must have the length as row count of A" ); 
    197207 
    198208        L=concat_vertical( zeros( n,n ), diag( sqrt( D0 ) )*A ); 
     
    202212         
    203213        vec w=zeros( n ); 
    204         vec v; 
     214        vec v=zeros(n); 
    205215        double sum, beta, pom; 
    206216 
  • bdm/stat/Makefile

    r15 r18  
    33 
    44clean: 
    5         rm *.o 
     5        $(RM) *.o 
  • bdm/stat/libBM.h

    r14 r18  
    112112}; 
    113113 
     114/*! \brief Abstract class for discrete-time sources of data. 
     115 
     116The class abstracts operations of: (i) data aquisition, (ii) data-preprocessing, (iii) scaling of data, and (iv) data resampling from the task of estimation and control. 
     117Moreover, for controlled systems, it is able to receive the desired control action and perform it in the next step. (Or as soon as possible). 
     118 
     119*/ 
     120class DS { 
     121        //!Observed variables, returned by \c getdata(). 
     122        RV Drv;  
     123        //!Action variables, accepted by \c write(). 
     124        RV Urv; // 
     125public: 
     126        //! Returns full vector of observed data  
     127        void getdata(vec &dt); 
     128        //! Returns data records at indeces. 
     129        void getdata(vec &dt, ivec &indeces); 
     130        //! Accepts action variable and schedule it for application. 
     131        void write(vec &ut); 
     132        //! Accepts action variables at specific indeces         
     133        void write(vec &ut, ivec &indeces); 
     134        /*! \brief Method that assigns random variables to the datasource.  
     135        Typically, the datasource will be constructed without knowledge of random variables. This method will associate existing variables with RVs. 
     136         
     137        (Inherited from m3k, may be deprecated soon). 
     138        */ 
     139        void linkrvs(RV &drv, RV &urv); 
     140         
     141        //! Moves from $t$ to $t+1$, i.e. perfroms the actions and reads response of the system.  
     142        void step(); 
     143}; 
    114144 
    115145 
  • mixpp.kdevelop

    r17 r18  
    1818    <run> 
    1919      <directoryradio>executable</directoryradio> 
    20       <mainprogram>/home/smidl/work/mixpp/tests/testKF</mainprogram> 
     20      <mainprogram>/home/smidl/work/mixpp/tests/test0</mainprogram> 
    2121      <programargs></programargs> 
    2222      <globaldebugarguments></globaldebugarguments> 
     
    222222    <tree> 
    223223      <hidepatterns>*.o,*.lo,CVS</hidepatterns> 
    224       <hidenonprojectfiles>false</hidenonprojectfiles> 
     224      <hidenonprojectfiles>true</hidenonprojectfiles> 
    225225      <showvcsfields>false</showvcsfields> 
    226226    </tree> 
  • mixpp.kdevelop.filelist

    r16 r18  
    2222bdm/stat/libBM.cpp 
    2323bdm/stat/libBM.h 
     24bdm/stat/libDS.cpp 
     25bdm/stat/libDS.h 
    2426bdm/stat/libEF.cpp 
    2527bdm/stat/libEF.h 
  • tests/Makefile

    r17 r18  
    1 LDFLAGS = -L../bdm 
    2 LDLIBS = -lbdm -litpp 
     1LDFLAGS += -L../bdm 
     2LDLIBS += -lbdm 
    33 
    4 all: subsystem test0 testKF 
     4all: subsystem test0 testKF testSL 
    55        echo $(CPPFLAGS) 
    66 
     
    1212testKF: testKF.o 
    1313 
     14testSL: testSL.o 
     15 
    1416clean: 
    1517        $(RM) test0 
  • tests/test0.cpp

    r15 r18  
    4141                cout << "ld:"<<Il.to_mat() << "eye:"<< I <<endl; 
    4242 
     43        cout << "Test ldform()"<<endl; 
     44        mat V = "1 2; 2 3";  
     45        ldmat lV(V); 
     46//      cout << "ld:" << lV.to_mat() << "eye:"<< I <<endl; 
     47 
    4348 
    4449        //Exit program: 
  • tests/testKF.cpp

    r17 r18  
    2020        int Ndat; 
    2121 
    22         fin.seek( "d" ); 
    23         fin >> Dt; 
     22        bool xxx= fin.seek( "d" ); 
     23        fin >>Dt; 
    2424        fin.seek( "A" );  
    2525        fin >> A; 
     
    3434        fin.seek( "Q" ); fin >> Q; 
    3535        fin.seek( "P0" ); fin >> P0; 
    36         fin.seek( "mu0" ); fin >> Mu0; mu0=Mu0; 
     36        fin.seek( "mu0" ); fin >> Mu0;  
     37        mu0=Mu0.get_col(0); 
    3738         
    3839        Ndat = Dt.cols();