-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmatrix.cpp
More file actions
44 lines (36 loc) · 1009 Bytes
/
matrix.cpp
File metadata and controls
44 lines (36 loc) · 1009 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include <iostream>
#include "matrix.hpp"
#include "matrix_determinant.hpp"
int main()
{
auto m2(vxl::make_matrix<2, 2>(1.0f, 2.0f, 3.0f, 6.0f));
auto n2(vxl::make_matrix<2, 2>(-2.0f, -2.0f, 1.0f, 1.0f));
std::cout << m2 << std::endl;
std::cout << n2 << std::endl;
std::cout << (m2 == m2) << std::endl;
std::cout << (m2 == n2) << std::endl;
std::cout << vxl::trans(m2) << std::endl;
std::cout << (m2 * n2) << std::endl;
std::cout << (m2 * vxl::vector<float, 2>{-1.f, 1.f}) << std::endl;
std::cout << (vxl::vector<float, 2>{-1.f, 1.f} * m2) << std::endl;
std::cout << vxl::det(
vxl::make_matrix<2, 2>(
1.f, 2.f, 3.f, 4.f)
) <<
std::endl;
std::cout << vxl::det(
vxl::make_matrix<3, 3>(
6.f, 4.f, 7.f, 3.f, 8.f, 6.f, 4.f, 7.f, 3.f)
) <<
std::endl;
std::cout << vxl::det(
vxl::make_matrix<4, 4>(
1.f, 2.f, 3.f, 4.f,
2.f, 3.f, 4.f, 1.f,
1.f, 4.f, 2.f, 3.f,
3.f, 2.f, 4.f, 5.f
)
) <<
std::endl;
return 0;
}