8 using namespace Kalman;
10 template <
typename T, K_UINT_32 BEG,
bool DBG>
14 T values[10] = {9.0, 8.0, 7.0, 6.0, 5.0, 4.0, 3.0, 2.0, 1.0, 0.0};
20 Matrix M3(0, 2, T(1.0));
21 Matrix M4(4, 1, T(2.0));
22 Matrix M5(3, 0, values);
23 Matrix M6(3, 1, values);
28 cout <<
"M0 : " << M0 << endl;
29 cout <<
"M1 : " << M1 << endl;
30 cout <<
"M2 : " << M2 << endl;
31 cout <<
"M3 : " << M3 << endl;
32 cout <<
"M4 : " << M4 << endl;
33 cout <<
"M5 : " << M5 << endl;
34 cout <<
"M6 : " << M6 << endl;
35 cout <<
"M7 : " << M7 << endl;
36 cout <<
"M8 : " << M8 << endl;
37 cout <<
"M9 : " << M9 << endl << endl;
49 cout <<
"M4 : " << M4 << endl;
50 cout <<
"M5 : " << M5 << endl;
51 cout <<
"M6 : " << M6 << endl;
52 cout <<
"M7 : " << M7 << endl;
53 cout <<
"M8 : " << M8 << endl << endl;
65 cout <<
"M0 : " << M0 << endl;
66 cout <<
"M1 : " << M1 << endl;
67 cout <<
"M2 : " << M2 << endl;
68 cout <<
"M3 : " << M3 << endl;
69 cout <<
"M4 : " << M4 << endl;
70 cout <<
"M5 : " << M5 << endl;
71 cout <<
"M6 : " << M6 << endl;
72 cout <<
"M7 : " << M7 << endl;
73 cout <<
"M8 : " << M8 << endl << endl;
77 const Matrix& ref = M4;
79 cout <<
"M4(1,1) = " << M4(1,1) << endl;
80 cout <<
"ref(1,1) = " << ref(1,1) << endl;
85 cout <<
"M4(1,1) = " << M4(1,1) << endl;
86 cout <<
"ref(1,1) = " << ref(1,1) << endl;
93 cout << e.what() << endl;
97 cout << ref(100,100) << endl;
99 cout << e.what() << endl;
109 cout <<
"M0 is of size : " << M0.
nrow() <<
" by " << M0.
ncol() << endl;
111 cout <<
"M0 : " << M0 << endl;
113 cout <<
"M1 is of size : " << M1.
nrow() <<
" by " << M1.
ncol() << endl;
115 cout <<
"M1 : " << M1 << endl;
117 cout <<
"----------------------------" << endl << endl;
124 test<float, 1, true>();
125 test<float, 1, false>();
128 test<double, 1, true>();
129 test<double, 1, false>();
132 test<complex<double>, 1,
true>();
133 test<complex<double>, 1,
false>();
K_UINT_32 nrow() const
Returns m_, the number of rows of the matrix.
Contains the interface of the KMatrix template class.
void assign(K_UINT_32 m, K_UINT_32 n, const T *v)
Copies a C-style array of instances of T in an m by n matrix.
void resize(K_UINT_32 m, K_UINT_32 n)
Resizes the matrix. Resulting matrix contents are undefined.
Minimalist matrix template class.
K_UINT_32 ncol() const
Returns n_, the number of columns of the matrix.
Exception class for access to out-of-bound elements.