93 unsigned int nbok = 0;
102 M34d m34dbis, resadd, ressub;
110 m34d.setComponent(i,j,i*j);
111 m34dbis.setComponent(i,j,i+j);
112 resadd.setComponent(i,j,i*j+i+j);
113 ressub.setComponent(i,j,i*j-(
double)i-(
double)j);
121 nbok += ((m34d + m34dbis) == resadd) ? 1 : 0;
123 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") "
124 <<
"ok" << std::endl;
125 nbok += ((m34dbis + m34d) == resadd) ? 1 : 0;
127 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") "
128 <<
"ok commutative" << std::endl;
132 nbok += (other == m34d) ? 1 : 0;
134 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") "
135 <<
"ok +=" << std::endl;
140 nbok += ((m34d - m34dbis) == ressub) ? 1 : 0;
145 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") "
146 <<
"ok simple" << std::endl;
150 nbok += ( (two*2.0) == four) ? 1 : 0;
153 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") "
154 <<
" [2]*2 == [4]" << std::endl;
156 nbok += ( two == four/2.0) ? 1 : 0;
159 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") "
160 <<
" [2]= [4]/2" << std::endl;
165 M43d transp = m34d.transpose();
166 nbok += (transp.transpose() == m34d) ? 1 : 0;
168 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") "
169 <<
"ok idem potent" << std::endl;
180 nbok += (two * one == eight33) ? 1 : 0;
182 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") "
183 <<
" [2]*[1] = [8]" << std::endl;
244 unsigned int nbok = 0;
250 mat2.setComponent(1,1,2);
254 trace.
info() << mat2.determinant() << std::endl;
255 nbok += (mat2.determinant() == 2) ? 1 : 0;
257 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") "
258 <<
" 2" << std::endl;
264 mat.setComponent(1,1,2);
265 mat.setComponent(2,2,4);
269 nbok += (mat.determinant() == 8) ? 1 : 0;
271 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") "
272 <<
" 8" << std::endl;
279 mat44.setComponent(1,1,2);
280 mat44.setComponent(2,2,4);
281 mat44.setComponent(3,3,4);
285 trace.
info() << mat44.determinant() << std::endl;
286 nbok += (mat44.determinant() == 32) ? 1 : 0;
288 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") "
289 <<
" 32" << std::endl;
307 unsigned int nbok = 0;
315 mat2.setComponent(1,1,2);
321 trace.
info() << mat2.inverse() << std::endl;
322 nbok += (( mat2 * mat2.inverse() )== Id2 ) ? 1 : 0;
324 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") "
325 <<
" M*M^-1=Id" << std::endl;
334 for(
unsigned int i=0; i< 6; i++)
335 for(
unsigned int j=0; j< 6; j++)
342 trace.
info() <<
"M^-1=" <<mat.inverse() << std::endl;
343 trace.
info() <<
"det(M)= "<<mat.determinant() <<std::endl;
344 trace.
info() <<
"M*M^-1= "<<mat.inverse()*mat << std::endl;
356 unsigned int nbok = 0;
360 SimpleMatrix<double, 3, 3> mat = {1, 2, 3, 4, 5, 6, 7, 8, 9};
365 nbok += ( mat( 0, 0 ) == 1 ) ? 1 : 0;
367 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") ";
370 nbok += ( mat( 0, 1 ) == 2 ) ? 1 : 0;
372 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") ";
375 nbok += ( mat( 2, 2 ) == 9 ) ? 1 : 0;
377 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") ";