f1 :: Mesh -> Matrix Double
f1 me = knx where
hx :: Double
(hx , _) = h me
a, knx :: Matrix Double
a = fromLists [[1,2], [3,4]]
knx = hx * a
-- knx = 2 * a
我不明白为什么在上述函数中,乘以 2 有效,而乘以 hx = 0.5 则无效。OTOH,将 aMatrix Double
与Double
外部函数相乘可以正常工作。
Couldn't match expected type ‘Matrix Double’
with actual type ‘Double’
In the first argument of ‘(*)’, namely ‘hx’
In the expression: hx * a
Failed, modules loaded: none.
我很困惑。欢迎任何指点!