fix compile warning by replacing C-style fabs with std::abs