Revision 22, 0.7 kB
(checked in by smidl, 16 years ago)
|
upravy Kalmana
|
Rev | Line | |
---|
[11] | 1 | #include <itpp/itbase.h> |
---|
| 2 | #include "libFN.h" |
---|
| 3 | |
---|
| 4 | using std::endl; |
---|
| 5 | |
---|
[19] | 6 | linfn linfn::evalsome ( ivec &rvind ) |
---|
| 7 | { |
---|
| 8 | return *this; |
---|
[11] | 9 | } |
---|
| 10 | |
---|
[22] | 11 | bilinfn::bilinfn ( const RV &rvx0, const RV &rvu0, const mat &A0, const mat &B0 ) : diffbifn ( rvx0,rvu0 ) |
---|
[19] | 12 | { |
---|
[22] | 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" ); |
---|
[19] | 16 | |
---|
[22] | 17 | // set dimensions |
---|
| 18 | dimy = A0.rows(); |
---|
| 19 | |
---|
| 20 | //set internals |
---|
[19] | 21 | A = A0; |
---|
| 22 | B = B0; |
---|
| 23 | }; |
---|
| 24 | |
---|
[22] | 25 | inline 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 | }; |
---|