-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgen.cpp
More file actions
37 lines (33 loc) · 941 Bytes
/
gen.cpp
File metadata and controls
37 lines (33 loc) · 941 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
#include<iostream>
#include<fstream>
#include<filesystem>
#include<string>
#include<random>
#include<ctime>
int main(){
std::uniform_real_distribution<float> gen_float(-1,1);
std::default_random_engine gen(time(0));
// for(size_t n = (1<<8); n <= (1<<13); n <<= 1){
int n = 64;
// std::string name = "data/" + std::to_string(n) + ".txt";
std::string name = "data.txt";
std::ofstream out(name);
out << n << std::endl;
for(int i = 0; i < n; ++i){
for(int j = 0; j < n; ++j){
// out<< gen_float(gen) << " ";
out<<gen()%100<<" ";
}
out << "\n";
}
for(int i = 0; i < n; ++i){
for(int j = 0; j < n; ++j){
// out<< gen_float(gen) << " ";
out<<gen()%100<<" ";
}
out << "\n";
}
out.flush();
out.close();
// }
}