//Max function is working as intended while the minElev is inserting a huge negative value when it hits the final column of the first row. Not sure what is going on and how to fix....
bool pathfinder::_read_data(string data_file_name) {
string string_1 = "", string_2 = "";
int rows = 0, columns = 0;
int x = 0; //Temp Variable
vector<int> temp;
vector<vector<int>> a;
ifstream fileIn(data_file_name);
// if (!fileIn) {
// cerr << "Couldn't read this file!!!";
// return 666;
// }
fileIn >> string_1 >> columns >> string_2 >> rows;
for (int i = 0; i < rows; i++) {
for (int j = 0; j < columns; j++) {
fileIn >> x;
temp.push_back(x);
}
a.push_back(temp);
temp.clear();
}
int maxElev = a[0][0];
int minElev = a[0][0];
for(int i = 0; i < a.size(); i++){
for(int j = 0; j < a.size(); j++){
if(a[i][j] > maxElev){
maxElev = a[i][j];
}
if(a[i][j] < minElev){
minElev = a[i][j];
}
}
}
// TODO: read in and store elevation data
// TODO: close input file
// TODO: return true if everything worked
return true;
}