-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgenerator.cpp
More file actions
38 lines (30 loc) · 723 Bytes
/
generator.cpp
File metadata and controls
38 lines (30 loc) · 723 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
38
//
// generator.c
// SequentialSA
//
// Created by Vincent Ramdhanie on 3/15/15.
// Copyright (c) 2015 Vincent Ramdhanie. All rights reserved.
//
#include "generator.h"
void generate(int a[][PLOT_M]){
for(int i = 0; i < PLOT_N; i++){
for(int j = 0; j < PLOT_M; j++){
a[i][j] = (rand() % 1000);
}
}
}
void print(int a[][PLOT_M]){
ofstream outStream;
outStream.open("plots");
if(outStream.fail()){
cout << "Failed to open output file\n";
exit(1);
}
for(int i = 0; i < PLOT_N; i++){
for(int j = 0; j < PLOT_M; j++){
outStream << a[i][j] << " ";
}
outStream << std::endl;
}
outStream.close();
}