To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit a4c3c9c7 authored by amiessen's avatar amiessen
Browse files

clean-up

parent f903339a
......@@ -129,14 +129,8 @@ void writeGridToFile(const std::map<std::vector<int>, bool> & grid,
{
// grid is ordered in increasing order of x coordinate. For each x, it is is
// ordered in increasing order of y coordinate.
// Transpose grid to write row wise.
// -----------------
std::map<std::vector<int>, bool> gridTranspose;
for (const auto & i: grid) {
gridTranspose.insert({std::vector<int>{i.first[1], i.first[0]}, i.second});
}
std::string outFilename= "regID.txt";
std::ofstream oFile(outFilename);
......@@ -146,8 +140,8 @@ void writeGridToFile(const std::map<std::vector<int>, bool> & grid,
int x = gridDim[1];
while (x <= gridDim[2]) {
auto point = gridTranspose.find(std::vector<int>{y,x});
if (point != gridTranspose.end()) {
auto point = grid.find(std::vector<int>{x,y});
if (point != grid.end()) {
if (point->second) { oFile << "#"; }
else { oFile << " "; }
} else {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment