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

前端 未结 1 1555
隐瞒了意图╮
隐瞒了意图╮ 2021-01-22 02:47

I\'m trying to build libspline for Matlab on Windows, available here:

http://ttic.uchicago.edu/~smaji/projects/libspline-release1.0.tar.gz

I get the following er

相关标签:
1条回答
  • 2021-01-22 02:58

    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);
    
    0 讨论(0)
提交回复
热议问题