rem: prob.shrink(hw); iter = (*this).solve(prob, g); bi(prob, orig); iter += smooth(orig, g); prob = orig;
add: ProblemResizable diff = prob.clone(); ProblemResizable shrunk; while((cyc < m_cyc) && !g(prob)){ if(init){ iter += smooth(orig, g); prob.shrink(hw); shrunk = prob.clone(); iter += (*this).solve(prob, g); shrunk -= prob; bi(shrunk, diff); orig -= diff; iter += smooth(orig, g); prob = orig; } else{ prob.shrink(hw); iter += (*this).solve(prob, g); bi(prob, orig); iter += smooth(orig, g); prob = orig; } ++cyc; }
context: template<class ProblemResizable> int multigrid::solve(ProblemResizable& prob, goal& g){  bilinear_interpolation bi;  half_weighting hw;  int iter = 0;  if(prob.I() == mg){    iter = smooth(prob, g);  }  else{    ProblemResizable orig = prob.clone();    prob.shrink(hw);    iter = (*this).solve(prob, g);		// recurse    bi(prob, orig);    iter += smooth(orig, g);	// postsmoothing    prob = orig;  }  return iter;}