Changeset 22 for bdm/stat/libFN.cpp

Show
Ignore:
Timestamp:
02/18/08 17:50:37 (16 years ago)
Author:
smidl
Message:

upravy Kalmana

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • bdm/stat/libFN.cpp

    r19 r22  
    99} 
    1010 
    11 bilinfn::bilinfn ( const RV &x0, const RV &u0, const mat &A0, const mat &B0 ) 
     11bilinfn::bilinfn ( const RV &rvx0, const RV &rvu0, const mat &A0, const mat &B0 ) : diffbifn ( rvx0,rvu0 ) 
    1212{ 
    13         it_assert_debug ( A0.cols() ==A0.rows() ==x0.count(), "linfn:: wrong A" ); 
    14         it_assert_debug ( ( B0.rows() ==x0.count() ) & ( B0.cols() ==u0.count() ), "linfn:: wrong B" ); 
     13        //check input 
     14        it_assert_debug ( ( A0.cols() ==dimx ) & ( A0.rows() ==B0.rows() ), "linfn:: wrong A" ); 
     15        it_assert_debug ( ( B0.cols() ==dimu ), "linfn:: wrong B" ); 
    1516 
     17        // set dimensions 
     18        dimy = A0.rows(); 
     19 
     20        //set internals 
    1621        A = A0; 
    1722        B = B0; 
    18         rv=x0; rv.add ( u0 ); 
    19         indexlist=rv.indexlist(); 
    2023}; 
    2124 
     25inline vec bilinfn::eval ( const  vec &x0, const vec &u0 ) 
     26{ 
     27        it_assert_debug ( x0.length() ==dimx, "linfn::eval Wrong xcond." ); 
     28        it_assert_debug ( u0.length() ==dimu, "linfn::eval Wrong ucond." ); 
     29        return A*x0+B*u0; 
     30};