小编ada*_*max的帖子

改善treap实施

这是我对一种treap的实现(使用隐式键和一些存储在节点中的附加信息):http://hpaste.org/42839/treap_with_implicit_keys

根据分析数据,GC占用该程序80%的时间.据我所知,这是因为每次节点被"修改"时,都会重新创建到根节点的每个节点.

我能在这里做些什么来提高性能还是我必须进入ST monad的领域?

optimization performance garbage-collection haskell data-structures

17
推荐指数
1
解决办法
2033
查看次数

Ruby数学宝石

有没有人知道数学/几何操作是否有好的宝石?我需要一些这样的东西:

  • 点产品
  • 交叉产品
  • 矢量之间的角度
  • 矩阵
  • 表面normale
  • 矢量计算(加,减......)
  • 奇异值分解

thx,tux

ruby math geometry linear-algebra

11
推荐指数
1
解决办法
3706
查看次数

Haskell中的高效数字读取

我正在寻找一种有效的方法来从文本文件中读取数字而无需安装其他软件包.Data.ByteString.Lazy.Char8.readInt似乎是整数的诀窍.我已经读过ByteString现在有一个readDouble方法,但是当我编写import Data.ByteString.Lex.Lazy.Double (readDouble)编译器时抱怨:

    Main.hs:4:7:
        Could not find module `Data.ByteString.Lex.Lazy.Double':
          locations searched:
            Data/ByteString/Lex/Lazy/Double.hs
            Data/ByteString/Lex/Lazy/Double.lhs

我的bytestring包版本是0.9.1.5.

那么,我做错了什么?或者可能有更好的解决方案?谢谢.

更新:好的,似乎readDouble是在默认情况下未安装的包bytestring-lexer中.还有其他想法吗?

performance parsing haskell

7
推荐指数
2
解决办法
1565
查看次数