Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

F# 1.9.9.9 and lapack

Tags:

.net

math

f#

lapack

Can anyone help me with example on using lapack with latest f#? Or it is not recommended for now?

I searched and only find http://fdatamining.blogspot.com/ but was not able to get FSharp.PowerPack.Math.Providers.dll compiled.

EDIT: @Yin, Thanks for your blog. On compiling FSharp.PowerPack.Math.Providers.dll from 1.9.7.8 source, Microsoft.FSharp.Compatibility.permutation is used several times and cannot be found. In your blog it is said just to define it explicitly:

type permutation = int –> int.

Alternatively I replace all Microsoft.FSharp.Compatibility.permutation with Microsoft.FSharp.Math.Permutation and got it compiled. Have not test it yet.

Could you please show us the test case for svd bug?

Thanks

like image 382
ahala Avatar asked Mar 30 '10 20:03

ahala


1 Answers

I wrote this blog. Do you use VS 2008? Have you installed PowerPack? What have you done so far? What compile errors did you get?

Using the math providers is NOT recommended by the F# team. However, this is the best I can find online for F# (The incomplete and alpha-test Math.Net needs time to mature). I can also tell you that the wrapper is buggy, e.g. there's a bug in the SVD wrapper. But this wrapper is small, you can maintain it yourself along the F# new releases and add new functions as you need (we have obvious license problem here!). My plan is to use and modify this wrapper until it is stable and rewrite a new one to clear license problem. Or, we can persuade MS or MSR to continue the development.

@ahala, the svd bug

search member this.dgesvd_((a:matrix)) = in lapack_service_netlib.fs

This function has a memory-access/segment-fault bug when doing SVD on a m-by-n(m>n) matrix.

To solve the problem, we need to change arg_jobu and arg_jobvt to 'S'. ref lapack doc here: http://linux.die.net/man/l/dgesvd

like image 177
Yin Zhu Avatar answered Nov 11 '22 00:11

Yin Zhu