Adjusting return types and main completion

This commit is contained in:
Noah L. Schrick 2022-03-08 11:53:40 -06:00
parent 3abc8a8491
commit b6c266add0
7 changed files with 10 additions and 8 deletions

Binary file not shown.

Binary file not shown.

View File

@ -18,6 +18,7 @@ HL::HL()
void HL::print_sol() void HL::print_sol()
{ {
auto sol = get_sol();
for(auto itr = sol.begin(); itr != sol.end(); itr++) for(auto itr = sol.begin(); itr != sol.end(); itr++)
std::cout << "Line ID " << std::get<0>(*itr) << " visible in range (" << std::cout << "Line ID " << std::get<0>(*itr) << " visible in range (" <<
std::get<0>(std::get<1>(*itr)) << std::get<0>(std::get<1>(*itr)) <<
@ -85,8 +86,8 @@ std::set<Line> HL::gen_sol(std::set<Line>& ls){
} }
//return sol; //return sol;
std::set<Line> dummy; //std::set<Line> dummy;
return dummy; //return dummy;
} }
std::set<Line> HL::construct_HWprob(){ std::set<Line> HL::construct_HWprob(){
@ -156,8 +157,6 @@ std::set<Line> HL::get_lines() const{
return lines; return lines;
} }
std::set<Line> HL::get_sol() const{ std::set<std::pair<int, std::pair<double, double>>> HL::get_sol() const{
std::set<Line> dummy; return sol;
return dummy;
//return sol;
} }

View File

@ -14,7 +14,7 @@ class HL
std::set<Line> construct_HWprob(); std::set<Line> construct_HWprob();
std::set<Line> get_lines() const; std::set<Line> get_lines() const;
std::set<Line> get_sol() const; std::set<std::pair<int, std::pair<double, double>>> get_sol() const;
private: private:
//Solution is in form (Line ID, (vis_start, vis_end)) //Solution is in form (Line ID, (vis_start, vis_end))

View File

@ -21,6 +21,9 @@ int main(int argc, char *argv[])
<< " and a y-intercept of " << line.get_ycept() << std::endl; << " and a y-intercept of " << line.get_ycept() << std::endl;
} }
std::set<Line> line_sol = inst.gen_sol(lines); std::cout << "Generating Solution." << std::endl;
inst.gen_sol(lines);
std::cout << "Solution is: " << std::endl;
inst.print_sol();
} }