【发布时间】:2020-10-01 17:50:27
【问题描述】:
我在 Julia 1.3.1 中使用 Cxx 来使用 boost 库的功能,安装此类库后它可以在 Linux 上正常工作,但在 Windows 中我从未让它工作。这是我写的模块:
module Airyzero
#Returns zeros of Airy's function
using Cxx;
export airyzero
cxx"""
#include<iostream>
#include <boost/math/special_functions/airy.hpp>
#include <boost/multiprecision/cpp_dec_float.hpp>
typedef boost::multiprecision::cpp_dec_float_50 float_type;
"""
cxx"""
double airyzero1(int y) {
return boost::math::airy_ai_zero<double>(y);
}
"""
airyzero(ind) = @cxx airyzero1(ind)
end
所以我可以在我的代码中使用来自 boost 的函数 airy_ai_zero 作为 airyzero。我需要它在 Windows 中也能工作,因为我实验室的计算机都没有使用 Linux(我的同事也没有)。
【问题讨论】:
-
我对特殊功能了解不多,但也许respective implementations in SpecialFunctions.jl就够了?
-
@phipsgabler 不,正是因为我想计算 Airy 函数的第 n 个零,最初我还检查了这个函数是否在 SpecialFunctions.jl 中实现,但事实并非如此,所以为了不重新发明轮子,我在 GSL.jl 或其他语言中寻找了一个实现,我在 boost 库中找到了该函数。