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
|
#include "ndim_matrix.h"
#include <iostream>
int main()
{
math::vector<float, 3> v = { 0, 1, 2 };
math::matrix<float, 4, 4> m = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5 };
math::matrix<float,3,4> a =
{
1, 0, 0, 1,
1, 1, 0, 0,
1, 1, 1, 1,
};
math::matrix<float,4,2> b =
{
1, 0,
0, 1,
0, 1,
1, 0
};
std::cout << "a = " << std::endl << a << std::endl;
std::cout << "b = " << std::endl << b << std::endl;
math::matrix<float,3,2> c = a * b;
std::cout << "c = " << std::endl << c << std::endl << std::endl;
math::vector<int, 3> init1 = { 1, 0, 0 };
math::vector<int, 3> init2 = { 0, 1, 0 };
math::matrix<math::vector<int, 3>, 3, 3> wow1 = { init1, init1, init1, init1, init1, init1, init1, init1, init1 };
math::matrix<math::vector<int, 3>, 3, 3> wow2 = { init2, init2, init2, init2, init2, init2, init2, init2, init2 };
std::cout << "wow1 = " << std::endl << wow1 << std::endl;
std::cout << "wow2 = " << std::endl << wow2 << std::endl;
std::cout << "wow1 x wow2 = " << std::endl << (wow1 * wow2) << std::endl;
std::cout << "sizeof(wow1) = " << sizeof(wow1) << std::endl;
} |
Partager