How to build matrix of zeros using hmatrix?
问题 Trying to use hmatrix, to create a zero marix. For some reason, when I try this on command line, it works: buildMatrix 2 3 (\(r,c) -> fromIntegral 0) However, when I try to do the same thing in my code: type Dim = (Int, Int) buildFull :: Matrix Double -> Vector Int -> Vector Int -> Dim -> Int buildFull matrix basic nonbasic (m, n) = do -- Build mxn matrix of zeroes let f = buildMatrix m n (\(r,c) -> fromIntegral 0) m it fails: Pivot.hs:23:17: Ambiguous type variable `a0' in the constraints: