root/bdm/stat/libFN.cpp @ 33

Revision 33, 0.6 kB (checked in by smidl, 16 years ago)

Oprava PF a MPF + jejich implementace pro pmsm system

Line 
1#include <itpp/itbase.h>
2#include "libFN.h"
3
4using std::endl;
5
6bilinfn::bilinfn ( const RV &rvx0, const RV &rvu0, const mat &A0, const mat &B0 ) : diffbifn ( rvx0,rvu0 )
7{
8        //check input
9        it_assert_debug ( ( A0.cols() ==dimx ) & ( A0.rows() ==B0.rows() ), "linfn:: wrong A" );
10        it_assert_debug ( ( B0.cols() ==dimu ), "linfn:: wrong B" );
11
12        // set dimensions
13        dimy = A0.rows();
14
15        //set internals
16        A = A0;
17        B = B0;
18};
19
20inline vec bilinfn::eval ( const  vec &x0, const vec &u0 )
21{
22        it_assert_debug ( x0.length() ==dimx, "linfn::eval Wrong xcond." );
23        it_assert_debug ( u0.length() ==dimu, "linfn::eval Wrong ucond." );
24        return A*x0+B*u0;
25};
Note: See TracBrowser for help on using the browser.