-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
52 lines (46 loc) · 1.2 KB
/
Copy pathmain.cpp
File metadata and controls
52 lines (46 loc) · 1.2 KB
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
#include "vector.h"
#include "class-integer.hpp"
#include "class-matrix.hpp"
#include "class-bint.hpp"
#include <iostream>
#include <fstream>
#include <string>
void TestInteger()
{
std::cout << "Test for classes without default constructor..." << std::endl;
sjtu::vector<Integer> vInt;
for (int i = 1; i <= 100; ++i) {
vInt.push_back(Integer(i));
}
std::cout << "Test OK..." << std::endl;
}
void TestMatrix()
{
std::cout << "Test for my Matrix..." << std::endl;
sjtu::vector<Diamond::Matrix<double>> vM;
for (int i = 1; i <= 10; ++i) {
vM.push_back(Diamond::Matrix<double>(i, i, i));
}
for (size_t i = 0; i < vM.size(); ++i) {
std::cout << vM[i] << std::endl;
}
}
void TestBint()
{
std::cout << "Test for big integer" << std::endl;
sjtu::vector<Util::Bint> vBint;
for (long long i = 1LL << 50; i < (1LL << 50) + 10; ++i) {
vBint.push_back(Util::Bint(i) * i);
}
for (sjtu::vector<Util::Bint>::iterator it = vBint.begin(); it != vBint.end(); ++it) {
std::cout << *it << " ";
}
std::cout << std::endl;
}
int main()
{
freopen("3_mineAns", "w", stdout);
TestInteger();
TestMatrix();
TestBint();
}