Building libspline for Matlab on Windows - ambiguous call to overloaded function 'pow'

烈酒焚心 提交于 2019-12-02 02:02:05

The line 156 in additiveModel.cpp is this:

dimwts[2*i] = 1.0/pow(i+1,reg);

Here you can see that both of the arguments that are being passed to pow are ints. Since there is no overload of pow in math.h that would take two ints, the overload resolution fails since the best viable function is not unique in this case.

You can fix this by casting the first parameter to a suitable type, such as double:

dimwts[2*i] = 1.0/pow(static_cast<double>(i+1),reg);
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!