-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
55 lines (44 loc) · 1.6 KB
/
main.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#include <iostream>
#include <chrono>
#include "src/Exponential.h"
int main() {
std::cout << "Started!" << std::endl;
auto start = std::chrono::high_resolution_clock::now();
// v Performance test ---------------------------------
// for (int i = 0; i < 1000; i++) {
// int randInt = 1000;
// double randDouble = 3.0;
//
// auto exp1 = expnot::Exponential(randInt, randDouble);
// auto exp2 = expnot::Exponential(randInt, randDouble);
//
// auto add = exp1 + exp2;
// auto add2 = exp2 + exp1;
// auto sub = exp1 - exp2;
// auto sub2 = exp2 - exp1;
// auto mul = exp1 * exp2;
// auto mul2 = exp2 * exp1;
// auto div = exp1 / exp2;
// auto div2 = exp2 / exp1;
// }
// ^ Performance test ---------------------------------
// v Add test -------------------------------------
auto expo = expnot::Exponential(1.0, 5);
auto expo2 = expnot::Exponential(1.0, 5);
auto expAdd = expo2 + expo;
std::cout << expAdd.toString() << std::endl;
// ^ Add test --------------------------------------
auto now = std::chrono::high_resolution_clock::now();
auto time = now - start;
std::cout << time.count() / 1000.0 / 1000.0 << " seconds" << std::endl;
expnot::Exponential a(1.5, 10);
expnot::Exponential b(1, 9);
std::cout << (a / b).toString() << std::endl;
std::cout << a << std::endl;
std::cout <<
expnot::Exponential(
-std::numeric_limits<double>::max(),
-std::numeric_limits<long long>::max())
<< std::endl;
return 0;
}