csharpfftfsharpintegrationinterpolationlinear-algebramathdifferentiationmatrixnumericsrandomregressionstatisticsmathnet
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
340 lines
25 KiB
340 lines
25 KiB
<!DOCTYPE html>
|
|
<html lang="en">
|
|
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Intel Math Kernel Library (MKL)
|
|
</title>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
<meta name="author" content="Christoph Ruegg, Marcus Cuda, Jurgen Van Gael">
|
|
|
|
<link rel="stylesheet" id="theme_link" href="https://cdnjs.cloudflare.com/ajax/libs/bootswatch/4.6.0/materia/bootstrap.min.css">
|
|
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
|
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/js/bootstrap.bundle.min.js" integrity="sha384-Piv4xVNRyMGpqkS2by6br4gNJ7DXjqk09RmUpJ8jgGtD7zP9yug3goQfGII0yAns" crossorigin="anonymous"></script>
|
|
|
|
<script type="text/javascript" async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js?config=TeX-MML-AM_CHTML"></script>
|
|
|
|
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
|
|
<link type="text/css" rel="stylesheet" href="https://numerics.mathdotnet.com/content/navbar-fixed-left.css" />
|
|
<link type="text/css" rel="stylesheet" href="https://numerics.mathdotnet.com/content/fsdocs-default.css" />
|
|
<link type="text/css" rel="stylesheet" href="https://numerics.mathdotnet.com/content/fsdocs-custom.css" />
|
|
<script type="text/javascript" src="https://numerics.mathdotnet.com/content/fsdocs-tips.js"></script>
|
|
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
|
|
<!--[if lt IE 9]>
|
|
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
|
|
<![endif]-->
|
|
<!-- BEGIN SEARCH BOX: this adds support for the search box -->
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/JavaScript-autoComplete/1.0.4/auto-complete.css" />
|
|
<!-- END SEARCH BOX: this adds support for the search box -->
|
|
|
|
</head>
|
|
|
|
<body>
|
|
<nav class="navbar navbar-expand-md navbar-light bg-secondary fixed-left" id="fsdocs-nav">
|
|
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarsExampleDefault" aria-controls="navbarsExampleDefault" aria-expanded="false" aria-label="Toggle navigation">
|
|
<span class="navbar-toggler-icon"></span>
|
|
</button>
|
|
<div class="collapse navbar-collapse navbar-nav-scroll" id="navbarsExampleDefault">
|
|
<a href="https://numerics.mathdotnet.com/"><img id="fsdocs-logo" src="/logo.png" /></a>
|
|
<!-- BEGIN SEARCH BOX: this adds support for the search box -->
|
|
<div id="header">
|
|
<div class="searchbox" id="fsdocs-searchbox">
|
|
<label for="search-by">
|
|
<i class="fas fa-search"></i>
|
|
</label>
|
|
<input data-search-input="" id="search-by" type="search" placeholder="Search..." />
|
|
<span data-search-clear="">
|
|
<i class="fas fa-times"></i>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
<!-- END SEARCH BOX: this adds support for the search box -->
|
|
<ul class="navbar-nav">
|
|
<li class="nav-header">Math.NET Numerics</li>
|
|
<li class="nav-item"><a class="nav-link" href="Packages.html">NuGet & Binaries</a></li>
|
|
<li class="nav-item"><a class="nav-link" href="ReleaseNotes.html">Release Notes</a></li>
|
|
<li class="nav-item"><a class="nav-link" href="https://github.com/mathnet/mathnet-numerics/blob/master/LICENSE.md">MIT License</a></li>
|
|
<li class="nav-item"><a class="nav-link" href="Compatibility.html">Platform Support</a></li>
|
|
<li class="nav-item"><a class="nav-link" href="https://numerics.mathdotnet.com/api/">Class Reference</a></li>
|
|
<li class="nav-item"><a class="nav-link" href="https://github.com/mathnet/mathnet-numerics/issues">Issues & Bugs</a></li>
|
|
<li class="nav-item"><a class="nav-link" href="Users.html">Who is using Math.NET?</a></li>
|
|
|
|
<li class="nav-header">Contributing</li>
|
|
<li class="nav-item"><a class="nav-link" href="Contributors.html">Contributors</a></li>
|
|
<li class="nav-item"><a class="nav-link" href="Contributing.html">Contributing</a></li>
|
|
<li class="nav-item"><a class="nav-link" href="Build.html">Build & Tools</a></li>
|
|
<li class="nav-item"><a class="nav-link" href="https://github.com/mathnet/mathnet-numerics/discussions/categories/ideas">Your Ideas</a></li>
|
|
|
|
<li class="nav-header">Getting Help</li>
|
|
<li class="nav-item"><a class="nav-link" href="https://discuss.mathdotnet.com/c/numerics">Discuss</a></li>
|
|
<li class="nav-item"><a class="nav-link" href="https://stackoverflow.com/questions/tagged/mathdotnet">Stack Overflow</a></li>
|
|
|
|
<li class="nav-header">Getting Started</li>
|
|
<l class="nav-item"i><a class="nav-link" href="/">Getting started</a></li>
|
|
<li class="nav-item"><a class="nav-link" href="Constants.html">Constants</a></li>
|
|
<li class="nav-item"><a class="nav-link" href="Matrix.html">Matrices and Vectors</a></li>
|
|
<li class="nav-item"><a class="nav-link" href="Euclid.html">Euclid & Number Theory</a></li>
|
|
<li class="nav-item">Combinatorics</li>
|
|
|
|
<li class="nav-header">Evaluation</li>
|
|
<li class="nav-item"><a class="nav-link" href="Functions.html">Special Functions</a></li>
|
|
<li class="nav-item"><a class="nav-link" href="Integration.html">Integration</a></li>
|
|
|
|
<li class="nav-header">Statistics/Probability</li>
|
|
<li class="nav-item"><a class="nav-link" href="DescriptiveStatistics.html">Descriptive Statistics</a></li>
|
|
<li class="nav-item"><a class="nav-link" href="Probability.html">Probability Distributions</a></li>
|
|
|
|
<li class="nav-header">Generation</li>
|
|
<li class="nav-item"><a class="nav-link" href="Generate.html">Generating Data</a></li>
|
|
<li class="nav-item"><a class="nav-link" href="Random.html">Random Numbers</a></li>
|
|
|
|
<li class="nav-header">Solving Equations</li>
|
|
<li class="nav-item"><a class="nav-link" href="LinearEquations.html">Linear Equation Systems</a></li>
|
|
|
|
<li class="nav-header">Optimization</li>
|
|
<li class="nav-item"><a class="nav-link" href="Distance.html">Distance Metrics</a></li>
|
|
|
|
<li class="nav-header">Curve Fitting</li>
|
|
<li class="nav-item"><a class="nav-link" href="Regression.html">Regression</a></li>
|
|
|
|
<li class="nav-header">Native Providers</li>
|
|
<li class="nav-item"><a class="nav-link" href="MKL.html">Intel MKL</a></li>
|
|
|
|
<li class="nav-header">Working Together</li>
|
|
<li class="nav-item"><a class="nav-link" href="CSV.html">Delimited Text Files (CSV)</a></li>
|
|
<li class="nav-item"><a class="nav-link" href="MatrixMarket.html">NIST MatrixMarket</a></li>
|
|
<li class="nav-item"><a class="nav-link" href="MatlabFiles.html">MATLAB</a></li>
|
|
<li class="nav-item"><a class="nav-link" href="IFSharpNotebook.html">IF# Notebook</a></li>
|
|
</ul>
|
|
</div>
|
|
</nav>
|
|
<div class="container">
|
|
<div class="masthead">
|
|
<h3 class="muted">
|
|
<a href="https://numerics.mathdotnet.com">Math.NET Numerics</a> |
|
|
<a href="https://www.mathdotnet.com">Math.NET Project</a> |
|
|
<a href="https://github.com/mathnet/mathnet-numerics">GitHub</a>
|
|
</h3>
|
|
</div>
|
|
<hr />
|
|
<div class="container" id="fsdocs-content">
|
|
<h1><a name="Intel-Math-Kernel-Library-MKL" class="anchor" href="#Intel-Math-Kernel-Library-MKL">Intel Math Kernel Library (MKL)</a></h1>
|
|
<p>Math.NET Numerics is designed such that performance-sensitive algorithms
|
|
can be swapped with alternative implementations by the concept of providers.
|
|
There is currently only a provider for <a href="https://numerics.mathdotnet.com/api/MathNet.Numerics.Providers.LinearAlgebra.Mkl/MklLinearAlgebraProvider.htm">linear algebra related routines</a>, but there
|
|
are plans to add additional more e.g. related to nonlinear optimization problems or signal processing.</p>
|
|
<p>Providers become interesting when they can leverage a platform-native high performance library
|
|
like Intel MKL instead of the default purely managed provider. Math.NET Numerics
|
|
provides such a provider as NuGet packages:</p>
|
|
<ul>
|
|
<li>MathNet.Numerics.MKL.Win</li>
|
|
<li>MathNet.Numerics.MKL.Linux</li>
|
|
</ul>
|
|
<p>Since these native libraries can become very big, there are also variants supporting
|
|
only a single platform, for example:</p>
|
|
<ul>
|
|
<li>MathNet.Numerics.MKL.Win-x86</li>
|
|
<li>MathNet.Numerics.MKL.Win-x64</li>
|
|
</ul>
|
|
<p>In order to leverage the MKL linear algebra provider, we need to make sure the .NET
|
|
runtime can find the native libraries (see below) and then enable it by calling:</p>
|
|
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp">Control.UseNativeMKL();
|
|
</code></pre></td></tr></table>
|
|
<p>Alternatively you can also enable it by setting the environment variable <code>MathNetNumericsLAProvider=MKL</code>.</p>
|
|
<p>You can also explicitly disable the MKL provider by forcing it to use the managed provider by calling:</p>
|
|
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp">Control.UseManaged();
|
|
</code></pre></td></tr></table>
|
|
<p>You can tell what provider is effectively loaded by calling <code>Control.LinearAlgebraProvider.ToString()</code>,
|
|
which will return something along the lines of <code>Intel MKL (x86; revision 7)</code>.</p>
|
|
<h2><a name="Native-Binaries" class="anchor" href="#Native-Binaries">Native Binaries</a></h2>
|
|
<p>In .Net, the fusion engine is responsible for finding referenced
|
|
assemblies in the file system and loading them into the executing process.
|
|
However, native binaries like our MKL provider are platform specific,
|
|
so we need to load them with services of the platform instead of the .Net runtime.
|
|
We use P/Invoke to talk to the binaries, but for this to work they must
|
|
have already been loaded or the platform service needs to be able to find and
|
|
load them on its own.</p>
|
|
<p>In order to make providers easier to use, since v3.6.0 Math.NET Numerics
|
|
first tries to load native providers from a set of known directories before
|
|
falling back to the platform's default behavior. In each of these directories
|
|
it first looks for a processor-architecture specific folder within the directory,
|
|
before looking at the directory itself:</p>
|
|
<ol>
|
|
<li>If <code>Control.NativeProviderPath</code> is set: <code>{NativeProviderPath}/{Platform}/</code></li>
|
|
<li>If <code>Control.NativeProviderPath</code> is set: <code>{NativeProviderPath}/</code></li>
|
|
<li><code>{AppDomain.BaseDirectory}/{Platform}/</code></li>
|
|
<li><code>{AppDomain.BaseDirectory}/</code></li>
|
|
<li><code>{ExecutingAssemblyPath}/{Platform}/</code></li>
|
|
<li><code>{ExecutingAssemblyPath}/</code></li>
|
|
<li>Fall back to the platform's default behavior (see below)</li>
|
|
</ol>
|
|
<p>Where <code>{Platform}</code> can be one of the following: <code>x86</code>, <code>x64</code>, <code>ia64</code>, <code>arm</code> or <code>arm64</code>.</p>
|
|
<p>This means that you can, for example, place the 32 bit MKL provider binaries into <code>C:\MKL\x86</code>
|
|
and the 64 bit ones into <code>C:\MKL\x64</code>, and then set <code>Control.NativeProviderPath = @"C:\MKL";</code>.
|
|
Numerics will automatically choose the right one depending on whether your process is
|
|
running in 32 or 64 bit mode, and there is no more need to copy the large binaries to the
|
|
output folder of every script or project.</p>
|
|
<h2><a name="Default-Behavior-on-Windows" class="anchor" href="#Default-Behavior-on-Windows">Default Behavior on Windows</a></h2>
|
|
<p>On Windows it is usually enough to make sure the native libraries are in the
|
|
same folder as the executable. Reference the appropriate NuGet package and set
|
|
"Copy to Output Directory" for both libMathNetNumercisMKL.dll and libiomp5md.dll
|
|
to "Copy always", or place the two native DLLs manually into the same directory
|
|
as your application's executable. There is no need to set the native provider
|
|
path explicitly.</p>
|
|
<p>For more details how the platform default behavior works and what influences it,
|
|
see <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms682586.aspx">Dynamic-Link Library Search Order</a>.</p>
|
|
<h2><a name="Default-Behavior-on-Linux" class="anchor" href="#Default-Behavior-on-Linux">Default Behavior on Linux</a></h2>
|
|
<p>Native assembly resolving is very different on Linux than on Windows, simply putting the native
|
|
libraries into the same folder as the executable is not enough. The safe way is to edit <code>/etc/ld.so.conf</code>
|
|
and use <code>ldconfig</code> to tell where to look for the libraries. Alternatively you could add the path
|
|
to <code>LD_LIBRARY_PATH</code> or even just copy them to <code>/usr/lib</code>.</p>
|
|
<p>For details see Mono's <a href="https://www.mono-project.com/docs/advanced/pinvoke/#linux-shared-library-search-path">Interop with Native Libraries</a>.</p>
|
|
<h2><a name="Default-Behavior-on-Mac-OS-X" class="anchor" href="#Default-Behavior-on-Mac-OS-X">Default Behavior on Mac OS X</a></h2>
|
|
<p>You can configure the search path on one of the environment variables like <code>DYLD_LIBRARY_PATH</code>
|
|
or just copy them e.g. to <code>/usr/lib</code>.</p>
|
|
<p>For details see Mono's <a href="https://www.mono-project.com/docs/advanced/pinvoke/#mac-os-x-framework-and-dylib-search-path">Interop with Native Libraries</a>.</p>
|
|
<p>To build the MKL native provider for OSX:</p>
|
|
<ol>
|
|
<li>
|
|
Make sure you've a valid <a href="https://software.intel.com/en-us/qualify-for-free-software/academicresearcher">Intel MKL</a> licence installed on your mac (look at opt/intel).
|
|
If not, you can get a free trial on intel's web site.
|
|
</li>
|
|
<li>Open the terminal</li>
|
|
<li>cd to the folder mathnet-numerics/src/NativeProviders/OSX</li>
|
|
<li>Run the .sh script by typing sh mkl_build.sh</li>
|
|
<li>... wait for the build</li>
|
|
</ol>
|
|
<table class="pre"><tr><td class="snippet"><pre class="fssnip"><code lang="sh">lionel:~ Lionel$ cd /Users/Lionel/Public/Git/GitHub/mathnet-numerics/src/NativeProviders/OSX
|
|
lionel:OSX Lionel$ ls
|
|
mkl_build.sh
|
|
lionel:OSX Lionel$ sh mkl_build.sh
|
|
</code></pre></td></tr></table>
|
|
<p>Check the /x86 and /x64 folders in mathnet-numerics/out/MKL: you should now find the <code>libiomp5.dylib</code> and <code>libMathNetNumercisMKL.dll</code> libaries.
|
|
You need to add the path to the generated libraries in your <code>DYLD_LIBRARY_PATH</code> environment variable (which you can move to the folder of you choice before).
|
|
To do that, open your /Users/Lionel/.bas_profile.sh file with a text editor and add the following statements.</p>
|
|
<table class="pre"><tr><td class="snippet"><pre class="fssnip"><code lang="sh">export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/Users/Lionel/../mathnet-numerics/out/MKL/OSX/x64
|
|
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/Users/Lionel/../mathnet-numerics/out/MKL/OSX/x86
|
|
</code></pre></td></tr></table>
|
|
<p>Of course replace <code>Lionel</code> by your account login.</p>
|
|
<p>Have a look a the example down this page to compare MKL-provider vs. managed-provider performances.</p>
|
|
<h2><a name="F-Interactive" class="anchor" href="#F-Interactive">F# Interactive</a></h2>
|
|
<p>In F# Interactive, the easiest way to use native providers is to copy them to a shared
|
|
directory somewhere and use them directly from there:</p>
|
|
<pre class="fssnip highlighted"><code lang="fsharp"><span onmouseout="hideTip(event, 'fs1', 1)" onmouseover="showTip(event, 'fs1', 1)" class="id">Control</span><span class="pn">.</span><span class="id">NativeProviderPath</span> <span class="k"><-</span> <span class="s">@"C:\MKL"</span>
|
|
<span onmouseout="hideTip(event, 'fs1', 2)" onmouseover="showTip(event, 'fs1', 2)" class="id">Control</span><span class="pn">.</span><span class="id">UseNativeMKL</span><span class="pn">(</span><span class="pn">)</span>
|
|
</code></pre>
|
|
<p>If you are using the F# Power Tools in VisualStudio, you can also let it generate "Reference
|
|
scripts for F# Interactive" right from the context menu. This will generate a script called
|
|
<code>load-references.fsx</code> in a <code>Scripts</code> folder, which you can extend as follows to load the
|
|
MKL provider automatically.</p>
|
|
<pre class="fssnip highlighted"><code lang="fsharp"><span class="k">open</span> <span onmouseout="hideTip(event, 'fs2', 3)" onmouseover="showTip(event, 'fs2', 3)" class="id">System</span><span class="pn">.</span><span onmouseout="hideTip(event, 'fs3', 4)" onmouseover="showTip(event, 'fs3', 4)" class="id">IO</span>
|
|
<span class="k">open</span> <span class="id">MathNet</span><span class="pn">.</span><span class="id">Numerics</span>
|
|
|
|
<span onmouseout="hideTip(event, 'fs1', 5)" onmouseover="showTip(event, 'fs1', 5)" class="id">Control</span><span class="pn">.</span><span class="id">NativeProviderPath</span> <span class="k"><-</span> <span onmouseout="hideTip(event, 'fs4', 6)" onmouseover="showTip(event, 'fs4', 6)" class="id">Path</span><span class="pn">.</span><span onmouseout="hideTip(event, 'fs5', 7)" onmouseover="showTip(event, 'fs5', 7)" class="id">Combine</span><span class="pn">(</span><span class="k">__SOURCE_DIRECTORY__</span><span class="pn">,</span><span class="s">"../"</span><span class="pn">)</span>
|
|
<span onmouseout="hideTip(event, 'fs1', 8)" onmouseover="showTip(event, 'fs1', 8)" class="id">Control</span><span class="pn">.</span><span class="id">UseNativeMKL</span><span class="pn">(</span><span class="pn">)</span>
|
|
</code></pre>
|
|
<p>This script assumes that the MKL binaries have been copied to the project directory,
|
|
which is also where the NuGet packages place them by default. If you place them somewhere
|
|
else, adapt the path accordingly.</p>
|
|
<p>See also <a href="https://christoph.ruegg.name/blog/loading-native-dlls-in-fsharp-interactive.html">Loading Native DLLs in F# Interactive</a>
|
|
for more alternatives.</p>
|
|
<h2><a name="LINQPad-and-assembly-shadowing" class="anchor" href="#LINQPad-and-assembly-shadowing">LINQPad and assembly shadowing</a></h2>
|
|
<p>The automatic strategy may still work if assembly shadowing is involved,
|
|
but it often simpler and more reliable to provide the folder explicitly.
|
|
This also works well in LINQPad, with and without assembly shadowing:</p>
|
|
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp">Control.NativeProviderPath <span class="o">=</span> <span class="s">@"C:\MKL"</span>;
|
|
Control.UseNativeMKL();
|
|
</code></pre></td></tr></table>
|
|
<h2><a name="Example-Intel-MKL-on-Linux-with-Mono" class="anchor" href="#Example-Intel-MKL-on-Linux-with-Mono">Example: Intel MKL on Linux with Mono</a></h2>
|
|
<p>We also provide MKL NuGet package for Linux if you do not want to build them yourself. Assuming you have
|
|
Mono and NuGet installed (here v3.2.8), you can fetch the MKL package of the right architecture
|
|
(x64 or x86, <code>uname -m</code> if you don't know) as usual:</p>
|
|
<table class="pre"><tr><td class="snippet"><pre class="fssnip"><code lang="sh">mono nuget.exe install MathNet.Numerics -Pre -OutputDirectory packages
|
|
mono nuget.exe install MathNet.Numerics.MKL.Linux-x64 -Pre -OutputDirectory packages
|
|
</code></pre></td></tr></table>
|
|
<p>Native assembly resolving is very different on Linux than on Windows, simply putting the native
|
|
libraries into the same folder as the executable is not enough. The safe way is to edit <code>/etc/ld.so.conf</code>
|
|
and use <code>ldconfig</code> to tell where to look for the libraries, but for now we'll just copy them to <code>/usr/lib</code>:</p>
|
|
<table class="pre"><tr><td class="snippet"><pre class="fssnip"><code lang="sh">sudo cp packages/MathNet.Numerics.MKL.Linux-x64.1.3.0/content/libiomp5.so /usr/lib/
|
|
sudo cp packages/MathNet.Numerics.MKL.Linux-x64.1.3.0/content/libMathNetNumercisMKL.dll /usr/lib/
|
|
</code></pre></td></tr></table>
|
|
<p>Then we're all set and can just call <code>Control.UseNativeMKL()</code> if we want to use the native provider.
|
|
Let's create the following C# file <code>Example.cs</code>:</p>
|
|
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">using</span> System;
|
|
<span class="k">using</span> System.Diagnostics;
|
|
<span class="k">using</span> MathNet.Numerics;
|
|
<span class="k">using</span> MathNet.Numerics.LinearAlgebra;
|
|
|
|
<span class="k">class</span> Program
|
|
{
|
|
<span class="k">static</span> <span class="k">void</span> Main(<span class="k">string</span>[] args)
|
|
{
|
|
<span class="c">// Using managed code only</span>
|
|
Control.UseManaged();
|
|
Console.WriteLine(Control.LinearAlgebraProvider);
|
|
|
|
<span class="k">var</span> m <span class="o">=</span> Matrix<<span class="k">double</span>>.Build.Random(<span class="n">500</span>, <span class="n">500</span>);
|
|
<span class="k">var</span> v <span class="o">=</span> Vector<<span class="k">double</span>>.Build.Random(<span class="n">500</span>);
|
|
|
|
<span class="k">var</span> w <span class="o">=</span> Stopwatch.StartNew();
|
|
<span class="k">var</span> y<span class="n">1</span> <span class="o">=</span> m.Solve(v);
|
|
Console.WriteLine(w.Elapsed);
|
|
Console.WriteLine(y<span class="n">1</span>);
|
|
|
|
<span class="c">// Using the Intel MKL native provider</span>
|
|
Control.UseNativeMKL();
|
|
Console.WriteLine(Control.LinearAlgebraProvider);
|
|
|
|
w.Restart();
|
|
<span class="k">var</span> y<span class="n">2</span> <span class="o">=</span> m.Solve(v);
|
|
Console.WriteLine(w.Elapsed);
|
|
Console.WriteLine(y<span class="n">2</span>);
|
|
}
|
|
}
|
|
</code></pre></td></tr></table>
|
|
<p>Compile and run:</p>
|
|
<table class="pre"><tr><td class="snippet"><pre class="fssnip"><code lang="sh"># single line:
|
|
mcs -optimize -lib:packages/MathNet.Numerics.3.0.0-alpha8/lib/net40/
|
|
-r:MathNet.Numerics.dll Example.cs -out:Example
|
|
# launch:
|
|
mono Example
|
|
</code></pre></td></tr></table>
|
|
<h2><a name="Licensing-Restrictions" class="anchor" href="#Licensing-Restrictions">Licensing Restrictions</a></h2>
|
|
<p>Be aware that unlike the core of Math.NET Numerics including the native wrapper, which are both
|
|
open source under the terms of the MIT/X11 license, the Intel MKL binaries themselves are closed
|
|
source and non-free.</p>
|
|
<p>The Math.NET Numerics project does own an Intel MKL license (for Windows, no longer for Linux) and
|
|
thus does have the right to distribute it along Math.NET Numerics. You can therefore use the Math.NET
|
|
Numerics MKL native provider for free for your own use. However, it does <em>not</em> give you any right to
|
|
redistribute it again yourself to customers of your own product. <strong>If you need to redistribute,
|
|
buy a license from Intel. If unsure, contact the Intel sales team to clarify.</strong></p>
|
|
|
|
<div class="fsdocs-tip" id="fs1">Namespace Microsoft.FSharp.Control</div>
|
|
<div class="fsdocs-tip" id="fs2">Namespace System</div>
|
|
<div class="fsdocs-tip" id="fs3">Namespace System.IO</div>
|
|
<div class="fsdocs-tip" id="fs4">type Path =
|
|
static member ChangeExtension : path: string * extension: string -> string
|
|
static member Combine : path1: string * path2: string -> string + 3 Überladungen
|
|
static member EndsInDirectorySeparator : path: ReadOnlySpan<char> -> bool + 1 Überladung
|
|
static member GetDirectoryName : path: ReadOnlySpan<char> -> ReadOnlySpan<char> + 1 Überladung
|
|
static member GetExtension : path: ReadOnlySpan<char> -> ReadOnlySpan<char> + 1 Überladung
|
|
static member GetFileName : path: ReadOnlySpan<char> -> ReadOnlySpan<char> + 1 Überladung
|
|
static member GetFileNameWithoutExtension : path: ReadOnlySpan<char> -> ReadOnlySpan<char> + 1 Überladung
|
|
static member GetFullPath : path: string -> string + 1 Überladung
|
|
static member GetInvalidFileNameChars : unit -> char []
|
|
static member GetInvalidPathChars : unit -> char []
|
|
...<br /><em><summary>Performs operations on <see cref="T:System.String" /> instances that contain file or directory path information. These operations are performed in a cross-platform manner.</summary></em></div>
|
|
<div class="fsdocs-tip" id="fs5">Path.Combine([<System.ParamArray>] paths: string []) : string<br />Path.Combine(path1: string, path2: string) : string<br />Path.Combine(path1: string, path2: string, path3: string) : string<br />Path.Combine(path1: string, path2: string, path3: string, path4: string) : string</div>
|
|
|
|
</div>
|
|
<!-- BEGIN SEARCH BOX: this adds support for the search box -->
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/JavaScript-autoComplete/1.0.4/auto-complete.css" />
|
|
<script type="text/javascript">var fsdocs_search_baseurl = 'https://numerics.mathdotnet.com/';</script>
|
|
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/lunr.js/2.3.8/lunr.min.js"></script>
|
|
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/JavaScript-autoComplete/1.0.4/auto-complete.min.js"></script>
|
|
<script type="text/javascript" src="https://numerics.mathdotnet.com/content/fsdocs-search.js"></script>
|
|
<!-- END SEARCH BOX: this adds support for the search box -->
|
|
</div>
|
|
</body>
|
|
|
|
</html>
|
|
|