void HungarianAlgorithm::solve(Mat CostMatrix_In,Mat& Assignment_Out){ this->CostMatrix = CostMatrix_In.clone() ; // The algorithm consists of 8 steps bool done = false ; int step = 0; while(!done){ switch(step){ case 0: step_zero(&step); break ; case 1: step_one(&step); break ; case 2: step_two(&step); break; case 3: step_three(&step); break ; case 4: step_four(&step); break; case 5: step_five(&step); Assignment_Out = this->AssignmentMatrix ; done = true ; break; } } }
std::tr1::shared_ptr<ListOfLists> Cons::perms() { std::tr1::shared_ptr<ListOfLists> rest_perms(xs->perms()); std::tr1::shared_ptr<Closure> step_two(new BindCallback1(x)); return rest_perms->bind(step_two); }