fix a compilation issue width VS2013

std::min and std::max are define in <algorithm>