albertoruiz/hmatrix — pull request #37 by takano-akio (2013-04-11 04:48:38+00:00)
Title: GSL minimization functions segault

The following program segfaults. The commit fixes it.

```haskell
{-# LANGUAGE ViewPatterns #-}

import Numeric.GSL.Minimization
import qualified Data.Vector.Storable as V

main = print $ loop 0

loop :: Double -> Double
loop x = loop $! x + rv V.! 0
where
(rv, _) = minimizeV NMSimplex2 1e-8 1 (V.replicate 2 100)
(func x) (V.replicate 2 0)

func :: Double -> V.Vector Double -> Double
func t (V.toList -> [x, y]) = (1 - x)**2
+ 100 * (y - t - x**2) **2
```