Numerical Computing with F#
F# is emerging as a great choice for Numerical computing. Reasons? Functional design, libraries such as PowerPack, MathProvider and Math.NET and the interoperability of the .NET Framework.
F# PowerPack is a collection of libraries and tools for F# provided by Microsoft. It brings additional types, lexer and parser generation tools, document generator, enhancements to Async and Parallel capabilities and more. Tomas Petricek has written a series of articles on numeric types provided by PowerPack -
-
Introduction to Numeric Types
-
Working with Matrices in F#
-
Defining and working with Custom Numerics in F#
- Generic Numeric Code in F#
There is also a set of samples and tutorials on MSDN on the same topic.
Other libraries that are useful for dealing with Numerics in F# -
-
MathProvider brings linear algebra to F# by providing a wrapper for native BLAS and LAPACK runtimes.
-
Math.NET Numerics provides methods and algorithms for various scientific and engineering numeric computations, such as special functions, probability models, integral transforms, etc. MSDN has a tutorial on how to use Math.NET numerics in F#.
F# is often compared with other numerical computing languages like R and MATLAB. However, .NET applications can call both MATLAB and R and this allows F# to be used alongside special purpose languages to get the best of both worlds.
Generic numeric code in F#
by
Tomas Petricek
Sho and Solver Foundation are other options for F#
by
Faisal Waris
Sho includes Intel MKL libraries (which MATLAB also uses) for very high performance linear algebra. Sho also includes packages for statistics and signal processing.
Solver Foundation (also from MSR) provides key solvers for linear, non-linear and constraint programming. The free "Express" version is limited for linear and quadratic models but is unrestricted for non-linear models. Coveted routines such as L-BFGS are available in supported, production quality form.
For data visualization, Sho and FSharpChart provide convenient wrappers over .Net DataVisualization.
An important point is that F# is really good at data integration and manipulation; often, the big work is in processing the data to feed it into numerical computing libraries (which are mostly freely available now).
One advantage of using F# over say R or MATLAB is that you can more easily embed the final product into a regular .Net application. F# interactive mode - while not as easy to use as MATLAB's - is decent enough for interactively developing the solution to a numerical problem.
Re: Generic numeric code in F#
by
Roopesh Shenoy
Re: Sho and Solver Foundation are other options for F#
by
Roopesh Shenoy
I agree about F# being good at data integration and manipulation - especially with Type providers and LINQ. I guess that's what makes it powerful!
Educational Content
Concurrency in Clojure
Stuart Halloway May 17, 2013
Confessions of an Agile Addict
Ole Friis Østergaard May 16, 2013
Web Development: You're Doing It Wrong
Stefan Tilkov May 16, 2013
Programming The Feynman Way
Ben Evans May 15, 2013





Hello stranger!
You need to Register an InfoQ account or Login to post comments. But there's so much more behind being registered.Get the most out of the InfoQ experience.
Tell us what you think