[Haskell-beginners] hmatrix, and Float

Alberto Ruiz aruiz at um.es
Mon Apr 12 08:10:57 EDT 2010


MAN wrote:
> I noticed that hmatrix defines the auxiliary type 'Element', and
> provides instances for Double and Complex, but not Float. Then Vector
> and Matrix are defined in terms of Element... is there any reason why
> Float is intentionally left out.

No, it is just that other improvements have higher priority... Float 
elements could be included in the future if really required.

> I'd like to use Numeric.LinearAlgebra with both single and double
> precision so as to compare results and times... could I?

I am not an expert, but it looks like Float computations are not faster 
than Double in typical cpus. For big arrays, differences are caused by 
memory/cache usage.

http://stackoverflow.com/questions/158889/are-doubles-faster-than-floats-in-c/160918#160918

Alberto


More information about the Beginners mailing list