class MatrixTests: public Test::RegisteredTest<MatrixTests>
{
+private:
+ typedef LinAl::SquareMatrix<double, 2> Matrix2d;
+ typedef LinAl::Matrix<double, 3, 2> Matrix3x2d;
+ typedef LinAl::Matrix<double, 2, 3> Matrix2x3d;
+ typedef LinAl::SquareMatrix<double, 3> Matrix3d;
+
public:
MatrixTests();
MatrixTests::MatrixTests()
{
add(&MatrixTests::multiply, "Multiplication");
- add(&MatrixTests::invert, "Inversion");
+ add(&MatrixTests::invert, "Inversion");
}
void MatrixTests::multiply()
9, 3, 9, 6
};
- LinAl::Matrix<double, 3, 2> a(data);
- LinAl::Matrix<double, 2, 3> b(data+6);
- EXPECT_EQUAL(a*b, (LinAl::Matrix<double, 3, 3>(data+12)));
- EXPECT_EQUAL(b*a, (LinAl::Matrix<double, 2, 2>(data+21)));
+ Matrix3x2d a(data);
+ Matrix2x3d b(data+6);
+ EXPECT_EQUAL(a*b, Matrix3d(data+12));
+ EXPECT_EQUAL(b*a, Matrix2d(data+21));
}
template<typename T, unsigned N>
1, 4, 2, 4, 8, 6, 2, 2, 4
};
- LinAl::SquareMatrix<double, 3> m(data);
- LinAl::SquareMatrix<double, 3> i = LinAl::invert(m);
+ Matrix3d m(data);
+ Matrix3d i = LinAl::invert(m);
EXPECT(is_identity(i*m));
}