小编ido*_*uch的帖子

行星模拟的"修复"性能

我使用欧拉辛方法编写了太阳系外行星的模拟,并实现了这一点a)使用repa和b)使用yarr.

yarr似乎比x30快了约x30repa.

鉴于此,我甚至没有尝试使用并行性.我的repa代码中是否有明显的性能问题?存储库位于github.repa如果这有用的话,我可以生成一个简化版本,但是你不会得到性能比较yarr.

或者,我如何调试性能问题repa

arrays haskell repa

53
推荐指数
1
解决办法
1039
查看次数

使用Repa并行数组的惯用选项定价和风险

假设我想使用有限差分法对一个看涨期权定价,然后修复以下工作:

import Data.Array.Repa as Repa

r, sigma, k, t, xMax, deltaX, deltaT :: Double
m, n, p :: Int
r = 0.05
sigma = 0.2
k = 50.0
t = 3.0
m = 3
p = 1
xMax = 150
deltaX = xMax / (fromIntegral m)
n = 800
deltaT = t / (fromIntegral n)

singleUpdater a = traverse a id f
  where
    Z :. m = extent a
    f _get (Z :. ix) | ix == 0   = 0.0 …
Run Code Online (Sandbox Code Playgroud)

arrays performance haskell repa

28
推荐指数
1
解决办法
2206
查看次数

使proj_api.h可用于pip install cartopy

我试图安装cartopy通过pip install cartopy.我已安装proj.4,它已在此处放置了必要的文件

~/Downloads/proj-4.9.2 $ ls -l /usr/local/include/proj_api.h -rw-r--r--@ 1 dom admin 5911 Nov 21 11:06 /usr/local/include/proj_api.h

但是pip install找不到它:

gcc -fno-strict-aliasing -I/Applications/SageMath/local/var/tmp/sage/build/python2-2.7.10.p2/include -DNDEBUG -g -fwrapv -O3 -Wall -Wno-unused -I/Applications/SageMath/local/include -I./lib/cartopy -I/usr/local/Cellar/geos/3.5.0/include -I/Applications/SageMath/local/include/python2.7 -c lib/cartopy/trace.cpp -o build/temp.macosx-10.9-x86_64-2.7/lib/cartopy/trace.o lib/cartopy/trace.cpp:282:22: fatal error: proj_api.h: No such file or directory #include "proj_api.h" ^ compilation terminated. error: command 'gcc' failed with exit status 1

如何获得-I/usr/local/include上述gcc命令中出现的内容?不知何故-I/usr/local/Cellar/geos/3.5.0/include被放在那里.

pip proj cartopy

4
推荐指数
2
解决办法
3111
查看次数

为什么在DifferentialEquations.jl中同时使用tableau和显式求解器?

我正在查看DifferentialEquations.jl包裹.在 DiffEqDevTools/src/ode_tableaus.jl我所看到的舞台造型 MidpointRK4.

但我也可以看到这些方案的明确代码 OrdinaryDiffEq/src/integrators/fixed_timestep_integrators.jl.

我有点期望一些代码使用tableaux而不是有一个明确的解算器.

我不知道如何检查是否正在使用画面.我尝试删除,OrdinaryDiffEq.jl但后来我的例子不会运行.

这反而表明正在使用显式代码.但在那种情况下,为什么画面存在呢?

differential-equations julia differentialequations.jl

3
推荐指数
1
解决办法
128
查看次数