Latest Updates
Latest Tweets
Fork me on GitHub

Quick Start

Math.NET can easily be used from any .NET language. The following quick start pages describe the minimal steps to get going using Math.NET in various environments for either C# or F# projects.

In Windows with VisualStudio 2010 and NuGet

Covers how to setup NuGet if not installed yet and how to get started using Math.NET Numerics in your C# or F#, .Net 4.0 or Silverlight 4 project. NuGet is a package manager with tight VisualStudio integration that greatly simplifies managing and upgrading dependencies in your projects. You can also use our NuGet packages with OpenWrap (a NuGet alternative).

Choose your environment:

 

In Windows with VisualStudio 2010 (traditional)

Covers how to install Math.NET Numerics in an C# or F#, .Net 4.0 or Silverlight 4 project using a traditional assembly reference.

Choose your environment:

 

With Mono and MonoDevelop in your favourite Operating System

Choose your environment:

 

Other

Math.NET can easily be used from any .NET language. On this page we describe the minimal steps to get going using Math.NET. For a more elaborate reference, consult our user guide, our documentation or search our blog for samples. Here are the steps to get Math.Net working for your application:

  1. First decide which version of Math.NET you want to use: you have a few options: a purely managed version of Math.NET, a Silverlight version of Math.NET and a version of Math.NET which uses native libraries for faster execution. You can read more about the different versions here.
  2. Download the latest Math.NET release from codeplex. On the right hand side there is a big green button called "Download" (you really can't miss it). On the download page you will find a link for the managed, Silverlight and native versions of Math.NET.
  3. Unzip your files to the solution you want to use Math.Net in.
  4. Add a reference to your project by right clicking on the project file > "Add Reference ...". Then you browse to the location where you unzipped Math.Net and find the MathNet.Numerics.dll in the "Release" folder. If you also want to use the F# front end, also reference the MathNet.Numerics.FSharp.dll. For Math.NET with a native backend, the only requirement is that Math.NET finds the native dll's. The easiest way to do so is to include the native dll's in your project, right click them > "Properties" and set "Copy to Output Directory" to "Always" or "If Newer".

  5. Open any of the Math.NET namespace and start using Math.NET. The following F# sample computes the sum of two vectors
    open MathNet.Numerics.FSharp
    open MathNet.Numerics.LinearAlgebra
    
    // Create a new 100 dimensional dense vector.
    let v = Double.DenseVector.init 100 (fun i -> float i / 100.0)
    
    // Another way to create a 100 dimensional dense vector is using the vector function.
    let w = vector (List.init 100 (fun i -> float i ** 2.0))
    
    // We can now add two vectors together ...
    let z = v + w