-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_vector.cpp
39 lines (27 loc) · 970 Bytes
/
test_vector.cpp
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
#include <iostream>
#include "Vector.h"
#include "Matrix2.h"
int main() {
std::vector<double> inputData = {1.0, 12.0, 89.0};
std::vector<double> inputData2 = {-10.0, 32.0, 89.0};
abVector<double> v1(inputData);
abVector<double> v2(inputData2);
abVector<double> sum = v1 + v2;
abVector<double> diff = v1 - v2;
std::cout << "SUM: " << std::endl;
std::cout << sum << std::endl;
std::cout << "DIFF: " << std::endl;
std::cout << diff << std::endl;
std::cout << "SCALAR MULT: " << std::endl;
std::cout << v1 * 5.0 << std::endl;
std::cout << 5.0 * v1 << std::endl;
std::cout << "DOT: " << std::endl;
std::cout << v1.dot(v1, v2) << std::endl;
std::cout << "CROSS: " << std::endl;
std::cout << v1.cross(v1, v2) << std::endl;
double input[9] = {1,2,3,3,2,1,2,1,3};
Matrix2<double> mat5(3, 3, input);
std::cout << mat5 << std::endl;
std::cout << mat5 * v1 << std::endl;
return 0;
}