Browse Source

Math.NET Numerics: 5.0.0-alpha02 docs update

gh-pages
Christoph Ruegg 5 years ago
parent
commit
ae6743c1a1
  1. 400
      Build.html
  2. 297
      CSV.html
  3. 281
      Compatibility.html
  4. 275
      Constants.html
  5. 281
      Contributing.html
  6. 275
      Contributors.html
  7. 538
      DescriptiveStatistics.html
  8. 351
      Distance.html
  9. BIN
      DistanceCanberra.png
  10. BIN
      DistanceChebyshev.png
  11. BIN
      DistanceCosine.png
  12. BIN
      DistanceEuclidean.png
  13. BIN
      DistanceMAE.png
  14. BIN
      DistanceMSE.png
  15. BIN
      DistanceManhattan.png
  16. BIN
      DistanceMinkowski3.png
  17. BIN
      DistancePearson.png
  18. BIN
      DistanceSAD.png
  19. BIN
      DistanceSSD.png
  20. 85
      Dockerfile
  21. 307
      Euclid.html
  22. 284
      Functions.html
  23. 418
      Generate.html
  24. 517
      IFsharpNotebook.html
  25. BIN
      IfSharp-GenerateIS.png
  26. BIN
      IfSharp-MatrixVector.png
  27. 291
      IntegralTransforms.html
  28. 384
      Integration.html
  29. 281
      Interpolation.html
  30. 346
      LinearEquations.html
  31. 400
      MKL.html
  32. 329
      MatlabFiles.html
  33. 804
      Matrix.html
  34. 291
      MatrixMarket.html
  35. 14
      NuGet.config
  36. 281
      Packages.html
  37. 638
      Probability.html
  38. 495
      Random.html
  39. 373
      Regression.html
  40. 281
      ReleaseNotes-MKL.html
  41. 281
      ReleaseNotes-OpenBLAS.html
  42. 275
      ReleaseNotes.html
  43. 275
      Users.html
  44. 5
      content/fsdocs-custom.css
  45. 594
      content/fsdocs-default.css
  46. 84
      content/fsdocs-search.js
  47. 54
      content/fsdocs-tips.js
  48. BIN
      content/img/copy-md-hover.png
  49. BIN
      content/img/copy-md.png
  50. BIN
      content/img/copy-xml-hover.png
  51. BIN
      content/img/copy-xml.png
  52. BIN
      content/img/github-hover.png
  53. BIN
      content/img/github.png
  54. 77
      content/navbar-fixed-left.css
  55. 78
      content/navbar-fixed-right.css
  56. 414
      index.html
  57. 1
      index.json
  58. BIN
      logo.png

400
Build.html

@ -1,63 +1,138 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>Building Math.NET Numerics
<head>
<meta charset="utf-8">
<title>Building Math.NET Numerics
</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta name="description" content="Math.NET Numerics, providing methods and algorithms for numerical computations in science, engineering and every day use. .Net 4, .Net 3.5, SL5, Win8, WP8, PCL 47 and 136, Mono, Xamarin Android/iOS."/>
<meta name="author" content="Christoph Ruegg, Marcus Cuda, Jurgen Van Gael"/>
<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 src="https://code.jquery.com/jquery-1.8.0.js"></script>
<script src="https://code.jquery.com/ui/1.8.23/jquery-ui.js"></script>
<script src="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/js/bootstrap.min.js"></script>
<link href="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap-combined.min.css" rel="stylesheet"/>
<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 type="text/css" rel="stylesheet" href="https://numerics.mathdotnet.com/content/style.css" />
<style>
#main table:not(.pre) {
border: 1px solid #dddddd;
max-width: 100%;
border-style: solid;
border-width: 1px;
border-color: gray;
border-collapse: collapse;
border-right-width: 1px;
border-bottom-width: 1px;
margin-top: 15px;
margin-bottom: 25px;
}
#main table:not(.pre) th, #main table:not(.pre) td {
border: 1px solid #dddddd;
padding: 6px;
}
#main table:not(.pre) th p, #main table:not(.pre) td p {
margin-bottom: 5px;
}
</style>
<script type="text/javascript" src="https://numerics.mathdotnet.com/content/tips.js"></script>
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<![endif]-->
<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>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
</head>
<body>
<div class="container">
<div class="masthead">
<ul class="nav nav-pills pull-right">
<li><a href="https://www.mathdotnet.com">Math.NET Project</a></li>
<li><a href="https://numerics.mathdotnet.com">Math.NET Numerics</a></li>
<li><a href="https://github.com/mathnet/mathnet-numerics">GitHub</a></li>
</ul>
<h3 class="muted">Math.NET Numerics</h3>
<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>
<hr />
<div class="row">
<div class="span9" id="main">
<h1><a name="Building-Math-NET-Numerics" class="anchor" href="#Building-Math-NET-Numerics">Building Math.NET Numerics</a></h1>
<!-- 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">Floating-Point Numbers</li>
<li class="nav-item">Arbitrary Precision Numbers</li>
<li class="nav-item">Complex Numbers</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">Differentiation</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">Transformation</li>
<li class="nav-item">Fourier Transform (FFT)</li>
<li class="nav-item">Filtering & DSP</li>
<li class="nav-item">Window Functions</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-item">Nonlinear Root Finding</li>
<li class="nav-header">Optimization</li>
<li class="nav-item">Linear Least Squares</li>
<li class="nav-item">Nonlinear 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-item">Interpolation</li>
<li class="nav-item">Fourier Approximation</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://www.mathdotnet.com">Math.NET Project</a> |
<a href="https://numerics.mathdotnet.com">Math.NET Numerics</a> |
<a href="https://github.com/mathnet/mathnet-numerics">GitHub</a>
</h3>
</div>
<hr />
<div class="container" id="fsdocs-content">
<h1><a name="Building-Math-NET-Numerics" class="anchor" href="#Building-Math-NET-Numerics">Building Math.NET Numerics</a></h1>
<p>If you do not want to use the official binaries, or if you like to modify,
debug or contribute, you can compile locally either using Visual Studio or
manually with the build scripts.</p>
@ -75,52 +150,30 @@ may fail to compile or provide correct IntelliSense.</p>
<p>Instead of a compatible IDE you can also build the solutions directly with
the .NET Core SDK build tools. You may need to run <code>restore.cmd</code> or <code>restore.sh</code>
before, once after every git checkout in order to restore the dependencies.</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="i">restore</span><span class="o">.</span><span class="i">cmd</span> (<span class="k">or</span> <span class="o">.</span><span class="o">/</span><span class="i">restore</span><span class="o">.</span><span class="i">sh</span>)
<span class="i">dotnet</span> <span class="i">build</span> <span class="i">MathNet</span><span class="o">.</span><span class="i">Numerics</span><span class="o">.</span><span class="i">sln</span>
</code></pre></td>
</tr>
</table>
<pre class="fssnip highlighted"><code lang="fsharp"><span class="id">restore</span><span class="pn">.</span><span class="id">cmd</span> <span class="pn">(</span><span class="k">or</span> <span class="pn">.</span><span class="o">/</span><span class="id">restore</span><span class="pn">.</span><span class="id">sh</span><span class="pn">)</span>
<span class="id">dotnet</span> <span class="id">build</span> <span class="id">MathNet</span><span class="pn">.</span><span class="id">Numerics</span><span class="pn">.</span><span class="id">sln</span>
</code></pre>
<h2><a name="FAKE" class="anchor" href="#FAKE">FAKE</a></h2>
<p>The fully automated build including unit tests, documentation and api
reference, NuGet and Zip packages is using <a href="https://fsharp.github.io/FAKE/">FAKE</a>.</p>
<p>FAKE itself is not included in the repository but it will download and bootstrap
itself automatically when build.cmd is run the first time. Note that this step
is <em>not</em> required when using Visual Studio or the .NET Core SDK directly.</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l"> 1: </span>
<span class="l"> 2: </span>
<span class="l"> 3: </span>
<span class="l"> 4: </span>
<span class="l"> 5: </span>
<span class="l"> 6: </span>
<span class="l"> 7: </span>
<span class="l"> 8: </span>
<span class="l"> 9: </span>
<span class="l">10: </span>
<span class="l">11: </span>
<span class="l">12: </span>
<span class="l">13: </span>
<span class="l">14: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="o">.</span><span class="o">/</span><span class="i">build</span><span class="o">.</span><span class="i">sh</span> # <span class="i">normal</span> <span class="i">build</span> <span class="k">and</span> <span onmouseout="hideTip(event, 'fs1', 1)" onmouseover="showTip(event, 'fs1', 1)" class="i">unit</span> <span class="i">tests</span>, <span class="k">when</span> <span onmouseout="hideTip(event, 'fs2', 2)" onmouseover="showTip(event, 'fs2', 2)" class="i">using</span> <span class="i">bash</span> <span class="i">shell</span> <span class="i">on</span> <span class="i">Windows</span> <span class="k">or</span> <span class="i">Linux</span><span class="o">.</span>
<span class="i">build</span><span class="o">.</span><span class="i">cmd</span> # <span class="i">normal</span> <span class="i">build</span> <span class="k">and</span> <span onmouseout="hideTip(event, 'fs1', 3)" onmouseover="showTip(event, 'fs1', 3)" class="i">unit</span> <span class="i">tests</span>, <span class="k">when</span> <span onmouseout="hideTip(event, 'fs2', 4)" onmouseover="showTip(event, 'fs2', 4)" class="i">using</span> <span class="i">Windows</span> <span class="i">CMD</span> <span class="i">shell</span><span class="o">.</span>
<pre class="fssnip highlighted"><code lang="fsharp"><span class="pn">.</span><span class="o">/</span><span class="id">build</span><span class="pn">.</span><span class="id">sh</span> <span class="pn">#</span> <span class="id">normal</span> <span class="id">build</span> <span class="k">and</span> <span onmouseout="hideTip(event, 'fs1', 1)" onmouseover="showTip(event, 'fs1', 1)" class="id">unit</span> <span class="id">tests</span><span class="pn">,</span> <span class="k">when</span> <span onmouseout="hideTip(event, 'fs2', 2)" onmouseover="showTip(event, 'fs2', 2)" class="id">using</span> <span class="id">bash</span> <span class="id">shell</span> <span class="id">on</span> <span class="id">Windows</span> <span class="k">or</span> <span class="id">Linux</span><span class="pn">.</span>
<span class="id">build</span><span class="pn">.</span><span class="id">cmd</span> <span class="pn">#</span> <span class="id">normal</span> <span class="id">build</span> <span class="k">and</span> <span onmouseout="hideTip(event, 'fs1', 3)" onmouseover="showTip(event, 'fs1', 3)" class="id">unit</span> <span class="id">tests</span><span class="pn">,</span> <span class="k">when</span> <span onmouseout="hideTip(event, 'fs2', 4)" onmouseover="showTip(event, 'fs2', 4)" class="id">using</span> <span class="id">Windows</span> <span class="id">CMD</span> <span class="id">shell</span><span class="pn">.</span>
<span class="o">.</span><span class="o">/</span><span class="i">build</span><span class="o">.</span><span class="i">sh</span> <span class="i">build</span> # <span class="i">normal</span> <span class="i">build</span>
<span class="o">.</span><span class="o">/</span><span class="i">build</span><span class="o">.</span><span class="i">sh</span> <span class="i">build</span> <span class="i">strongname</span> # <span class="i">normal</span> <span class="i">build</span> <span class="k">and</span> <span class="i">also</span> <span class="i">build</span> <span class="i">strong</span><span class="o">-</span><span class="i">named</span> <span class="i">variant</span>
<span class="pn">.</span><span class="o">/</span><span class="id">build</span><span class="pn">.</span><span class="id">sh</span> <span class="id">build</span> <span class="pn">#</span> <span class="id">normal</span> <span class="id">build</span>
<span class="pn">.</span><span class="o">/</span><span class="id">build</span><span class="pn">.</span><span class="id">sh</span> <span class="id">build</span> <span class="id">strongname</span> <span class="pn">#</span> <span class="id">normal</span> <span class="id">build</span> <span class="k">and</span> <span class="id">also</span> <span class="id">build</span> <span class="id">strong</span><span class="o">-</span><span class="id">named</span> <span class="id">variant</span>
<span class="o">.</span><span class="o">/</span><span class="i">build</span><span class="o">.</span><span class="i">sh</span> <span class="i">test</span> # <span class="i">normal</span> <span class="i">build</span>, <span class="i">run</span> <span onmouseout="hideTip(event, 'fs1', 5)" onmouseover="showTip(event, 'fs1', 5)" class="i">unit</span> <span class="i">tests</span>
<span class="o">.</span><span class="o">/</span><span class="i">build</span><span class="o">.</span><span class="i">sh</span> <span class="i">test</span> <span class="i">quick</span> # <span class="i">normal</span> <span class="i">build</span>, <span class="i">run</span> <span onmouseout="hideTip(event, 'fs1', 6)" onmouseover="showTip(event, 'fs1', 6)" class="i">unit</span> <span class="i">tests</span> <span class="i">except</span> <span class="i">long</span> <span class="i">running</span> <span class="i">ones</span>
<span class="pn">.</span><span class="o">/</span><span class="id">build</span><span class="pn">.</span><span class="id">sh</span> <span class="id">test</span> <span class="pn">#</span> <span class="id">normal</span> <span class="id">build</span><span class="pn">,</span> <span class="id">run</span> <span onmouseout="hideTip(event, 'fs1', 5)" onmouseover="showTip(event, 'fs1', 5)" class="id">unit</span> <span class="id">tests</span>
<span class="pn">.</span><span class="o">/</span><span class="id">build</span><span class="pn">.</span><span class="id">sh</span> <span class="id">test</span> <span class="id">quick</span> <span class="pn">#</span> <span class="id">normal</span> <span class="id">build</span><span class="pn">,</span> <span class="id">run</span> <span onmouseout="hideTip(event, 'fs1', 6)" onmouseover="showTip(event, 'fs1', 6)" class="id">unit</span> <span class="id">tests</span> <span class="id">except</span> <span class="id">long</span> <span class="id">running</span> <span class="id">ones</span>
<span class="o">.</span><span class="o">/</span><span class="i">build</span><span class="o">.</span><span class="i">sh</span> <span class="i">clean</span> # <span class="i">cleanup</span> <span class="i">build</span> <span class="i">artifacts</span>
<span class="o">.</span><span class="o">/</span><span class="i">build</span><span class="o">.</span><span class="i">sh</span> <span class="i">docs</span> # <span class="i">generate</span> <span class="i">documentation</span>
<span class="o">.</span><span class="o">/</span><span class="i">build</span><span class="o">.</span><span class="i">sh</span> <span class="i">api</span> # <span class="i">generate</span> <span class="i">api</span> <span class="i">reference</span>
<span class="pn">.</span><span class="o">/</span><span class="id">build</span><span class="pn">.</span><span class="id">sh</span> <span class="id">clean</span> <span class="pn">#</span> <span class="id">cleanup</span> <span class="id">build</span> <span class="id">artifacts</span>
<span class="pn">.</span><span class="o">/</span><span class="id">build</span><span class="pn">.</span><span class="id">sh</span> <span class="id">docs</span> <span class="pn">#</span> <span class="id">generate</span> <span class="id">documentation</span>
<span class="pn">.</span><span class="o">/</span><span class="id">build</span><span class="pn">.</span><span class="id">sh</span> <span class="id">api</span> <span class="pn">#</span> <span class="id">generate</span> <span class="id">api</span> <span class="id">reference</span>
<span class="o">.</span><span class="o">/</span><span class="i">build</span><span class="o">.</span><span class="i">sh</span> <span class="i">all</span> # <span class="i">build</span>, <span class="i">test</span>, <span class="i">docs</span>, <span class="i">api</span> <span class="i">reference</span>
</code></pre></td>
</tr>
</table>
<span class="pn">.</span><span class="o">/</span><span class="id">build</span><span class="pn">.</span><span class="id">sh</span> <span class="id">all</span> <span class="pn">#</span> <span class="id">build</span><span class="pn">,</span> <span class="id">test</span><span class="pn">,</span> <span class="id">docs</span><span class="pn">,</span> <span class="id">api</span> <span class="id">reference</span>
</code></pre>
<p>If the build or tests fail claiming that FSharp.Core was not be found, see
<a href="https://fsharp.org/use/windows/">fsharp.org</a> or install the
<a href="https://go.microsoft.com/fwlink/?LinkId=261286">Visual F# 3.0 Tools</a> directly.</p>
@ -156,30 +209,12 @@ first add a new release header and change notes on top of the <code>RELEASENOTES
document in the root directory. The fake builds pick this up and propagate it
to the assembly info files automatically.</p>
<p>The build can then be launched by calling:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="o">.</span><span class="o">/</span><span class="i">build</span><span class="o">.</span><span class="i">sh</span> <span class="i">all</span>
</code></pre></td>
</tr>
</table>
<pre class="fssnip highlighted"><code lang="fsharp"><span class="pn">.</span><span class="o">/</span><span class="id">build</span><span class="pn">.</span><span class="id">sh</span> <span class="id">all</span>
</code></pre>
<p>The build script will print the current version as part of the the header banner,
which is also included in the release notes document in the build artifacts.
Example:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l"> 1: </span>
<span class="l"> 2: </span>
<span class="l"> 3: </span>
<span class="l"> 4: </span>
<span class="l"> 5: </span>
<span class="l"> 6: </span>
<span class="l"> 7: </span>
<span class="l"> 8: </span>
<span class="l"> 9: </span>
<span class="l">10: </span>
<span class="l">11: </span>
<span class="l">12: </span>
<span class="l">13: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="c">// __ __ _ _ _ _ ______ _______</span>
<pre class="fssnip highlighted"><code lang="fsharp"><span class="c">// __ __ _ _ _ _ ______ _______</span>
<span class="c">// | \/ | | | | | | \ | | ____|__ __|</span>
<span class="c">// | \ / | __ _| |_| |__ | \| | |__ | |</span>
<span class="c">// | |\/| |/ _` | __| &#39;_ \ | . ` | __| | |</span>
@ -192,9 +227,7 @@ Example:</p>
<span class="c">// Math.NET Numerics v3.5.0</span>
<span class="c">// Math.NET Numerics MKL Provider v1.7.0</span>
<span class="c">// Math.NET Numerics Data Extensions v3.1.0</span>
</code></pre></td>
</tr>
</table>
</code></pre>
<p>The artifacts are then ready in the <code>out/packages</code> directory.</p>
<h2><a name="Extra-Packages" class="anchor" href="#Extra-Packages">Extra Packages</a></h2>
<p>In addition to the core package this repository also include extra packages
@ -218,16 +251,10 @@ Visual Studio 2019, with the following options
</li>
</ul>
<p>The build can then be triggered by calling:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="o">.</span><span class="o">/</span><span class="i">build</span><span class="o">.</span><span class="i">sh</span> <span class="i">MklWinBuild</span> <span class="c">// build both 32 and 64 bit variants</span>
<span class="o">.</span><span class="o">/</span><span class="i">build</span><span class="o">.</span><span class="i">sh</span> <span class="i">MklTest</span> <span class="c">// run all tests with the MKL provider enforced</span>
<span class="o">.</span><span class="o">/</span><span class="i">build</span><span class="o">.</span><span class="i">sh</span> <span class="i">MklWinAll</span> <span class="c">// build and run tests</span>
</code></pre></td>
</tr>
</table>
<pre class="fssnip highlighted"><code lang="fsharp"><span class="pn">.</span><span class="o">/</span><span class="id">build</span><span class="pn">.</span><span class="id">sh</span> <span class="id">MklWinBuild</span> <span class="c">// build both 32 and 64 bit variants</span>
<span class="pn">.</span><span class="o">/</span><span class="id">build</span><span class="pn">.</span><span class="id">sh</span> <span class="id">MklTest</span> <span class="c">// run all tests with the MKL provider enforced</span>
<span class="pn">.</span><span class="o">/</span><span class="id">build</span><span class="pn">.</span><span class="id">sh</span> <span class="id">MklWinAll</span> <span class="c">// build and run tests</span>
</code></pre>
<p>If you run into an error with <code>mkl_link_tool.exe</code> you may need to patch a targets file,
see <a href="https://software.intel.com/en-us/forums/intel-math-kernel-library/topic/851578">MKL 2020.1, VS2019 linking bug </a>.</p>
<p>The build puts the binaries to <code>out/MKL/Windows/x64</code> (and <code>x86</code>), the NuGet package
@ -240,30 +267,18 @@ this is also what the unit tests do when you run the <code>MklTest</code> build
<li><p>Update <code>CONTRIBUTORS.md</code> file (via <code>git shortlog -sn</code>)</p></li>
<li>
<p>Build Release:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="i">build</span><span class="o">.</span><span class="i">sh</span> <span class="i">all</span> <span class="i">strongname</span>
</code></pre></td>
</tr>
</table>
<pre class="fssnip highlighted"><code lang="fsharp"><span class="id">build</span><span class="pn">.</span><span class="id">sh</span> <span class="id">all</span> <span class="id">strongname</span>
</code></pre>
</li>
<li>Commit and push release notes and (auto-updated) assembly info files with new "Release: v1.2.3" commit</li>
<li>
<p>Publish Release:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
<span class="l">4: </span>
<span class="l">5: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="i">build</span><span class="o">.</span><span class="i">sh</span> <span class="i">PublishDocs</span>
<span class="i">build</span><span class="o">.</span><span class="i">sh</span> <span class="i">PublishApi</span>
<span class="i">build</span><span class="o">.</span><span class="i">sh</span> <span class="i">PublishTag</span>
<span class="i">build</span><span class="o">.</span><span class="i">sh</span> <span class="i">PublishArchive</span>
<span class="i">build</span><span class="o">.</span><span class="i">sh</span> <span class="i">PublishNuGet</span>
</code></pre></td>
</tr>
</table>
<pre class="fssnip highlighted"><code lang="fsharp"><span class="id">build</span><span class="pn">.</span><span class="id">sh</span> <span class="id">PublishDocs</span>
<span class="id">build</span><span class="pn">.</span><span class="id">sh</span> <span class="id">PublishApi</span>
<span class="id">build</span><span class="pn">.</span><span class="id">sh</span> <span class="id">PublishTag</span>
<span class="id">build</span><span class="pn">.</span><span class="id">sh</span> <span class="id">PublishArchive</span>
<span class="id">build</span><span class="pn">.</span><span class="id">sh</span> <span class="id">PublishNuGet</span>
</code></pre>
</li>
<li><p>Consider a tweet via <a href="https://twitter.com/MathDotNet">@MathDotNet</a></p></li>
<li>
@ -273,90 +288,21 @@ this is also what the unit tests do when you run the <code>MklTest</code> build
</li>
</ul>
<div class="tip" id="fs1">type unit = Unit<br /><br />Full name: Microsoft.FSharp.Core.unit</div>
<div class="tip" id="fs2">val using : resource:&#39;T -&gt; action:(&#39;T -&gt; &#39;U) -&gt; &#39;U (requires &#39;T :&gt; System.IDisposable)<br /><br />Full name: Microsoft.FSharp.Core.Operators.using</div>
<div class="fsdocs-tip" id="fs1">type unit = Unit<br /><em>&lt;summary&gt;The type &#39;unit&#39;, which has only one value &quot;()&quot;. This value is special and
always uses the representation &#39;null&#39;.&lt;/summary&gt;<br />&lt;category index=&quot;1&quot;&gt;Basic Types&lt;/category&gt;</em></div>
<div class="fsdocs-tip" id="fs2">val using : resource:&#39;T -&gt; action:(&#39;T -&gt; &#39;U) -&gt; &#39;U (requires &#39;T :&gt; System.IDisposable)<br /><em>&lt;summary&gt;Clean up resources associated with the input object after the completion of the given function.
Cleanup occurs even when an exception is raised by the protected
code. &lt;/summary&gt;<br />&lt;param name=&quot;resource&quot;&gt;The resource to be disposed after action is called.&lt;/param&gt;<br />&lt;param name=&quot;action&quot;&gt;The action that accepts the resource.&lt;/param&gt;<br />&lt;returns&gt;The resulting value.&lt;/returns&gt;</em></div>
</div>
<div class="span3">
<ul class="nav nav-list" id="menu">
<li class="nav-header">Math.NET Numerics</li>
<li><a href="https://numerics.mathdotnet.com/Packages.html">NuGet & Binaries</a></li>
<li><a href="https://numerics.mathdotnet.com/ReleaseNotes.html">Release Notes</a></li>
<li><a href="https://numerics.mathdotnet.com/License.html">MIT License</a></li>
<li><a href="https://numerics.mathdotnet.com/Compatibility.html">Platform Support</a></li>
<li><a href="https://numerics.mathdotnet.com/api/">Class Reference</a></li>
<li><a href="https://github.com/mathnet/mathnet-numerics/issues">Issues & Bugs</a></li>
<li><a href="https://numerics.mathdotnet.com/Users.html">Who is using Math.NET?</a></li>
<li class="nav-header">Contributing</li>
<li><a href="https://numerics.mathdotnet.com/Contributors.html">Contributors</a></li>
<li><a href="https://numerics.mathdotnet.com/Contributing.html">Contributing</a></li>
<li><a href="https://numerics.mathdotnet.com/Build.html">Build & Tools</a></li>
<li><a href="http://feedback.mathdotnet.com/forums/2060-math-net-numerics">Your Ideas</a></li>
<li class="nav-header">Getting Help</li>
<li><a href="https://discuss.mathdotnet.com/c/numerics">Discuss</a></li>
<li><a href="https://stackoverflow.com/questions/tagged/mathdotnet">Stack Overflow</a></li>
<li class="nav-header">Getting Started</li>
<li><a href="https://numerics.mathdotnet.com/">Getting started</a></li>
<li><a href="https://numerics.mathdotnet.com/Constants.html">Constants</a></li>
<li>Floating-Point Numbers</li>
<li>Arbitrary Precision Numbers</li>
<li>Complex Numbers</li>
<li><a href="https://numerics.mathdotnet.com/Matrix.html">Matrices and Vectors</a></li>
<li><a href="https://numerics.mathdotnet.com/Euclid.html">Euclid & Number Theory</a></li>
<li>Combinatorics</li>
<li class="nav-header">Evaluation</li>
<li><a href="https://numerics.mathdotnet.com/Functions.html">Special Functions</a></li>
<li>Differentiation</li>
<li><a href="https://numerics.mathdotnet.com/Integration.html">Integration</a></li>
<li class="nav-header">Statistics/Probability</li>
<li><a href="https://numerics.mathdotnet.com/DescriptiveStatistics.html">Descriptive Statistics</a></li>
<li><a href="https://numerics.mathdotnet.com/Probability.html">Probability Distributions</a></li>
<li class="nav-header">Generation</li>
<li><a href="https://numerics.mathdotnet.com/Generate.html">Generating Data</a></li>
<li><a href="https://numerics.mathdotnet.com/Random.html">Random Numbers</a></li>
<li class="nav-header">Transformation</li>
<li>Fourier Transform (FFT)</li>
<li>Filtering & DSP</li>
<li>Window Functions</li>
<li class="nav-header">Solving Equations</li>
<li><a href="https://numerics.mathdotnet.com/LinearEquations.html">Linear Equation Systems</a></li>
<li>Nonlinear Root Finding</li>
<li class="nav-header">Optimization</li>
<li>Linear Least Squares</li>
<li>Nonlinear Optimization</li>
<li><a href="https://numerics.mathdotnet.com/Distance.html">Distance Metrics</a></li>
<li class="nav-header">Curve Fitting</li>
<li><a href="https://numerics.mathdotnet.com/Regression.html">Regression</a></li>
<li>Interpolation</li>
<li>Fourier Approximation</li>
<li class="nav-header">Native Providers</li>
<li><a href="https://numerics.mathdotnet.com/MKL.html">Intel MKL</a></li>
<li class="nav-header">Working Together</li>
<li><a href="https://numerics.mathdotnet.com/CSV.html">Delimited Text Files (CSV)</a></li>
<li><a href="https://numerics.mathdotnet.com/MatrixMarket.html">NIST MatrixMarket</a></li>
<li><a href="https://numerics.mathdotnet.com/MatlabFiles.html">MATLAB</a></li>
<li><a href="https://numerics.mathdotnet.com/IFSharpNotebook.html">IF# Notebook</a></li>
<li>FsLab & Deedle</li>
<li>Microsoft Excel</li>
<li>numl.net machine learning</li>
<li>R-project</li>
</ul>
</div>
</div>
</div>
</body>
<!-- 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>

297
CSV.html

@ -1,72 +1,143 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>Delimited Text Files (CSV &amp; TSV)
<head>
<meta charset="utf-8">
<title>Delimited Text Files (CSV &amp; TSV)
</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta name="description" content="Math.NET Numerics, providing methods and algorithms for numerical computations in science, engineering and every day use. .Net 4, .Net 3.5, SL5, Win8, WP8, PCL 47 and 136, Mono, Xamarin Android/iOS."/>
<meta name="author" content="Christoph Ruegg, Marcus Cuda, Jurgen Van Gael"/>
<script src="https://code.jquery.com/jquery-1.8.0.js"></script>
<script src="https://code.jquery.com/ui/1.8.23/jquery-ui.js"></script>
<script src="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/js/bootstrap.min.js"></script>
<link href="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap-combined.min.css" rel="stylesheet"/>
<link type="text/css" rel="stylesheet" href="https://numerics.mathdotnet.com/content/style.css" />
<style>
#main table:not(.pre) {
border: 1px solid #dddddd;
max-width: 100%;
border-style: solid;
border-width: 1px;
border-color: gray;
border-collapse: collapse;
border-right-width: 1px;
border-bottom-width: 1px;
margin-top: 15px;
margin-bottom: 25px;
}
#main table:not(.pre) th, #main table:not(.pre) td {
border: 1px solid #dddddd;
padding: 6px;
}
#main table:not(.pre) th p, #main table:not(.pre) td p {
margin-bottom: 5px;
}
</style>
<script type="text/javascript" src="https://numerics.mathdotnet.com/content/tips.js"></script>
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<![endif]-->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
</head>
<body>
<div class="container">
<div class="masthead">
<ul class="nav nav-pills pull-right">
<li><a href="https://www.mathdotnet.com">Math.NET Project</a></li>
<li><a href="https://numerics.mathdotnet.com">Math.NET Numerics</a></li>
<li><a href="https://github.com/mathnet/mathnet-numerics">GitHub</a></li>
</ul>
<h3 class="muted">Math.NET Numerics</h3>
<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>
<hr />
<div class="row">
<div class="span9" id="main">
<h1><a name="Delimited-Text-Files-CSV-amp-TSV" class="anchor" href="#Delimited-Text-Files-CSV-amp-TSV">Delimited Text Files (CSV &amp; TSV)</a></h1>
<!-- 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">Floating-Point Numbers</li>
<li class="nav-item">Arbitrary Precision Numbers</li>
<li class="nav-item">Complex Numbers</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">Differentiation</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">Transformation</li>
<li class="nav-item">Fourier Transform (FFT)</li>
<li class="nav-item">Filtering & DSP</li>
<li class="nav-item">Window Functions</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-item">Nonlinear Root Finding</li>
<li class="nav-header">Optimization</li>
<li class="nav-item">Linear Least Squares</li>
<li class="nav-item">Nonlinear 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-item">Interpolation</li>
<li class="nav-item">Fourier Approximation</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://www.mathdotnet.com">Math.NET Project</a> |
<a href="https://numerics.mathdotnet.com">Math.NET Numerics</a> |
<a href="https://github.com/mathnet/mathnet-numerics">GitHub</a>
</h3>
</div>
<hr />
<div class="container" id="fsdocs-content">
<h1><a name="Delimited-Text-Files-CSV-amp-TSV" class="anchor" href="#Delimited-Text-Files-CSV-amp-TSV">Delimited Text Files (CSV &amp; TSV)</a></h1>
<p>Likely the most common file format for tabular data, delimited files like CSV store data as text
with one line per row and values within rows separated by a comma.
Such text files are supported by virtually all software that deals with tabular data.</p>
<p>Example:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
</pre></td>
<td class="snippet"><pre class="fssnip"><code lang="text">A,B,C
<table class="pre"><tr><td class="snippet"><pre class="fssnip"><code lang="text">A,B,C
0.5,0.6,98.0
2.0,3.4,5.3
</code></pre></td></tr></table>
@ -91,11 +162,7 @@ you can use this method using a StringReader.
<p>All these functions expect the data type of the matrix to be generated as generic type argument.
Only Double, Single, Complex and Complex32 are supported.</p>
<p>Example:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">using</span> MathNet.Numerics.Data.Text;
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">using</span> MathNet.Numerics.Data.Text;
Matrix&lt;<span class="k">double</span>&gt; matrix <span class="o">=</span> DelimitedReader.Read&lt;<span class="k">double</span>&gt;(<span class="s">"data.csv"</span>, <span class="k">false</span>, <span class="s">","</span>, <span class="k">true</span>);
</code></pre></td></tr></table>
@ -145,9 +212,7 @@ Default: null.
</li>
</ul>
<p>Example:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp">DelimitedWriter.Write(<span class="s">"data.csv"</span>, matrix, <span class="s">","</span>);
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp">DelimitedWriter.Write(<span class="s">"data.csv"</span>, matrix, <span class="s">","</span>);
</code></pre></td></tr></table>
<h2><a name="Alternatives" class="anchor" href="#Alternatives">Alternatives</a></h2>
<p>The data extension packages also offer other ways to serialize a matrix to a binary stream or file.
@ -157,88 +222,16 @@ Among others:</p>
<li><a href="MatlabFiles.html">MATLAB Level-5 Mat files</a></li>
</ul>
</div>
<div class="span3">
<ul class="nav nav-list" id="menu">
<li class="nav-header">Math.NET Numerics</li>
<li><a href="https://numerics.mathdotnet.com/Packages.html">NuGet & Binaries</a></li>
<li><a href="https://numerics.mathdotnet.com/ReleaseNotes.html">Release Notes</a></li>
<li><a href="https://numerics.mathdotnet.com/License.html">MIT License</a></li>
<li><a href="https://numerics.mathdotnet.com/Compatibility.html">Platform Support</a></li>
<li><a href="https://numerics.mathdotnet.com/api/">Class Reference</a></li>
<li><a href="https://github.com/mathnet/mathnet-numerics/issues">Issues & Bugs</a></li>
<li><a href="https://numerics.mathdotnet.com/Users.html">Who is using Math.NET?</a></li>
<li class="nav-header">Contributing</li>
<li><a href="https://numerics.mathdotnet.com/Contributors.html">Contributors</a></li>
<li><a href="https://numerics.mathdotnet.com/Contributing.html">Contributing</a></li>
<li><a href="https://numerics.mathdotnet.com/Build.html">Build & Tools</a></li>
<li><a href="http://feedback.mathdotnet.com/forums/2060-math-net-numerics">Your Ideas</a></li>
<li class="nav-header">Getting Help</li>
<li><a href="https://discuss.mathdotnet.com/c/numerics">Discuss</a></li>
<li><a href="https://stackoverflow.com/questions/tagged/mathdotnet">Stack Overflow</a></li>
<li class="nav-header">Getting Started</li>
<li><a href="https://numerics.mathdotnet.com/">Getting started</a></li>
<li><a href="https://numerics.mathdotnet.com/Constants.html">Constants</a></li>
<li>Floating-Point Numbers</li>
<li>Arbitrary Precision Numbers</li>
<li>Complex Numbers</li>
<li><a href="https://numerics.mathdotnet.com/Matrix.html">Matrices and Vectors</a></li>
<li><a href="https://numerics.mathdotnet.com/Euclid.html">Euclid & Number Theory</a></li>
<li>Combinatorics</li>
<li class="nav-header">Evaluation</li>
<li><a href="https://numerics.mathdotnet.com/Functions.html">Special Functions</a></li>
<li>Differentiation</li>
<li><a href="https://numerics.mathdotnet.com/Integration.html">Integration</a></li>
<li class="nav-header">Statistics/Probability</li>
<li><a href="https://numerics.mathdotnet.com/DescriptiveStatistics.html">Descriptive Statistics</a></li>
<li><a href="https://numerics.mathdotnet.com/Probability.html">Probability Distributions</a></li>
<li class="nav-header">Generation</li>
<li><a href="https://numerics.mathdotnet.com/Generate.html">Generating Data</a></li>
<li><a href="https://numerics.mathdotnet.com/Random.html">Random Numbers</a></li>
<li class="nav-header">Transformation</li>
<li>Fourier Transform (FFT)</li>
<li>Filtering & DSP</li>
<li>Window Functions</li>
<li class="nav-header">Solving Equations</li>
<li><a href="https://numerics.mathdotnet.com/LinearEquations.html">Linear Equation Systems</a></li>
<li>Nonlinear Root Finding</li>
<li class="nav-header">Optimization</li>
<li>Linear Least Squares</li>
<li>Nonlinear Optimization</li>
<li><a href="https://numerics.mathdotnet.com/Distance.html">Distance Metrics</a></li>
<li class="nav-header">Curve Fitting</li>
<li><a href="https://numerics.mathdotnet.com/Regression.html">Regression</a></li>
<li>Interpolation</li>
<li>Fourier Approximation</li>
<li class="nav-header">Native Providers</li>
<li><a href="https://numerics.mathdotnet.com/MKL.html">Intel MKL</a></li>
<li class="nav-header">Working Together</li>
<li><a href="https://numerics.mathdotnet.com/CSV.html">Delimited Text Files (CSV)</a></li>
<li><a href="https://numerics.mathdotnet.com/MatrixMarket.html">NIST MatrixMarket</a></li>
<li><a href="https://numerics.mathdotnet.com/MatlabFiles.html">MATLAB</a></li>
<li><a href="https://numerics.mathdotnet.com/IFSharpNotebook.html">IF# Notebook</a></li>
<li>FsLab & Deedle</li>
<li>Microsoft Excel</li>
<li>numl.net machine learning</li>
<li>R-project</li>
</ul>
</div>
</div>
</div>
</body>
<!-- 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>

281
Compatibility.html

@ -1,63 +1,138 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>Platform Support
<head>
<meta charset="utf-8">
<title>Platform Support
</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta name="description" content="Math.NET Numerics, providing methods and algorithms for numerical computations in science, engineering and every day use. .Net 4, .Net 3.5, SL5, Win8, WP8, PCL 47 and 136, Mono, Xamarin Android/iOS."/>
<meta name="author" content="Christoph Ruegg, Marcus Cuda, Jurgen Van Gael"/>
<script src="https://code.jquery.com/jquery-1.8.0.js"></script>
<script src="https://code.jquery.com/ui/1.8.23/jquery-ui.js"></script>
<script src="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/js/bootstrap.min.js"></script>
<link href="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap-combined.min.css" rel="stylesheet"/>
<link type="text/css" rel="stylesheet" href="https://numerics.mathdotnet.com/content/style.css" />
<style>
#main table:not(.pre) {
border: 1px solid #dddddd;
max-width: 100%;
border-style: solid;
border-width: 1px;
border-color: gray;
border-collapse: collapse;
border-right-width: 1px;
border-bottom-width: 1px;
margin-top: 15px;
margin-bottom: 25px;
}
#main table:not(.pre) th, #main table:not(.pre) td {
border: 1px solid #dddddd;
padding: 6px;
}
#main table:not(.pre) th p, #main table:not(.pre) td p {
margin-bottom: 5px;
}
</style>
<script type="text/javascript" src="https://numerics.mathdotnet.com/content/tips.js"></script>
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<![endif]-->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
</head>
<body>
<div class="container">
<div class="masthead">
<ul class="nav nav-pills pull-right">
<li><a href="https://www.mathdotnet.com">Math.NET Project</a></li>
<li><a href="https://numerics.mathdotnet.com">Math.NET Numerics</a></li>
<li><a href="https://github.com/mathnet/mathnet-numerics">GitHub</a></li>
</ul>
<h3 class="muted">Math.NET Numerics</h3>
<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>
<hr />
<div class="row">
<div class="span9" id="main">
<h1><a name="Platform-Support" class="anchor" href="#Platform-Support">Platform Support</a></h1>
<!-- 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">Floating-Point Numbers</li>
<li class="nav-item">Arbitrary Precision Numbers</li>
<li class="nav-item">Complex Numbers</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">Differentiation</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">Transformation</li>
<li class="nav-item">Fourier Transform (FFT)</li>
<li class="nav-item">Filtering & DSP</li>
<li class="nav-item">Window Functions</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-item">Nonlinear Root Finding</li>
<li class="nav-header">Optimization</li>
<li class="nav-item">Linear Least Squares</li>
<li class="nav-item">Nonlinear 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-item">Interpolation</li>
<li class="nav-item">Fourier Approximation</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://www.mathdotnet.com">Math.NET Project</a> |
<a href="https://numerics.mathdotnet.com">Math.NET Numerics</a> |
<a href="https://github.com/mathnet/mathnet-numerics">GitHub</a>
</h3>
</div>
<hr />
<div class="container" id="fsdocs-content">
<h1><a name="Platform-Support" class="anchor" href="#Platform-Support">Platform Support</a></h1>
<p>Supported Platforms:</p>
<ul>
<li>.NET 5.0 or higher, with builds for 5.0.</li>
@ -76,88 +151,16 @@
<li>F#: additionally <a href="https://www.nuget.org/packages/FSharp.Core">FSharp.Core</a></li>
</ul>
</div>
<div class="span3">
<ul class="nav nav-list" id="menu">
<li class="nav-header">Math.NET Numerics</li>
<li><a href="https://numerics.mathdotnet.com/Packages.html">NuGet & Binaries</a></li>
<li><a href="https://numerics.mathdotnet.com/ReleaseNotes.html">Release Notes</a></li>
<li><a href="https://numerics.mathdotnet.com/License.html">MIT License</a></li>
<li><a href="https://numerics.mathdotnet.com/Compatibility.html">Platform Support</a></li>
<li><a href="https://numerics.mathdotnet.com/api/">Class Reference</a></li>
<li><a href="https://github.com/mathnet/mathnet-numerics/issues">Issues & Bugs</a></li>
<li><a href="https://numerics.mathdotnet.com/Users.html">Who is using Math.NET?</a></li>
<li class="nav-header">Contributing</li>
<li><a href="https://numerics.mathdotnet.com/Contributors.html">Contributors</a></li>
<li><a href="https://numerics.mathdotnet.com/Contributing.html">Contributing</a></li>
<li><a href="https://numerics.mathdotnet.com/Build.html">Build & Tools</a></li>
<li><a href="http://feedback.mathdotnet.com/forums/2060-math-net-numerics">Your Ideas</a></li>
<li class="nav-header">Getting Help</li>
<li><a href="https://discuss.mathdotnet.com/c/numerics">Discuss</a></li>
<li><a href="https://stackoverflow.com/questions/tagged/mathdotnet">Stack Overflow</a></li>
<li class="nav-header">Getting Started</li>
<li><a href="https://numerics.mathdotnet.com/">Getting started</a></li>
<li><a href="https://numerics.mathdotnet.com/Constants.html">Constants</a></li>
<li>Floating-Point Numbers</li>
<li>Arbitrary Precision Numbers</li>
<li>Complex Numbers</li>
<li><a href="https://numerics.mathdotnet.com/Matrix.html">Matrices and Vectors</a></li>
<li><a href="https://numerics.mathdotnet.com/Euclid.html">Euclid & Number Theory</a></li>
<li>Combinatorics</li>
<li class="nav-header">Evaluation</li>
<li><a href="https://numerics.mathdotnet.com/Functions.html">Special Functions</a></li>
<li>Differentiation</li>
<li><a href="https://numerics.mathdotnet.com/Integration.html">Integration</a></li>
<li class="nav-header">Statistics/Probability</li>
<li><a href="https://numerics.mathdotnet.com/DescriptiveStatistics.html">Descriptive Statistics</a></li>
<li><a href="https://numerics.mathdotnet.com/Probability.html">Probability Distributions</a></li>
<li class="nav-header">Generation</li>
<li><a href="https://numerics.mathdotnet.com/Generate.html">Generating Data</a></li>
<li><a href="https://numerics.mathdotnet.com/Random.html">Random Numbers</a></li>
<li class="nav-header">Transformation</li>
<li>Fourier Transform (FFT)</li>
<li>Filtering & DSP</li>
<li>Window Functions</li>
<li class="nav-header">Solving Equations</li>
<li><a href="https://numerics.mathdotnet.com/LinearEquations.html">Linear Equation Systems</a></li>
<li>Nonlinear Root Finding</li>
<li class="nav-header">Optimization</li>
<li>Linear Least Squares</li>
<li>Nonlinear Optimization</li>
<li><a href="https://numerics.mathdotnet.com/Distance.html">Distance Metrics</a></li>
<li class="nav-header">Curve Fitting</li>
<li><a href="https://numerics.mathdotnet.com/Regression.html">Regression</a></li>
<li>Interpolation</li>
<li>Fourier Approximation</li>
<li class="nav-header">Native Providers</li>
<li><a href="https://numerics.mathdotnet.com/MKL.html">Intel MKL</a></li>
<li class="nav-header">Working Together</li>
<li><a href="https://numerics.mathdotnet.com/CSV.html">Delimited Text Files (CSV)</a></li>
<li><a href="https://numerics.mathdotnet.com/MatrixMarket.html">NIST MatrixMarket</a></li>
<li><a href="https://numerics.mathdotnet.com/MatlabFiles.html">MATLAB</a></li>
<li><a href="https://numerics.mathdotnet.com/IFSharpNotebook.html">IF# Notebook</a></li>
<li>FsLab & Deedle</li>
<li>Microsoft Excel</li>
<li>numl.net machine learning</li>
<li>R-project</li>
</ul>
</div>
</div>
</div>
</body>
<!-- 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>

275
Constants.html

@ -1,63 +1,138 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>Constants
<head>
<meta charset="utf-8">
<title>Constants
</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta name="description" content="Math.NET Numerics, providing methods and algorithms for numerical computations in science, engineering and every day use. .Net 4, .Net 3.5, SL5, Win8, WP8, PCL 47 and 136, Mono, Xamarin Android/iOS."/>
<meta name="author" content="Christoph Ruegg, Marcus Cuda, Jurgen Van Gael"/>
<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 src="https://code.jquery.com/jquery-1.8.0.js"></script>
<script src="https://code.jquery.com/ui/1.8.23/jquery-ui.js"></script>
<script src="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/js/bootstrap.min.js"></script>
<link href="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap-combined.min.css" rel="stylesheet"/>
<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 type="text/css" rel="stylesheet" href="https://numerics.mathdotnet.com/content/style.css" />
<style>
#main table:not(.pre) {
border: 1px solid #dddddd;
max-width: 100%;
border-style: solid;
border-width: 1px;
border-color: gray;
border-collapse: collapse;
border-right-width: 1px;
border-bottom-width: 1px;
margin-top: 15px;
margin-bottom: 25px;
}
#main table:not(.pre) th, #main table:not(.pre) td {
border: 1px solid #dddddd;
padding: 6px;
}
#main table:not(.pre) th p, #main table:not(.pre) td p {
margin-bottom: 5px;
}
</style>
<script type="text/javascript" src="https://numerics.mathdotnet.com/content/tips.js"></script>
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<![endif]-->
<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>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
</head>
<body>
<div class="container">
<div class="masthead">
<ul class="nav nav-pills pull-right">
<li><a href="https://www.mathdotnet.com">Math.NET Project</a></li>
<li><a href="https://numerics.mathdotnet.com">Math.NET Numerics</a></li>
<li><a href="https://github.com/mathnet/mathnet-numerics">GitHub</a></li>
</ul>
<h3 class="muted">Math.NET Numerics</h3>
<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>
<hr />
<div class="row">
<div class="span9" id="main">
<h1><a name="Constants" class="anchor" href="#Constants">Constants</a></h1>
<!-- 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">Floating-Point Numbers</li>
<li class="nav-item">Arbitrary Precision Numbers</li>
<li class="nav-item">Complex Numbers</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">Differentiation</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">Transformation</li>
<li class="nav-item">Fourier Transform (FFT)</li>
<li class="nav-item">Filtering & DSP</li>
<li class="nav-item">Window Functions</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-item">Nonlinear Root Finding</li>
<li class="nav-header">Optimization</li>
<li class="nav-item">Linear Least Squares</li>
<li class="nav-item">Nonlinear 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-item">Interpolation</li>
<li class="nav-item">Fourier Approximation</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://www.mathdotnet.com">Math.NET Project</a> |
<a href="https://numerics.mathdotnet.com">Math.NET Numerics</a> |
<a href="https://github.com/mathnet/mathnet-numerics">GitHub</a>
</h3>
</div>
<hr />
<div class="container" id="fsdocs-content">
<h1><a name="Constants" class="anchor" href="#Constants">Constants</a></h1>
<p>Math.NET Numerics contains a set of often used mathematical and scientific
constants. Mathematical and defined scientific constants are as accurate as
double precision allows, while measured constants are implemented according
@ -820,88 +895,16 @@ to 2007 CODATA.</p>
</table>
</div>
<div class="span3">
<ul class="nav nav-list" id="menu">
<li class="nav-header">Math.NET Numerics</li>
<li><a href="https://numerics.mathdotnet.com/Packages.html">NuGet & Binaries</a></li>
<li><a href="https://numerics.mathdotnet.com/ReleaseNotes.html">Release Notes</a></li>
<li><a href="https://numerics.mathdotnet.com/License.html">MIT License</a></li>
<li><a href="https://numerics.mathdotnet.com/Compatibility.html">Platform Support</a></li>
<li><a href="https://numerics.mathdotnet.com/api/">Class Reference</a></li>
<li><a href="https://github.com/mathnet/mathnet-numerics/issues">Issues & Bugs</a></li>
<li><a href="https://numerics.mathdotnet.com/Users.html">Who is using Math.NET?</a></li>
<li class="nav-header">Contributing</li>
<li><a href="https://numerics.mathdotnet.com/Contributors.html">Contributors</a></li>
<li><a href="https://numerics.mathdotnet.com/Contributing.html">Contributing</a></li>
<li><a href="https://numerics.mathdotnet.com/Build.html">Build & Tools</a></li>
<li><a href="http://feedback.mathdotnet.com/forums/2060-math-net-numerics">Your Ideas</a></li>
<li class="nav-header">Getting Help</li>
<li><a href="https://discuss.mathdotnet.com/c/numerics">Discuss</a></li>
<li><a href="https://stackoverflow.com/questions/tagged/mathdotnet">Stack Overflow</a></li>
<li class="nav-header">Getting Started</li>
<li><a href="https://numerics.mathdotnet.com/">Getting started</a></li>
<li><a href="https://numerics.mathdotnet.com/Constants.html">Constants</a></li>
<li>Floating-Point Numbers</li>
<li>Arbitrary Precision Numbers</li>
<li>Complex Numbers</li>
<li><a href="https://numerics.mathdotnet.com/Matrix.html">Matrices and Vectors</a></li>
<li><a href="https://numerics.mathdotnet.com/Euclid.html">Euclid & Number Theory</a></li>
<li>Combinatorics</li>
<li class="nav-header">Evaluation</li>
<li><a href="https://numerics.mathdotnet.com/Functions.html">Special Functions</a></li>
<li>Differentiation</li>
<li><a href="https://numerics.mathdotnet.com/Integration.html">Integration</a></li>
<li class="nav-header">Statistics/Probability</li>
<li><a href="https://numerics.mathdotnet.com/DescriptiveStatistics.html">Descriptive Statistics</a></li>
<li><a href="https://numerics.mathdotnet.com/Probability.html">Probability Distributions</a></li>
<li class="nav-header">Generation</li>
<li><a href="https://numerics.mathdotnet.com/Generate.html">Generating Data</a></li>
<li><a href="https://numerics.mathdotnet.com/Random.html">Random Numbers</a></li>
<li class="nav-header">Transformation</li>
<li>Fourier Transform (FFT)</li>
<li>Filtering & DSP</li>
<li>Window Functions</li>
<li class="nav-header">Solving Equations</li>
<li><a href="https://numerics.mathdotnet.com/LinearEquations.html">Linear Equation Systems</a></li>
<li>Nonlinear Root Finding</li>
<li class="nav-header">Optimization</li>
<li>Linear Least Squares</li>
<li>Nonlinear Optimization</li>
<li><a href="https://numerics.mathdotnet.com/Distance.html">Distance Metrics</a></li>
<li class="nav-header">Curve Fitting</li>
<li><a href="https://numerics.mathdotnet.com/Regression.html">Regression</a></li>
<li>Interpolation</li>
<li>Fourier Approximation</li>
<li class="nav-header">Native Providers</li>
<li><a href="https://numerics.mathdotnet.com/MKL.html">Intel MKL</a></li>
<li class="nav-header">Working Together</li>
<li><a href="https://numerics.mathdotnet.com/CSV.html">Delimited Text Files (CSV)</a></li>
<li><a href="https://numerics.mathdotnet.com/MatrixMarket.html">NIST MatrixMarket</a></li>
<li><a href="https://numerics.mathdotnet.com/MatlabFiles.html">MATLAB</a></li>
<li><a href="https://numerics.mathdotnet.com/IFSharpNotebook.html">IF# Notebook</a></li>
<li>FsLab & Deedle</li>
<li>Microsoft Excel</li>
<li>numl.net machine learning</li>
<li>R-project</li>
</ul>
</div>
</div>
</div>
</body>
<!-- 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>

281
Contributing.html

@ -1,63 +1,138 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>Contribute to Math.NET Numerics
<head>
<meta charset="utf-8">
<title>Contribute to Math.NET Numerics
</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta name="description" content="Math.NET Numerics, providing methods and algorithms for numerical computations in science, engineering and every day use. .Net 4, .Net 3.5, SL5, Win8, WP8, PCL 47 and 136, Mono, Xamarin Android/iOS."/>
<meta name="author" content="Christoph Ruegg, Marcus Cuda, Jurgen Van Gael"/>
<script src="https://code.jquery.com/jquery-1.8.0.js"></script>
<script src="https://code.jquery.com/ui/1.8.23/jquery-ui.js"></script>
<script src="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/js/bootstrap.min.js"></script>
<link href="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap-combined.min.css" rel="stylesheet"/>
<link type="text/css" rel="stylesheet" href="https://numerics.mathdotnet.com/content/style.css" />
<style>
#main table:not(.pre) {
border: 1px solid #dddddd;
max-width: 100%;
border-style: solid;
border-width: 1px;
border-color: gray;
border-collapse: collapse;
border-right-width: 1px;
border-bottom-width: 1px;
margin-top: 15px;
margin-bottom: 25px;
}
#main table:not(.pre) th, #main table:not(.pre) td {
border: 1px solid #dddddd;
padding: 6px;
}
#main table:not(.pre) th p, #main table:not(.pre) td p {
margin-bottom: 5px;
}
</style>
<script type="text/javascript" src="https://numerics.mathdotnet.com/content/tips.js"></script>
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<![endif]-->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
</head>
<body>
<div class="container">
<div class="masthead">
<ul class="nav nav-pills pull-right">
<li><a href="https://www.mathdotnet.com">Math.NET Project</a></li>
<li><a href="https://numerics.mathdotnet.com">Math.NET Numerics</a></li>
<li><a href="https://github.com/mathnet/mathnet-numerics">GitHub</a></li>
</ul>
<h3 class="muted">Math.NET Numerics</h3>
<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>
<hr />
<div class="row">
<div class="span9" id="main">
<h1><a name="Contribute-to-Math-NET-Numerics" class="anchor" href="#Contribute-to-Math-NET-Numerics">Contribute to Math.NET Numerics</a></h1>
<!-- 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">Floating-Point Numbers</li>
<li class="nav-item">Arbitrary Precision Numbers</li>
<li class="nav-item">Complex Numbers</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">Differentiation</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">Transformation</li>
<li class="nav-item">Fourier Transform (FFT)</li>
<li class="nav-item">Filtering & DSP</li>
<li class="nav-item">Window Functions</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-item">Nonlinear Root Finding</li>
<li class="nav-header">Optimization</li>
<li class="nav-item">Linear Least Squares</li>
<li class="nav-item">Nonlinear 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-item">Interpolation</li>
<li class="nav-item">Fourier Approximation</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://www.mathdotnet.com">Math.NET Project</a> |
<a href="https://numerics.mathdotnet.com">Math.NET Numerics</a> |
<a href="https://github.com/mathnet/mathnet-numerics">GitHub</a>
</h3>
</div>
<hr />
<div class="container" id="fsdocs-content">
<h1><a name="Contribute-to-Math-NET-Numerics" class="anchor" href="#Contribute-to-Math-NET-Numerics">Contribute to Math.NET Numerics</a></h1>
<p>Math.NET Numerics is driven by the community and contributors like you. I'm excited that you're interested to help us move forward and improve Numerics. We usually accept contributions and try to attribute them properly, provided they keep the library consistent, focused and mathematically accurate. Have a look at the following tips to get started quickly. I'm looking forward to your pull requests! Thanks!</p>
<p><em>Christoph Rüegg (@cdrnet)</em></p>
<h2><a name="Getting-Started" class="anchor" href="#Getting-Started">Getting Started</a></h2>
@ -94,88 +169,16 @@ We try to follow <a href="https://semver.org/">semantic versioning</a>, meaning
<p><strong>Merges:</strong><br />
Please avoid merging mainline back into your pull request branch. If you need to leverage some changes recently added to mainline, consider to rebase instead. In other words, please make sure your commits sit directly on top of a recent mainline master.</p>
</div>
<div class="span3">
<ul class="nav nav-list" id="menu">
<li class="nav-header">Math.NET Numerics</li>
<li><a href="https://numerics.mathdotnet.com/Packages.html">NuGet & Binaries</a></li>
<li><a href="https://numerics.mathdotnet.com/ReleaseNotes.html">Release Notes</a></li>
<li><a href="https://numerics.mathdotnet.com/License.html">MIT License</a></li>
<li><a href="https://numerics.mathdotnet.com/Compatibility.html">Platform Support</a></li>
<li><a href="https://numerics.mathdotnet.com/api/">Class Reference</a></li>
<li><a href="https://github.com/mathnet/mathnet-numerics/issues">Issues & Bugs</a></li>
<li><a href="https://numerics.mathdotnet.com/Users.html">Who is using Math.NET?</a></li>
<li class="nav-header">Contributing</li>
<li><a href="https://numerics.mathdotnet.com/Contributors.html">Contributors</a></li>
<li><a href="https://numerics.mathdotnet.com/Contributing.html">Contributing</a></li>
<li><a href="https://numerics.mathdotnet.com/Build.html">Build & Tools</a></li>
<li><a href="http://feedback.mathdotnet.com/forums/2060-math-net-numerics">Your Ideas</a></li>
<li class="nav-header">Getting Help</li>
<li><a href="https://discuss.mathdotnet.com/c/numerics">Discuss</a></li>
<li><a href="https://stackoverflow.com/questions/tagged/mathdotnet">Stack Overflow</a></li>
<li class="nav-header">Getting Started</li>
<li><a href="https://numerics.mathdotnet.com/">Getting started</a></li>
<li><a href="https://numerics.mathdotnet.com/Constants.html">Constants</a></li>
<li>Floating-Point Numbers</li>
<li>Arbitrary Precision Numbers</li>
<li>Complex Numbers</li>
<li><a href="https://numerics.mathdotnet.com/Matrix.html">Matrices and Vectors</a></li>
<li><a href="https://numerics.mathdotnet.com/Euclid.html">Euclid & Number Theory</a></li>
<li>Combinatorics</li>
<li class="nav-header">Evaluation</li>
<li><a href="https://numerics.mathdotnet.com/Functions.html">Special Functions</a></li>
<li>Differentiation</li>
<li><a href="https://numerics.mathdotnet.com/Integration.html">Integration</a></li>
<li class="nav-header">Statistics/Probability</li>
<li><a href="https://numerics.mathdotnet.com/DescriptiveStatistics.html">Descriptive Statistics</a></li>
<li><a href="https://numerics.mathdotnet.com/Probability.html">Probability Distributions</a></li>
<li class="nav-header">Generation</li>
<li><a href="https://numerics.mathdotnet.com/Generate.html">Generating Data</a></li>
<li><a href="https://numerics.mathdotnet.com/Random.html">Random Numbers</a></li>
<li class="nav-header">Transformation</li>
<li>Fourier Transform (FFT)</li>
<li>Filtering & DSP</li>
<li>Window Functions</li>
<li class="nav-header">Solving Equations</li>
<li><a href="https://numerics.mathdotnet.com/LinearEquations.html">Linear Equation Systems</a></li>
<li>Nonlinear Root Finding</li>
<li class="nav-header">Optimization</li>
<li>Linear Least Squares</li>
<li>Nonlinear Optimization</li>
<li><a href="https://numerics.mathdotnet.com/Distance.html">Distance Metrics</a></li>
<li class="nav-header">Curve Fitting</li>
<li><a href="https://numerics.mathdotnet.com/Regression.html">Regression</a></li>
<li>Interpolation</li>
<li>Fourier Approximation</li>
<li class="nav-header">Native Providers</li>
<li><a href="https://numerics.mathdotnet.com/MKL.html">Intel MKL</a></li>
<li class="nav-header">Working Together</li>
<li><a href="https://numerics.mathdotnet.com/CSV.html">Delimited Text Files (CSV)</a></li>
<li><a href="https://numerics.mathdotnet.com/MatrixMarket.html">NIST MatrixMarket</a></li>
<li><a href="https://numerics.mathdotnet.com/MatlabFiles.html">MATLAB</a></li>
<li><a href="https://numerics.mathdotnet.com/IFSharpNotebook.html">IF# Notebook</a></li>
<li>FsLab & Deedle</li>
<li>Microsoft Excel</li>
<li>numl.net machine learning</li>
<li>R-project</li>
</ul>
</div>
</div>
</div>
</body>
<!-- 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>

275
Contributors.html

@ -1,63 +1,138 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>Math.NET Numerics Contributors
<head>
<meta charset="utf-8">
<title>Math.NET Numerics Contributors
</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta name="description" content="Math.NET Numerics, providing methods and algorithms for numerical computations in science, engineering and every day use. .Net 4, .Net 3.5, SL5, Win8, WP8, PCL 47 and 136, Mono, Xamarin Android/iOS."/>
<meta name="author" content="Christoph Ruegg, Marcus Cuda, Jurgen Van Gael"/>
<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 src="https://code.jquery.com/jquery-1.8.0.js"></script>
<script src="https://code.jquery.com/ui/1.8.23/jquery-ui.js"></script>
<script src="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/js/bootstrap.min.js"></script>
<link href="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap-combined.min.css" rel="stylesheet"/>
<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 type="text/css" rel="stylesheet" href="https://numerics.mathdotnet.com/content/style.css" />
<style>
#main table:not(.pre) {
border: 1px solid #dddddd;
max-width: 100%;
border-style: solid;
border-width: 1px;
border-color: gray;
border-collapse: collapse;
border-right-width: 1px;
border-bottom-width: 1px;
margin-top: 15px;
margin-bottom: 25px;
}
#main table:not(.pre) th, #main table:not(.pre) td {
border: 1px solid #dddddd;
padding: 6px;
}
#main table:not(.pre) th p, #main table:not(.pre) td p {
margin-bottom: 5px;
}
</style>
<script type="text/javascript" src="https://numerics.mathdotnet.com/content/tips.js"></script>
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<![endif]-->
<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>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
</head>
<body>
<div class="container">
<div class="masthead">
<ul class="nav nav-pills pull-right">
<li><a href="https://www.mathdotnet.com">Math.NET Project</a></li>
<li><a href="https://numerics.mathdotnet.com">Math.NET Numerics</a></li>
<li><a href="https://github.com/mathnet/mathnet-numerics">GitHub</a></li>
</ul>
<h3 class="muted">Math.NET Numerics</h3>
<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>
<hr />
<div class="row">
<div class="span9" id="main">
<h1><a name="Math-NET-Numerics-Contributors" class="anchor" href="#Math-NET-Numerics-Contributors">Math.NET Numerics Contributors</a></h1>
<!-- 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">Floating-Point Numbers</li>
<li class="nav-item">Arbitrary Precision Numbers</li>
<li class="nav-item">Complex Numbers</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">Differentiation</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">Transformation</li>
<li class="nav-item">Fourier Transform (FFT)</li>
<li class="nav-item">Filtering & DSP</li>
<li class="nav-item">Window Functions</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-item">Nonlinear Root Finding</li>
<li class="nav-header">Optimization</li>
<li class="nav-item">Linear Least Squares</li>
<li class="nav-item">Nonlinear 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-item">Interpolation</li>
<li class="nav-item">Fourier Approximation</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://www.mathdotnet.com">Math.NET Project</a> |
<a href="https://numerics.mathdotnet.com">Math.NET Numerics</a> |
<a href="https://github.com/mathnet/mathnet-numerics">GitHub</a>
</h3>
</div>
<hr />
<div class="container" id="fsdocs-content">
<h1><a name="Math-NET-Numerics-Contributors" class="anchor" href="#Math-NET-Numerics-Contributors">Math.NET Numerics Contributors</a></h1>
<p>The Math.NET project is a community effort. We accept contributions and pull requests, but other support like submitting issues or helping the community are just as valuable. Why don't you join us as well?</p>
<p><strong>Thanks for all the contributions!</strong></p>
<h3><a name="Maintainers" class="anchor" href="#Maintainers">Maintainers</a></h3>
@ -227,88 +302,16 @@ This section is incomplete - let us know if we forgot something.</em></p>
<li>Xamarin (license)</li>
</ul>
</div>
<div class="span3">
<ul class="nav nav-list" id="menu">
<li class="nav-header">Math.NET Numerics</li>
<li><a href="https://numerics.mathdotnet.com/Packages.html">NuGet & Binaries</a></li>
<li><a href="https://numerics.mathdotnet.com/ReleaseNotes.html">Release Notes</a></li>
<li><a href="https://numerics.mathdotnet.com/License.html">MIT License</a></li>
<li><a href="https://numerics.mathdotnet.com/Compatibility.html">Platform Support</a></li>
<li><a href="https://numerics.mathdotnet.com/api/">Class Reference</a></li>
<li><a href="https://github.com/mathnet/mathnet-numerics/issues">Issues & Bugs</a></li>
<li><a href="https://numerics.mathdotnet.com/Users.html">Who is using Math.NET?</a></li>
<li class="nav-header">Contributing</li>
<li><a href="https://numerics.mathdotnet.com/Contributors.html">Contributors</a></li>
<li><a href="https://numerics.mathdotnet.com/Contributing.html">Contributing</a></li>
<li><a href="https://numerics.mathdotnet.com/Build.html">Build & Tools</a></li>
<li><a href="http://feedback.mathdotnet.com/forums/2060-math-net-numerics">Your Ideas</a></li>
<li class="nav-header">Getting Help</li>
<li><a href="https://discuss.mathdotnet.com/c/numerics">Discuss</a></li>
<li><a href="https://stackoverflow.com/questions/tagged/mathdotnet">Stack Overflow</a></li>
<li class="nav-header">Getting Started</li>
<li><a href="https://numerics.mathdotnet.com/">Getting started</a></li>
<li><a href="https://numerics.mathdotnet.com/Constants.html">Constants</a></li>
<li>Floating-Point Numbers</li>
<li>Arbitrary Precision Numbers</li>
<li>Complex Numbers</li>
<li><a href="https://numerics.mathdotnet.com/Matrix.html">Matrices and Vectors</a></li>
<li><a href="https://numerics.mathdotnet.com/Euclid.html">Euclid & Number Theory</a></li>
<li>Combinatorics</li>
<li class="nav-header">Evaluation</li>
<li><a href="https://numerics.mathdotnet.com/Functions.html">Special Functions</a></li>
<li>Differentiation</li>
<li><a href="https://numerics.mathdotnet.com/Integration.html">Integration</a></li>
<li class="nav-header">Statistics/Probability</li>
<li><a href="https://numerics.mathdotnet.com/DescriptiveStatistics.html">Descriptive Statistics</a></li>
<li><a href="https://numerics.mathdotnet.com/Probability.html">Probability Distributions</a></li>
<li class="nav-header">Generation</li>
<li><a href="https://numerics.mathdotnet.com/Generate.html">Generating Data</a></li>
<li><a href="https://numerics.mathdotnet.com/Random.html">Random Numbers</a></li>
<li class="nav-header">Transformation</li>
<li>Fourier Transform (FFT)</li>
<li>Filtering & DSP</li>
<li>Window Functions</li>
<li class="nav-header">Solving Equations</li>
<li><a href="https://numerics.mathdotnet.com/LinearEquations.html">Linear Equation Systems</a></li>
<li>Nonlinear Root Finding</li>
<li class="nav-header">Optimization</li>
<li>Linear Least Squares</li>
<li>Nonlinear Optimization</li>
<li><a href="https://numerics.mathdotnet.com/Distance.html">Distance Metrics</a></li>
<li class="nav-header">Curve Fitting</li>
<li><a href="https://numerics.mathdotnet.com/Regression.html">Regression</a></li>
<li>Interpolation</li>
<li>Fourier Approximation</li>
<li class="nav-header">Native Providers</li>
<li><a href="https://numerics.mathdotnet.com/MKL.html">Intel MKL</a></li>
<li class="nav-header">Working Together</li>
<li><a href="https://numerics.mathdotnet.com/CSV.html">Delimited Text Files (CSV)</a></li>
<li><a href="https://numerics.mathdotnet.com/MatrixMarket.html">NIST MatrixMarket</a></li>
<li><a href="https://numerics.mathdotnet.com/MatlabFiles.html">MATLAB</a></li>
<li><a href="https://numerics.mathdotnet.com/IFSharpNotebook.html">IF# Notebook</a></li>
<li>FsLab & Deedle</li>
<li>Microsoft Excel</li>
<li>numl.net machine learning</li>
<li>R-project</li>
</ul>
</div>
</div>
</div>
</body>
<!-- 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>

538
DescriptiveStatistics.html

@ -1,68 +1,141 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>Descriptive Statistics
<head>
<meta charset="utf-8">
<title>Descriptive Statistics
</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta name="description" content="Math.NET Numerics, providing methods and algorithms for numerical computations in science, engineering and every day use. .Net 4, .Net 3.5, SL5, Win8, WP8, PCL 47 and 136, Mono, Xamarin Android/iOS."/>
<meta name="author" content="Christoph Ruegg, Marcus Cuda, Jurgen Van Gael"/>
<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 src="https://code.jquery.com/jquery-1.8.0.js"></script>
<script src="https://code.jquery.com/ui/1.8.23/jquery-ui.js"></script>
<script src="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/js/bootstrap.min.js"></script>
<link href="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap-combined.min.css" rel="stylesheet"/>
<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 type="text/css" rel="stylesheet" href="https://numerics.mathdotnet.com/content/style.css" />
<style>
#main table:not(.pre) {
border: 1px solid #dddddd;
max-width: 100%;
border-style: solid;
border-width: 1px;
border-color: gray;
border-collapse: collapse;
border-right-width: 1px;
border-bottom-width: 1px;
margin-top: 15px;
margin-bottom: 25px;
}
#main table:not(.pre) th, #main table:not(.pre) td {
border: 1px solid #dddddd;
padding: 6px;
}
#main table:not(.pre) th p, #main table:not(.pre) td p {
margin-bottom: 5px;
}
</style>
<script type="text/javascript" src="https://numerics.mathdotnet.com/content/tips.js"></script>
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<![endif]-->
<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>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
</head>
<body>
<div class="container">
<div class="masthead">
<ul class="nav nav-pills pull-right">
<li><a href="https://www.mathdotnet.com">Math.NET Project</a></li>
<li><a href="https://numerics.mathdotnet.com">Math.NET Numerics</a></li>
<li><a href="https://github.com/mathnet/mathnet-numerics">GitHub</a></li>
</ul>
<h3 class="muted">Math.NET Numerics</h3>
<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>
<hr />
<div class="row">
<div class="span9" id="main">
<h1><a name="Descriptive-Statistics" class="anchor" href="#Descriptive-Statistics">Descriptive Statistics</a></h1>
<!-- 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">Floating-Point Numbers</li>
<li class="nav-item">Arbitrary Precision Numbers</li>
<li class="nav-item">Complex Numbers</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">Differentiation</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">Transformation</li>
<li class="nav-item">Fourier Transform (FFT)</li>
<li class="nav-item">Filtering & DSP</li>
<li class="nav-item">Window Functions</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-item">Nonlinear Root Finding</li>
<li class="nav-header">Optimization</li>
<li class="nav-item">Linear Least Squares</li>
<li class="nav-item">Nonlinear 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-item">Interpolation</li>
<li class="nav-item">Fourier Approximation</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://www.mathdotnet.com">Math.NET Project</a> |
<a href="https://numerics.mathdotnet.com">Math.NET Numerics</a> |
<a href="https://github.com/mathnet/mathnet-numerics">GitHub</a>
</h3>
</div>
<hr />
<div class="container" id="fsdocs-content">
<h1><a name="Descriptive-Statistics" class="anchor" href="#Descriptive-Statistics">Descriptive Statistics</a></h1>
<h2><a name="Initialization" class="anchor" href="#Initialization">Initialization</a></h2>
<p>We need to reference Math.NET Numerics and open the statistics namespace:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">using</span> MathNet.Numerics.Statistics;
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">using</span> MathNet.Numerics.Statistics;
</code></pre></td></tr></table>
<h2><a name="Univariate-Statistical-Analysis" class="anchor" href="#Univariate-Statistical-Analysis">Univariate Statistical Analysis</a></h2>
<p>The primary class for statistical analysis is <code>Statistics</code> which provides common
@ -88,21 +161,7 @@ Useful if data larger than local memory is streamed directly from a disk or netw
</ul>
<p>Another alternative, in case you need to gather a whole set of statistical characteristics
in one pass, is provided by the <code>DescriptiveStatistics</code> class:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l"> 1: </span>
<span class="l"> 2: </span>
<span class="l"> 3: </span>
<span class="l"> 4: </span>
<span class="l"> 5: </span>
<span class="l"> 6: </span>
<span class="l"> 7: </span>
<span class="l"> 8: </span>
<span class="l"> 9: </span>
<span class="l">10: </span>
<span class="l">11: </span>
<span class="l">12: </span>
<span class="l">13: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">var</span> samples <span class="o">=</span> <span class="k">new</span> ChiSquare(<span class="n">5</span>).Samples().Take(<span class="n">1000</span>);
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">var</span> samples <span class="o">=</span> <span class="k">new</span> ChiSquare(<span class="n">5</span>).Samples().Take(<span class="n">1000</span>);
<span class="k">var</span> statistics <span class="o">=</span> <span class="k">new</span> DescriptiveStatistics(samples);
<span class="k">var</span> largestElement <span class="o">=</span> statistics.Maximum;
@ -123,11 +182,7 @@ and <code>StreamingStatistics</code>. The one in <code>SortedArrayStatistics</co
time complexity, but expects the array to be sorted ascendingly.</p>
<p>Both min and max are directly affected by outliers and are therefore no robust statistics at all.
For a more robust alternative, consider using Quantiles instead.</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">var</span> samples <span class="o">=</span> <span class="k">new</span> ChiSquare(<span class="n">5</span>).Samples().Take(<span class="n">1000</span>).ToArray();
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">var</span> samples <span class="o">=</span> <span class="k">new</span> ChiSquare(<span class="n">5</span>).Samples().Take(<span class="n">1000</span>).ToArray();
<span class="k">var</span> largestElement <span class="o">=</span> samples.Maximum();
<span class="k">var</span> smallestElement <span class="o">=</span> samples.Minimum();
</code></pre></td></tr></table>
@ -139,26 +194,15 @@ The mean is affected by outliers, so if you need a more robust estimate consider
<code>StreamingStatistics.Mean(stream)</code>
<code>ArrayStatistics.Mean(data)</code></p>
<p><span class="math">\[\overline{x} = \frac{1}{N}\sum_{i=1}^N x_i\]</span></p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
<span class="l">4: </span>
<span class="l">5: </span>
<span class="l">6: </span>
<span class="l">7: </span>
<span class="l">8: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="k">let</span> <span onmouseout="hideTip(event, 'fs1', 1)" onmouseover="showTip(event, 'fs1', 1)" class="i">whiteNoise</span> <span class="o">=</span> <span class="i">Generate</span><span class="o">.</span><span class="i">Normal</span>(<span class="n">1000</span>, <span class="i">mean</span><span class="o">=</span><span class="n">10.0</span>, <span class="i">standardDeviation</span><span class="o">=</span><span class="n">2.0</span>)
<pre class="fssnip highlighted"><code lang="fsharp"><span class="k">let</span> <span onmouseout="hideTip(event, 'fs1', 1)" onmouseover="showTip(event, 'fs1', 1)" class="id">whiteNoise</span> <span class="o">=</span> <span class="id">Generate</span><span class="pn">.</span><span class="id">Normal</span><span class="pn">(</span><span class="n">1000</span><span class="pn">,</span> <span class="id">mean</span><span class="o">=</span><span class="n">10.0</span><span class="pn">,</span> <span class="id">standardDeviation</span><span class="o">=</span><span class="n">2.0</span><span class="pn">)</span>
<span class="fsi">val samples : float [] = [|12.90021939; 9.631515037; 7.810008046; 14.13301053; ...|] </span>
<span class="i">Statistics</span><span class="o">.</span><span class="i">Mean</span> <span onmouseout="hideTip(event, 'fs1', 2)" onmouseover="showTip(event, 'fs1', 2)" class="i">whiteNoise</span>
<span class="id">Statistics</span><span class="pn">.</span><span class="id">Mean</span> <span onmouseout="hideTip(event, 'fs1', 2)" onmouseover="showTip(event, 'fs1', 2)" class="id">whiteNoise</span>
<span class="fsi">val it : float = 10.02162347</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs2', 3)" onmouseover="showTip(event, 'fs2', 3)" class="i">wave</span> <span class="o">=</span> <span class="i">Generate</span><span class="o">.</span><span class="i">Sinusoidal</span>(<span class="n">1000</span>, <span class="i">samplingRate</span><span class="o">=</span><span class="n">100.</span>, <span class="i">frequency</span><span class="o">=</span><span class="n">5.</span>, <span class="i">amplitude</span><span class="o">=</span><span class="n">0.5</span>)
<span class="i">Statistics</span><span class="o">.</span><span class="i">Mean</span> <span onmouseout="hideTip(event, 'fs2', 4)" onmouseover="showTip(event, 'fs2', 4)" class="i">wave</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs2', 3)" onmouseover="showTip(event, 'fs2', 3)" class="id">wave</span> <span class="o">=</span> <span class="id">Generate</span><span class="pn">.</span><span class="id">Sinusoidal</span><span class="pn">(</span><span class="n">1000</span><span class="pn">,</span> <span class="id">samplingRate</span><span class="o">=</span><span class="n">100.</span><span class="pn">,</span> <span class="id">frequency</span><span class="o">=</span><span class="n">5.</span><span class="pn">,</span> <span class="id">amplitude</span><span class="o">=</span><span class="n">0.5</span><span class="pn">)</span>
<span class="id">Statistics</span><span class="pn">.</span><span class="id">Mean</span> <span onmouseout="hideTip(event, 'fs2', 4)" onmouseover="showTip(event, 'fs2', 4)" class="id">wave</span>
<span class="fsi">val it : float = -4.133520783e-17</span>
</code></pre></td>
</tr>
</table>
</code></pre>
<h2><a name="Variance-and-Standard-Deviation" class="anchor" href="#Variance-and-Standard-Deviation">Variance and Standard Deviation</a></h2>
<p>Variance <span class="math">\(\sigma^2\)</span> and the Standard Deviation <span class="math">\(\sigma\)</span> are measures of how far the samples are spread out.</p>
<p>If the whole population is available, the functions with the Population-prefix
@ -172,38 +216,23 @@ Bessel's correction with an <span class="math">\(N-1\)</span> normalizer to a sa
<p><code>Statistics.Variance(samples)</code>
<code>Statistics.StandardDeviation(samples)</code></p>
<p><span class="math">\[s^2 = \frac{1}{N-1}\sum_{i=1}^N (x_i - \overline{x})^2\]</span></p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
<span class="l">4: </span>
<span class="l">5: </span>
<span class="l">6: </span>
<span class="l">7: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="i">Statistics</span><span class="o">.</span><span class="i">Variance</span> <span onmouseout="hideTip(event, 'fs1', 5)" onmouseover="showTip(event, 'fs1', 5)" class="i">whiteNoise</span>
<pre class="fssnip highlighted"><code lang="fsharp"><span class="id">Statistics</span><span class="pn">.</span><span class="id">Variance</span> <span onmouseout="hideTip(event, 'fs1', 5)" onmouseover="showTip(event, 'fs1', 5)" class="id">whiteNoise</span>
<span class="fsi">val it : float = 3.819436094</span>
<span class="i">Statistics</span><span class="o">.</span><span class="i">StandardDeviation</span> <span onmouseout="hideTip(event, 'fs1', 6)" onmouseover="showTip(event, 'fs1', 6)" class="i">whiteNoise</span>
<span class="id">Statistics</span><span class="pn">.</span><span class="id">StandardDeviation</span> <span onmouseout="hideTip(event, 'fs1', 6)" onmouseover="showTip(event, 'fs1', 6)" class="id">whiteNoise</span>
<span class="fsi">val it : float = 1.954337764</span>
<span class="i">Statistics</span><span class="o">.</span><span class="i">Variance</span> <span onmouseout="hideTip(event, 'fs2', 7)" onmouseover="showTip(event, 'fs2', 7)" class="i">wave</span>
<span class="id">Statistics</span><span class="pn">.</span><span class="id">Variance</span> <span onmouseout="hideTip(event, 'fs2', 7)" onmouseover="showTip(event, 'fs2', 7)" class="id">wave</span>
<span class="fsi">val it : float = 0.1251251251</span>
</code></pre></td>
</tr>
</table>
</code></pre>
<h4><a name="Combined-Routines" class="anchor" href="#Combined-Routines">Combined Routines</a></h4>
<p>Since mean and variance are often needed together, there are routines
that evaluate both in a single pass:</p>
<p><code>Statistics.MeanVariance(samples)</code>
<code>ArrayStatistics.MeanVariance(samples)</code>
<code>StreamingStatistics.MeanVariance(samples)</code></p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="i">Statistics</span><span class="o">.</span><span class="i">MeanVariance</span> <span onmouseout="hideTip(event, 'fs1', 8)" onmouseover="showTip(event, 'fs1', 8)" class="i">whiteNoise</span>
<pre class="fssnip highlighted"><code lang="fsharp"><span class="id">Statistics</span><span class="pn">.</span><span class="id">MeanVariance</span> <span onmouseout="hideTip(event, 'fs1', 8)" onmouseover="showTip(event, 'fs1', 8)" class="id">whiteNoise</span>
<span class="fsi">val it : float * float = (10.02162347, 3.819436094)</span>
</code></pre></td>
</tr>
</table>
</code></pre>
<h2><a name="Covariance" class="anchor" href="#Covariance">Covariance</a></h2>
<p>The sample covariance is an estimation of the Covariance, a measure of how much two random
variables change together. Similarly to the variance above, there are two versions in order to
@ -212,18 +241,11 @@ apply Bessel's correction to bias in case of sample data.</p>
<p><span class="math">\[q = \frac{1}{N-1}\sum_{i=1}^N (x_i - \overline{x})(y_i - \overline{y})\]</span></p>
<p><code>Statistics.PopulationCovariance(population1, population2)</code></p>
<p><span class="math">\[q = \frac{1}{N}\sum_{i=1}^N (x_i - \mu_x)(y_i - \mu_y)\]</span></p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
<span class="l">4: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="i">Statistics</span><span class="o">.</span><span class="i">Covariance</span>(<span onmouseout="hideTip(event, 'fs1', 9)" onmouseover="showTip(event, 'fs1', 9)" class="i">whiteNoise</span>, <span onmouseout="hideTip(event, 'fs1', 10)" onmouseover="showTip(event, 'fs1', 10)" class="i">whiteNoise</span>)
<pre class="fssnip highlighted"><code lang="fsharp"><span class="id">Statistics</span><span class="pn">.</span><span class="id">Covariance</span><span class="pn">(</span><span onmouseout="hideTip(event, 'fs1', 9)" onmouseover="showTip(event, 'fs1', 9)" class="id">whiteNoise</span><span class="pn">,</span> <span onmouseout="hideTip(event, 'fs1', 10)" onmouseover="showTip(event, 'fs1', 10)" class="id">whiteNoise</span><span class="pn">)</span>
<span class="fsi">val it : float = 3.819436094</span>
<span class="i">Statistics</span><span class="o">.</span><span class="i">Covariance</span>(<span onmouseout="hideTip(event, 'fs1', 11)" onmouseover="showTip(event, 'fs1', 11)" class="i">whiteNoise</span>, <span onmouseout="hideTip(event, 'fs2', 12)" onmouseover="showTip(event, 'fs2', 12)" class="i">wave</span>)
<span class="id">Statistics</span><span class="pn">.</span><span class="id">Covariance</span><span class="pn">(</span><span onmouseout="hideTip(event, 'fs1', 11)" onmouseover="showTip(event, 'fs1', 11)" class="id">whiteNoise</span><span class="pn">,</span> <span onmouseout="hideTip(event, 'fs2', 12)" onmouseover="showTip(event, 'fs2', 12)" class="id">wave</span><span class="pn">)</span>
<span class="fsi">val it : float = 0.04397985084</span>
</code></pre></td>
</tr>
</table>
</code></pre>
<h2><a name="Order-Statistics" class="anchor" href="#Order-Statistics">Order Statistics</a></h2>
<h4><a name="Order-Statistic" class="anchor" href="#Order-Statistic">Order Statistic</a></h4>
<p>The k-th order statistic of a sample set is the k-th smallest value. Note that,
@ -244,34 +266,19 @@ provided data and then on each invocation uses efficient sorted algorithms:</p>
<p><code>Statistics.OrderStatisticFunc(data)</code></p>
<p>Such Inplace and Func variants are a common pattern throughout the Statistics class
and also the rest of the library.</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l"> 1: </span>
<span class="l"> 2: </span>
<span class="l"> 3: </span>
<span class="l"> 4: </span>
<span class="l"> 5: </span>
<span class="l"> 6: </span>
<span class="l"> 7: </span>
<span class="l"> 8: </span>
<span class="l"> 9: </span>
<span class="l">10: </span>
<span class="l">11: </span>
<span class="l">12: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="i">Statistics</span><span class="o">.</span><span class="i">OrderStatistic</span>(<span onmouseout="hideTip(event, 'fs1', 13)" onmouseover="showTip(event, 'fs1', 13)" class="i">whiteNoise</span>, <span class="n">1</span>)
<pre class="fssnip highlighted"><code lang="fsharp"><span class="id">Statistics</span><span class="pn">.</span><span class="id">OrderStatistic</span><span class="pn">(</span><span onmouseout="hideTip(event, 'fs1', 13)" onmouseover="showTip(event, 'fs1', 13)" class="id">whiteNoise</span><span class="pn">,</span> <span class="n">1</span><span class="pn">)</span>
<span class="fsi">val it : float = 3.633070184</span>
<span class="i">Statistics</span><span class="o">.</span><span class="i">OrderStatistic</span>(<span onmouseout="hideTip(event, 'fs1', 14)" onmouseover="showTip(event, 'fs1', 14)" class="i">whiteNoise</span>, <span class="n">1000</span>)
<span class="id">Statistics</span><span class="pn">.</span><span class="id">OrderStatistic</span><span class="pn">(</span><span onmouseout="hideTip(event, 'fs1', 14)" onmouseover="showTip(event, 'fs1', 14)" class="id">whiteNoise</span><span class="pn">,</span> <span class="n">1000</span><span class="pn">)</span>
<span class="fsi">val it : float = 16.65183566</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs3', 15)" onmouseover="showTip(event, 'fs3', 15)" class="f">os</span> <span class="o">=</span> <span class="i">Statistics</span><span class="o">.</span><span class="i">orderStatisticFunc</span> <span onmouseout="hideTip(event, 'fs1', 16)" onmouseover="showTip(event, 'fs1', 16)" class="i">whiteNoise</span>
<span onmouseout="hideTip(event, 'fs3', 17)" onmouseover="showTip(event, 'fs3', 17)" class="f">os</span> <span class="n">250</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs3', 15)" onmouseover="showTip(event, 'fs3', 15)" class="fn">os</span> <span class="o">=</span> <span class="id">Statistics</span><span class="pn">.</span><span class="id">orderStatisticFunc</span> <span onmouseout="hideTip(event, 'fs1', 16)" onmouseover="showTip(event, 'fs1', 16)" class="id">whiteNoise</span>
<span onmouseout="hideTip(event, 'fs3', 17)" onmouseover="showTip(event, 'fs3', 17)" class="fn">os</span> <span class="n">250</span>
<span class="fsi">val it : float = 8.645491746</span>
<span onmouseout="hideTip(event, 'fs3', 18)" onmouseover="showTip(event, 'fs3', 18)" class="f">os</span> <span class="n">500</span>
<span onmouseout="hideTip(event, 'fs3', 18)" onmouseover="showTip(event, 'fs3', 18)" class="fn">os</span> <span class="n">500</span>
<span class="fsi">val it : float = 10.11872428</span>
<span onmouseout="hideTip(event, 'fs3', 19)" onmouseover="showTip(event, 'fs3', 19)" class="f">os</span> <span class="n">750</span>
<span onmouseout="hideTip(event, 'fs3', 19)" onmouseover="showTip(event, 'fs3', 19)" class="fn">os</span> <span class="n">750</span>
<span class="fsi">val it : float = 11.33170746</span>
</code></pre></td>
</tr>
</table>
</code></pre>
<h4><a name="Median" class="anchor" href="#Median">Median</a></h4>
<p>Median is a robust indicator of central tendency and much less affected by outliers
than the sample mean. The median is estimated by the value exactly in the middle of
@ -283,18 +290,11 @@ the sorted set of samples and thus separating the higher half of the data from t
uses the default quantile definition, which is equivalent to mode 8 in R and is approximately
median-unbiased regardless of the sample distribution. If you need another convention, use
<code>QuantileCustom</code> instead, see below for details.</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
<span class="l">4: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="i">Statistics</span><span class="o">.</span><span class="i">Median</span> <span onmouseout="hideTip(event, 'fs1', 20)" onmouseover="showTip(event, 'fs1', 20)" class="i">whiteNoise</span>
<pre class="fssnip highlighted"><code lang="fsharp"><span class="id">Statistics</span><span class="pn">.</span><span class="id">Median</span> <span onmouseout="hideTip(event, 'fs1', 20)" onmouseover="showTip(event, 'fs1', 20)" class="id">whiteNoise</span>
<span class="fsi">val it : float = 10.11872428</span>
<span class="i">Statistics</span><span class="o">.</span><span class="i">Median</span> <span onmouseout="hideTip(event, 'fs2', 21)" onmouseover="showTip(event, 'fs2', 21)" class="i">wave</span>
<span class="id">Statistics</span><span class="pn">.</span><span class="id">Median</span> <span onmouseout="hideTip(event, 'fs2', 21)" onmouseover="showTip(event, 'fs2', 21)" class="id">wave</span>
<span class="fsi">val it : float = -2.452600839e-16</span>
</code></pre></td>
</tr>
</table>
</code></pre>
<h4><a name="Quartiles-and-the-5-number-summary" class="anchor" href="#Quartiles-and-the-5-number-summary">Quartiles and the 5-number summary</a></h4>
<p>Quartiles group the ascendingly sorted data into four equal groups, where each
group represents a quarter of the data. The lower quartile is estimated by
@ -307,50 +307,31 @@ estimates the median as discussed above.</p>
<code>SortedArrayStatistics.UpperQuartile(data)</code>
<code>ArrayStatistics.LowerQuartileInplace(data)</code>
<code>ArrayStatistics.UpperQuartileInplace(data)</code></p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
<span class="l">4: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="i">Statistics</span><span class="o">.</span><span class="i">LowerQuartile</span> <span onmouseout="hideTip(event, 'fs1', 22)" onmouseover="showTip(event, 'fs1', 22)" class="i">whiteNoise</span>
<pre class="fssnip highlighted"><code lang="fsharp"><span class="id">Statistics</span><span class="pn">.</span><span class="id">LowerQuartile</span> <span onmouseout="hideTip(event, 'fs1', 22)" onmouseover="showTip(event, 'fs1', 22)" class="id">whiteNoise</span>
<span class="fsi">val it : float = 8.645491746</span>
<span class="i">Statistics</span><span class="o">.</span><span class="i">UpperQuartile</span> <span onmouseout="hideTip(event, 'fs1', 23)" onmouseover="showTip(event, 'fs1', 23)" class="i">whiteNoise</span>
<span class="id">Statistics</span><span class="pn">.</span><span class="id">UpperQuartile</span> <span onmouseout="hideTip(event, 'fs1', 23)" onmouseover="showTip(event, 'fs1', 23)" class="id">whiteNoise</span>
<span class="fsi">val it : float = 11.33213732</span>
</code></pre></td>
</tr>
</table>
</code></pre>
<p>Using that data we can provide a useful set of indicators usually named 5-number summary,
which consists of the minimum value, the lower quartile, the median, the upper quartile and
the maximum value. All these values can be visualized in the popular box plot diagrams.</p>
<p><code>Statistics.FiveNumberSummary(data)</code>
<code>SortedArrayStatistics.FiveNumberSummary(data)</code>
<code>ArrayStatistics.FiveNumberSummaryInplace(data)</code></p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
<span class="l">4: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="i">Statistics</span><span class="o">.</span><span class="i">FiveNumberSummary</span> <span onmouseout="hideTip(event, 'fs1', 24)" onmouseover="showTip(event, 'fs1', 24)" class="i">whiteNoise</span>
<pre class="fssnip highlighted"><code lang="fsharp"><span class="id">Statistics</span><span class="pn">.</span><span class="id">FiveNumberSummary</span> <span onmouseout="hideTip(event, 'fs1', 24)" onmouseover="showTip(event, 'fs1', 24)" class="id">whiteNoise</span>
<span class="fsi">val it : float [] = [|3.633070184; 8.645937823; 10.12165054; 11.33213732; 16.65183566|] </span>
<span class="i">Statistics</span><span class="o">.</span><span class="i">FiveNumberSummary</span> <span onmouseout="hideTip(event, 'fs2', 25)" onmouseover="showTip(event, 'fs2', 25)" class="i">wave</span>
<span class="id">Statistics</span><span class="pn">.</span><span class="id">FiveNumberSummary</span> <span onmouseout="hideTip(event, 'fs2', 25)" onmouseover="showTip(event, 'fs2', 25)" class="id">wave</span>
<span class="fsi">val it : float [] = [|-0.5; -0.3584185509; -2.452600839e-16; 0.3584185509; 0.5|] </span>
</code></pre></td>
</tr>
</table>
</code></pre>
<p>The difference between the upper and the lower quartile is called inter-quartile range (IQR)
and is a robust indicator of spread. In box plots the IQR is the total height of the box.</p>
<p><code>Statistics.InterquartileRange(data)</code>
<code>SortedArrayStatistics.InterquartileRange(data)</code>
<code>ArrayStatistics.InterquartileRangeInplace(data)</code></p>
<p>Just like median, quartiles use the default R8 quantile definition internally.</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="i">Statistics</span><span class="o">.</span><span class="i">InterquartileRange</span> <span onmouseout="hideTip(event, 'fs1', 26)" onmouseover="showTip(event, 'fs1', 26)" class="i">whiteNoise</span>
<pre class="fssnip highlighted"><code lang="fsharp"><span class="id">Statistics</span><span class="pn">.</span><span class="id">InterquartileRange</span> <span onmouseout="hideTip(event, 'fs1', 26)" onmouseover="showTip(event, 'fs1', 26)" class="id">whiteNoise</span>
<span class="fsi">val it : float = 2.686199498</span>
</code></pre></td>
</tr>
</table>
</code></pre>
<h4><a name="Percentiles" class="anchor" href="#Percentiles">Percentiles</a></h4>
<p>Percentiles extend the concept further by grouping the sorted values into 100
equal groups and looking at the 101 places (0,1,..,100) between and around them.
@ -361,18 +342,11 @@ The 0-percentile represents the minimum value, 25 the first quartile, 50 the med
<code>SortedArrayStatistics.Percentile(data, p)</code>
<code>ArrayStatistics.PercentileInplace(data, p)</code></p>
<p>Just like median, percentiles use the default R8 quantile definition internally.</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
<span class="l">4: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="i">Statistics</span><span class="o">.</span><span class="i">Percentile</span>(<span onmouseout="hideTip(event, 'fs1', 27)" onmouseover="showTip(event, 'fs1', 27)" class="i">whiteNoise</span>, <span class="n">5</span>)
<pre class="fssnip highlighted"><code lang="fsharp"><span class="id">Statistics</span><span class="pn">.</span><span class="id">Percentile</span><span class="pn">(</span><span onmouseout="hideTip(event, 'fs1', 27)" onmouseover="showTip(event, 'fs1', 27)" class="id">whiteNoise</span><span class="pn">,</span> <span class="n">5</span><span class="pn">)</span>
<span class="fsi">val it : float = 6.693373507</span>
<span class="i">Statistics</span><span class="o">.</span><span class="i">Percentile</span>(<span onmouseout="hideTip(event, 'fs1', 28)" onmouseover="showTip(event, 'fs1', 28)" class="i">whiteNoise</span>, <span class="n">98</span>)
<span class="id">Statistics</span><span class="pn">.</span><span class="id">Percentile</span><span class="pn">(</span><span onmouseout="hideTip(event, 'fs1', 28)" onmouseover="showTip(event, 'fs1', 28)" class="id">whiteNoise</span><span class="pn">,</span> <span class="n">98</span><span class="pn">)</span>
<span class="fsi">val it : float = 13.97580653</span>
</code></pre></td>
</tr>
</table>
</code></pre>
<h4><a name="Quantiles" class="anchor" href="#Quantiles">Quantiles</a></h4>
<p>Instead of grouping into 4 or 100 boxes, quantiles generalize the concept to an infinite number
of boxes and thus to arbitrary real numbers <span class="math">\(\tau\)</span> between 0.0 and 1.0, where 0.0 represents the
@ -382,14 +356,9 @@ the inverse cumulative distribution function of the sample distribution.</p>
<code>Statistics.QuantileFunc(data)</code>
<code>SortedArrayStatistics.Quantile(data, tau)</code>
<code>ArrayStatistics.QuantileInplace(data, tau)</code></p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="i">Statistics</span><span class="o">.</span><span class="i">Quantile</span>(<span onmouseout="hideTip(event, 'fs1', 29)" onmouseover="showTip(event, 'fs1', 29)" class="i">whiteNoise</span>, <span class="n">0.98</span>)
<pre class="fssnip highlighted"><code lang="fsharp"><span class="id">Statistics</span><span class="pn">.</span><span class="id">Quantile</span><span class="pn">(</span><span onmouseout="hideTip(event, 'fs1', 29)" onmouseover="showTip(event, 'fs1', 29)" class="id">whiteNoise</span><span class="pn">,</span> <span class="n">0.98</span><span class="pn">)</span>
<span class="fsi">val it : float = 13.97580653</span>
</code></pre></td>
</tr>
</table>
</code></pre>
<h4><a name="Quantile-Conventions-and-Compatibility" class="anchor" href="#Quantile-Conventions-and-Compatibility">Quantile Conventions and Compatibility</a></h4>
<p>Remember that all these descriptive statistics do not <em>compute</em> but merely <em>estimate</em>
statistical indicators of the value distribution. In the case of quantiles,
@ -440,22 +409,13 @@ Similar to <code>QuantileDefinition</code>, the <code>RankDefinition</code> enum
<p><code>Statistics.Ranks(data, definition)</code>
<code>SortedArrayStatistics.Ranks(data, definition)</code>
<code>ArrayStatistics.RanksInplace(data, definition)</code></p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
<span class="l">4: </span>
<span class="l">5: </span>
<span class="l">6: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="i">Statistics</span><span class="o">.</span><span class="i">Ranks</span>(<span onmouseout="hideTip(event, 'fs1', 30)" onmouseover="showTip(event, 'fs1', 30)" class="i">whiteNoise</span>)
<pre class="fssnip highlighted"><code lang="fsharp"><span class="id">Statistics</span><span class="pn">.</span><span class="id">Ranks</span><span class="pn">(</span><span onmouseout="hideTip(event, 'fs1', 30)" onmouseover="showTip(event, 'fs1', 30)" class="id">whiteNoise</span><span class="pn">)</span>
<span class="fsi">val it : float [] = [|634.0; 736.0; 405.0; 395.0; 197.0; 167.0; 722.0; 44.0; ...|] </span>
<span class="i">Statistics</span><span class="o">.</span><span class="i">Ranks</span>([| <span class="n">13.0</span>; <span class="n">14.0</span>; <span class="n">11.0</span>; <span class="n">12.0</span>; <span class="n">13.0</span> |], <span class="i">RankDefinition</span><span class="o">.</span><span class="i">Average</span>)
<span class="id">Statistics</span><span class="pn">.</span><span class="id">Ranks</span><span class="pn">(</span><span class="pn">[|</span> <span class="n">13.0</span><span class="pn">;</span> <span class="n">14.0</span><span class="pn">;</span> <span class="n">11.0</span><span class="pn">;</span> <span class="n">12.0</span><span class="pn">;</span> <span class="n">13.0</span> <span class="pn">|]</span><span class="pn">,</span> <span class="id">RankDefinition</span><span class="pn">.</span><span class="id">Average</span><span class="pn">)</span>
<span class="fsi">val it : float [] = [|3.5; 5.0; 1.0; 2.0; 3.5|] </span>
<span class="i">Statistics</span><span class="o">.</span><span class="i">Ranks</span>([| <span class="n">13.0</span>; <span class="n">14.0</span>; <span class="n">11.0</span>; <span class="n">12.0</span>; <span class="n">13.0</span> |], <span class="i">RankDefinition</span><span class="o">.</span><span class="i">Sports</span>)
<span class="id">Statistics</span><span class="pn">.</span><span class="id">Ranks</span><span class="pn">(</span><span class="pn">[|</span> <span class="n">13.0</span><span class="pn">;</span> <span class="n">14.0</span><span class="pn">;</span> <span class="n">11.0</span><span class="pn">;</span> <span class="n">12.0</span><span class="pn">;</span> <span class="n">13.0</span> <span class="pn">|]</span><span class="pn">,</span> <span class="id">RankDefinition</span><span class="pn">.</span><span class="id">Sports</span><span class="pn">)</span>
<span class="fsi">val it : float [] = [|3.0; 5.0; 1.0; 2.0; 3.0|] </span>
</code></pre></td>
</tr>
</table>
</code></pre>
<h4><a name="Quantile-Rank" class="anchor" href="#Quantile-Rank">Quantile Rank</a></h4>
<p>Counterpart of the <code>Quantile</code> function, estimates <span class="math">\(\tau\)</span> of the provided <span class="math">\(\tau\)</span>-quantile value
<span class="math">\(x\)</span> from the provided samples. The <span class="math">\(\tau\)</span>-quantile is the data value where the cumulative distribution
@ -463,165 +423,63 @@ function crosses <span class="math">\(\tau\)</span>.</p>
<p><code>Statistics.QuantileRank(data, x, definition)</code>
<code>Statistics.QuantileRankFunc(data, definition)</code>
<code>SortedArrayStatistics.QuantileRank(data, x, definition)</code></p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
<span class="l">4: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="i">Statistics</span><span class="o">.</span><span class="i">QuantileRank</span>(<span onmouseout="hideTip(event, 'fs1', 31)" onmouseover="showTip(event, 'fs1', 31)" class="i">whiteNoise</span>, <span class="n">13.0</span>)
<pre class="fssnip highlighted"><code lang="fsharp"><span class="id">Statistics</span><span class="pn">.</span><span class="id">QuantileRank</span><span class="pn">(</span><span onmouseout="hideTip(event, 'fs1', 31)" onmouseover="showTip(event, 'fs1', 31)" class="id">whiteNoise</span><span class="pn">,</span> <span class="n">13.0</span><span class="pn">)</span>
<span class="fsi">val it : float = 0.9370045563</span>
<span class="i">Statistics</span><span class="o">.</span><span class="i">QuantileRank</span>(<span onmouseout="hideTip(event, 'fs1', 32)" onmouseover="showTip(event, 'fs1', 32)" class="i">whiteNoise</span>, <span class="n">6.7</span>, <span class="i">RankDefinition</span><span class="o">.</span><span class="i">Average</span>)
<span class="id">Statistics</span><span class="pn">.</span><span class="id">QuantileRank</span><span class="pn">(</span><span onmouseout="hideTip(event, 'fs1', 32)" onmouseover="showTip(event, 'fs1', 32)" class="id">whiteNoise</span><span class="pn">,</span> <span class="n">6.7</span><span class="pn">,</span> <span class="id">RankDefinition</span><span class="pn">.</span><span class="id">Average</span><span class="pn">)</span>
<span class="fsi">val it : float = 0.04960610389</span>
</code></pre></td>
</tr>
</table>
</code></pre>
<h2><a name="Empirical-Distribution-Functions" class="anchor" href="#Empirical-Distribution-Functions">Empirical Distribution Functions</a></h2>
<p><code>Statistics.EmpiricalCDF(data, x)</code>
<code>Statistics.EmpiricalCDFFunc(data)</code>
<code>Statistics.EmpiricalInvCDF(data, tau)</code>
<code>Statistics.EmpiricalInvCDFFunc(data)</code>
<code>SortedArrayStatistics.EmpiricalCDF(data, x)</code></p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l"> 1: </span>
<span class="l"> 2: </span>
<span class="l"> 3: </span>
<span class="l"> 4: </span>
<span class="l"> 5: </span>
<span class="l"> 6: </span>
<span class="l"> 7: </span>
<span class="l"> 8: </span>
<span class="l"> 9: </span>
<span class="l">10: </span>
<span class="l">11: </span>
<span class="l">12: </span>
<span class="l">13: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="k">let</span> <span onmouseout="hideTip(event, 'fs4', 33)" onmouseover="showTip(event, 'fs4', 33)" class="i">ecdf</span> <span class="o">=</span> <span class="i">Statistics</span><span class="o">.</span><span class="i">EmpiricalCDFFunc</span> <span onmouseout="hideTip(event, 'fs1', 34)" onmouseover="showTip(event, 'fs1', 34)" class="i">whiteNoise</span>
<span class="i">Generate</span><span class="o">.</span><span class="i">LinearSpacedMap</span>(<span class="n">20</span>, <span class="i">start</span><span class="o">=</span><span class="n">3.0</span>, <span class="i">stop</span><span class="o">=</span><span class="n">17.0</span>, <span class="i">map</span><span class="o">=</span><span onmouseout="hideTip(event, 'fs4', 35)" onmouseover="showTip(event, 'fs4', 35)" class="i">ecdf</span>)
<pre class="fssnip highlighted"><code lang="fsharp"><span class="k">let</span> <span onmouseout="hideTip(event, 'fs4', 33)" onmouseover="showTip(event, 'fs4', 33)" class="id">ecdf</span> <span class="o">=</span> <span class="id">Statistics</span><span class="pn">.</span><span class="id">EmpiricalCDFFunc</span> <span onmouseout="hideTip(event, 'fs1', 34)" onmouseover="showTip(event, 'fs1', 34)" class="id">whiteNoise</span>
<span class="id">Generate</span><span class="pn">.</span><span class="id">LinearSpacedMap</span><span class="pn">(</span><span class="n">20</span><span class="pn">,</span> <span class="id">start</span><span class="o">=</span><span class="n">3.0</span><span class="pn">,</span> <span class="id">stop</span><span class="o">=</span><span class="n">17.0</span><span class="pn">,</span> <span class="id">map</span><span class="o">=</span><span onmouseout="hideTip(event, 'fs4', 35)" onmouseover="showTip(event, 'fs4', 35)" class="id">ecdf</span><span class="pn">)</span>
<span class="fsi">val it : float [] =</span>
<span class="fsi"> [|0.0; 0.001; 0.002; 0.005; 0.022; 0.05; 0.094; 0.172; 0.278; 0.423; 0.555; </span>
<span class="fsi"> 0.705; 0.843; 0.921; 0.944; 0.983; 0.992; 0.997; 0.999; 1.0|] </span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs5', 36)" onmouseover="showTip(event, 'fs5', 36)" class="f">eicdf</span> <span class="o">=</span> <span class="i">Statistics</span><span class="o">.</span><span class="i">empiricalInvCDFFunc</span> <span onmouseout="hideTip(event, 'fs1', 37)" onmouseover="showTip(event, 'fs1', 37)" class="i">whiteNoise</span>
[ <span class="k">for</span> <span onmouseout="hideTip(event, 'fs6', 38)" onmouseover="showTip(event, 'fs6', 38)" class="i">tau</span> <span class="k">in</span> <span class="n">0.0</span><span class="o">..</span><span class="n">0.05</span><span class="o">..</span><span class="n">1.0</span> <span class="k">-&gt;</span> <span onmouseout="hideTip(event, 'fs5', 39)" onmouseover="showTip(event, 'fs5', 39)" class="f">eicdf</span> <span onmouseout="hideTip(event, 'fs6', 40)" onmouseover="showTip(event, 'fs6', 40)" class="i">tau</span> ]
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs5', 36)" onmouseover="showTip(event, 'fs5', 36)" class="fn">eicdf</span> <span class="o">=</span> <span class="id">Statistics</span><span class="pn">.</span><span class="id">empiricalInvCDFFunc</span> <span onmouseout="hideTip(event, 'fs1', 37)" onmouseover="showTip(event, 'fs1', 37)" class="id">whiteNoise</span>
<span class="pn">[</span> <span class="k">for</span> <span onmouseout="hideTip(event, 'fs6', 38)" onmouseover="showTip(event, 'fs6', 38)" class="fn">tau</span> <span class="k">in</span> <span class="o">0.0</span><span class="o">..</span><span class="n">0.05</span><span class="o">..</span><span class="n">1.0</span> <span class="k">-&gt;</span> <span onmouseout="hideTip(event, 'fs5', 39)" onmouseover="showTip(event, 'fs5', 39)" class="fn">eicdf</span> <span onmouseout="hideTip(event, 'fs6', 40)" onmouseover="showTip(event, 'fs6', 40)" class="fn">tau</span> <span class="pn">]</span>
<span class="fsi">val it : float [] =</span>
<span class="fsi"> [3.633070184; 6.682142043; 7.520000817; 8.040513497; 8.347587493; </span>
<span class="fsi"> 8.645491746; 9.02681611; 9.298987151; 9.522627142; 9.819352699; 10.11872428; </span>
<span class="fsi"> 10.35991046; 10.57530906; 10.8259542; 11.08605473; 11.33170746; 11.54356436; </span>
<span class="fsi"> 11.90973541; 12.4294346; 13.36889423; 16.65183566] </span>
</code></pre></td>
</tr>
</table>
</code></pre>
<h2><a name="Histograms" class="anchor" href="#Histograms">Histograms</a></h2>
<p>A histogram can be computed using the <a href="https://numerics.mathdotnet.com/api/MathNet.Numerics.Statistics/Histogram.htm">Histogram</a> class. Its constructor takes
the samples enumerable, the number of buckets to create, plus optionally the range
(minimum, maximum) of the sample data if available.</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">var</span> histogram <span class="o">=</span> <span class="k">new</span> Histogram(samples, <span class="n">10</span>);
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">var</span> histogram <span class="o">=</span> <span class="k">new</span> Histogram(samples, <span class="n">10</span>);
<span class="k">var</span> bucket<span class="n">3</span>count <span class="o">=</span> histogram[<span class="n">2</span>].Count;
</code></pre></td></tr></table>
<h2><a name="Correlation" class="anchor" href="#Correlation">Correlation</a></h2>
<p>The <code>Correlation</code> class supports computing Pearson's product-momentum and Spearman's ranked
correlation coefficient, as well as their correlation matrix for a set of vectors.</p>
<p>Code Sample: Computing the correlation coefficient of 1000 samples of f(x) = 2x and g(x) = x^2:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">double</span>[] dataF <span class="o">=</span> Generate.LinearSpacedMap(<span class="n">1000</span>, <span class="n">0</span>, <span class="n">100</span>, x <span class="o">=</span><span class="o">&gt;</span> <span class="n">2</span>*x);
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">double</span>[] dataF <span class="o">=</span> Generate.LinearSpacedMap(<span class="n">1000</span>, <span class="n">0</span>, <span class="n">100</span>, x <span class="o">=</span><span class="o">&gt;</span> <span class="n">2</span>*x);
<span class="k">double</span>[] dataG <span class="o">=</span> Generate.LinearSpacedMap(<span class="n">1000</span>, <span class="n">0</span>, <span class="n">100</span>, x <span class="o">=</span><span class="o">&gt;</span> x*x);
<span class="k">double</span> correlation <span class="o">=</span> Correlation.Pearson(dataF, dataG);
</code></pre></td></tr></table>
<div class="tip" id="fs1">val whiteNoise : obj<br /><br />Full name: DescriptiveStatistics.whiteNoise</div>
<div class="tip" id="fs2">val wave : obj<br /><br />Full name: DescriptiveStatistics.wave</div>
<div class="tip" id="fs3">val os : (int -&gt; obj)<br /><br />Full name: DescriptiveStatistics.os</div>
<div class="tip" id="fs4">val ecdf : obj<br /><br />Full name: DescriptiveStatistics.ecdf</div>
<div class="tip" id="fs5">val eicdf : (float -&gt; obj)<br /><br />Full name: DescriptiveStatistics.eicdf</div>
<div class="tip" id="fs6">val tau : float</div>
<div class="fsdocs-tip" id="fs1">val whiteNoise : obj</div>
<div class="fsdocs-tip" id="fs2">val wave : obj</div>
<div class="fsdocs-tip" id="fs3">val os : (int -&gt; obj)</div>
<div class="fsdocs-tip" id="fs4">val ecdf : obj</div>
<div class="fsdocs-tip" id="fs5">val eicdf : (float -&gt; obj)</div>
<div class="fsdocs-tip" id="fs6">val tau : float</div>
</div>
<div class="span3">
<ul class="nav nav-list" id="menu">
<li class="nav-header">Math.NET Numerics</li>
<li><a href="https://numerics.mathdotnet.com/Packages.html">NuGet & Binaries</a></li>
<li><a href="https://numerics.mathdotnet.com/ReleaseNotes.html">Release Notes</a></li>
<li><a href="https://numerics.mathdotnet.com/License.html">MIT License</a></li>
<li><a href="https://numerics.mathdotnet.com/Compatibility.html">Platform Support</a></li>
<li><a href="https://numerics.mathdotnet.com/api/">Class Reference</a></li>
<li><a href="https://github.com/mathnet/mathnet-numerics/issues">Issues & Bugs</a></li>
<li><a href="https://numerics.mathdotnet.com/Users.html">Who is using Math.NET?</a></li>
<li class="nav-header">Contributing</li>
<li><a href="https://numerics.mathdotnet.com/Contributors.html">Contributors</a></li>
<li><a href="https://numerics.mathdotnet.com/Contributing.html">Contributing</a></li>
<li><a href="https://numerics.mathdotnet.com/Build.html">Build & Tools</a></li>
<li><a href="http://feedback.mathdotnet.com/forums/2060-math-net-numerics">Your Ideas</a></li>
<li class="nav-header">Getting Help</li>
<li><a href="https://discuss.mathdotnet.com/c/numerics">Discuss</a></li>
<li><a href="https://stackoverflow.com/questions/tagged/mathdotnet">Stack Overflow</a></li>
<li class="nav-header">Getting Started</li>
<li><a href="https://numerics.mathdotnet.com/">Getting started</a></li>
<li><a href="https://numerics.mathdotnet.com/Constants.html">Constants</a></li>
<li>Floating-Point Numbers</li>
<li>Arbitrary Precision Numbers</li>
<li>Complex Numbers</li>
<li><a href="https://numerics.mathdotnet.com/Matrix.html">Matrices and Vectors</a></li>
<li><a href="https://numerics.mathdotnet.com/Euclid.html">Euclid & Number Theory</a></li>
<li>Combinatorics</li>
<li class="nav-header">Evaluation</li>
<li><a href="https://numerics.mathdotnet.com/Functions.html">Special Functions</a></li>
<li>Differentiation</li>
<li><a href="https://numerics.mathdotnet.com/Integration.html">Integration</a></li>
<li class="nav-header">Statistics/Probability</li>
<li><a href="https://numerics.mathdotnet.com/DescriptiveStatistics.html">Descriptive Statistics</a></li>
<li><a href="https://numerics.mathdotnet.com/Probability.html">Probability Distributions</a></li>
<li class="nav-header">Generation</li>
<li><a href="https://numerics.mathdotnet.com/Generate.html">Generating Data</a></li>
<li><a href="https://numerics.mathdotnet.com/Random.html">Random Numbers</a></li>
<li class="nav-header">Transformation</li>
<li>Fourier Transform (FFT)</li>
<li>Filtering & DSP</li>
<li>Window Functions</li>
<li class="nav-header">Solving Equations</li>
<li><a href="https://numerics.mathdotnet.com/LinearEquations.html">Linear Equation Systems</a></li>
<li>Nonlinear Root Finding</li>
<li class="nav-header">Optimization</li>
<li>Linear Least Squares</li>
<li>Nonlinear Optimization</li>
<li><a href="https://numerics.mathdotnet.com/Distance.html">Distance Metrics</a></li>
<li class="nav-header">Curve Fitting</li>
<li><a href="https://numerics.mathdotnet.com/Regression.html">Regression</a></li>
<li>Interpolation</li>
<li>Fourier Approximation</li>
<li class="nav-header">Native Providers</li>
<li><a href="https://numerics.mathdotnet.com/MKL.html">Intel MKL</a></li>
<li class="nav-header">Working Together</li>
<li><a href="https://numerics.mathdotnet.com/CSV.html">Delimited Text Files (CSV)</a></li>
<li><a href="https://numerics.mathdotnet.com/MatrixMarket.html">NIST MatrixMarket</a></li>
<li><a href="https://numerics.mathdotnet.com/MatlabFiles.html">MATLAB</a></li>
<li><a href="https://numerics.mathdotnet.com/IFSharpNotebook.html">IF# Notebook</a></li>
<li>FsLab & Deedle</li>
<li>Microsoft Excel</li>
<li>numl.net machine learning</li>
<li>R-project</li>
</ul>
</div>
</div>
</div>
</body>
<!-- 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>

351
Distance.html

@ -1,63 +1,138 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>Distance Metrics
</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta name="description" content="Math.NET Numerics, providing methods and algorithms for numerical computations in science, engineering and every day use. .Net 4, .Net 3.5, SL5, Win8, WP8, PCL 47 and 136, Mono, Xamarin Android/iOS."/>
<meta name="author" content="Christoph Ruegg, Marcus Cuda, Jurgen Van Gael"/>
<script src="https://code.jquery.com/jquery-1.8.0.js"></script>
<script src="https://code.jquery.com/ui/1.8.23/jquery-ui.js"></script>
<script src="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/js/bootstrap.min.js"></script>
<link href="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap-combined.min.css" rel="stylesheet"/>
<link type="text/css" rel="stylesheet" href="https://numerics.mathdotnet.com/content/style.css" />
<style>
#main table:not(.pre) {
border: 1px solid #dddddd;
max-width: 100%;
border-style: solid;
border-width: 1px;
border-color: gray;
border-collapse: collapse;
border-right-width: 1px;
border-bottom-width: 1px;
margin-top: 15px;
margin-bottom: 25px;
}
#main table:not(.pre) th, #main table:not(.pre) td {
border: 1px solid #dddddd;
padding: 6px;
}
#main table:not(.pre) th p, #main table:not(.pre) td p {
margin-bottom: 5px;
}
</style>
<script type="text/javascript" src="https://numerics.mathdotnet.com/content/tips.js"></script>
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<![endif]-->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
</head>
<body>
<div class="container">
<div class="masthead">
<ul class="nav nav-pills pull-right">
<li><a href="https://www.mathdotnet.com">Math.NET Project</a></li>
<li><a href="https://numerics.mathdotnet.com">Math.NET Numerics</a></li>
<li><a href="https://github.com/mathnet/mathnet-numerics">GitHub</a></li>
</ul>
<h3 class="muted">Math.NET Numerics</h3>
<head>
<meta charset="utf-8">
<title>Distance Metrics
</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>
<hr />
<div class="row">
<div class="span9" id="main">
<h1><a name="Distance-Metrics" class="anchor" href="#Distance-Metrics">Distance Metrics</a></h1>
<!-- 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">Floating-Point Numbers</li>
<li class="nav-item">Arbitrary Precision Numbers</li>
<li class="nav-item">Complex Numbers</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">Differentiation</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">Transformation</li>
<li class="nav-item">Fourier Transform (FFT)</li>
<li class="nav-item">Filtering & DSP</li>
<li class="nav-item">Window Functions</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-item">Nonlinear Root Finding</li>
<li class="nav-header">Optimization</li>
<li class="nav-item">Linear Least Squares</li>
<li class="nav-item">Nonlinear 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-item">Interpolation</li>
<li class="nav-item">Fourier Approximation</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://www.mathdotnet.com">Math.NET Project</a> |
<a href="https://numerics.mathdotnet.com">Math.NET Numerics</a> |
<a href="https://github.com/mathnet/mathnet-numerics">GitHub</a>
</h3>
</div>
<hr />
<div class="container" id="fsdocs-content">
<h1><a name="Distance-Metrics" class="anchor" href="#Distance-Metrics">Distance Metrics</a></h1>
<p>A metric or distance function is a function <span class="math">\(d(x,y)\)</span> that defines the distance
between elements of a set as a non-negative real number. If the distance is zero, both elements are equivalent
under that specific metric. Distance functions thus provide a way to measure how close two elements are, where elements
@ -68,196 +143,100 @@ as error or cost functions to be minimized in an optimization problem.</p>
are valid metrics as well. Every normed vector space induces a distance given by <span class="math">\(d(\vec x, \vec y) = \|\vec x - \vec y\|\)</span>.</p>
<p>Math.NET Numerics provides the following distance functions on vectors and arrays:</p>
<h2><a name="Sum-of-Absolute-Difference-SAD" class="anchor" href="#Sum-of-Absolute-Difference-SAD">Sum of Absolute Difference (SAD)</a></h2>
<img src="img/DistanceSAD.png" style="width:87px; height:87px; float:left; margin:10px 10px 10px 0;" />
<img src="DistanceSAD.png" style="width:87px; height:87px; float:left; margin:10px 10px 10px 0;" />
<p>The sum of absolute difference is equivalent to the <span class="math">\(L_1\)</span>-norm of the difference, also known as Manhattan- or Taxicab-norm.
The <code>abs</code> function makes this metric a bit complicated to deal with analytically, but it is more robust than SSD.</p>
<p><span class="math">\[d_{\mathbf{SAD}} : (x, y) \mapsto \|x-y\|_1 = \sum_{i=1}^{n} |x_i-y_i|\]</span></p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">double</span> d <span class="o">=</span> Distance.SAD(x, y);
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">double</span> d <span class="o">=</span> Distance.SAD(x, y);
</code></pre></td></tr></table>
<h2><a name="Sum-of-Squared-Difference-SSD" class="anchor" href="#Sum-of-Squared-Difference-SSD">Sum of Squared Difference (SSD)</a></h2>
<img src="img/DistanceSSD.png" style="width:87px; height:87px; float:left; margin:10px 10px 10px 0;" />
<img src="DistanceSSD.png" style="width:87px; height:87px; float:left; margin:10px 10px 10px 0;" />
<p>The sum of squared difference is equivalent to the squared <span class="math">\(L_2\)</span>-norm, also known as Euclidean norm.
It is therefore also known as Squared Euclidean distance.
This is the fundamental metric in least squares problems and linear algebra. The absence of the <code>abs</code>
function makes this metric convenient to deal with analytically, but the squares cause it to be very
sensitive to large outliers.</p>
<p><span class="math">\[d_{\mathbf{SSD}} : (x, y) \mapsto \|x-y\|_2^2 = \langle x-y, x-y\rangle = \sum_{i=1}^{n} (x_i-y_i)^2\]</span></p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">double</span> d <span class="o">=</span> Distance.SSD(x, y);
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">double</span> d <span class="o">=</span> Distance.SSD(x, y);
</code></pre></td></tr></table>
<h2><a name="Mean-Absolute-Error-MAE" class="anchor" href="#Mean-Absolute-Error-MAE">Mean-Absolute Error (MAE)</a></h2>
<img src="img/DistanceMAE.png" style="width:87px; height:87px; float:left; margin:10px 10px 10px 0;" />
<img src="DistanceMAE.png" style="width:87px; height:87px; float:left; margin:10px 10px 10px 0;" />
<p>The mean absolute error is a normalized version of the sum of absolute difference.</p>
<p><span class="math">\[d_{\mathbf{MAE}} : (x, y) \mapsto \frac{d_{\mathbf{SAD}}}{n} = \frac{\|x-y\|_1}{n} = \frac{1}{n}\sum_{i=1}^{n} |x_i-y_i|\]</span></p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">double</span> d <span class="o">=</span> Distance.MAE(x, y);
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">double</span> d <span class="o">=</span> Distance.MAE(x, y);
</code></pre></td></tr></table>
<h2><a name="Mean-Squared-Error-MSE" class="anchor" href="#Mean-Squared-Error-MSE">Mean-Squared Error (MSE)</a></h2>
<img src="img/DistanceMSE.png" style="width:87px; height:87px; float:left; margin:10px 10px 10px 0;" />
<img src="DistanceMSE.png" style="width:87px; height:87px; float:left; margin:10px 10px 10px 0;" />
<p>The mean squared error is a normalized version of the sum of squared difference.</p>
<p><span class="math">\[d_{\mathbf{MSE}} : (x, y) \mapsto \frac{d_{\mathbf{SSD}}}{n} = \frac{\|x-y\|_2^2}{n} = \frac{1}{n}\sum_{i=1}^{n} (x_i-y_i)^2\]</span></p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">double</span> d <span class="o">=</span> Distance.MSE(x, y);
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">double</span> d <span class="o">=</span> Distance.MSE(x, y);
</code></pre></td></tr></table>
<h2><a name="Euclidean-Distance" class="anchor" href="#Euclidean-Distance">Euclidean Distance</a></h2>
<img src="img/DistanceEuclidean.png" style="width:87px; height:87px; float:left; margin:10px 10px 10px 0;" />
<img src="DistanceEuclidean.png" style="width:87px; height:87px; float:left; margin:10px 10px 10px 0;" />
<p>The euclidean distance is the <span class="math">\(L_2\)</span>-norm of the difference, a special case of the Minkowski distance with p=2.
It is the natural distance in a geometric interpretation.</p>
<p><span class="math">\[d_{\mathbf{2}} : (x, y) \mapsto \|x-y\|_2 = \sqrt{d_{\mathbf{SSD}}} = \sqrt{\sum_{i=1}^{n} (x_i-y_i)^2}\]</span></p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">double</span> d <span class="o">=</span> Distance.Euclidean(x, y);
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">double</span> d <span class="o">=</span> Distance.Euclidean(x, y);
</code></pre></td></tr></table>
<h2><a name="Manhattan-Distance" class="anchor" href="#Manhattan-Distance">Manhattan Distance</a></h2>
<img src="img/DistanceManhattan.png" style="width:87px; height:87px; float:left; margin:10px 10px 10px 0;" />
<img src="DistanceManhattan.png" style="width:87px; height:87px; float:left; margin:10px 10px 10px 0;" />
<p>The Manhattan distance is the <span class="math">\(L_1\)</span>-norm of the difference, a special case of the Minkowski distance with p=1
and equivalent to the sum of absolute difference.</p>
<p><span class="math">\[d_{\mathbf{1}} \equiv d_{\mathbf{SAD}} : (x, y) \mapsto \|x-y\|_1 = \sum_{i=1}^{n} |x_i-y_i|\]</span></p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">double</span> d <span class="o">=</span> Distance.Manhattan(x, y);
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">double</span> d <span class="o">=</span> Distance.Manhattan(x, y);
</code></pre></td></tr></table>
<h2><a name="Chebyshev-Distance" class="anchor" href="#Chebyshev-Distance">Chebyshev Distance</a></h2>
<img src="img/DistanceChebyshev.png" style="width:87px; height:87px; float:left; margin:10px 10px 10px 0;" />
<img src="DistanceChebyshev.png" style="width:87px; height:87px; float:left; margin:10px 10px 10px 0;" />
<p>The Chebyshev distance is the <span class="math">\(L_\infty\)</span>-norm of the difference, a special case of the Minkowski distance
where p goes to infinity. It is also known as Chessboard distance.</p>
<p><span class="math">\[d_{\mathbf{\infty}} : (x, y) \mapsto \|x-y\|_\infty = \lim_{p \rightarrow \infty}\bigg(\sum_{i=1}^{n} |x_i-y_i|^p\bigg)^\frac{1}{p} = \max_{i} |x_i-y_i|\]</span></p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">double</span> d <span class="o">=</span> Distance.Chebyshev(x, y);
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">double</span> d <span class="o">=</span> Distance.Chebyshev(x, y);
</code></pre></td></tr></table>
<h2><a name="Minkowski-Distance" class="anchor" href="#Minkowski-Distance">Minkowski Distance</a></h2>
<img src="img/DistanceMinkowski3.png" style="width:87px; height:87px; float:left; margin:10px 10px 10px 0;" />
<img src="DistanceMinkowski3.png" style="width:87px; height:87px; float:left; margin:10px 10px 10px 0;" />
<p>The Minkowski distance is the generalized <span class="math">\(L_p\)</span>-norm of the difference.
The contour plot on the left demonstrates the case of p=3.</p>
<p><span class="math">\[d_{\mathbf{p}} : (x, y) \mapsto \|x-y\|_p = \bigg(\sum_{i=1}^{n} |x_i-y_i|^p\bigg)^\frac{1}{p}\]</span></p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">double</span> d <span class="o">=</span> Distance.Minkowski(p, x, y);
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">double</span> d <span class="o">=</span> Distance.Minkowski(p, x, y);
</code></pre></td></tr></table>
<h2><a name="Canberra-Distance" class="anchor" href="#Canberra-Distance">Canberra Distance</a></h2>
<img src="img/DistanceCanberra.png" style="width:87px; height:87px; float:left; margin:10px 10px 10px 0;" />
<img src="DistanceCanberra.png" style="width:87px; height:87px; float:left; margin:10px 10px 10px 0;" />
<p>The Canberra distance is a weighted version of the Manhattan distance, introduced and refined 1967 by Lance, Williams and Adkins.
It is often used for data scattered around an origin, as it is biased for measures around the origin and very sensitive for values close to zero.</p>
<p><span class="math">\[d_{\mathbf{CAD}} : (x, y) \mapsto \sum_{i=1}^{n} \frac{|x_i-y_i|}{|x_i|+|y_i|}\]</span></p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">double</span> d <span class="o">=</span> Distance.Canberra(x, y);
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">double</span> d <span class="o">=</span> Distance.Canberra(x, y);
</code></pre></td></tr></table>
<h2><a name="Cosine-Distance" class="anchor" href="#Cosine-Distance">Cosine Distance</a></h2>
<img src="img/DistanceCosine.png" style="width:87px; height:87px; float:left; margin:10px 10px 10px 0;" />
<img src="DistanceCosine.png" style="width:87px; height:87px; float:left; margin:10px 10px 10px 0;" />
<p>The cosine distance contains the dot product scaled by the product of the Euclidean distances from the origin.
It represents the angular distance of two vectors while ignoring their scale.</p>
<p><span class="math">\[d_{\mathbf{cos}} : (x, y) \mapsto 1-\frac{\langle x, y\rangle}{\|x\|_2\|y\|_2} = 1-\frac{\sum_{i=1}^{n} x_i y_i}{\sqrt{\sum_{i=1}^{n} x_i^2}\sqrt{\sum_{i=1}^{n} y_i^2}}\]</span></p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">double</span> d <span class="o">=</span> Distance.Cosine(x, y);
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">double</span> d <span class="o">=</span> Distance.Cosine(x, y);
</code></pre></td></tr></table>
<h2><a name="Pearson-s-Distance" class="anchor" href="#Pearson-s-Distance">Pearson's Distance</a></h2>
<img src="img/DistancePearson.png" style="width:87px; height:87px; float:left; margin:10px 10px 10px 0;" />
<img src="DistancePearson.png" style="width:87px; height:87px; float:left; margin:10px 10px 10px 0;" />
<p>The Pearson distance is a correlation distance based on Pearson's product-momentum correlation coefficient
of the two sample vectors. Since the correlation coefficient falls between [-1, 1], the Pearson distance
lies in [0, 2] and measures the linear relationship between the two vectors.</p>
<p><span class="math">\[d_{\mathbf{Pearson}} : (x, y) \mapsto 1 - \mathbf{Corr}(x, y)\]</span></p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">double</span> d <span class="o">=</span> Distance.Pearson(x, y);
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">double</span> d <span class="o">=</span> Distance.Pearson(x, y);
</code></pre></td></tr></table>
<h2><a name="Hamming-Distance" class="anchor" href="#Hamming-Distance">Hamming Distance</a></h2>
<p>The hamming distance represents the number of entries in the two sample vectors which are different.
It is a fundamental distance measure in information theory but less relevant in non-integer numerical problems.</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">double</span> d <span class="o">=</span> Distance.Hamming(x, y);
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">double</span> d <span class="o">=</span> Distance.Hamming(x, y);
</code></pre></td></tr></table>
</div>
<div class="span3">
<ul class="nav nav-list" id="menu">
<li class="nav-header">Math.NET Numerics</li>
<li><a href="https://numerics.mathdotnet.com/Packages.html">NuGet & Binaries</a></li>
<li><a href="https://numerics.mathdotnet.com/ReleaseNotes.html">Release Notes</a></li>
<li><a href="https://numerics.mathdotnet.com/License.html">MIT License</a></li>
<li><a href="https://numerics.mathdotnet.com/Compatibility.html">Platform Support</a></li>
<li><a href="https://numerics.mathdotnet.com/api/">Class Reference</a></li>
<li><a href="https://github.com/mathnet/mathnet-numerics/issues">Issues & Bugs</a></li>
<li><a href="https://numerics.mathdotnet.com/Users.html">Who is using Math.NET?</a></li>
<li class="nav-header">Contributing</li>
<li><a href="https://numerics.mathdotnet.com/Contributors.html">Contributors</a></li>
<li><a href="https://numerics.mathdotnet.com/Contributing.html">Contributing</a></li>
<li><a href="https://numerics.mathdotnet.com/Build.html">Build & Tools</a></li>
<li><a href="http://feedback.mathdotnet.com/forums/2060-math-net-numerics">Your Ideas</a></li>
<li class="nav-header">Getting Help</li>
<li><a href="https://discuss.mathdotnet.com/c/numerics">Discuss</a></li>
<li><a href="https://stackoverflow.com/questions/tagged/mathdotnet">Stack Overflow</a></li>
<li class="nav-header">Getting Started</li>
<li><a href="https://numerics.mathdotnet.com/">Getting started</a></li>
<li><a href="https://numerics.mathdotnet.com/Constants.html">Constants</a></li>
<li>Floating-Point Numbers</li>
<li>Arbitrary Precision Numbers</li>
<li>Complex Numbers</li>
<li><a href="https://numerics.mathdotnet.com/Matrix.html">Matrices and Vectors</a></li>
<li><a href="https://numerics.mathdotnet.com/Euclid.html">Euclid & Number Theory</a></li>
<li>Combinatorics</li>
<li class="nav-header">Evaluation</li>
<li><a href="https://numerics.mathdotnet.com/Functions.html">Special Functions</a></li>
<li>Differentiation</li>
<li><a href="https://numerics.mathdotnet.com/Integration.html">Integration</a></li>
<li class="nav-header">Statistics/Probability</li>
<li><a href="https://numerics.mathdotnet.com/DescriptiveStatistics.html">Descriptive Statistics</a></li>
<li><a href="https://numerics.mathdotnet.com/Probability.html">Probability Distributions</a></li>
<li class="nav-header">Generation</li>
<li><a href="https://numerics.mathdotnet.com/Generate.html">Generating Data</a></li>
<li><a href="https://numerics.mathdotnet.com/Random.html">Random Numbers</a></li>
<li class="nav-header">Transformation</li>
<li>Fourier Transform (FFT)</li>
<li>Filtering & DSP</li>
<li>Window Functions</li>
<li class="nav-header">Solving Equations</li>
<li><a href="https://numerics.mathdotnet.com/LinearEquations.html">Linear Equation Systems</a></li>
<li>Nonlinear Root Finding</li>
<li class="nav-header">Optimization</li>
<li>Linear Least Squares</li>
<li>Nonlinear Optimization</li>
<li><a href="https://numerics.mathdotnet.com/Distance.html">Distance Metrics</a></li>
<li class="nav-header">Curve Fitting</li>
<li><a href="https://numerics.mathdotnet.com/Regression.html">Regression</a></li>
<li>Interpolation</li>
<li>Fourier Approximation</li>
<li class="nav-header">Native Providers</li>
<li><a href="https://numerics.mathdotnet.com/MKL.html">Intel MKL</a></li>
<li class="nav-header">Working Together</li>
<li><a href="https://numerics.mathdotnet.com/CSV.html">Delimited Text Files (CSV)</a></li>
<li><a href="https://numerics.mathdotnet.com/MatrixMarket.html">NIST MatrixMarket</a></li>
<li><a href="https://numerics.mathdotnet.com/MatlabFiles.html">MATLAB</a></li>
<li><a href="https://numerics.mathdotnet.com/IFSharpNotebook.html">IF# Notebook</a></li>
<li>FsLab & Deedle</li>
<li>Microsoft Excel</li>
<li>numl.net machine learning</li>
<li>R-project</li>
</ul>
</div>
</div>
</div>
</body>
<!-- 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>

BIN
DistanceCanberra.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
DistanceChebyshev.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

BIN
DistanceCosine.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

BIN
DistanceEuclidean.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
DistanceMAE.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
DistanceMSE.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
DistanceManhattan.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
DistanceMinkowski3.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

BIN
DistancePearson.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

BIN
DistanceSAD.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
DistanceSSD.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

85
Dockerfile

@ -0,0 +1,85 @@
FROM jupyter/base-notebook:latest
# Install .NET CLI dependencies
ARG NB_USER=fsdocs-user
ARG NB_UID=1000
ENV USER ${NB_USER}
ENV NB_UID ${NB_UID}
ENV HOME /home/${NB_USER}
WORKDIR ${HOME}
USER root
RUN apt-get update
RUN apt-get install -y curl
ENV \
# Enable detection of running in a container
DOTNET_RUNNING_IN_CONTAINER=true \
# Enable correct mode for dotnet watch (only mode supported in a container)
DOTNET_USE_POLLING_FILE_WATCHER=true \
# Skip extraction of XML docs - generally not useful within an image/container - helps performance
NUGET_XMLDOC_MODE=skip \
# Opt out of telemetry until after we install jupyter when building the image, this prevents caching of machine id
DOTNET_INTERACTIVE_CLI_TELEMETRY_OPTOUT=true
# Install .NET CLI dependencies
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
libc6 \
libgcc1 \
libgssapi-krb5-2 \
libicu66 \
libssl1.1 \
libstdc++6 \
zlib1g \
&& rm -rf /var/lib/apt/lists/*
# Install .NET Core SDK
# When updating the SDK version, the sha512 value a few lines down must also be updated.
ENV DOTNET_SDK_VERSION 5.0.101
RUN dotnet_sdk_version=5.0.101 \
&& curl -SL --output dotnet.tar.gz https://dotnetcli.azureedge.net/dotnet/Sdk/$dotnet_sdk_version/dotnet-sdk-$dotnet_sdk_version-linux-x64.tar.gz \
&& dotnet_sha512='398d88099d765b8f5b920a3a2607c2d2d8a946786c1a3e51e73af1e663f0ee770b2b624a630b1bec1ceed43628ea8bc97963ba6c870d42bec064bde1cd1c9edb' \
&& echo "$dotnet_sha512 dotnet.tar.gz" | sha512sum -c - \
&& mkdir -p /usr/share/dotnet \
&& tar -ozxf dotnet.tar.gz -C /usr/share/dotnet \
&& rm dotnet.tar.gz \
&& ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet \
# Trigger first run experience by running arbitrary cmd
&& dotnet help
# Copy notebooks
COPY ./ ${HOME}/notebooks/
# Copy package sources
COPY ./NuGet.config ${HOME}/nuget.config
RUN chown -R ${NB_UID} ${HOME}
USER ${USER}
#Install nteract
RUN pip install nteract_on_jupyter
# Install lastest build from master branch of Microsoft.DotNet.Interactive
RUN dotnet tool install -g Microsoft.dotnet-interactive --add-source "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json"
#latest stable from nuget.org
#RUN dotnet tool install -g Microsoft.dotnet-interactive --add-source "https://api.nuget.org/v3/index.json"
ENV PATH="${PATH}:${HOME}/.dotnet/tools"
RUN echo "$PATH"
# Install kernel specs
RUN dotnet interactive jupyter install
# Enable telemetry once we install jupyter for the image
ENV DOTNET_INTERACTIVE_CLI_TELEMETRY_OPTOUT=false
# Set root to notebooks
WORKDIR ${HOME}/notebooks/

307
Euclid.html

@ -1,63 +1,138 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>Euclid &amp; Number Theory
<head>
<meta charset="utf-8">
<title>Euclid &amp; Number Theory
</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta name="description" content="Math.NET Numerics, providing methods and algorithms for numerical computations in science, engineering and every day use. .Net 4, .Net 3.5, SL5, Win8, WP8, PCL 47 and 136, Mono, Xamarin Android/iOS."/>
<meta name="author" content="Christoph Ruegg, Marcus Cuda, Jurgen Van Gael"/>
<script src="https://code.jquery.com/jquery-1.8.0.js"></script>
<script src="https://code.jquery.com/ui/1.8.23/jquery-ui.js"></script>
<script src="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/js/bootstrap.min.js"></script>
<link href="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap-combined.min.css" rel="stylesheet"/>
<link type="text/css" rel="stylesheet" href="https://numerics.mathdotnet.com/content/style.css" />
<style>
#main table:not(.pre) {
border: 1px solid #dddddd;
max-width: 100%;
border-style: solid;
border-width: 1px;
border-color: gray;
border-collapse: collapse;
border-right-width: 1px;
border-bottom-width: 1px;
margin-top: 15px;
margin-bottom: 25px;
}
#main table:not(.pre) th, #main table:not(.pre) td {
border: 1px solid #dddddd;
padding: 6px;
}
#main table:not(.pre) th p, #main table:not(.pre) td p {
margin-bottom: 5px;
}
</style>
<script type="text/javascript" src="https://numerics.mathdotnet.com/content/tips.js"></script>
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<![endif]-->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
</head>
<body>
<div class="container">
<div class="masthead">
<ul class="nav nav-pills pull-right">
<li><a href="https://www.mathdotnet.com">Math.NET Project</a></li>
<li><a href="https://numerics.mathdotnet.com">Math.NET Numerics</a></li>
<li><a href="https://github.com/mathnet/mathnet-numerics">GitHub</a></li>
</ul>
<h3 class="muted">Math.NET Numerics</h3>
<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>
<hr />
<div class="row">
<div class="span9" id="main">
<h1><a name="Euclid-amp-Number-Theory" class="anchor" href="#Euclid-amp-Number-Theory">Euclid &amp; Number Theory</a></h1>
<!-- 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">Floating-Point Numbers</li>
<li class="nav-item">Arbitrary Precision Numbers</li>
<li class="nav-item">Complex Numbers</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">Differentiation</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">Transformation</li>
<li class="nav-item">Fourier Transform (FFT)</li>
<li class="nav-item">Filtering & DSP</li>
<li class="nav-item">Window Functions</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-item">Nonlinear Root Finding</li>
<li class="nav-header">Optimization</li>
<li class="nav-item">Linear Least Squares</li>
<li class="nav-item">Nonlinear 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-item">Interpolation</li>
<li class="nav-item">Fourier Approximation</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://www.mathdotnet.com">Math.NET Project</a> |
<a href="https://numerics.mathdotnet.com">Math.NET Numerics</a> |
<a href="https://github.com/mathnet/mathnet-numerics">GitHub</a>
</h3>
</div>
<hr />
<div class="container" id="fsdocs-content">
<h1><a name="Euclid-amp-Number-Theory" class="anchor" href="#Euclid-amp-Number-Theory">Euclid &amp; Number Theory</a></h1>
<p>The static <code>Euclid</code> class in the <code>MathNet.Numerics</code> namespace provides routines related
to the domain of integers.</p>
<h2><a name="Remainder-vs-Canonical-Modulus" class="anchor" href="#Remainder-vs-Canonical-Modulus">Remainder vs. Canonical Modulus</a></h2>
@ -72,12 +147,7 @@ where the result of the division cannot be expressed as an integer. It is thus n
that the <strong>remainder has the sign of the dividend</strong>.</p>
<p>In C# and F#, the remainder is available as <code>%</code> operator, in VB as <code>Mod</code>.
Alternatively you can use the Reminder function:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
<span class="l">4: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp">Euclid.Remainder( <span class="n">5</span>, <span class="n">3</span>); <span class="c">// = 2, such that 5 = 1*3 + 2</span>
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp">Euclid.Remainder( <span class="n">5</span>, <span class="n">3</span>); <span class="c">// = 2, such that 5 = 1*3 + 2</span>
Euclid.Remainder(<span class="n">-5</span>, <span class="n">3</span>); <span class="c">// = -2, such that -5 = -1*3 - 2</span>
Euclid.Remainder( <span class="n">5</span>, <span class="n">-3</span>); <span class="c">// = 2, such that 5 = -1*-3 + 2</span>
Euclid.Remainder(<span class="n">-5</span>, <span class="n">-3</span>); <span class="c">// = -2, such that -5 = 1*-3 - 2</span>
@ -89,12 +159,7 @@ when their difference is an integer multiple of n. The modulo operator normalize
to the fundamental or smallest values congruent modulo n, where n is the divisor, and thus
to the interval from 0 to n (including 0 but excluding n, possibly negative). It is thus natural that
the <strong>modulus always has the sign of the divisor</strong>.</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
<span class="l">4: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp">Euclid.Modulus( <span class="n">5</span>, <span class="n">3</span>); <span class="c">// = 2, congruent modulo 3 by 5 - 1*3</span>
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp">Euclid.Modulus( <span class="n">5</span>, <span class="n">3</span>); <span class="c">// = 2, congruent modulo 3 by 5 - 1*3</span>
Euclid.Modulus(<span class="n">-5</span>, <span class="n">3</span>); <span class="c">// = 1, congruent modulo 3 by -5 + 2*3</span>
Euclid.Modulus( <span class="n">5</span>, <span class="n">-3</span>); <span class="c">// = -1, congruent modulo -3 by 5 + 2*-3</span>
Euclid.Modulus(<span class="n">-5</span>, <span class="n">-3</span>); <span class="c">// = -2, congruent modulo -3 by -5 - 1*-3</span>
@ -123,13 +188,7 @@ the integer argument is a perfect square, i.e. a square of an integer.</p>
<p>The <code>GreatestCommonDivisor</code> evaluates the <strong>GCD</strong> of either two integers or a full list or array of them
using Euclid's algorithm. An extended version also returns how exactly the GCD can be composed from two
integer arguments.</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
<span class="l">4: </span>
<span class="l">5: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp">Euclid.GreatestCommonDivisor(<span class="n">10</span>, <span class="n">15</span>, <span class="n">45</span>); <span class="c">// 5</span>
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp">Euclid.GreatestCommonDivisor(<span class="n">10</span>, <span class="n">15</span>, <span class="n">45</span>); <span class="c">// 5</span>
<span class="k">long</span> x, y;
Euclid.ExtendedGreatestCommonDivisor(<span class="n">45</span>, <span class="n">18</span>, <span class="k">out</span> x, <span class="k">out</span> y) <span class="c">// 9</span>
@ -137,93 +196,19 @@ Euclid.ExtendedGreatestCommonDivisor(<span class="n">45</span>, <span class="n">
</code></pre></td></tr></table>
<h4><a name="Least-Common-Multiple" class="anchor" href="#Least-Common-Multiple">Least Common Multiple</a></h4>
<p>Closely related to the GCD, <code>LeastCommonMultiple</code> returns the <strong>LCM</strong> of two or more integers.</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp">Euclid.LeastCommonMultiple(<span class="n">3</span>, <span class="n">5</span>, <span class="n">6</span>); <span class="c">// 30</span>
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp">Euclid.LeastCommonMultiple(<span class="n">3</span>, <span class="n">5</span>, <span class="n">6</span>); <span class="c">// 30</span>
</code></pre></td></tr></table>
</div>
<div class="span3">
<ul class="nav nav-list" id="menu">
<li class="nav-header">Math.NET Numerics</li>
<li><a href="https://numerics.mathdotnet.com/Packages.html">NuGet & Binaries</a></li>
<li><a href="https://numerics.mathdotnet.com/ReleaseNotes.html">Release Notes</a></li>
<li><a href="https://numerics.mathdotnet.com/License.html">MIT License</a></li>
<li><a href="https://numerics.mathdotnet.com/Compatibility.html">Platform Support</a></li>
<li><a href="https://numerics.mathdotnet.com/api/">Class Reference</a></li>
<li><a href="https://github.com/mathnet/mathnet-numerics/issues">Issues & Bugs</a></li>
<li><a href="https://numerics.mathdotnet.com/Users.html">Who is using Math.NET?</a></li>
<li class="nav-header">Contributing</li>
<li><a href="https://numerics.mathdotnet.com/Contributors.html">Contributors</a></li>
<li><a href="https://numerics.mathdotnet.com/Contributing.html">Contributing</a></li>
<li><a href="https://numerics.mathdotnet.com/Build.html">Build & Tools</a></li>
<li><a href="http://feedback.mathdotnet.com/forums/2060-math-net-numerics">Your Ideas</a></li>
<li class="nav-header">Getting Help</li>
<li><a href="https://discuss.mathdotnet.com/c/numerics">Discuss</a></li>
<li><a href="https://stackoverflow.com/questions/tagged/mathdotnet">Stack Overflow</a></li>
<li class="nav-header">Getting Started</li>
<li><a href="https://numerics.mathdotnet.com/">Getting started</a></li>
<li><a href="https://numerics.mathdotnet.com/Constants.html">Constants</a></li>
<li>Floating-Point Numbers</li>
<li>Arbitrary Precision Numbers</li>
<li>Complex Numbers</li>
<li><a href="https://numerics.mathdotnet.com/Matrix.html">Matrices and Vectors</a></li>
<li><a href="https://numerics.mathdotnet.com/Euclid.html">Euclid & Number Theory</a></li>
<li>Combinatorics</li>
<li class="nav-header">Evaluation</li>
<li><a href="https://numerics.mathdotnet.com/Functions.html">Special Functions</a></li>
<li>Differentiation</li>
<li><a href="https://numerics.mathdotnet.com/Integration.html">Integration</a></li>
<li class="nav-header">Statistics/Probability</li>
<li><a href="https://numerics.mathdotnet.com/DescriptiveStatistics.html">Descriptive Statistics</a></li>
<li><a href="https://numerics.mathdotnet.com/Probability.html">Probability Distributions</a></li>
<li class="nav-header">Generation</li>
<li><a href="https://numerics.mathdotnet.com/Generate.html">Generating Data</a></li>
<li><a href="https://numerics.mathdotnet.com/Random.html">Random Numbers</a></li>
<li class="nav-header">Transformation</li>
<li>Fourier Transform (FFT)</li>
<li>Filtering & DSP</li>
<li>Window Functions</li>
<li class="nav-header">Solving Equations</li>
<li><a href="https://numerics.mathdotnet.com/LinearEquations.html">Linear Equation Systems</a></li>
<li>Nonlinear Root Finding</li>
<li class="nav-header">Optimization</li>
<li>Linear Least Squares</li>
<li>Nonlinear Optimization</li>
<li><a href="https://numerics.mathdotnet.com/Distance.html">Distance Metrics</a></li>
<li class="nav-header">Curve Fitting</li>
<li><a href="https://numerics.mathdotnet.com/Regression.html">Regression</a></li>
<li>Interpolation</li>
<li>Fourier Approximation</li>
<li class="nav-header">Native Providers</li>
<li><a href="https://numerics.mathdotnet.com/MKL.html">Intel MKL</a></li>
<li class="nav-header">Working Together</li>
<li><a href="https://numerics.mathdotnet.com/CSV.html">Delimited Text Files (CSV)</a></li>
<li><a href="https://numerics.mathdotnet.com/MatrixMarket.html">NIST MatrixMarket</a></li>
<li><a href="https://numerics.mathdotnet.com/MatlabFiles.html">MATLAB</a></li>
<li><a href="https://numerics.mathdotnet.com/IFSharpNotebook.html">IF# Notebook</a></li>
<li>FsLab & Deedle</li>
<li>Microsoft Excel</li>
<li>numl.net machine learning</li>
<li>R-project</li>
</ul>
</div>
</div>
</div>
</body>
<!-- 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>

284
Functions.html

@ -1,63 +1,138 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>Special Functions
<head>
<meta charset="utf-8">
<title>Special Functions
</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta name="description" content="Math.NET Numerics, providing methods and algorithms for numerical computations in science, engineering and every day use. .Net 4, .Net 3.5, SL5, Win8, WP8, PCL 47 and 136, Mono, Xamarin Android/iOS."/>
<meta name="author" content="Christoph Ruegg, Marcus Cuda, Jurgen Van Gael"/>
<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 src="https://code.jquery.com/jquery-1.8.0.js"></script>
<script src="https://code.jquery.com/ui/1.8.23/jquery-ui.js"></script>
<script src="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/js/bootstrap.min.js"></script>
<link href="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap-combined.min.css" rel="stylesheet"/>
<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 type="text/css" rel="stylesheet" href="https://numerics.mathdotnet.com/content/style.css" />
<style>
#main table:not(.pre) {
border: 1px solid #dddddd;
max-width: 100%;
border-style: solid;
border-width: 1px;
border-color: gray;
border-collapse: collapse;
border-right-width: 1px;
border-bottom-width: 1px;
margin-top: 15px;
margin-bottom: 25px;
}
#main table:not(.pre) th, #main table:not(.pre) td {
border: 1px solid #dddddd;
padding: 6px;
}
#main table:not(.pre) th p, #main table:not(.pre) td p {
margin-bottom: 5px;
}
</style>
<script type="text/javascript" src="https://numerics.mathdotnet.com/content/tips.js"></script>
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<![endif]-->
<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>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
</head>
<body>
<div class="container">
<div class="masthead">
<ul class="nav nav-pills pull-right">
<li><a href="https://www.mathdotnet.com">Math.NET Project</a></li>
<li><a href="https://numerics.mathdotnet.com">Math.NET Numerics</a></li>
<li><a href="https://github.com/mathnet/mathnet-numerics">GitHub</a></li>
</ul>
<h3 class="muted">Math.NET Numerics</h3>
<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>
<hr />
<div class="row">
<div class="span9" id="main">
<h1><a name="Special-Functions" class="anchor" href="#Special-Functions">Special Functions</a></h1>
<!-- 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">Floating-Point Numbers</li>
<li class="nav-item">Arbitrary Precision Numbers</li>
<li class="nav-item">Complex Numbers</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">Differentiation</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">Transformation</li>
<li class="nav-item">Fourier Transform (FFT)</li>
<li class="nav-item">Filtering & DSP</li>
<li class="nav-item">Window Functions</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-item">Nonlinear Root Finding</li>
<li class="nav-header">Optimization</li>
<li class="nav-item">Linear Least Squares</li>
<li class="nav-item">Nonlinear 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-item">Interpolation</li>
<li class="nav-item">Fourier Approximation</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://www.mathdotnet.com">Math.NET Project</a> |
<a href="https://numerics.mathdotnet.com">Math.NET Numerics</a> |
<a href="https://github.com/mathnet/mathnet-numerics">GitHub</a>
</h3>
</div>
<hr />
<div class="container" id="fsdocs-content">
<h1><a name="Special-Functions" class="anchor" href="#Special-Functions">Special Functions</a></h1>
<p>All the following special functions are available in the static <code>SpecialFunctions</code> class:</p>
<h2><a name="Factorial" class="anchor" href="#Factorial">Factorial</a></h2>
<ul>
@ -65,10 +140,7 @@
</ul>
<p><span class="math">\[x \mapsto x! = \prod_{k=1}^{x} k = \Gamma(x+1)\]</span></p>
<p>Code Sample:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">double</span> x <span class="o">=</span> SpecialFunctions.Factorial(<span class="n">14</span>); <span class="c">// 87178291200.0</span>
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">double</span> x <span class="o">=</span> SpecialFunctions.Factorial(<span class="n">14</span>); <span class="c">// 87178291200.0</span>
<span class="k">double</span> y <span class="o">=</span> SpecialFunctions.Factorial(<span class="n">31</span>); <span class="c">// 8.2228386541779224E+33</span>
</code></pre></td></tr></table>
<ul>
@ -186,9 +258,7 @@
<p>Inverse <span class="math">\(x\)</span> of the complementary Error function, such that <span class="math">\(\mathrm{erfc}(x) = z\)</span>.</p>
<p><span class="math">\[z \mapsto \mathrm{erfc}^{-1}(z)\]</span></p>
<p>Code Sample:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">double</span> erf <span class="o">=</span> SpecialFunctions.Erf(<span class="n">0.9</span>); <span class="c">// 0.7969082124</span>
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">double</span> erf <span class="o">=</span> SpecialFunctions.Erf(<span class="n">0.9</span>); <span class="c">// 0.7969082124</span>
</code></pre></td></tr></table>
<h2><a name="Sigmoid-Logistic-function" class="anchor" href="#Sigmoid-Logistic-function">Sigmoid: Logistic function</a></h2>
<ul>
@ -307,88 +377,16 @@ for both real and complex arguments.</p>
<li>Conversion routines between radian, degree and grad.</li>
</ul>
</div>
<div class="span3">
<ul class="nav nav-list" id="menu">
<li class="nav-header">Math.NET Numerics</li>
<li><a href="https://numerics.mathdotnet.com/Packages.html">NuGet & Binaries</a></li>
<li><a href="https://numerics.mathdotnet.com/ReleaseNotes.html">Release Notes</a></li>
<li><a href="https://numerics.mathdotnet.com/License.html">MIT License</a></li>
<li><a href="https://numerics.mathdotnet.com/Compatibility.html">Platform Support</a></li>
<li><a href="https://numerics.mathdotnet.com/api/">Class Reference</a></li>
<li><a href="https://github.com/mathnet/mathnet-numerics/issues">Issues & Bugs</a></li>
<li><a href="https://numerics.mathdotnet.com/Users.html">Who is using Math.NET?</a></li>
<li class="nav-header">Contributing</li>
<li><a href="https://numerics.mathdotnet.com/Contributors.html">Contributors</a></li>
<li><a href="https://numerics.mathdotnet.com/Contributing.html">Contributing</a></li>
<li><a href="https://numerics.mathdotnet.com/Build.html">Build & Tools</a></li>
<li><a href="http://feedback.mathdotnet.com/forums/2060-math-net-numerics">Your Ideas</a></li>
<li class="nav-header">Getting Help</li>
<li><a href="https://discuss.mathdotnet.com/c/numerics">Discuss</a></li>
<li><a href="https://stackoverflow.com/questions/tagged/mathdotnet">Stack Overflow</a></li>
<li class="nav-header">Getting Started</li>
<li><a href="https://numerics.mathdotnet.com/">Getting started</a></li>
<li><a href="https://numerics.mathdotnet.com/Constants.html">Constants</a></li>
<li>Floating-Point Numbers</li>
<li>Arbitrary Precision Numbers</li>
<li>Complex Numbers</li>
<li><a href="https://numerics.mathdotnet.com/Matrix.html">Matrices and Vectors</a></li>
<li><a href="https://numerics.mathdotnet.com/Euclid.html">Euclid & Number Theory</a></li>
<li>Combinatorics</li>
<li class="nav-header">Evaluation</li>
<li><a href="https://numerics.mathdotnet.com/Functions.html">Special Functions</a></li>
<li>Differentiation</li>
<li><a href="https://numerics.mathdotnet.com/Integration.html">Integration</a></li>
<li class="nav-header">Statistics/Probability</li>
<li><a href="https://numerics.mathdotnet.com/DescriptiveStatistics.html">Descriptive Statistics</a></li>
<li><a href="https://numerics.mathdotnet.com/Probability.html">Probability Distributions</a></li>
<li class="nav-header">Generation</li>
<li><a href="https://numerics.mathdotnet.com/Generate.html">Generating Data</a></li>
<li><a href="https://numerics.mathdotnet.com/Random.html">Random Numbers</a></li>
<li class="nav-header">Transformation</li>
<li>Fourier Transform (FFT)</li>
<li>Filtering & DSP</li>
<li>Window Functions</li>
<li class="nav-header">Solving Equations</li>
<li><a href="https://numerics.mathdotnet.com/LinearEquations.html">Linear Equation Systems</a></li>
<li>Nonlinear Root Finding</li>
<li class="nav-header">Optimization</li>
<li>Linear Least Squares</li>
<li>Nonlinear Optimization</li>
<li><a href="https://numerics.mathdotnet.com/Distance.html">Distance Metrics</a></li>
<li class="nav-header">Curve Fitting</li>
<li><a href="https://numerics.mathdotnet.com/Regression.html">Regression</a></li>
<li>Interpolation</li>
<li>Fourier Approximation</li>
<li class="nav-header">Native Providers</li>
<li><a href="https://numerics.mathdotnet.com/MKL.html">Intel MKL</a></li>
<li class="nav-header">Working Together</li>
<li><a href="https://numerics.mathdotnet.com/CSV.html">Delimited Text Files (CSV)</a></li>
<li><a href="https://numerics.mathdotnet.com/MatrixMarket.html">NIST MatrixMarket</a></li>
<li><a href="https://numerics.mathdotnet.com/MatlabFiles.html">MATLAB</a></li>
<li><a href="https://numerics.mathdotnet.com/IFSharpNotebook.html">IF# Notebook</a></li>
<li>FsLab & Deedle</li>
<li>Microsoft Excel</li>
<li>numl.net machine learning</li>
<li>R-project</li>
</ul>
</div>
</div>
</div>
</body>
<!-- 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>

418
Generate.html

@ -1,63 +1,138 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>Generating Data
<head>
<meta charset="utf-8">
<title>Generating Data
</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta name="description" content="Math.NET Numerics, providing methods and algorithms for numerical computations in science, engineering and every day use. .Net 4, .Net 3.5, SL5, Win8, WP8, PCL 47 and 136, Mono, Xamarin Android/iOS."/>
<meta name="author" content="Christoph Ruegg, Marcus Cuda, Jurgen Van Gael"/>
<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 src="https://code.jquery.com/jquery-1.8.0.js"></script>
<script src="https://code.jquery.com/ui/1.8.23/jquery-ui.js"></script>
<script src="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/js/bootstrap.min.js"></script>
<link href="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap-combined.min.css" rel="stylesheet"/>
<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 type="text/css" rel="stylesheet" href="https://numerics.mathdotnet.com/content/style.css" />
<style>
#main table:not(.pre) {
border: 1px solid #dddddd;
max-width: 100%;
border-style: solid;
border-width: 1px;
border-color: gray;
border-collapse: collapse;
border-right-width: 1px;
border-bottom-width: 1px;
margin-top: 15px;
margin-bottom: 25px;
}
#main table:not(.pre) th, #main table:not(.pre) td {
border: 1px solid #dddddd;
padding: 6px;
}
#main table:not(.pre) th p, #main table:not(.pre) td p {
margin-bottom: 5px;
}
</style>
<script type="text/javascript" src="https://numerics.mathdotnet.com/content/tips.js"></script>
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<![endif]-->
<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>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
</head>
<body>
<div class="container">
<div class="masthead">
<ul class="nav nav-pills pull-right">
<li><a href="https://www.mathdotnet.com">Math.NET Project</a></li>
<li><a href="https://numerics.mathdotnet.com">Math.NET Numerics</a></li>
<li><a href="https://github.com/mathnet/mathnet-numerics">GitHub</a></li>
</ul>
<h3 class="muted">Math.NET Numerics</h3>
<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>
<hr />
<div class="row">
<div class="span9" id="main">
<h1><a name="Generating-Data" class="anchor" href="#Generating-Data">Generating Data</a></h1>
<!-- 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">Floating-Point Numbers</li>
<li class="nav-item">Arbitrary Precision Numbers</li>
<li class="nav-item">Complex Numbers</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">Differentiation</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">Transformation</li>
<li class="nav-item">Fourier Transform (FFT)</li>
<li class="nav-item">Filtering & DSP</li>
<li class="nav-item">Window Functions</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-item">Nonlinear Root Finding</li>
<li class="nav-header">Optimization</li>
<li class="nav-item">Linear Least Squares</li>
<li class="nav-item">Nonlinear 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-item">Interpolation</li>
<li class="nav-item">Fourier Approximation</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://www.mathdotnet.com">Math.NET Project</a> |
<a href="https://numerics.mathdotnet.com">Math.NET Numerics</a> |
<a href="https://github.com/mathnet/mathnet-numerics">GitHub</a>
</h3>
</div>
<hr />
<div class="container" id="fsdocs-content">
<h1><a name="Generating-Data" class="anchor" href="#Generating-Data">Generating Data</a></h1>
<p>Numerics is all about analyzing and manipulating numeric data. But unless you can read in data from an external
file, source or e.g. with the excellent <a href="https://fsharp.github.io/FSharp.Data/">F# Type Providers</a>,
you may need to generate synthetic or random data locally, or transform existing data into a new form.
@ -70,23 +145,13 @@ This is intended for simplicity and consistency between array and sequence opera
and either a provided step or a step of 1.0. Linear range is equivalent to the
single colon <code>:</code> and double colon <code>::</code> operators in MATLAB.</p>
<p>F# has built in linear range support in array comprehensions with the colon operator:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
<span class="l">4: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp">[ <span class="n">10.0</span> <span class="o">..</span> <span class="n">2.0</span> <span class="o">..</span> <span class="n">15.0</span> ]
<pre class="fssnip highlighted"><code lang="fsharp"><span class="pn">[</span> <span class="o">10.0</span> <span class="o">..</span> <span class="n">2.0</span> <span class="o">..</span> <span class="n">15.0</span> <span class="pn">]</span>
<span class="fsi">val it : float list = [10.0; 12.0; 14.0] </span>
[ <span class="k">for</span> <span onmouseout="hideTip(event, 'fs1', 1)" onmouseover="showTip(event, 'fs1', 1)" class="i">x</span> <span class="k">in</span> <span class="n">10.0</span> <span class="o">..</span> <span class="n">2.0</span> <span class="o">..</span> <span class="n">15.0</span> <span class="k">-&gt;</span> <span onmouseout="hideTip(event, 'fs2', 2)" onmouseover="showTip(event, 'fs2', 2)" class="f">sin</span> <span onmouseout="hideTip(event, 'fs1', 3)" onmouseover="showTip(event, 'fs1', 3)" class="i">x</span> ]
<span class="pn">[</span> <span class="k">for</span> <span onmouseout="hideTip(event, 'fs1', 1)" onmouseover="showTip(event, 'fs1', 1)" class="fn">x</span> <span class="k">in</span> <span class="o">10.0</span> <span class="o">..</span> <span class="n">2.0</span> <span class="o">..</span> <span class="n">15.0</span> <span class="k">-&gt;</span> <span onmouseout="hideTip(event, 'fs2', 2)" onmouseover="showTip(event, 'fs2', 2)" class="fn">sin</span> <span onmouseout="hideTip(event, 'fs1', 3)" onmouseover="showTip(event, 'fs1', 3)" class="fn">x</span> <span class="pn">]</span>
<span class="fsi">val it : float list = [-0.5440211109; -0.536572918; 0.9906073557] </span>
</code></pre></td>
</tr>
</table>
</code></pre>
<p>In C# you can get the same result with <code>LinearRange</code>:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp">Generate.LinearRange(<span class="n">10</span>, <span class="n">2</span>, <span class="n">15</span>); <span class="c">// returns array { 10.0, 12.0, 14.0 }</span>
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp">Generate.LinearRange(<span class="n">10</span>, <span class="n">2</span>, <span class="n">15</span>); <span class="c">// returns array { 10.0, 12.0, 14.0 }</span>
Generate.LinearRangeMap(<span class="n">10</span>, <span class="n">2</span>, <span class="n">15</span>, Math.Sin); <span class="c">// applies sin(x) to each value</span>
</code></pre></td></tr></table>
<p>Most of the routines in the <code>Generate</code> class have variants with a <code>Map</code> suffix.
@ -98,32 +163,19 @@ lazy enumerable sequences instead of arrays.</p>
<p>Generates a linearly or log-spaced array within an interval, but other than linear range
where the step is provided, here we instead provide the number of values we want.
This is equivalent to the linspace and logspace operators in MATLAB.</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp">Generate.LinearSpaced(<span class="n">11</span>, <span class="n">0.0</span>, <span class="n">1.0</span>); <span class="c">// returns array { 0.0, 0.1, 0.2, .., 1.0 }</span>
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp">Generate.LinearSpaced(<span class="n">11</span>, <span class="n">0.0</span>, <span class="n">1.0</span>); <span class="c">// returns array { 0.0, 0.1, 0.2, .., 1.0 }</span>
Generate.LinearSpacedMap(<span class="n">15</span>, <span class="n">0.0</span>, Math.Pi, Math.Sin); <span class="c">// applies sin(x) to each value</span>
</code></pre></td></tr></table>
<p>In F# you can also use:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
<span class="l">4: </span>
<span class="l">5: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="i">Generate</span><span class="o">.</span><span class="i">linearSpacedMap</span> <span class="n">15</span> <span class="n">0.0</span> <span class="i">Math</span><span class="o">.</span><span class="i">PI</span> <span onmouseout="hideTip(event, 'fs2', 4)" onmouseover="showTip(event, 'fs2', 4)" class="i">sin</span>
<pre class="fssnip highlighted"><code lang="fsharp"><span class="id">Generate</span><span class="pn">.</span><span class="id">linearSpacedMap</span> <span class="n">15</span> <span class="n">0.0</span> <span class="id">Math</span><span class="pn">.</span><span class="id">PI</span> <span onmouseout="hideTip(event, 'fs2', 4)" onmouseover="showTip(event, 'fs2', 4)" class="id">sin</span>
<span class="fsi">val it : float [] = </span>
<span class="fsi"> [|0.0; 0.222520934; 0.4338837391; 0.6234898019; 0.7818314825; 0.9009688679; </span>
<span class="fsi"> 0.9749279122; 1.0; 0.9749279122; 0.9009688679; 0.7818314825; 0.6234898019; </span>
<span class="fsi"> 0.4338837391; 0.222520934; 1.224606354e-16|] </span>
</code></pre></td>
</tr>
</table>
</code></pre>
<p><code>LogSpaced</code> works the same way but instead of the values <span class="math">\(10^x\)</span> it spaces the decade exponents <span class="math">\(x\)</span> linearly
between the provided two exponents.</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp">Generate.LogSpaced(<span class="n">4</span>,<span class="n">0</span>,<span class="n">3</span>); <span class="c">// returns array { 1, 10, 100, 1000 }</span>
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp">Generate.LogSpaced(<span class="n">4</span>,<span class="n">0</span>,<span class="n">3</span>); <span class="c">// returns array { 1, 10, 100, 1000 }</span>
</code></pre></td></tr></table>
<h2><a name="Kronecker-Delta-Impulse" class="anchor" href="#Kronecker-Delta-Impulse">Kronecker Delta Impulse</a></h2>
<p>The Kronecker delta <span class="math">\(\delta[n]\)</span> is a fundamental signal in time-discrete signal processing,
@ -134,20 +186,12 @@ It is closely related to the Dirac delta impulse function <span class="math">\(\
parameter <span class="math">\(d\)</span> and amplitude <span class="math">\(A\)</span> such that the resulting generated signal is</p>
<p><span class="math">\[s[n] = A\cdot\delta[n-d] = \begin{cases} 0 &amp;\mbox{if } n \ne d \\ A &amp; \mbox{if } n = d\end{cases}\]</span></p>
<p>There is also a periodic version in <code>PeriodicImpulse</code> which accepts an additional <code>period</code> parameter.</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
<span class="l">4: </span>
<span class="l">5: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="i">Generate</span><span class="o">.</span><span class="i">Impulse</span>(<span class="n">8</span>, <span class="n">2.0</span>, <span class="n">3</span>)
<pre class="fssnip highlighted"><code lang="fsharp"><span class="id">Generate</span><span class="pn">.</span><span class="id">Impulse</span><span class="pn">(</span><span class="n">8</span><span class="pn">,</span> <span class="n">2.0</span><span class="pn">,</span> <span class="n">3</span><span class="pn">)</span>
<span class="fsi">val it : float [] = [|0.0; 0.0; 0.0; 2.0; 0.0; 0.0; 0.0; 0.0|] </span>
<span class="i">Generate</span><span class="o">.</span><span class="i">PeriodicImpulse</span>(<span class="n">8</span>, <span class="n">3</span>, <span class="n">10.0</span>, <span class="n">1</span>)
<span class="id">Generate</span><span class="pn">.</span><span class="id">PeriodicImpulse</span><span class="pn">(</span><span class="n">8</span><span class="pn">,</span> <span class="n">3</span><span class="pn">,</span> <span class="n">10.0</span><span class="pn">,</span> <span class="n">1</span><span class="pn">)</span>
<span class="fsi">val it : float [] = [|0.0; 10.0; 0.0; 0.0; 10.0; 0.0; 0.0; 10.0|] </span>
</code></pre></td>
</tr>
</table>
</code></pre>
<h2><a name="Heaviside-Step" class="anchor" href="#Heaviside-Step">Heaviside Step</a></h2>
<p>Another fundamental signal in signal processing, the Heaviside step function <span class="math">\(H[n]\)</span>
is the integral of the Dirac delta impulse and represents a signal that switches on
@ -156,14 +200,9 @@ at a specified time and then stays on indefinitely. In discrete time:</p>
<p>The <code>Step</code> routines generates a Heaviside step, but just like the Kronecker Delta impulse
also accepts a sample delay parameter <span class="math">\(d\)</span> and amplitude <span class="math">\(A\)</span> such that the resulting generated signal is</p>
<p><span class="math">\[s[n] = A\cdot H[n-d] = \begin{cases} 0 &amp;\mbox{if } n &lt; d \\ A &amp; \mbox{if } n \ge d\end{cases}\]</span></p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="i">Generate</span><span class="o">.</span><span class="i">Step</span>(<span class="n">8</span>, <span class="n">2.0</span>, <span class="n">3</span>)
<pre class="fssnip highlighted"><code lang="fsharp"><span class="id">Generate</span><span class="pn">.</span><span class="id">Step</span><span class="pn">(</span><span class="n">8</span><span class="pn">,</span> <span class="n">2.0</span><span class="pn">,</span> <span class="n">3</span><span class="pn">)</span>
<span class="fsi">val it : float [] = [|0.0; 0.0; 0.0; 2.0; 2.0; 2.0; 2.0; 2.0|] </span>
</code></pre></td>
</tr>
</table>
</code></pre>
<h2><a name="Periodic-Sawtooth" class="anchor" href="#Periodic-Sawtooth">Periodic Sawtooth</a></h2>
<p>Generates an array of the given length with a periodic upper forward sawtooth signal,
i.e. a line starting at zero up to some amplitude <span class="math">\(A\)</span>, then drop back to zero instantly and start afresh.
@ -190,36 +229,24 @@ The circumference of the circle. Typically <span class="math">\(1\)</span> or <s
<li><strong>Delay</strong>: Optional initial delay, in samples. Contributes to <span class="math">\(\theta\)</span>.</li>
</ul>
<p>The equivalent map function accepts a custom map lambda as second argument after the length:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
<span class="l">4: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="i">Generate</span><span class="o">.</span><span class="i">periodicMap</span> <span class="n">15</span> ((<span class="o">+</span>) <span class="n">100.0</span>) <span class="n">1000.0</span> <span class="n">100.0</span> <span class="n">10.0</span> <span class="n">0.0</span> <span class="n">0</span>
<pre class="fssnip highlighted"><code lang="fsharp"><span class="id">Generate</span><span class="pn">.</span><span class="id">periodicMap</span> <span class="n">15</span> <span class="pn">(</span><span class="pn">(</span><span class="o">+</span><span class="pn">)</span> <span class="n">100.0</span><span class="pn">)</span> <span class="n">1000.0</span> <span class="n">100.0</span> <span class="n">10.0</span> <span class="n">0.0</span> <span class="n">0</span>
<span class="fsi">val it : float [] = </span>
<span class="fsi"> [|100.0; 101.0; 102.0; 103.0; 104.0; 105.0; 106.0; 107.0; 108.0; 109.0; </span>
<span class="fsi"> 100.0; 101.0; 102.0; 103.0; 104.0|] </span>
</code></pre></td>
</tr>
</table>
</code></pre>
<h2><a name="Sinusoidal" class="anchor" href="#Sinusoidal">Sinusoidal</a></h2>
<p>Generates a Sine wave array of the given length. This is equivalent to applying a scaled
trigonometric Sine function to a periodic sawtooth of amplitude <span class="math">\(2\pi\)</span>.</p>
<p><span class="math">\[s(x) = A\cdot\sin(2\pi\nu x + \theta)\]</span></p>
<p><code>Generate.Sinusoidal(length,samplingRate,frequency,amplitude,mean,phase,delay)</code></p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp">Generate.Sinusoidal(<span class="n">15</span>, <span class="n">1000.0</span>, <span class="n">100.0</span>, <span class="n">10.0</span>);
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp">Generate.Sinusoidal(<span class="n">15</span>, <span class="n">1000.0</span>, <span class="n">100.0</span>, <span class="n">10.0</span>);
<span class="c">// returns array { 0, 5.9, 9.5, 9.5, 5.9, 0, -5.9, ... }</span>
</code></pre></td></tr></table>
<h2><a name="Random" class="anchor" href="#Random">Random</a></h2>
<p>Generate random sequences by sampling from a random distribution.</p>
<h4><a name="Uniform-Distribution" class="anchor" href="#Uniform-Distribution">Uniform Distribution</a></h4>
<p>Generate sample sequences distributed uniformly between 0 and 1.</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp">Generate.Uniform(<span class="n">100</span>); <span class="c">// e.g. 0.867421787170424, 0.236744313145403, ... </span>
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp">Generate.Uniform(<span class="n">100</span>); <span class="c">// e.g. 0.867421787170424, 0.236744313145403, ... </span>
</code></pre></td></tr></table>
<p>Uniform supports mapping to functions with not only one but also two uniform variables
as arguments, with <code>UniformMap</code> and <code>UniformMap2</code>. As usual, lazy sequences can be
@ -235,142 +262,55 @@ from. See the section about random numbers and probability distributions for det
<h2><a name="Map" class="anchor" href="#Map">Map</a></h2>
<p>Generates a new array or sequence where each new values is the result of applying the provided function
the the corresponding value in the input data.</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">var</span> a <span class="o">=</span> <span class="k">new</span> <span class="k">double</span>[] { <span class="n">2.0</span>, <span class="n">4.0</span>, <span class="n">3.0</span>, <span class="n">6.0</span> };
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">var</span> a <span class="o">=</span> <span class="k">new</span> <span class="k">double</span>[] { <span class="n">2.0</span>, <span class="n">4.0</span>, <span class="n">3.0</span>, <span class="n">6.0</span> };
Generate.Map(a, x <span class="o">=</span><span class="o">&gt;</span> x <span class="o">+</span> <span class="n">1.0</span>); <span class="c">// returns array { 3.0, 5.0, 4.0, 7.0 }</span>
</code></pre></td></tr></table>
<p>In F# you'd typically use the Array module to the same effect (and should continue to do so):</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span onmouseout="hideTip(event, 'fs3', 5)" onmouseover="showTip(event, 'fs3', 5)" class="t">Array</span><span class="o">.</span><span onmouseout="hideTip(event, 'fs4', 6)" onmouseover="showTip(event, 'fs4', 6)" class="f">map</span> ((<span class="o">+</span>) <span class="n">1.0</span>) <span onmouseout="hideTip(event, 'fs5', 7)" onmouseover="showTip(event, 'fs5', 7)" class="i">a</span>
<pre class="fssnip highlighted"><code lang="fsharp"><span onmouseout="hideTip(event, 'fs3', 5)" onmouseover="showTip(event, 'fs3', 5)" class="m">Array</span><span class="pn">.</span><span onmouseout="hideTip(event, 'fs4', 6)" onmouseover="showTip(event, 'fs4', 6)" class="id">map</span> <span class="pn">(</span><span class="pn">(</span><span class="o">+</span><span class="pn">)</span> <span class="n">1.0</span><span class="pn">)</span> <span onmouseout="hideTip(event, 'fs5', 7)" onmouseover="showTip(event, 'fs5', 7)" class="id">a</span>
<span class="fsi">val it : float [] = [|3.0; 5.0; 4.0; 7.0|] </span>
</code></pre></td>
</tr>
</table>
</code></pre>
<p>...but no equivalent operation is available in the .NET base class libraries (BCL) for C#.
You can use LINQ, but that operates on sequences instead of arrays:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp">a.Select(x <span class="o">=</span><span class="o">&gt;</span> x <span class="o">+</span> <span class="n">1.0</span>).ToArray();
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp">a.Select(x <span class="o">=</span><span class="o">&gt;</span> x <span class="o">+</span> <span class="n">1.0</span>).ToArray();
</code></pre></td></tr></table>
<p>Similarly, with <code>Map2</code> you can also map a function accepting two inputs to two input arrays:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="k">let</span> <span onmouseout="hideTip(event, 'fs6', 8)" onmouseover="showTip(event, 'fs6', 8)" class="i">b</span> <span class="o">=</span> [| <span class="n">1.0</span>; <span class="o">-</span><span class="n">1.0</span>; <span class="n">2.0</span>; <span class="o">-</span><span class="n">2.0</span> |]
<span class="i">Generate</span><span class="o">.</span><span class="i">Map2</span>(<span onmouseout="hideTip(event, 'fs5', 9)" onmouseover="showTip(event, 'fs5', 9)" class="i">a</span>, <span onmouseout="hideTip(event, 'fs6', 10)" onmouseover="showTip(event, 'fs6', 10)" class="i">b</span>, <span class="k">fun</span> <span class="i">x</span> <span class="i">y</span> <span class="k">-&gt;</span> <span class="i">x</span> <span class="o">+</span> <span class="i">y</span>)
<pre class="fssnip highlighted"><code lang="fsharp"><span class="k">let</span> <span onmouseout="hideTip(event, 'fs6', 8)" onmouseover="showTip(event, 'fs6', 8)" class="id">b</span> <span class="o">=</span> <span class="pn">[|</span> <span class="n">1.0</span><span class="pn">;</span> <span class="o">-</span><span class="n">1.0</span><span class="pn">;</span> <span class="n">2.0</span><span class="pn">;</span> <span class="o">-</span><span class="n">2.0</span> <span class="pn">|]</span>
<span class="id">Generate</span><span class="pn">.</span><span class="id">Map2</span><span class="pn">(</span><span onmouseout="hideTip(event, 'fs5', 9)" onmouseover="showTip(event, 'fs5', 9)" class="id">a</span><span class="pn">,</span> <span onmouseout="hideTip(event, 'fs6', 10)" onmouseover="showTip(event, 'fs6', 10)" class="id">b</span><span class="pn">,</span> <span class="k">fun</span> <span class="id">x</span> <span class="id">y</span> <span class="k">-&gt;</span> <span class="id">x</span> <span class="o">+</span> <span class="id">y</span><span class="pn">)</span>
<span class="fsi">val it : float [] = [|3.0; 3.0; 5.0; 4.0|] </span>
</code></pre></td>
</tr>
</table>
</code></pre>
<p>Typical F# equivalent:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span onmouseout="hideTip(event, 'fs3', 11)" onmouseover="showTip(event, 'fs3', 11)" class="t">Array</span><span class="o">.</span><span onmouseout="hideTip(event, 'fs7', 12)" onmouseover="showTip(event, 'fs7', 12)" class="f">map2</span> (<span class="o">+</span>) <span onmouseout="hideTip(event, 'fs5', 13)" onmouseover="showTip(event, 'fs5', 13)" class="i">a</span> <span onmouseout="hideTip(event, 'fs6', 14)" onmouseover="showTip(event, 'fs6', 14)" class="i">b</span>
<pre class="fssnip highlighted"><code lang="fsharp"><span onmouseout="hideTip(event, 'fs3', 11)" onmouseover="showTip(event, 'fs3', 11)" class="m">Array</span><span class="pn">.</span><span onmouseout="hideTip(event, 'fs7', 12)" onmouseover="showTip(event, 'fs7', 12)" class="id">map2</span> <span class="pn">(</span><span class="o">+</span><span class="pn">)</span> <span onmouseout="hideTip(event, 'fs5', 13)" onmouseover="showTip(event, 'fs5', 13)" class="id">a</span> <span onmouseout="hideTip(event, 'fs6', 14)" onmouseover="showTip(event, 'fs6', 14)" class="id">b</span>
<span class="fsi">val it : float [] = [|3.0; 3.0; 5.0; 4.0|] </span>
</code></pre></td>
</tr>
</table>
</code></pre>
<p>And in C# with LINQ:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp">a.Zip(b, (x, y) <span class="o">=</span><span class="o">&gt;</span> x <span class="o">+</span> y).ToArray();
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp">a.Zip(b, (x, y) <span class="o">=</span><span class="o">&gt;</span> x <span class="o">+</span> y).ToArray();
</code></pre></td></tr></table>
<div class="tip" id="fs1">val x : float</div>
<div class="tip" id="fs2">val sin : value:&#39;T -&gt; &#39;T (requires member Sin)<br /><br />Full name: Microsoft.FSharp.Core.Operators.sin</div>
<div class="tip" id="fs3">module Array<br /><br />from Microsoft.FSharp.Collections</div>
<div class="tip" id="fs4">val map : mapping:(&#39;T -&gt; &#39;U) -&gt; array:&#39;T [] -&gt; &#39;U []<br /><br />Full name: Microsoft.FSharp.Collections.Array.map</div>
<div class="tip" id="fs5">val a : float []<br /><br />Full name: Generate.a</div>
<div class="tip" id="fs6">val b : float []<br /><br />Full name: Generate.b</div>
<div class="tip" id="fs7">val map2 : mapping:(&#39;T1 -&gt; &#39;T2 -&gt; &#39;U) -&gt; array1:&#39;T1 [] -&gt; array2:&#39;T2 [] -&gt; &#39;U []<br /><br />Full name: Microsoft.FSharp.Collections.Array.map2</div>
<div class="fsdocs-tip" id="fs1">val x : float</div>
<div class="fsdocs-tip" id="fs2">val sin : value:&#39;T -&gt; &#39;T (requires member Sin)<br /><em>&lt;summary&gt;Sine of the given number&lt;/summary&gt;<br />&lt;param name=&quot;value&quot;&gt;The input value.&lt;/param&gt;<br />&lt;returns&gt;The sine of the input.&lt;/returns&gt;</em></div>
<div class="fsdocs-tip" id="fs3">Modul Array
</div>
<div class="span3">
<ul class="nav nav-list" id="menu">
<li class="nav-header">Math.NET Numerics</li>
<li><a href="https://numerics.mathdotnet.com/Packages.html">NuGet & Binaries</a></li>
<li><a href="https://numerics.mathdotnet.com/ReleaseNotes.html">Release Notes</a></li>
<li><a href="https://numerics.mathdotnet.com/License.html">MIT License</a></li>
<li><a href="https://numerics.mathdotnet.com/Compatibility.html">Platform Support</a></li>
<li><a href="https://numerics.mathdotnet.com/api/">Class Reference</a></li>
<li><a href="https://github.com/mathnet/mathnet-numerics/issues">Issues & Bugs</a></li>
<li><a href="https://numerics.mathdotnet.com/Users.html">Who is using Math.NET?</a></li>
<li class="nav-header">Contributing</li>
<li><a href="https://numerics.mathdotnet.com/Contributors.html">Contributors</a></li>
<li><a href="https://numerics.mathdotnet.com/Contributing.html">Contributing</a></li>
<li><a href="https://numerics.mathdotnet.com/Build.html">Build & Tools</a></li>
<li><a href="http://feedback.mathdotnet.com/forums/2060-math-net-numerics">Your Ideas</a></li>
<li class="nav-header">Getting Help</li>
<li><a href="https://discuss.mathdotnet.com/c/numerics">Discuss</a></li>
<li><a href="https://stackoverflow.com/questions/tagged/mathdotnet">Stack Overflow</a></li>
<li class="nav-header">Getting Started</li>
<li><a href="https://numerics.mathdotnet.com/">Getting started</a></li>
<li><a href="https://numerics.mathdotnet.com/Constants.html">Constants</a></li>
<li>Floating-Point Numbers</li>
<li>Arbitrary Precision Numbers</li>
<li>Complex Numbers</li>
<li><a href="https://numerics.mathdotnet.com/Matrix.html">Matrices and Vectors</a></li>
<li><a href="https://numerics.mathdotnet.com/Euclid.html">Euclid & Number Theory</a></li>
<li>Combinatorics</li>
<li class="nav-header">Evaluation</li>
<li><a href="https://numerics.mathdotnet.com/Functions.html">Special Functions</a></li>
<li>Differentiation</li>
<li><a href="https://numerics.mathdotnet.com/Integration.html">Integration</a></li>
<li class="nav-header">Statistics/Probability</li>
<li><a href="https://numerics.mathdotnet.com/DescriptiveStatistics.html">Descriptive Statistics</a></li>
<li><a href="https://numerics.mathdotnet.com/Probability.html">Probability Distributions</a></li>
<li class="nav-header">Generation</li>
<li><a href="https://numerics.mathdotnet.com/Generate.html">Generating Data</a></li>
<li><a href="https://numerics.mathdotnet.com/Random.html">Random Numbers</a></li>
<li class="nav-header">Transformation</li>
<li>Fourier Transform (FFT)</li>
<li>Filtering & DSP</li>
<li>Window Functions</li>
aus Microsoft.FSharp.Collections<br /><em>&lt;summary&gt;Contains operations for working with arrays.&lt;/summary&gt;<br />&lt;remarks&gt;
See also &lt;a href=&quot;https://docs.microsoft.com/dotnet/fsharp/language-reference/arrays&quot;&gt;F# Language Guide - Arrays&lt;/a&gt;.
&lt;/remarks&gt;</em></div>
<div class="fsdocs-tip" id="fs4">val map : mapping:(&#39;T -&gt; &#39;U) -&gt; array:&#39;T [] -&gt; &#39;U []<br /><em>&lt;summary&gt;Builds a new array whose elements are the results of applying the given function
to each of the elements of the array.&lt;/summary&gt;<br />&lt;param name=&quot;mapping&quot;&gt;The function to transform elements of the array.&lt;/param&gt;<br />&lt;param name=&quot;array&quot;&gt;The input array.&lt;/param&gt;<br />&lt;returns&gt;The array of transformed elements.&lt;/returns&gt;<br />&lt;exception cref=&quot;T:System.ArgumentNullException&quot;&gt;Thrown when the input array is null.&lt;/exception&gt;</em></div>
<div class="fsdocs-tip" id="fs5">val a : float []</div>
<div class="fsdocs-tip" id="fs6">val b : float []</div>
<div class="fsdocs-tip" id="fs7">val map2 : mapping:(&#39;T1 -&gt; &#39;T2 -&gt; &#39;U) -&gt; array1:&#39;T1 [] -&gt; array2:&#39;T2 [] -&gt; &#39;U []<br /><em>&lt;summary&gt;Builds a new collection whose elements are the results of applying the given function
to the corresponding elements of the two collections pairwise. The two input
arrays must have the same lengths, otherwise an &lt;c&gt;ArgumentException&lt;/c&gt; is
raised.&lt;/summary&gt;<br />&lt;param name=&quot;mapping&quot;&gt;The function to transform the pairs of the input elements.&lt;/param&gt;<br />&lt;param name=&quot;array1&quot;&gt;The first input array.&lt;/param&gt;<br />&lt;param name=&quot;array2&quot;&gt;The second input array.&lt;/param&gt;<br />&lt;exception cref=&quot;T:System.ArgumentException&quot;&gt;Thrown when the input arrays differ in length.&lt;/exception&gt;<br />&lt;exception cref=&quot;T:System.ArgumentNullException&quot;&gt;Thrown when either of the input arrays is null.&lt;/exception&gt;<br />&lt;returns&gt;The array of transformed elements.&lt;/returns&gt;</em></div>
<li class="nav-header">Solving Equations</li>
<li><a href="https://numerics.mathdotnet.com/LinearEquations.html">Linear Equation Systems</a></li>
<li>Nonlinear Root Finding</li>
<li class="nav-header">Optimization</li>
<li>Linear Least Squares</li>
<li>Nonlinear Optimization</li>
<li><a href="https://numerics.mathdotnet.com/Distance.html">Distance Metrics</a></li>
<li class="nav-header">Curve Fitting</li>
<li><a href="https://numerics.mathdotnet.com/Regression.html">Regression</a></li>
<li>Interpolation</li>
<li>Fourier Approximation</li>
<li class="nav-header">Native Providers</li>
<li><a href="https://numerics.mathdotnet.com/MKL.html">Intel MKL</a></li>
<li class="nav-header">Working Together</li>
<li><a href="https://numerics.mathdotnet.com/CSV.html">Delimited Text Files (CSV)</a></li>
<li><a href="https://numerics.mathdotnet.com/MatrixMarket.html">NIST MatrixMarket</a></li>
<li><a href="https://numerics.mathdotnet.com/MatlabFiles.html">MATLAB</a></li>
<li><a href="https://numerics.mathdotnet.com/IFSharpNotebook.html">IF# Notebook</a></li>
<li>FsLab & Deedle</li>
<li>Microsoft Excel</li>
<li>numl.net machine learning</li>
<li>R-project</li>
</ul>
</div>
</div>
</div>
</body>
<!-- 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>

517
IFsharpNotebook.html

@ -1,63 +1,138 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>IF# Notebook
<head>
<meta charset="utf-8">
<title>IF# Notebook
</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta name="description" content="Math.NET Numerics, providing methods and algorithms for numerical computations in science, engineering and every day use. .Net 4, .Net 3.5, SL5, Win8, WP8, PCL 47 and 136, Mono, Xamarin Android/iOS."/>
<meta name="author" content="Christoph Ruegg, Marcus Cuda, Jurgen Van Gael"/>
<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 src="https://code.jquery.com/jquery-1.8.0.js"></script>
<script src="https://code.jquery.com/ui/1.8.23/jquery-ui.js"></script>
<script src="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/js/bootstrap.min.js"></script>
<link href="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap-combined.min.css" rel="stylesheet"/>
<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 type="text/css" rel="stylesheet" href="https://numerics.mathdotnet.com/content/style.css" />
<style>
#main table:not(.pre) {
border: 1px solid #dddddd;
max-width: 100%;
border-style: solid;
border-width: 1px;
border-color: gray;
border-collapse: collapse;
border-right-width: 1px;
border-bottom-width: 1px;
margin-top: 15px;
margin-bottom: 25px;
}
#main table:not(.pre) th, #main table:not(.pre) td {
border: 1px solid #dddddd;
padding: 6px;
}
#main table:not(.pre) th p, #main table:not(.pre) td p {
margin-bottom: 5px;
}
</style>
<script type="text/javascript" src="https://numerics.mathdotnet.com/content/tips.js"></script>
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<![endif]-->
<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>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
</head>
<body>
<div class="container">
<div class="masthead">
<ul class="nav nav-pills pull-right">
<li><a href="https://www.mathdotnet.com">Math.NET Project</a></li>
<li><a href="https://numerics.mathdotnet.com">Math.NET Numerics</a></li>
<li><a href="https://github.com/mathnet/mathnet-numerics">GitHub</a></li>
</ul>
<h3 class="muted">Math.NET Numerics</h3>
<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>
<hr />
<div class="row">
<div class="span9" id="main">
<h1><a name="IF-Notebook" class="anchor" href="#IF-Notebook">IF# Notebook</a></h1>
<!-- 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">Floating-Point Numbers</li>
<li class="nav-item">Arbitrary Precision Numbers</li>
<li class="nav-item">Complex Numbers</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">Differentiation</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">Transformation</li>
<li class="nav-item">Fourier Transform (FFT)</li>
<li class="nav-item">Filtering & DSP</li>
<li class="nav-item">Window Functions</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-item">Nonlinear Root Finding</li>
<li class="nav-header">Optimization</li>
<li class="nav-item">Linear Least Squares</li>
<li class="nav-item">Nonlinear 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-item">Interpolation</li>
<li class="nav-item">Fourier Approximation</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://www.mathdotnet.com">Math.NET Project</a> |
<a href="https://numerics.mathdotnet.com">Math.NET Numerics</a> |
<a href="https://github.com/mathnet/mathnet-numerics">GitHub</a>
</h3>
</div>
<hr />
<div class="container" id="fsdocs-content">
<h1><a name="IF-Notebook" class="anchor" href="#IF-Notebook">IF# Notebook</a></h1>
<p><a href="https://ipython.org/">iPython</a> provides a rich browser-based interactive notebook with support for code, text, mathematical expressions,
inline plots and other rich media. <a href="https://github.com/BayardRock/IfSharp">IfSharp</a>, developed by Bayard Rock, is an F# profile
for iPython with IntelliSense and embedded FSharp.Charting. Thanks to its NuGet support it can load other packages like Math.NET Numerics on demand.</p>
@ -80,216 +155,146 @@ Since v3.3 the Math.NET Numerics F# package includes a script <code>MathNet.Nume
Unfortunately loading this script requires the exact version in the path - if you know a way to avoid this please let us know.</p>
<p><img src="img/IfSharp-MatrixVector.png" alt="Screenshot" /></p>
<p>Alternatively you can also use the code below and adapt it to your needs, e.g. if you want it to show more rows.</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l"> 1: </span>
<span class="l"> 2: </span>
<span class="l"> 3: </span>
<span class="l"> 4: </span>
<span class="l"> 5: </span>
<span class="l"> 6: </span>
<span class="l"> 7: </span>
<span class="l"> 8: </span>
<span class="l"> 9: </span>
<span class="l">10: </span>
<span class="l">11: </span>
<span class="l">12: </span>
<span class="l">13: </span>
<span class="l">14: </span>
<span class="l">15: </span>
<span class="l">16: </span>
<span class="l">17: </span>
<span class="l">18: </span>
<span class="l">19: </span>
<span class="l">20: </span>
<span class="l">21: </span>
<span class="l">22: </span>
<span class="l">23: </span>
<span class="l">24: </span>
<span class="l">25: </span>
<span class="l">26: </span>
<span class="l">27: </span>
<span class="l">28: </span>
<span class="l">29: </span>
<span class="l">30: </span>
<span class="l">31: </span>
<span class="l">32: </span>
<span class="l">33: </span>
<span class="l">34: </span>
<span class="l">35: </span>
<span class="l">36: </span>
<span class="l">37: </span>
<span class="l">38: </span>
<span class="l">39: </span>
<span class="l">40: </span>
<span class="l">41: </span>
<span class="l">42: </span>
<span class="l">43: </span>
<span class="l">44: </span>
<span class="l">45: </span>
<span class="l">46: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="k">open</span> <span class="i">MathNet</span><span class="o">.</span><span class="i">Numerics</span><span class="o">.</span><span class="i">LinearAlgebra</span>
<pre class="fssnip highlighted"><code lang="fsharp"><span class="k">open</span> <span class="id">MathNet</span><span class="pn">.</span><span class="id">Numerics</span><span class="pn">.</span><span class="id">LinearAlgebra</span>
<span class="k">let</span> <span class="k">inline</span> (|<span class="p">Float</span>|_|) (<span onmouseout="hideTip(event, 'fs1', 1)" onmouseover="showTip(event, 'fs1', 1)" class="i">v</span><span class="o">:</span><span onmouseout="hideTip(event, 'fs2', 2)" onmouseover="showTip(event, 'fs2', 2)" class="t">obj</span>) <span class="o">=</span>
<span class="k">if</span> <span onmouseout="hideTip(event, 'fs1', 3)" onmouseover="showTip(event, 'fs1', 3)" class="i">v</span> <span class="o">:?</span> <span onmouseout="hideTip(event, 'fs3', 4)" onmouseover="showTip(event, 'fs3', 4)" class="t">float</span> <span class="k">then</span> <span onmouseout="hideTip(event, 'fs4', 5)" onmouseover="showTip(event, 'fs4', 5)" class="p">Some</span>(<span onmouseout="hideTip(event, 'fs1', 6)" onmouseover="showTip(event, 'fs1', 6)" class="i">v</span> <span class="o">:?&gt;</span> <span onmouseout="hideTip(event, 'fs3', 7)" onmouseover="showTip(event, 'fs3', 7)" class="t">float</span>) <span class="k">else</span> <span onmouseout="hideTip(event, 'fs5', 8)" onmouseover="showTip(event, 'fs5', 8)" class="p">None</span>
<span class="k">let</span> <span class="k">inline</span> (|<span class="p">Float32</span>|_|) (<span onmouseout="hideTip(event, 'fs1', 9)" onmouseover="showTip(event, 'fs1', 9)" class="i">v</span><span class="o">:</span><span onmouseout="hideTip(event, 'fs2', 10)" onmouseover="showTip(event, 'fs2', 10)" class="t">obj</span>) <span class="o">=</span>
<span class="k">if</span> <span onmouseout="hideTip(event, 'fs1', 11)" onmouseover="showTip(event, 'fs1', 11)" class="i">v</span> <span class="o">:?</span> <span onmouseout="hideTip(event, 'fs6', 12)" onmouseover="showTip(event, 'fs6', 12)" class="t">float32</span> <span class="k">then</span> <span onmouseout="hideTip(event, 'fs4', 13)" onmouseover="showTip(event, 'fs4', 13)" class="p">Some</span>(<span onmouseout="hideTip(event, 'fs1', 14)" onmouseover="showTip(event, 'fs1', 14)" class="i">v</span> <span class="o">:?&gt;</span> <span onmouseout="hideTip(event, 'fs6', 15)" onmouseover="showTip(event, 'fs6', 15)" class="t">float32</span>) <span class="k">else</span> <span onmouseout="hideTip(event, 'fs5', 16)" onmouseover="showTip(event, 'fs5', 16)" class="p">None</span>
<span class="k">let</span> <span class="k">inline</span> (|<span class="p">PositiveInfinity</span>|_|) (<span onmouseout="hideTip(event, 'fs7', 17)" onmouseover="showTip(event, 'fs7', 17)" class="i">v</span><span class="o">:</span> <span class="o">^</span><span class="i">T</span>) <span class="o">=</span>
<span class="k">if</span> (<span class="o">^</span><span class="i">T</span> <span class="o">:</span> (<span class="k">static</span> <span class="k">member</span> <span class="i">IsPositiveInfinity</span><span class="o">:</span> <span class="o">&#39;</span><span class="i">T</span> <span class="k">-&gt;</span> <span onmouseout="hideTip(event, 'fs8', 18)" onmouseover="showTip(event, 'fs8', 18)" class="t">bool</span>) (<span onmouseout="hideTip(event, 'fs7', 19)" onmouseover="showTip(event, 'fs7', 19)" class="i">v</span>))
<span class="k">then</span> <span onmouseout="hideTip(event, 'fs4', 20)" onmouseover="showTip(event, 'fs4', 20)" class="p">Some</span> <span class="p">PositiveInfinity</span> <span class="k">else</span> <span onmouseout="hideTip(event, 'fs5', 21)" onmouseover="showTip(event, 'fs5', 21)" class="p">None</span>
<span class="k">let</span> <span class="k">inline</span> (|<span class="p">NegativeInfinity</span>|_|) (<span onmouseout="hideTip(event, 'fs9', 22)" onmouseover="showTip(event, 'fs9', 22)" class="i">v</span><span class="o">:</span> <span class="o">^</span><span class="i">T</span>) <span class="o">=</span>
<span class="k">if</span> (<span class="o">^</span><span class="i">T</span> <span class="o">:</span> (<span class="k">static</span> <span class="k">member</span> <span class="i">IsNegativeInfinity</span><span class="o">:</span> <span class="o">&#39;</span><span class="i">T</span> <span class="k">-&gt;</span> <span onmouseout="hideTip(event, 'fs8', 23)" onmouseover="showTip(event, 'fs8', 23)" class="t">bool</span>) (<span onmouseout="hideTip(event, 'fs9', 24)" onmouseover="showTip(event, 'fs9', 24)" class="i">v</span>))
<span class="k">then</span> <span onmouseout="hideTip(event, 'fs4', 25)" onmouseover="showTip(event, 'fs4', 25)" class="p">Some</span> <span class="p">NegativeInfinity</span> <span class="k">else</span> <span onmouseout="hideTip(event, 'fs5', 26)" onmouseover="showTip(event, 'fs5', 26)" class="p">None</span>
<span class="k">let</span> <span class="k">inline</span> (|<span class="p">NaN</span>|_|) (<span onmouseout="hideTip(event, 'fs10', 27)" onmouseover="showTip(event, 'fs10', 27)" class="i">v</span><span class="o">:</span> <span class="o">^</span><span class="i">T</span>) <span class="o">=</span>
<span class="k">if</span> (<span class="o">^</span><span class="i">T</span> <span class="o">:</span> (<span class="k">static</span> <span class="k">member</span> <span class="i">IsNaN</span><span class="o">:</span> <span class="o">&#39;</span><span class="i">T</span> <span class="k">-&gt;</span> <span onmouseout="hideTip(event, 'fs8', 28)" onmouseover="showTip(event, 'fs8', 28)" class="t">bool</span>) (<span onmouseout="hideTip(event, 'fs10', 29)" onmouseover="showTip(event, 'fs10', 29)" class="i">v</span>))
<span class="k">then</span> <span onmouseout="hideTip(event, 'fs4', 30)" onmouseover="showTip(event, 'fs4', 30)" class="p">Some</span> <span class="p">NaN</span> <span class="k">else</span> <span onmouseout="hideTip(event, 'fs5', 31)" onmouseover="showTip(event, 'fs5', 31)" class="p">None</span>
<span class="k">let</span> <span class="k">inline</span> <span class="pn">(</span><span class="fn">|</span><span class="uc">Float</span><span class="pn">|</span><span class="id">_</span><span class="pn">|</span><span class="pn">)</span> <span class="pn">(</span><span onmouseout="hideTip(event, 'fs1', 1)" onmouseover="showTip(event, 'fs1', 1)" class="fn">v</span><span class="pn">:</span><span onmouseout="hideTip(event, 'fs2', 2)" onmouseover="showTip(event, 'fs2', 2)" class="rt">obj</span><span class="pn">)</span> <span class="o">=</span>
<span class="k">if</span> <span onmouseout="hideTip(event, 'fs1', 3)" onmouseover="showTip(event, 'fs1', 3)" class="fn">v</span> <span class="o">:?</span> <span onmouseout="hideTip(event, 'fs3', 4)" onmouseover="showTip(event, 'fs3', 4)" class="vt">float</span> <span class="k">then</span> <span onmouseout="hideTip(event, 'fs4', 5)" onmouseover="showTip(event, 'fs4', 5)" class="uc">Some</span><span class="pn">(</span><span onmouseout="hideTip(event, 'fs1', 6)" onmouseover="showTip(event, 'fs1', 6)" class="fn">v</span> <span class="o">:?&gt;</span> <span onmouseout="hideTip(event, 'fs3', 7)" onmouseover="showTip(event, 'fs3', 7)" class="vt">float</span><span class="pn">)</span> <span class="k">else</span> <span onmouseout="hideTip(event, 'fs5', 8)" onmouseover="showTip(event, 'fs5', 8)" class="uc">None</span>
<span class="k">let</span> <span class="k">inline</span> <span class="pn">(</span><span class="fn">|</span><span class="uc">Float32</span><span class="pn">|</span><span class="id">_</span><span class="pn">|</span><span class="pn">)</span> <span class="pn">(</span><span onmouseout="hideTip(event, 'fs1', 9)" onmouseover="showTip(event, 'fs1', 9)" class="fn">v</span><span class="pn">:</span><span onmouseout="hideTip(event, 'fs2', 10)" onmouseover="showTip(event, 'fs2', 10)" class="rt">obj</span><span class="pn">)</span> <span class="o">=</span>
<span class="k">if</span> <span onmouseout="hideTip(event, 'fs1', 11)" onmouseover="showTip(event, 'fs1', 11)" class="fn">v</span> <span class="o">:?</span> <span onmouseout="hideTip(event, 'fs6', 12)" onmouseover="showTip(event, 'fs6', 12)" class="vt">float32</span> <span class="k">then</span> <span onmouseout="hideTip(event, 'fs4', 13)" onmouseover="showTip(event, 'fs4', 13)" class="uc">Some</span><span class="pn">(</span><span onmouseout="hideTip(event, 'fs1', 14)" onmouseover="showTip(event, 'fs1', 14)" class="fn">v</span> <span class="o">:?&gt;</span> <span onmouseout="hideTip(event, 'fs6', 15)" onmouseover="showTip(event, 'fs6', 15)" class="vt">float32</span><span class="pn">)</span> <span class="k">else</span> <span onmouseout="hideTip(event, 'fs5', 16)" onmouseover="showTip(event, 'fs5', 16)" class="uc">None</span>
<span class="k">let</span> <span class="k">inline</span> <span class="pn">(</span><span class="fn">|</span><span class="uc">PositiveInfinity</span><span class="pn">|</span><span class="id">_</span><span class="pn">|</span><span class="pn">)</span> <span class="pn">(</span><span onmouseout="hideTip(event, 'fs7', 17)" onmouseover="showTip(event, 'fs7', 17)" class="fn">v</span><span class="pn">:</span> <span class="ta">^</span><span class="id">T</span><span class="pn">)</span> <span class="o">=</span>
<span class="k">if</span> <span class="pn">(</span><span class="ta">^</span><span class="id">T</span> <span class="pn">:</span> <span class="pn">(</span><span class="k">static</span> <span class="k">member</span> <span class="fn">IsPositiveInfinity</span><span class="pn">:</span> <span class="ta">&#39;</span><span class="id">T</span> <span class="k">-&gt;</span> <span onmouseout="hideTip(event, 'fs8', 18)" onmouseover="showTip(event, 'fs8', 18)" class="vt">bool</span><span class="pn">)</span> <span class="pn">(</span><span onmouseout="hideTip(event, 'fs7', 19)" onmouseover="showTip(event, 'fs7', 19)" class="fn">v</span><span class="pn">)</span><span class="pn">)</span>
<span class="k">then</span> <span onmouseout="hideTip(event, 'fs4', 20)" onmouseover="showTip(event, 'fs4', 20)" class="uc">Some</span> <span class="uc">PositiveInfinity</span> <span class="k">else</span> <span onmouseout="hideTip(event, 'fs5', 21)" onmouseover="showTip(event, 'fs5', 21)" class="uc">None</span>
<span class="k">let</span> <span class="k">inline</span> <span class="pn">(</span><span class="fn">|</span><span class="uc">NegativeInfinity</span><span class="pn">|</span><span class="id">_</span><span class="pn">|</span><span class="pn">)</span> <span class="pn">(</span><span onmouseout="hideTip(event, 'fs9', 22)" onmouseover="showTip(event, 'fs9', 22)" class="fn">v</span><span class="pn">:</span> <span class="ta">^</span><span class="id">T</span><span class="pn">)</span> <span class="o">=</span>
<span class="k">if</span> <span class="pn">(</span><span class="ta">^</span><span class="id">T</span> <span class="pn">:</span> <span class="pn">(</span><span class="k">static</span> <span class="k">member</span> <span class="fn">IsNegativeInfinity</span><span class="pn">:</span> <span class="ta">&#39;</span><span class="id">T</span> <span class="k">-&gt;</span> <span onmouseout="hideTip(event, 'fs8', 23)" onmouseover="showTip(event, 'fs8', 23)" class="vt">bool</span><span class="pn">)</span> <span class="pn">(</span><span onmouseout="hideTip(event, 'fs9', 24)" onmouseover="showTip(event, 'fs9', 24)" class="fn">v</span><span class="pn">)</span><span class="pn">)</span>
<span class="k">then</span> <span onmouseout="hideTip(event, 'fs4', 25)" onmouseover="showTip(event, 'fs4', 25)" class="uc">Some</span> <span class="uc">NegativeInfinity</span> <span class="k">else</span> <span onmouseout="hideTip(event, 'fs5', 26)" onmouseover="showTip(event, 'fs5', 26)" class="uc">None</span>
<span class="k">let</span> <span class="k">inline</span> <span class="pn">(</span><span class="fn">|</span><span class="uc">NaN</span><span class="pn">|</span><span class="id">_</span><span class="pn">|</span><span class="pn">)</span> <span class="pn">(</span><span onmouseout="hideTip(event, 'fs10', 27)" onmouseover="showTip(event, 'fs10', 27)" class="fn">v</span><span class="pn">:</span> <span class="ta">^</span><span class="id">T</span><span class="pn">)</span> <span class="o">=</span>
<span class="k">if</span> <span class="pn">(</span><span class="ta">^</span><span class="id">T</span> <span class="pn">:</span> <span class="pn">(</span><span class="k">static</span> <span class="k">member</span> <span class="fn">IsNaN</span><span class="pn">:</span> <span class="ta">&#39;</span><span class="id">T</span> <span class="k">-&gt;</span> <span onmouseout="hideTip(event, 'fs8', 28)" onmouseover="showTip(event, 'fs8', 28)" class="vt">bool</span><span class="pn">)</span> <span class="pn">(</span><span onmouseout="hideTip(event, 'fs10', 29)" onmouseover="showTip(event, 'fs10', 29)" class="fn">v</span><span class="pn">)</span><span class="pn">)</span>
<span class="k">then</span> <span onmouseout="hideTip(event, 'fs4', 30)" onmouseover="showTip(event, 'fs4', 30)" class="uc">Some</span> <span class="uc">NaN</span> <span class="k">else</span> <span onmouseout="hideTip(event, 'fs5', 31)" onmouseover="showTip(event, 'fs5', 31)" class="uc">None</span>
<span class="k">let</span> <span class="k">inline</span> <span onmouseout="hideTip(event, 'fs11', 32)" onmouseover="showTip(event, 'fs11', 32)" class="f">formatMathValue</span> (<span onmouseout="hideTip(event, 'fs12', 33)" onmouseover="showTip(event, 'fs12', 33)" class="i">floatFormat</span><span class="o">:</span><span onmouseout="hideTip(event, 'fs13', 34)" onmouseover="showTip(event, 'fs13', 34)" class="t">string</span>) <span class="o">=</span> <span class="k">function</span>
| <span onmouseout="hideTip(event, 'fs14', 35)" onmouseover="showTip(event, 'fs14', 35)" class="p">PositiveInfinity</span> <span class="k">-&gt;</span> <span class="s">&quot;</span><span class="e">\\</span><span class="s">infty&quot;</span>
| <span onmouseout="hideTip(event, 'fs15', 36)" onmouseover="showTip(event, 'fs15', 36)" class="p">NegativeInfinity</span> <span class="k">-&gt;</span> <span class="s">&quot;-</span><span class="e">\\</span><span class="s">infty&quot;</span>
| <span onmouseout="hideTip(event, 'fs16', 37)" onmouseover="showTip(event, 'fs16', 37)" class="p">NaN</span> <span class="k">-&gt;</span> <span class="s">&quot;</span><span class="e">\\</span><span class="s">times&quot;</span>
| <span onmouseout="hideTip(event, 'fs17', 38)" onmouseover="showTip(event, 'fs17', 38)" class="p">Float</span> <span onmouseout="hideTip(event, 'fs18', 39)" onmouseover="showTip(event, 'fs18', 39)" class="i">v</span> <span class="k">-&gt;</span> <span onmouseout="hideTip(event, 'fs18', 40)" onmouseover="showTip(event, 'fs18', 40)" class="i">v</span><span class="o">.</span><span onmouseout="hideTip(event, 'fs19', 41)" onmouseover="showTip(event, 'fs19', 41)" class="f">ToString</span>(<span onmouseout="hideTip(event, 'fs12', 42)" onmouseover="showTip(event, 'fs12', 42)" class="i">floatFormat</span>)
| <span onmouseout="hideTip(event, 'fs20', 43)" onmouseover="showTip(event, 'fs20', 43)" class="p">Float32</span> <span onmouseout="hideTip(event, 'fs21', 44)" onmouseover="showTip(event, 'fs21', 44)" class="i">v</span> <span class="k">-&gt;</span> <span onmouseout="hideTip(event, 'fs21', 45)" onmouseover="showTip(event, 'fs21', 45)" class="i">v</span><span class="o">.</span><span onmouseout="hideTip(event, 'fs22', 46)" onmouseover="showTip(event, 'fs22', 46)" class="f">ToString</span>(<span onmouseout="hideTip(event, 'fs12', 47)" onmouseover="showTip(event, 'fs12', 47)" class="i">floatFormat</span>)
| <span onmouseout="hideTip(event, 'fs23', 48)" onmouseover="showTip(event, 'fs23', 48)" class="i">v</span> <span class="k">-&gt;</span> <span onmouseout="hideTip(event, 'fs23', 49)" onmouseover="showTip(event, 'fs23', 49)" class="i">v</span><span class="o">.</span><span onmouseout="hideTip(event, 'fs24', 50)" onmouseover="showTip(event, 'fs24', 50)" class="f">ToString</span>()
<span class="k">let</span> <span class="k">inline</span> <span onmouseout="hideTip(event, 'fs11', 32)" onmouseover="showTip(event, 'fs11', 32)" class="fn">formatMathValue</span> <span class="pn">(</span><span onmouseout="hideTip(event, 'fs12', 33)" onmouseover="showTip(event, 'fs12', 33)" class="fn">floatFormat</span><span class="pn">:</span><span onmouseout="hideTip(event, 'fs13', 34)" onmouseover="showTip(event, 'fs13', 34)" class="rt">string</span><span class="pn">)</span> <span class="o">=</span> <span class="k">function</span>
<span class="pn">|</span> <span onmouseout="hideTip(event, 'fs14', 35)" onmouseover="showTip(event, 'fs14', 35)" class="uc">PositiveInfinity</span> <span class="k">-&gt;</span> <span class="s">&quot;\\infty&quot;</span>
<span class="pn">|</span> <span onmouseout="hideTip(event, 'fs15', 36)" onmouseover="showTip(event, 'fs15', 36)" class="uc">NegativeInfinity</span> <span class="k">-&gt;</span> <span class="s">&quot;-\\infty&quot;</span>
<span class="pn">|</span> <span onmouseout="hideTip(event, 'fs16', 37)" onmouseover="showTip(event, 'fs16', 37)" class="uc">NaN</span> <span class="k">-&gt;</span> <span class="s">&quot;\\times&quot;</span>
<span class="pn">|</span> <span onmouseout="hideTip(event, 'fs17', 38)" onmouseover="showTip(event, 'fs17', 38)" class="uc">Float</span> <span onmouseout="hideTip(event, 'fs18', 39)" onmouseover="showTip(event, 'fs18', 39)" class="fn">v</span> <span class="k">-&gt;</span> <span onmouseout="hideTip(event, 'fs18', 40)" onmouseover="showTip(event, 'fs18', 40)" class="fn">v</span><span class="pn">.</span><span onmouseout="hideTip(event, 'fs19', 41)" onmouseover="showTip(event, 'fs19', 41)" class="id">ToString</span><span class="pn">(</span><span onmouseout="hideTip(event, 'fs12', 42)" onmouseover="showTip(event, 'fs12', 42)" class="fn">floatFormat</span><span class="pn">)</span>
<span class="pn">|</span> <span onmouseout="hideTip(event, 'fs20', 43)" onmouseover="showTip(event, 'fs20', 43)" class="uc">Float32</span> <span onmouseout="hideTip(event, 'fs21', 44)" onmouseover="showTip(event, 'fs21', 44)" class="fn">v</span> <span class="k">-&gt;</span> <span onmouseout="hideTip(event, 'fs21', 45)" onmouseover="showTip(event, 'fs21', 45)" class="fn">v</span><span class="pn">.</span><span onmouseout="hideTip(event, 'fs22', 46)" onmouseover="showTip(event, 'fs22', 46)" class="id">ToString</span><span class="pn">(</span><span onmouseout="hideTip(event, 'fs12', 47)" onmouseover="showTip(event, 'fs12', 47)" class="fn">floatFormat</span><span class="pn">)</span>
<span class="pn">|</span> <span onmouseout="hideTip(event, 'fs23', 48)" onmouseover="showTip(event, 'fs23', 48)" class="fn">v</span> <span class="k">-&gt;</span> <span onmouseout="hideTip(event, 'fs23', 49)" onmouseover="showTip(event, 'fs23', 49)" class="fn">v</span><span class="pn">.</span><span onmouseout="hideTip(event, 'fs24', 50)" onmouseover="showTip(event, 'fs24', 50)" class="id">ToString</span><span class="pn">(</span><span class="pn">)</span>
<span class="k">let</span> <span class="k">inline</span> <span onmouseout="hideTip(event, 'fs25', 51)" onmouseover="showTip(event, 'fs25', 51)" class="f">formatMatrix</span> (<span onmouseout="hideTip(event, 'fs26', 52)" onmouseover="showTip(event, 'fs26', 52)" class="i">matrix</span><span class="o">:</span> <span class="i">Matrix</span><span class="o">&lt;</span><span class="o">&#39;</span><span class="i">T</span><span class="o">&gt;</span>) <span class="o">=</span>
<span onmouseout="hideTip(event, 'fs27', 53)" onmouseover="showTip(event, 'fs27', 53)" class="t">String</span><span class="o">.</span><span onmouseout="hideTip(event, 'fs28', 54)" onmouseover="showTip(event, 'fs28', 54)" class="f">concat</span> <span class="i">Environment</span><span class="o">.</span><span class="i">NewLine</span>
[ <span class="s">&quot;</span><span class="e">\\</span><span class="s">begin{bmatrix}&quot;</span>
<span onmouseout="hideTip(event, 'fs26', 55)" onmouseover="showTip(event, 'fs26', 55)" class="i">matrix</span><span class="o">.</span><span class="i">ToMatrixString</span>(<span class="n">10</span>,<span class="n">4</span>,<span class="n">7</span>,<span class="n">2</span>,<span class="s">&quot;</span><span class="e">\\</span><span class="s">cdots&quot;</span>,<span class="s">&quot;</span><span class="e">\\</span><span class="s">vdots&quot;</span>,<span class="s">&quot;</span><span class="e">\\</span><span class="s">ddots&quot;</span>,
<span class="s">&quot; &amp; &quot;</span>, <span class="s">&quot;</span><span class="e">\\</span><span class="s"></span><span class="e">\\</span><span class="s"> &quot;</span> <span class="o">+</span> <span class="i">Environment</span><span class="o">.</span><span class="i">NewLine</span>, (<span class="k">fun</span> <span class="i">x</span> <span class="k">-&gt;</span> <span onmouseout="hideTip(event, 'fs11', 56)" onmouseover="showTip(event, 'fs11', 56)" class="i">formatMathValue</span> <span class="s">&quot;G4&quot;</span> <span class="i">x</span>))
<span class="s">&quot;</span><span class="e">\\</span><span class="s">end{bmatrix}&quot;</span> ]
<span class="k">let</span> <span class="k">inline</span> <span onmouseout="hideTip(event, 'fs25', 51)" onmouseover="showTip(event, 'fs25', 51)" class="fn">formatMatrix</span> <span class="pn">(</span><span onmouseout="hideTip(event, 'fs26', 52)" onmouseover="showTip(event, 'fs26', 52)" class="fn">matrix</span><span class="pn">:</span> <span class="id">Matrix</span><span class="pn">&lt;</span><span class="id">&#39;</span><span class="id">T</span><span class="pn">&gt;</span><span class="pn">)</span> <span class="o">=</span>
<span onmouseout="hideTip(event, 'fs27', 53)" onmouseover="showTip(event, 'fs27', 53)" class="m">String</span><span class="pn">.</span><span onmouseout="hideTip(event, 'fs28', 54)" onmouseover="showTip(event, 'fs28', 54)" class="id">concat</span> <span class="id">Environment</span><span class="pn">.</span><span class="id">NewLine</span>
<span class="pn">[</span> <span class="s">&quot;\\begin{bmatrix}&quot;</span>
<span onmouseout="hideTip(event, 'fs26', 55)" onmouseover="showTip(event, 'fs26', 55)" class="fn">matrix</span><span class="pn">.</span><span class="id">ToMatrixString</span><span class="pn">(</span><span class="n">10</span><span class="pn">,</span><span class="n">4</span><span class="pn">,</span><span class="n">7</span><span class="pn">,</span><span class="n">2</span><span class="pn">,</span><span class="s">&quot;\\cdots&quot;</span><span class="pn">,</span><span class="s">&quot;\\vdots&quot;</span><span class="pn">,</span><span class="s">&quot;\\ddots&quot;</span><span class="pn">,</span>
<span class="s">&quot; &amp; &quot;</span><span class="pn">,</span> <span class="s">&quot;\\\\ &quot;</span> <span class="o">+</span> <span class="id">Environment</span><span class="pn">.</span><span class="id">NewLine</span><span class="pn">,</span> <span class="pn">(</span><span class="k">fun</span> <span class="id">x</span> <span class="k">-&gt;</span> <span onmouseout="hideTip(event, 'fs11', 56)" onmouseover="showTip(event, 'fs11', 56)" class="id">formatMathValue</span> <span class="s">&quot;G4&quot;</span> <span class="id">x</span><span class="pn">)</span><span class="pn">)</span>
<span class="s">&quot;\\end{bmatrix}&quot;</span> <span class="pn">]</span>
<span class="k">let</span> <span class="k">inline</span> <span onmouseout="hideTip(event, 'fs29', 57)" onmouseover="showTip(event, 'fs29', 57)" class="f">formatVector</span> (<span onmouseout="hideTip(event, 'fs30', 58)" onmouseover="showTip(event, 'fs30', 58)" class="i">vector</span><span class="o">:</span> <span class="i">Vector</span><span class="o">&lt;</span><span class="o">&#39;</span><span class="i">T</span><span class="o">&gt;</span>) <span class="o">=</span>
<span onmouseout="hideTip(event, 'fs27', 59)" onmouseover="showTip(event, 'fs27', 59)" class="t">String</span><span class="o">.</span><span onmouseout="hideTip(event, 'fs28', 60)" onmouseover="showTip(event, 'fs28', 60)" class="f">concat</span> <span class="i">Environment</span><span class="o">.</span><span class="i">NewLine</span>
[ <span class="s">&quot;</span><span class="e">\\</span><span class="s">begin{bmatrix}&quot;</span>
<span onmouseout="hideTip(event, 'fs30', 61)" onmouseover="showTip(event, 'fs30', 61)" class="i">vector</span><span class="o">.</span><span class="i">ToVectorString</span>(<span class="n">12</span>, <span class="n">80</span>, <span class="s">&quot;</span><span class="e">\\</span><span class="s">vdots&quot;</span>, <span class="s">&quot; &amp; &quot;</span>, <span class="s">&quot;</span><span class="e">\\</span><span class="s"></span><span class="e">\\</span><span class="s"> &quot;</span> <span class="o">+</span> <span class="i">Environment</span><span class="o">.</span><span class="i">NewLine</span>,
(<span class="k">fun</span> <span class="i">x</span> <span class="k">-&gt;</span> <span onmouseout="hideTip(event, 'fs11', 62)" onmouseover="showTip(event, 'fs11', 62)" class="i">formatMathValue</span> <span class="s">&quot;G4&quot;</span> <span class="i">x</span>))
<span class="s">&quot;</span><span class="e">\\</span><span class="s">end{bmatrix}&quot;</span> ]
<span class="k">let</span> <span class="k">inline</span> <span onmouseout="hideTip(event, 'fs29', 57)" onmouseover="showTip(event, 'fs29', 57)" class="fn">formatVector</span> <span class="pn">(</span><span onmouseout="hideTip(event, 'fs30', 58)" onmouseover="showTip(event, 'fs30', 58)" class="fn">vector</span><span class="pn">:</span> <span onmouseout="hideTip(event, 'fs31', 59)" onmouseover="showTip(event, 'fs31', 59)" class="vt">Vector</span><span class="pn">&lt;</span><span class="ta">&#39;</span><span class="id">T</span><span class="pn">&gt;</span><span class="pn">)</span> <span class="o">=</span>
<span onmouseout="hideTip(event, 'fs27', 60)" onmouseover="showTip(event, 'fs27', 60)" class="m">String</span><span class="pn">.</span><span onmouseout="hideTip(event, 'fs28', 61)" onmouseover="showTip(event, 'fs28', 61)" class="id">concat</span> <span class="id">Environment</span><span class="pn">.</span><span class="id">NewLine</span>
<span class="pn">[</span> <span class="s">&quot;\\begin{bmatrix}&quot;</span>
<span onmouseout="hideTip(event, 'fs30', 62)" onmouseover="showTip(event, 'fs30', 62)" class="fn">vector</span><span class="pn">.</span><span class="id">ToVectorString</span><span class="pn">(</span><span class="n">12</span><span class="pn">,</span> <span class="n">80</span><span class="pn">,</span> <span class="s">&quot;\\vdots&quot;</span><span class="pn">,</span> <span class="s">&quot; &amp; &quot;</span><span class="pn">,</span> <span class="s">&quot;\\\\ &quot;</span> <span class="o">+</span> <span class="id">Environment</span><span class="pn">.</span><span class="id">NewLine</span><span class="pn">,</span>
<span class="pn">(</span><span class="k">fun</span> <span class="id">x</span> <span class="k">-&gt;</span> <span onmouseout="hideTip(event, 'fs11', 63)" onmouseover="showTip(event, 'fs11', 63)" class="id">formatMathValue</span> <span class="s">&quot;G4&quot;</span> <span class="id">x</span><span class="pn">)</span><span class="pn">)</span>
<span class="s">&quot;\\end{bmatrix}&quot;</span> <span class="pn">]</span>
<span class="i">App</span><span class="o">.</span><span class="i">AddDisplayPrinter</span> (<span class="k">fun</span> (<span class="i">x</span><span class="o">:</span><span class="i">Matrix</span><span class="o">&lt;</span><span onmouseout="hideTip(event, 'fs3', 63)" onmouseover="showTip(event, 'fs3', 63)" class="i">float</span><span class="o">&gt;</span>) <span class="k">-&gt;</span>
{ <span class="i">ContentType</span> <span class="o">=</span> <span class="s">&quot;text/latex&quot;</span>; <span onmouseout="hideTip(event, 'fs31', 64)" onmouseover="showTip(event, 'fs31', 64)" class="i">Data</span> <span class="o">=</span> <span onmouseout="hideTip(event, 'fs25', 65)" onmouseover="showTip(event, 'fs25', 65)" class="i">formatMatrix</span> <span class="i">x</span> })
<span class="i">App</span><span class="o">.</span><span class="i">AddDisplayPrinter</span> (<span class="k">fun</span> (<span class="i">x</span><span class="o">:</span><span class="i">Matrix</span><span class="o">&lt;</span><span onmouseout="hideTip(event, 'fs6', 66)" onmouseover="showTip(event, 'fs6', 66)" class="i">float32</span><span class="o">&gt;</span>) <span class="k">-&gt;</span>
{ <span class="i">ContentType</span> <span class="o">=</span> <span class="s">&quot;text/latex&quot;</span>; <span onmouseout="hideTip(event, 'fs31', 67)" onmouseover="showTip(event, 'fs31', 67)" class="i">Data</span> <span class="o">=</span> <span onmouseout="hideTip(event, 'fs25', 68)" onmouseover="showTip(event, 'fs25', 68)" class="i">formatMatrix</span> <span class="i">x</span> })
<span class="i">App</span><span class="o">.</span><span class="i">AddDisplayPrinter</span> (<span class="k">fun</span> (<span class="i">x</span><span class="o">:</span><span class="i">Vector</span><span class="o">&lt;</span><span onmouseout="hideTip(event, 'fs3', 69)" onmouseover="showTip(event, 'fs3', 69)" class="i">float</span><span class="o">&gt;</span>) <span class="k">-&gt;</span>
{ <span class="i">ContentType</span> <span class="o">=</span> <span class="s">&quot;text/latex&quot;</span>; <span onmouseout="hideTip(event, 'fs31', 70)" onmouseover="showTip(event, 'fs31', 70)" class="i">Data</span> <span class="o">=</span> <span onmouseout="hideTip(event, 'fs29', 71)" onmouseover="showTip(event, 'fs29', 71)" class="i">formatVector</span> <span class="i">x</span> })
<span class="i">App</span><span class="o">.</span><span class="i">AddDisplayPrinter</span> (<span class="k">fun</span> (<span class="i">x</span><span class="o">:</span><span class="i">Vector</span><span class="o">&lt;</span><span onmouseout="hideTip(event, 'fs6', 72)" onmouseover="showTip(event, 'fs6', 72)" class="i">float32</span><span class="o">&gt;</span>) <span class="k">-&gt;</span>
{ <span class="i">ContentType</span> <span class="o">=</span> <span class="s">&quot;text/latex&quot;</span>; <span onmouseout="hideTip(event, 'fs31', 73)" onmouseover="showTip(event, 'fs31', 73)" class="i">Data</span> <span class="o">=</span> <span onmouseout="hideTip(event, 'fs29', 74)" onmouseover="showTip(event, 'fs29', 74)" class="i">formatVector</span> <span class="i">x</span> })
</code></pre></td>
</tr>
</table>
<span class="id">App</span><span class="pn">.</span><span class="id">AddDisplayPrinter</span> <span class="pn">(</span><span class="k">fun</span> <span class="pn">(</span><span class="id">x</span><span class="pn">:</span><span class="id">Matrix</span><span class="pn">&lt;</span><span onmouseout="hideTip(event, 'fs3', 64)" onmouseover="showTip(event, 'fs3', 64)" class="id">float</span><span class="pn">&gt;</span><span class="pn">)</span> <span class="k">-&gt;</span>
<span class="pn">{</span> <span class="id">ContentType</span> <span class="o">=</span> <span class="s">&quot;text/latex&quot;</span><span class="pn">;</span> <span onmouseout="hideTip(event, 'fs32', 65)" onmouseover="showTip(event, 'fs32', 65)" class="id">Data</span> <span class="o">=</span> <span onmouseout="hideTip(event, 'fs25', 66)" onmouseover="showTip(event, 'fs25', 66)" class="id">formatMatrix</span> <span class="id">x</span> <span class="pn">}</span><span class="pn">)</span>
<span class="id">App</span><span class="pn">.</span><span class="id">AddDisplayPrinter</span> <span class="pn">(</span><span class="k">fun</span> <span class="pn">(</span><span class="id">x</span><span class="pn">:</span><span class="id">Matrix</span><span class="pn">&lt;</span><span onmouseout="hideTip(event, 'fs6', 67)" onmouseover="showTip(event, 'fs6', 67)" class="id">float32</span><span class="pn">&gt;</span><span class="pn">)</span> <span class="k">-&gt;</span>
<span class="pn">{</span> <span class="id">ContentType</span> <span class="o">=</span> <span class="s">&quot;text/latex&quot;</span><span class="pn">;</span> <span onmouseout="hideTip(event, 'fs32', 68)" onmouseover="showTip(event, 'fs32', 68)" class="id">Data</span> <span class="o">=</span> <span onmouseout="hideTip(event, 'fs25', 69)" onmouseover="showTip(event, 'fs25', 69)" class="id">formatMatrix</span> <span class="id">x</span> <span class="pn">}</span><span class="pn">)</span>
<span class="id">App</span><span class="pn">.</span><span class="id">AddDisplayPrinter</span> <span class="pn">(</span><span class="k">fun</span> <span class="pn">(</span><span class="id">x</span><span class="pn">:</span><span onmouseout="hideTip(event, 'fs31', 70)" onmouseover="showTip(event, 'fs31', 70)" class="id">Vector</span><span class="pn">&lt;</span><span onmouseout="hideTip(event, 'fs3', 71)" onmouseover="showTip(event, 'fs3', 71)" class="id">float</span><span class="pn">&gt;</span><span class="pn">)</span> <span class="k">-&gt;</span>
<span class="pn">{</span> <span class="id">ContentType</span> <span class="o">=</span> <span class="s">&quot;text/latex&quot;</span><span class="pn">;</span> <span onmouseout="hideTip(event, 'fs32', 72)" onmouseover="showTip(event, 'fs32', 72)" class="id">Data</span> <span class="o">=</span> <span onmouseout="hideTip(event, 'fs29', 73)" onmouseover="showTip(event, 'fs29', 73)" class="id">formatVector</span> <span class="id">x</span> <span class="pn">}</span><span class="pn">)</span>
<span class="id">App</span><span class="pn">.</span><span class="id">AddDisplayPrinter</span> <span class="pn">(</span><span class="k">fun</span> <span class="pn">(</span><span class="id">x</span><span class="pn">:</span><span onmouseout="hideTip(event, 'fs31', 74)" onmouseover="showTip(event, 'fs31', 74)" class="id">Vector</span><span class="pn">&lt;</span><span onmouseout="hideTip(event, 'fs6', 75)" onmouseover="showTip(event, 'fs6', 75)" class="id">float32</span><span class="pn">&gt;</span><span class="pn">)</span> <span class="k">-&gt;</span>
<span class="pn">{</span> <span class="id">ContentType</span> <span class="o">=</span> <span class="s">&quot;text/latex&quot;</span><span class="pn">;</span> <span onmouseout="hideTip(event, 'fs32', 76)" onmouseover="showTip(event, 'fs32', 76)" class="id">Data</span> <span class="o">=</span> <span onmouseout="hideTip(event, 'fs29', 77)" onmouseover="showTip(event, 'fs29', 77)" class="id">formatVector</span> <span class="id">x</span> <span class="pn">}</span><span class="pn">)</span>
</code></pre>
<div class="tip" id="fs1">val v : obj</div>
<div class="tip" id="fs2">type obj = System.Object<br /><br />Full name: Microsoft.FSharp.Core.obj</div>
<div class="tip" id="fs3">Multiple items<br />val float : value:&#39;T -&gt; float (requires member op_Explicit)<br /><br />Full name: Microsoft.FSharp.Core.Operators.float<br /><br />--------------------<br />type float = System.Double<br /><br />Full name: Microsoft.FSharp.Core.float<br /><br />--------------------<br />type float&lt;&#39;Measure&gt; = float<br /><br />Full name: Microsoft.FSharp.Core.float&lt;_&gt;</div>
<div class="tip" id="fs4">union case Option.Some: Value: &#39;T -&gt; Option&lt;&#39;T&gt;</div>
<div class="tip" id="fs5">union case Option.None: Option&lt;&#39;T&gt;</div>
<div class="tip" id="fs6">Multiple items<br />val float32 : value:&#39;T -&gt; float32 (requires member op_Explicit)<br /><br />Full name: Microsoft.FSharp.Core.Operators.float32<br /><br />--------------------<br />type float32 = System.Single<br /><br />Full name: Microsoft.FSharp.Core.float32<br /><br />--------------------<br />type float32&lt;&#39;Measure&gt; = float32<br /><br />Full name: Microsoft.FSharp.Core.float32&lt;_&gt;</div>
<div class="tip" id="fs7">val v : &#39;T (requires member IsPositiveInfinity)</div>
<div class="tip" id="fs8">type bool = System.Boolean<br /><br />Full name: Microsoft.FSharp.Core.bool</div>
<div class="tip" id="fs9">val v : &#39;T (requires member IsNegativeInfinity)</div>
<div class="tip" id="fs10">val v : &#39;T (requires member IsNaN)</div>
<div class="tip" id="fs11">val formatMathValue : floatFormat:string -&gt; _arg1:&#39;a -&gt; string (requires member IsNaN and member IsPositiveInfinity and member IsNegativeInfinity)<br /><br />Full name: IFsharpNotebook.formatMathValue</div>
<div class="tip" id="fs12">val floatFormat : string</div>
<div class="tip" id="fs13">Multiple items<br />val string : value:&#39;T -&gt; string<br /><br />Full name: Microsoft.FSharp.Core.Operators.string<br /><br />--------------------<br />type string = System.String<br /><br />Full name: Microsoft.FSharp.Core.string</div>
<div class="tip" id="fs14">active recognizer PositiveInfinity: &#39;T -&gt; unit option<br /><br />Full name: IFsharpNotebook.( |PositiveInfinity|_| )</div>
<div class="tip" id="fs15">active recognizer NegativeInfinity: &#39;T -&gt; unit option<br /><br />Full name: IFsharpNotebook.( |NegativeInfinity|_| )</div>
<div class="tip" id="fs16">active recognizer NaN: &#39;T -&gt; unit option<br /><br />Full name: IFsharpNotebook.( |NaN|_| )</div>
<div class="tip" id="fs17">active recognizer Float: obj -&gt; float option<br /><br />Full name: IFsharpNotebook.( |Float|_| )</div>
<div class="tip" id="fs18">val v : float</div>
<div class="tip" id="fs19">System.Double.ToString() : string<br />System.Double.ToString(provider: System.IFormatProvider) : string<br />System.Double.ToString(format: string) : string<br />System.Double.ToString(format: string, provider: System.IFormatProvider) : string</div>
<div class="tip" id="fs20">active recognizer Float32: obj -&gt; float32 option<br /><br />Full name: IFsharpNotebook.( |Float32|_| )</div>
<div class="tip" id="fs21">val v : float32</div>
<div class="tip" id="fs22">System.Single.ToString() : string<br />System.Single.ToString(format: string) : string<br />System.Single.ToString(provider: System.IFormatProvider) : string<br />System.Single.ToString(format: string, provider: System.IFormatProvider) : string</div>
<div class="tip" id="fs23">val v : &#39;a (requires member IsNaN and member IsPositiveInfinity and member IsNegativeInfinity)</div>
<div class="tip" id="fs24">System.Object.ToString() : string</div>
<div class="tip" id="fs25">val formatMatrix : matrix:&#39;a -&gt; string<br /><br />Full name: IFsharpNotebook.formatMatrix</div>
<div class="tip" id="fs26">val matrix : &#39;a</div>
<div class="tip" id="fs27">module String<br /><br />from Microsoft.FSharp.Core</div>
<div class="tip" id="fs28">val concat : sep:string -&gt; strings:seq&lt;string&gt; -&gt; string<br /><br />Full name: Microsoft.FSharp.Core.String.concat</div>
<div class="tip" id="fs29">val formatVector : vector:&#39;a -&gt; string<br /><br />Full name: IFsharpNotebook.formatVector</div>
<div class="tip" id="fs30">val vector : &#39;a</div>
<div class="tip" id="fs31">namespace Microsoft.FSharp.Data</div>
<div class="fsdocs-tip" id="fs1">val v : obj</div>
<div class="fsdocs-tip" id="fs2">type obj = System.Object<br /><em>&lt;summary&gt;An abbreviation for the CLI type &lt;see cref=&quot;T:System.Object&quot; /&gt;.&lt;/summary&gt;<br />&lt;category&gt;Basic Types&lt;/category&gt;</em></div>
<div class="fsdocs-tip" id="fs3">Multiple items<br />val float : value:&#39;T -&gt; float (requires member op_Explicit)<br /><em>&lt;summary&gt;Converts the argument to 64-bit float. This is a direct conversion for all
primitive numeric types. For strings, the input is converted using &lt;c&gt;Double.Parse()&lt;/c&gt;
with InvariantCulture settings. Otherwise the operation requires an appropriate
static conversion method on the input type.&lt;/summary&gt;<br />&lt;param name=&quot;value&quot;&gt;The input value.&lt;/param&gt;<br />&lt;returns&gt;The converted float&lt;/returns&gt;</em><br /><br />--------------------<br />[&lt;Struct&gt;]
type float = System.Double<br /><em>&lt;summary&gt;An abbreviation for the CLI type &lt;see cref=&quot;T:System.Double&quot; /&gt;.&lt;/summary&gt;<br />&lt;category&gt;Basic Types&lt;/category&gt;</em><br /><br />--------------------<br />type float&lt;&#39;Measure&gt; =
float<br /><em>&lt;summary&gt;The type of double-precision floating point numbers, annotated with a unit of measure.
The unit of measure is erased in compiled code and when values of this type
are analyzed using reflection. The type is representationally equivalent to
&lt;see cref=&quot;T:System.Double&quot; /&gt;.&lt;/summary&gt;<br />&lt;category index=&quot;6&quot;&gt;Basic Types with Units of Measure&lt;/category&gt;</em></div>
<div class="fsdocs-tip" id="fs4">Union-Fall Option.Some: Value: &#39;T -&gt; Option&lt;&#39;T&gt;<br /><em>&lt;summary&gt;The representation of &quot;Value of type &#39;T&quot;&lt;/summary&gt;<br />&lt;param name=&quot;Value&quot;&gt;The input value.&lt;/param&gt;<br />&lt;returns&gt;An option representing the value.&lt;/returns&gt;</em></div>
<div class="fsdocs-tip" id="fs5">Union-Fall Option.None: Option&lt;&#39;T&gt;<br /><em>&lt;summary&gt;The representation of &quot;No value&quot;&lt;/summary&gt;</em></div>
<div class="fsdocs-tip" id="fs6">Multiple items<br />val float32 : value:&#39;T -&gt; float32 (requires member op_Explicit)<br /><em>&lt;summary&gt;Converts the argument to 32-bit float. This is a direct conversion for all
primitive numeric types. For strings, the input is converted using &lt;c&gt;Single.Parse()&lt;/c&gt;
with InvariantCulture settings. Otherwise the operation requires an appropriate
static conversion method on the input type.&lt;/summary&gt;<br />&lt;param name=&quot;value&quot;&gt;The input value.&lt;/param&gt;<br />&lt;returns&gt;The converted float32&lt;/returns&gt;</em><br /><br />--------------------<br />[&lt;Struct&gt;]
type float32 = System.Single<br /><em>&lt;summary&gt;An abbreviation for the CLI type &lt;see cref=&quot;T:System.Single&quot; /&gt;.&lt;/summary&gt;<br />&lt;category&gt;Basic Types&lt;/category&gt;</em><br /><br />--------------------<br />type float32&lt;&#39;Measure&gt; =
float32<br /><em>&lt;summary&gt;The type of single-precision floating point numbers, annotated with a unit of measure.
The unit of measure is erased in compiled code and when values of this type
are analyzed using reflection. The type is representationally equivalent to
&lt;see cref=&quot;T:System.Single&quot; /&gt;.
&lt;/summary&gt;<br />&lt;category&gt;Basic Types with Units of Measure&lt;/category&gt;</em></div>
<div class="fsdocs-tip" id="fs7">val v : &#39;T (requires member IsPositiveInfinity)</div>
<div class="fsdocs-tip" id="fs8">[&lt;Struct&gt;]
type bool = System.Boolean<br /><em>&lt;summary&gt;An abbreviation for the CLI type &lt;see cref=&quot;T:System.Boolean&quot; /&gt;.&lt;/summary&gt;<br />&lt;category&gt;Basic Types&lt;/category&gt;</em></div>
<div class="fsdocs-tip" id="fs9">val v : &#39;T (requires member IsNegativeInfinity)</div>
<div class="fsdocs-tip" id="fs10">val v : &#39;T (requires member IsNaN)</div>
<div class="fsdocs-tip" id="fs11">val formatMathValue : floatFormat:string -&gt; _arg1:&#39;a -&gt; string (requires member IsNaN and member IsPositiveInfinity and member IsNegativeInfinity)</div>
<div class="fsdocs-tip" id="fs12">val floatFormat : string</div>
<div class="fsdocs-tip" id="fs13">Multiple items<br />val string : value:&#39;T -&gt; string<br /><em>&lt;summary&gt;Converts the argument to a string using &lt;c&gt;ToString&lt;/c&gt;.&lt;/summary&gt;<br />&lt;remarks&gt;For standard integer and floating point values the and any type that implements &lt;c&gt;IFormattable&lt;/c&gt;&lt;c&gt;ToString&lt;/c&gt; conversion uses &lt;c&gt;CultureInfo.InvariantCulture&lt;/c&gt;. &lt;/remarks&gt;<br />&lt;param name=&quot;value&quot;&gt;The input value.&lt;/param&gt;<br />&lt;returns&gt;The converted string.&lt;/returns&gt;</em><br /><br />--------------------<br />type string = System.String<br /><em>&lt;summary&gt;An abbreviation for the CLI type &lt;see cref=&quot;T:System.String&quot; /&gt;.&lt;/summary&gt;<br />&lt;category&gt;Basic Types&lt;/category&gt;</em></div>
<div class="fsdocs-tip" id="fs14">aktive Erkennung PositiveInfinity: &#39;T -&gt; unit option</div>
<div class="fsdocs-tip" id="fs15">aktive Erkennung NegativeInfinity: &#39;T -&gt; unit option</div>
<div class="fsdocs-tip" id="fs16">aktive Erkennung NaN: &#39;T -&gt; unit option</div>
<div class="fsdocs-tip" id="fs17">aktive Erkennung Float: obj -&gt; float option</div>
<div class="fsdocs-tip" id="fs18">val v : float</div>
<div class="fsdocs-tip" id="fs19">System.Double.ToString() : string<br />System.Double.ToString(format: string) : string<br />System.Double.ToString(provider: System.IFormatProvider) : string<br />System.Double.ToString(format: string, provider: System.IFormatProvider) : string</div>
<div class="fsdocs-tip" id="fs20">aktive Erkennung Float32: obj -&gt; float32 option</div>
<div class="fsdocs-tip" id="fs21">val v : float32</div>
<div class="fsdocs-tip" id="fs22">System.Single.ToString() : string<br />System.Single.ToString(format: string) : string<br />System.Single.ToString(provider: System.IFormatProvider) : string<br />System.Single.ToString(format: string, provider: System.IFormatProvider) : string</div>
<div class="fsdocs-tip" id="fs23">val v : &#39;a (requires member IsNaN and member IsPositiveInfinity and member IsNegativeInfinity)</div>
<div class="fsdocs-tip" id="fs24">System.Object.ToString() : string</div>
<div class="fsdocs-tip" id="fs25">val formatMatrix : matrix:&#39;a -&gt; string</div>
<div class="fsdocs-tip" id="fs26">val matrix : &#39;a</div>
<div class="fsdocs-tip" id="fs27">Modul String
</div>
<div class="span3">
<ul class="nav nav-list" id="menu">
<li class="nav-header">Math.NET Numerics</li>
<li><a href="https://numerics.mathdotnet.com/Packages.html">NuGet & Binaries</a></li>
<li><a href="https://numerics.mathdotnet.com/ReleaseNotes.html">Release Notes</a></li>
<li><a href="https://numerics.mathdotnet.com/License.html">MIT License</a></li>
<li><a href="https://numerics.mathdotnet.com/Compatibility.html">Platform Support</a></li>
<li><a href="https://numerics.mathdotnet.com/api/">Class Reference</a></li>
<li><a href="https://github.com/mathnet/mathnet-numerics/issues">Issues & Bugs</a></li>
<li><a href="https://numerics.mathdotnet.com/Users.html">Who is using Math.NET?</a></li>
<li class="nav-header">Contributing</li>
<li><a href="https://numerics.mathdotnet.com/Contributors.html">Contributors</a></li>
<li><a href="https://numerics.mathdotnet.com/Contributing.html">Contributing</a></li>
<li><a href="https://numerics.mathdotnet.com/Build.html">Build & Tools</a></li>
<li><a href="http://feedback.mathdotnet.com/forums/2060-math-net-numerics">Your Ideas</a></li>
<li class="nav-header">Getting Help</li>
<li><a href="https://discuss.mathdotnet.com/c/numerics">Discuss</a></li>
<li><a href="https://stackoverflow.com/questions/tagged/mathdotnet">Stack Overflow</a></li>
<li class="nav-header">Getting Started</li>
<li><a href="https://numerics.mathdotnet.com/">Getting started</a></li>
<li><a href="https://numerics.mathdotnet.com/Constants.html">Constants</a></li>
<li>Floating-Point Numbers</li>
<li>Arbitrary Precision Numbers</li>
<li>Complex Numbers</li>
<li><a href="https://numerics.mathdotnet.com/Matrix.html">Matrices and Vectors</a></li>
<li><a href="https://numerics.mathdotnet.com/Euclid.html">Euclid & Number Theory</a></li>
<li>Combinatorics</li>
<li class="nav-header">Evaluation</li>
<li><a href="https://numerics.mathdotnet.com/Functions.html">Special Functions</a></li>
<li>Differentiation</li>
<li><a href="https://numerics.mathdotnet.com/Integration.html">Integration</a></li>
<li class="nav-header">Statistics/Probability</li>
<li><a href="https://numerics.mathdotnet.com/DescriptiveStatistics.html">Descriptive Statistics</a></li>
<li><a href="https://numerics.mathdotnet.com/Probability.html">Probability Distributions</a></li>
<li class="nav-header">Generation</li>
<li><a href="https://numerics.mathdotnet.com/Generate.html">Generating Data</a></li>
<li><a href="https://numerics.mathdotnet.com/Random.html">Random Numbers</a></li>
<li class="nav-header">Transformation</li>
<li>Fourier Transform (FFT)</li>
<li>Filtering & DSP</li>
<li>Window Functions</li>
aus Microsoft.FSharp.Core<br /><em>&lt;summary&gt;Functional programming operators for string processing. Further string operations
are available via the member functions on strings and other functionality in
&lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/system.string.aspx&quot;&gt;System.String&lt;/a&gt;
and &lt;a href=&quot;http://msdn2.microsoft.com/library/system.text.regularexpressions.aspx&quot;&gt;System.Text.RegularExpressions&lt;/a&gt; types.
&lt;/summary&gt;<br />&lt;category&gt;Strings and Text&lt;/category&gt;</em></div>
<div class="fsdocs-tip" id="fs28">val concat : sep:string -&gt; strings:seq&lt;string&gt; -&gt; string<br /><em>&lt;summary&gt;Returns a new string made by concatenating the given strings
with separator &lt;c&gt;sep&lt;/c&gt;, that is &lt;c&gt;a1 + sep + ... + sep + aN&lt;/c&gt;.&lt;/summary&gt;<br />&lt;param name=&quot;sep&quot;&gt;The separator string to be inserted between the strings
of the input sequence.&lt;/param&gt;<br />&lt;param name=&quot;strings&quot;&gt;The sequence of strings to be concatenated.&lt;/param&gt;<br />&lt;returns&gt;A new string consisting of the concatenated strings separated by
the separation string.&lt;/returns&gt;<br />&lt;exception cref=&quot;T:System.ArgumentNullException&quot;&gt;Thrown when &lt;c&gt;strings&lt;/c&gt; is null.&lt;/exception&gt;</em></div>
<div class="fsdocs-tip" id="fs29">val formatVector : vector:Vector&lt;&#39;T&gt; -&gt; string (requires default constructor and value type and &#39;T :&gt; System.ValueType)</div>
<div class="fsdocs-tip" id="fs30">val vector : Vector&lt;&#39;T&gt; (requires default constructor and value type and &#39;T :&gt; System.ValueType)</div>
<div class="fsdocs-tip" id="fs31">Multiple items<br />type Vector =
static member Abs&lt;&#39;T (requires default constructor and value type and &#39;T :&gt; ValueType)&gt; : value: Vector&lt;&#39;T&gt; -&gt; Vector&lt;&#39;T&gt;
static member Add&lt;&#39;T (requires default constructor and value type and &#39;T :&gt; ValueType)&gt; : left: Vector&lt;&#39;T&gt; * right: Vector&lt;&#39;T&gt; -&gt; Vector&lt;&#39;T&gt;
static member AndNot&lt;&#39;T (requires default constructor and value type and &#39;T :&gt; ValueType)&gt; : left: Vector&lt;&#39;T&gt; * right: Vector&lt;&#39;T&gt; -&gt; Vector&lt;&#39;T&gt;
static member AsVectorByte&lt;&#39;T (requires default constructor and value type and &#39;T :&gt; ValueType)&gt; : value: Vector&lt;&#39;T&gt; -&gt; Vector&lt;byte&gt;
static member AsVectorDouble&lt;&#39;T (requires default constructor and value type and &#39;T :&gt; ValueType)&gt; : value: Vector&lt;&#39;T&gt; -&gt; Vector&lt;float&gt;
static member AsVectorInt16&lt;&#39;T (requires default constructor and value type and &#39;T :&gt; ValueType)&gt; : value: Vector&lt;&#39;T&gt; -&gt; Vector&lt;int16&gt;
static member AsVectorInt32&lt;&#39;T (requires default constructor and value type and &#39;T :&gt; ValueType)&gt; : value: Vector&lt;&#39;T&gt; -&gt; Vector&lt;int&gt;
static member AsVectorInt64&lt;&#39;T (requires default constructor and value type and &#39;T :&gt; ValueType)&gt; : value: Vector&lt;&#39;T&gt; -&gt; Vector&lt;int64&gt;
static member AsVectorSByte&lt;&#39;T (requires default constructor and value type and &#39;T :&gt; ValueType)&gt; : value: Vector&lt;&#39;T&gt; -&gt; Vector&lt;sbyte&gt;
static member AsVectorSingle&lt;&#39;T (requires default constructor and value type and &#39;T :&gt; ValueType)&gt; : value: Vector&lt;&#39;T&gt; -&gt; Vector&lt;float32&gt;
...<br /><em>&lt;summary&gt;Provides a collection of static convenience methods for creating, manipulating, combining, and converting generic vectors.&lt;/summary&gt;</em><br /><br />--------------------<br />[&lt;Struct&gt;]
type Vector&lt;&#39;T (requires default constructor and value type and &#39;T :&gt; ValueType)&gt; =
new : values: ReadOnlySpan&lt;byte&gt; -&gt; unit + 5 &#220;berladungen
member CopyTo : destination: Span&lt;byte&gt; -&gt; unit + 3 &#220;berladungen
member Equals : other: Vector&lt;&#39;T&gt; -&gt; bool + 1 &#220;berladung
member GetHashCode : unit -&gt; int
member ToString : unit -&gt; string + 2 &#220;berladungen
member TryCopyTo : destination: Span&lt;byte&gt; -&gt; bool + 1 &#220;berladung
static member op_Addition : left: Vector&lt;&#39;T&gt; * right: Vector&lt;&#39;T&gt; -&gt; Vector&lt;&#39;T&gt;
static member op_BitwiseAnd : left: Vector&lt;&#39;T&gt; * right: Vector&lt;&#39;T&gt; -&gt; Vector&lt;&#39;T&gt;
static member op_BitwiseOr : left: Vector&lt;&#39;T&gt; * right: Vector&lt;&#39;T&gt; -&gt; Vector&lt;&#39;T&gt;
static member op_Division : left: Vector&lt;&#39;T&gt; * right: Vector&lt;&#39;T&gt; -&gt; Vector&lt;&#39;T&gt;
...<br /><em>&lt;summary&gt;Represents a single vector of a specified numeric type that is suitable for low-level optimization of parallel algorithms.&lt;/summary&gt;<br />&lt;typeparam name=&quot;T&quot;&gt;The vector type. &lt;c&gt;T&lt;/c&gt; can be any primitive numeric type.&lt;/typeparam&gt;</em><br /><br />--------------------<br />Vector ()<br />Vector(values: System.ReadOnlySpan&lt;byte&gt;) : Vector&lt;&#39;T&gt;<br />Vector(values: System.ReadOnlySpan&lt;&#39;T&gt;) : Vector&lt;&#39;T&gt;<br />Vector(values: System.Span&lt;&#39;T&gt;) : Vector&lt;&#39;T&gt;<br />Vector(value: &#39;T) : Vector&lt;&#39;T&gt;<br />Vector(values: &#39;T []) : Vector&lt;&#39;T&gt;<br />Vector(values: &#39;T [], index: int) : Vector&lt;&#39;T&gt;</div>
<div class="fsdocs-tip" id="fs32">Namespace Microsoft.FSharp.Data</div>
<li class="nav-header">Solving Equations</li>
<li><a href="https://numerics.mathdotnet.com/LinearEquations.html">Linear Equation Systems</a></li>
<li>Nonlinear Root Finding</li>
<li class="nav-header">Optimization</li>
<li>Linear Least Squares</li>
<li>Nonlinear Optimization</li>
<li><a href="https://numerics.mathdotnet.com/Distance.html">Distance Metrics</a></li>
<li class="nav-header">Curve Fitting</li>
<li><a href="https://numerics.mathdotnet.com/Regression.html">Regression</a></li>
<li>Interpolation</li>
<li>Fourier Approximation</li>
<li class="nav-header">Native Providers</li>
<li><a href="https://numerics.mathdotnet.com/MKL.html">Intel MKL</a></li>
<li class="nav-header">Working Together</li>
<li><a href="https://numerics.mathdotnet.com/CSV.html">Delimited Text Files (CSV)</a></li>
<li><a href="https://numerics.mathdotnet.com/MatrixMarket.html">NIST MatrixMarket</a></li>
<li><a href="https://numerics.mathdotnet.com/MatlabFiles.html">MATLAB</a></li>
<li><a href="https://numerics.mathdotnet.com/IFSharpNotebook.html">IF# Notebook</a></li>
<li>FsLab & Deedle</li>
<li>Microsoft Excel</li>
<li>numl.net machine learning</li>
<li>R-project</li>
</ul>
</div>
</div>
</div>
</body>
<!-- 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>

BIN
IfSharp-GenerateIS.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

BIN
IfSharp-MatrixVector.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

291
IntegralTransforms.html

@ -1,63 +1,138 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>Fourier and related linear integral transforms
<head>
<meta charset="utf-8">
<title>Fourier and related linear integral transforms
</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta name="description" content="Math.NET Numerics, providing methods and algorithms for numerical computations in science, engineering and every day use. .Net 4, .Net 3.5, SL5, Win8, WP8, PCL 47 and 136, Mono, Xamarin Android/iOS."/>
<meta name="author" content="Christoph Ruegg, Marcus Cuda, Jurgen Van Gael"/>
<script src="https://code.jquery.com/jquery-1.8.0.js"></script>
<script src="https://code.jquery.com/ui/1.8.23/jquery-ui.js"></script>
<script src="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/js/bootstrap.min.js"></script>
<link href="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap-combined.min.css" rel="stylesheet"/>
<link type="text/css" rel="stylesheet" href="https://numerics.mathdotnet.com/content/style.css" />
<style>
#main table:not(.pre) {
border: 1px solid #dddddd;
max-width: 100%;
border-style: solid;
border-width: 1px;
border-color: gray;
border-collapse: collapse;
border-right-width: 1px;
border-bottom-width: 1px;
margin-top: 15px;
margin-bottom: 25px;
}
#main table:not(.pre) th, #main table:not(.pre) td {
border: 1px solid #dddddd;
padding: 6px;
}
#main table:not(.pre) th p, #main table:not(.pre) td p {
margin-bottom: 5px;
}
</style>
<script type="text/javascript" src="https://numerics.mathdotnet.com/content/tips.js"></script>
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<![endif]-->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
</head>
<body>
<div class="container">
<div class="masthead">
<ul class="nav nav-pills pull-right">
<li><a href="https://www.mathdotnet.com">Math.NET Project</a></li>
<li><a href="https://numerics.mathdotnet.com">Math.NET Numerics</a></li>
<li><a href="https://github.com/mathnet/mathnet-numerics">GitHub</a></li>
</ul>
<h3 class="muted">Math.NET Numerics</h3>
<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>
<hr />
<div class="row">
<div class="span9" id="main">
<h1><a name="Fourier-and-related-linear-integral-transforms" class="anchor" href="#Fourier-and-related-linear-integral-transforms">Fourier and related linear integral transforms</a></h1>
<!-- 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">Floating-Point Numbers</li>
<li class="nav-item">Arbitrary Precision Numbers</li>
<li class="nav-item">Complex Numbers</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">Differentiation</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">Transformation</li>
<li class="nav-item">Fourier Transform (FFT)</li>
<li class="nav-item">Filtering & DSP</li>
<li class="nav-item">Window Functions</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-item">Nonlinear Root Finding</li>
<li class="nav-header">Optimization</li>
<li class="nav-item">Linear Least Squares</li>
<li class="nav-item">Nonlinear 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-item">Interpolation</li>
<li class="nav-item">Fourier Approximation</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://www.mathdotnet.com">Math.NET Project</a> |
<a href="https://numerics.mathdotnet.com">Math.NET Numerics</a> |
<a href="https://github.com/mathnet/mathnet-numerics">GitHub</a>
</h3>
</div>
<hr />
<div class="container" id="fsdocs-content">
<h1><a name="Fourier-and-related-linear-integral-transforms" class="anchor" href="#Fourier-and-related-linear-integral-transforms">Fourier and related linear integral transforms</a></h1>
<p>Math.NET Numerics currently supports two linear integral transforms: The discrete Fourier
transform and the discrete Hartley transform. Both are strongly localized in the frequency
spectrum, but while the Fourier transform operates on complex values, the Hartley transform
@ -75,15 +150,7 @@ We provide implementations of the following algorithms:</p>
</ul>
<p>Furthermore, the <em><a href="https://numerics.mathdotnet.com/api/MathNet.Numerics.IntegralTransforms/Fourier.htm">Transform</a></em> class provides a shortcut for the Bluestein FFT using static methods which are even easier to use: <em><a href="https://numerics.mathdotnet.com/api/MathNet.Numerics.IntegralTransforms/Transform.htm#FourierForward">FourierForward</a></em>, <em><a href="https://numerics.mathdotnet.com/api/MathNet.Numerics.IntegralTransforms/Transform.htm#FourierInverse">FourierInverse</a></em>.</p>
<p>Code Sample using the Transform class:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
<span class="l">4: </span>
<span class="l">5: </span>
<span class="l">6: </span>
<span class="l">7: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="c">// create a complex sample vector of length 96</span>
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="c">// create a complex sample vector of length 96</span>
Complex[] samples <span class="o">=</span> SignalGenerator.EquidistantInterval(
t <span class="o">=</span><span class="o">&gt;</span> <span class="k">new</span> Complex(<span class="n">1.0</span> <span class="o">/</span> (t <span class="o">*</span> t <span class="o">+</span> <span class="n">1.0</span>), t <span class="o">/</span> (t <span class="o">*</span> t <span class="o">+</span> <span class="n">1.0</span>)),
<span class="n">-16</span>, <span class="n">16</span>, <span class="n">96</span>);
@ -114,88 +181,16 @@ Transform.FourierForward(samples);
<h2><a name="Hartley-Space-Discrete-Hartley-Transform" class="anchor" href="#Hartley-Space-Discrete-Hartley-Transform">Hartley Space: Discrete Hartley Transform</a></h2>
<p>...</p>
</div>
<div class="span3">
<ul class="nav nav-list" id="menu">
<li class="nav-header">Math.NET Numerics</li>
<li><a href="https://numerics.mathdotnet.com/Packages.html">NuGet & Binaries</a></li>
<li><a href="https://numerics.mathdotnet.com/ReleaseNotes.html">Release Notes</a></li>
<li><a href="https://numerics.mathdotnet.com/License.html">MIT License</a></li>
<li><a href="https://numerics.mathdotnet.com/Compatibility.html">Platform Support</a></li>
<li><a href="https://numerics.mathdotnet.com/api/">Class Reference</a></li>
<li><a href="https://github.com/mathnet/mathnet-numerics/issues">Issues & Bugs</a></li>
<li><a href="https://numerics.mathdotnet.com/Users.html">Who is using Math.NET?</a></li>
<li class="nav-header">Contributing</li>
<li><a href="https://numerics.mathdotnet.com/Contributors.html">Contributors</a></li>
<li><a href="https://numerics.mathdotnet.com/Contributing.html">Contributing</a></li>
<li><a href="https://numerics.mathdotnet.com/Build.html">Build & Tools</a></li>
<li><a href="http://feedback.mathdotnet.com/forums/2060-math-net-numerics">Your Ideas</a></li>
<li class="nav-header">Getting Help</li>
<li><a href="https://discuss.mathdotnet.com/c/numerics">Discuss</a></li>
<li><a href="https://stackoverflow.com/questions/tagged/mathdotnet">Stack Overflow</a></li>
<li class="nav-header">Getting Started</li>
<li><a href="https://numerics.mathdotnet.com/">Getting started</a></li>
<li><a href="https://numerics.mathdotnet.com/Constants.html">Constants</a></li>
<li>Floating-Point Numbers</li>
<li>Arbitrary Precision Numbers</li>
<li>Complex Numbers</li>
<li><a href="https://numerics.mathdotnet.com/Matrix.html">Matrices and Vectors</a></li>
<li><a href="https://numerics.mathdotnet.com/Euclid.html">Euclid & Number Theory</a></li>
<li>Combinatorics</li>
<li class="nav-header">Evaluation</li>
<li><a href="https://numerics.mathdotnet.com/Functions.html">Special Functions</a></li>
<li>Differentiation</li>
<li><a href="https://numerics.mathdotnet.com/Integration.html">Integration</a></li>
<li class="nav-header">Statistics/Probability</li>
<li><a href="https://numerics.mathdotnet.com/DescriptiveStatistics.html">Descriptive Statistics</a></li>
<li><a href="https://numerics.mathdotnet.com/Probability.html">Probability Distributions</a></li>
<li class="nav-header">Generation</li>
<li><a href="https://numerics.mathdotnet.com/Generate.html">Generating Data</a></li>
<li><a href="https://numerics.mathdotnet.com/Random.html">Random Numbers</a></li>
<li class="nav-header">Transformation</li>
<li>Fourier Transform (FFT)</li>
<li>Filtering & DSP</li>
<li>Window Functions</li>
<li class="nav-header">Solving Equations</li>
<li><a href="https://numerics.mathdotnet.com/LinearEquations.html">Linear Equation Systems</a></li>
<li>Nonlinear Root Finding</li>
<li class="nav-header">Optimization</li>
<li>Linear Least Squares</li>
<li>Nonlinear Optimization</li>
<li><a href="https://numerics.mathdotnet.com/Distance.html">Distance Metrics</a></li>
<li class="nav-header">Curve Fitting</li>
<li><a href="https://numerics.mathdotnet.com/Regression.html">Regression</a></li>
<li>Interpolation</li>
<li>Fourier Approximation</li>
<li class="nav-header">Native Providers</li>
<li><a href="https://numerics.mathdotnet.com/MKL.html">Intel MKL</a></li>
<li class="nav-header">Working Together</li>
<li><a href="https://numerics.mathdotnet.com/CSV.html">Delimited Text Files (CSV)</a></li>
<li><a href="https://numerics.mathdotnet.com/MatrixMarket.html">NIST MatrixMarket</a></li>
<li><a href="https://numerics.mathdotnet.com/MatlabFiles.html">MATLAB</a></li>
<li><a href="https://numerics.mathdotnet.com/IFSharpNotebook.html">IF# Notebook</a></li>
<li>FsLab & Deedle</li>
<li>Microsoft Excel</li>
<li>numl.net machine learning</li>
<li>R-project</li>
</ul>
</div>
</div>
</div>
</body>
<!-- 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>

384
Integration.html

@ -1,78 +1,141 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>Numerical Integration
<head>
<meta charset="utf-8">
<title>Numerical Integration
</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta name="description" content="Math.NET Numerics, providing methods and algorithms for numerical computations in science, engineering and every day use. .Net 4, .Net 3.5, SL5, Win8, WP8, PCL 47 and 136, Mono, Xamarin Android/iOS."/>
<meta name="author" content="Christoph Ruegg, Marcus Cuda, Jurgen Van Gael"/>
<script src="https://code.jquery.com/jquery-1.8.0.js"></script>
<script src="https://code.jquery.com/ui/1.8.23/jquery-ui.js"></script>
<script src="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/js/bootstrap.min.js"></script>
<link href="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap-combined.min.css" rel="stylesheet"/>
<link type="text/css" rel="stylesheet" href="https://numerics.mathdotnet.com/content/style.css" />
<style>
#main table:not(.pre) {
border: 1px solid #dddddd;
max-width: 100%;
border-style: solid;
border-width: 1px;
border-color: gray;
border-collapse: collapse;
border-right-width: 1px;
border-bottom-width: 1px;
margin-top: 15px;
margin-bottom: 25px;
}
#main table:not(.pre) th, #main table:not(.pre) td {
border: 1px solid #dddddd;
padding: 6px;
}
#main table:not(.pre) th p, #main table:not(.pre) td p {
margin-bottom: 5px;
}
</style>
<script type="text/javascript" src="https://numerics.mathdotnet.com/content/tips.js"></script>
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<![endif]-->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
</head>
<body>
<div class="container">
<div class="masthead">
<ul class="nav nav-pills pull-right">
<li><a href="https://www.mathdotnet.com">Math.NET Project</a></li>
<li><a href="https://numerics.mathdotnet.com">Math.NET Numerics</a></li>
<li><a href="https://github.com/mathnet/mathnet-numerics">GitHub</a></li>
</ul>
<h3 class="muted">Math.NET Numerics</h3>
<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>
<hr />
<div class="row">
<div class="span9" id="main">
<h1><a name="Numerical-Integration" class="anchor" href="#Numerical-Integration">Numerical Integration</a></h1>
<!-- 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">Floating-Point Numbers</li>
<li class="nav-item">Arbitrary Precision Numbers</li>
<li class="nav-item">Complex Numbers</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">Differentiation</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">Transformation</li>
<li class="nav-item">Fourier Transform (FFT)</li>
<li class="nav-item">Filtering & DSP</li>
<li class="nav-item">Window Functions</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-item">Nonlinear Root Finding</li>
<li class="nav-header">Optimization</li>
<li class="nav-item">Linear Least Squares</li>
<li class="nav-item">Nonlinear 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-item">Interpolation</li>
<li class="nav-item">Fourier Approximation</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://www.mathdotnet.com">Math.NET Project</a> |
<a href="https://numerics.mathdotnet.com">Math.NET Numerics</a> |
<a href="https://github.com/mathnet/mathnet-numerics">GitHub</a>
</h3>
</div>
<hr />
<div class="container" id="fsdocs-content">
<h1><a name="Numerical-Integration" class="anchor" href="#Numerical-Integration">Numerical Integration</a></h1>
<p>The following double precision numerical integration or quadrature rules are supported in Math.NET Numerics under the <code>MathNet.Numerics.Integration</code> namespace. Unless stated otherwise, the examples below evaluate the integral <span class="math">\(\int_0^{10} x^2 \, dx = \frac{1000}{3} \approx 333.\overline{3}\)</span>.</p>
<h2><a name="Simpson-s-Rule" class="anchor" href="#Simpson-s-Rule">Simpson's Rule</a></h2>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l"> 1: </span>
<span class="l"> 2: </span>
<span class="l"> 3: </span>
<span class="l"> 4: </span>
<span class="l"> 5: </span>
<span class="l"> 6: </span>
<span class="l"> 7: </span>
<span class="l"> 8: </span>
<span class="l"> 9: </span>
<span class="l">10: </span>
<span class="l">11: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="c">// Composite approximation with 4 partitions</span>
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="c">// Composite approximation with 4 partitions</span>
<span class="k">double</span> composite <span class="o">=</span> SimpsonRule.IntegrateComposite(x <span class="o">=</span><span class="o">&gt;</span> x <span class="o">*</span> x, <span class="n">0.0</span>, <span class="n">10.0</span>, <span class="n">4</span>);
<span class="c">// Approximate value using IntegrateComposite with 4 partitions is: 333.33333333333337</span>
@ -85,25 +148,7 @@ Console.WriteLine(<span class="s">"Approximate value using IntegrateComposite wi
Console.WriteLine(<span class="s">"Approximate value using IntegrateThreePoint is: "</span> <span class="o">+</span> threePoint);
</code></pre></td></tr></table>
<h2><a name="Newton-Cotes-Trapezium-Rule" class="anchor" href="#Newton-Cotes-Trapezium-Rule">Newton Cotes Trapezium Rule</a></h2>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l"> 1: </span>
<span class="l"> 2: </span>
<span class="l"> 3: </span>
<span class="l"> 4: </span>
<span class="l"> 5: </span>
<span class="l"> 6: </span>
<span class="l"> 7: </span>
<span class="l"> 8: </span>
<span class="l"> 9: </span>
<span class="l">10: </span>
<span class="l">11: </span>
<span class="l">12: </span>
<span class="l">13: </span>
<span class="l">14: </span>
<span class="l">15: </span>
<span class="l">16: </span>
<span class="l">17: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="c">// Adaptive approximation with a relative error of 1e-5</span>
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="c">// Adaptive approximation with a relative error of 1e-5</span>
<span class="k">double</span> adaptive <span class="o">=</span> NewtonCotesTrapeziumRule.IntegrateAdaptive(x <span class="o">=</span><span class="o">&gt;</span> x <span class="o">*</span> x, <span class="n">0.0</span>, <span class="n">10.0</span>, <span class="n">1</span>e<span class="n">-5</span>);
<span class="c">// Approximate value of the integral using IntegrateAdaptive with a relative error of 1e-5 is: 333.333969116211</span>
@ -123,13 +168,7 @@ Console.WriteLine(<span class="s">"Approximate value using IntegrateTwoPoint is:
</code></pre></td></tr></table>
<h2><a name="Double-Exponential-Transformation" class="anchor" href="#Double-Exponential-Transformation">Double-Exponential Transformation</a></h2>
<p>The Double-Exponential Transformation is suited for integration of smooth functions with no discontinuities, derivative discontinuities, and poles inside the interval.</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
<span class="l">4: </span>
<span class="l">5: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="c">// Approximate using a relative error of 1e-5.</span>
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="c">// Approximate using a relative error of 1e-5.</span>
<span class="k">double</span> integrate <span class="o">=</span> DoubleExponentialTransformation.Integrate(x <span class="o">=</span><span class="o">&gt;</span> x <span class="o">*</span> x, <span class="n">0.0</span>, <span class="n">10.0</span>, <span class="n">1</span>e<span class="n">-5</span>);
<span class="c">// Approximate value using a relative error of 1e-5 is: 333.333333333332</span>
@ -142,20 +181,7 @@ Console.WriteLine(<span class="s">"Approximate value using a relative error of 1
<p>This algorithm calculates the abscissas and weights for a given order and integration interval. For efficiency, pre-computed abscissas and weights for the orders <span class="math">\(N = 2 - 20, \, 32, \, 64, \, 96, 100, \, 128, \, 256, \, 512, \, 1024\)</span> are used. Otherwise, they are calculated on the fly using Newton's method. For more information on the algorithm see <a href="https://www.holoborodko.com/pavel/numerical-methods/numerical-integration/">[Holoborodko, Pavel] </a>.</p>
<h3><a name="Abscissas-and-Weights" class="anchor" href="#Abscissas-and-Weights">Abscissas and Weights</a></h3>
<p>We'll first use the abscissas and weights to approximate an integral using a 5-point Gauss-Legendre rule</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l"> 1: </span>
<span class="l"> 2: </span>
<span class="l"> 3: </span>
<span class="l"> 4: </span>
<span class="l"> 5: </span>
<span class="l"> 6: </span>
<span class="l"> 7: </span>
<span class="l"> 8: </span>
<span class="l"> 9: </span>
<span class="l">10: </span>
<span class="l">11: </span>
<span class="l">12: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="c">// Create a 5-point Gauss-Legendre rule over the integration interval [0, 10]</span>
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="c">// Create a 5-point Gauss-Legendre rule over the integration interval [0, 10]</span>
GaussLegendreRule rule <span class="o">=</span> <span class="k">new</span> GaussLegendreRule(<span class="n">0.0</span>, <span class="n">10.0</span>, <span class="n">5</span>);
<span class="k">double</span> sum <span class="o">=</span> <span class="n">0</span>; <span class="c">// Will hold the approximate value of the integral</span>
@ -174,23 +200,7 @@ Console.WriteLine(<span class="s">"Approximate value is: "</span> <span class="o
<li><code>double GetWeight(int i)</code></li>
</ul>
<p>then use the properties <code>Abscissas</code> and <code>Weights</code></p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l"> 1: </span>
<span class="l"> 2: </span>
<span class="l"> 3: </span>
<span class="l"> 4: </span>
<span class="l"> 5: </span>
<span class="l"> 6: </span>
<span class="l"> 7: </span>
<span class="l"> 8: </span>
<span class="l"> 9: </span>
<span class="l">10: </span>
<span class="l">11: </span>
<span class="l">12: </span>
<span class="l">13: </span>
<span class="l">14: </span>
<span class="l">15: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="c">// Create a 5-point Gauss-Legendre rule over the integration interval [0, 10]</span>
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="c">// Create a 5-point Gauss-Legendre rule over the integration interval [0, 10]</span>
GaussLegendreRule rule <span class="o">=</span> <span class="k">new</span> GaussLegendreRule(<span class="n">0.0</span>, <span class="n">10.0</span>, <span class="n">5</span>);
<span class="k">double</span>[] x <span class="o">=</span> rule.Abscissas; <span class="c">// Creates a clone and returns array of abscissas</span>
@ -207,19 +217,7 @@ GaussLegendreRule rule <span class="o">=</span> <span class="k">new</span> Gauss
Console.WriteLine(<span class="s">"Approximate value is: "</span> <span class="o">+</span> sum);;
</code></pre></td></tr></table>
<p>In addition to obtaining the abscissas and weights, the order and integration interval can be obtained</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l"> 1: </span>
<span class="l"> 2: </span>
<span class="l"> 3: </span>
<span class="l"> 4: </span>
<span class="l"> 5: </span>
<span class="l"> 6: </span>
<span class="l"> 7: </span>
<span class="l"> 8: </span>
<span class="l"> 9: </span>
<span class="l">10: </span>
<span class="l">11: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="c">// Create a 5-point Gauss-Legendre rule over the integration interval [0, 10]</span>
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="c">// Create a 5-point Gauss-Legendre rule over the integration interval [0, 10]</span>
GaussLegendreRule rule <span class="o">=</span> <span class="k">new</span> GaussLegendreRule(<span class="n">0.0</span>, <span class="n">10.0</span>, <span class="n">5</span>);
<span class="c">// The order of the rule is: 5</span>
@ -233,19 +231,7 @@ Console.WriteLine(<span class="s">"The upper integral bound is: "</span> <span c
</code></pre></td></tr></table>
<h3><a name="Integrate-Method" class="anchor" href="#Integrate-Method">Integrate Method</a></h3>
<p>For convenience, we provide an overloaded static method <code>double Integrate(...)</code> which preforms 1D and 2D integration of a function. The first parameter to the method is a delegate of type <code>Func&lt;double, double&gt;</code> or <code>Func&lt;double, double, double&gt;</code> for 1D and 2D integration respectively. So for example</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l"> 1: </span>
<span class="l"> 2: </span>
<span class="l"> 3: </span>
<span class="l"> 4: </span>
<span class="l"> 5: </span>
<span class="l"> 6: </span>
<span class="l"> 7: </span>
<span class="l"> 8: </span>
<span class="l"> 9: </span>
<span class="l">10: </span>
<span class="l">11: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="c">// 1D integration using a 5-point Gauss-Legendre rule over the integration interval [0, 10]</span>
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="c">// 1D integration using a 5-point Gauss-Legendre rule over the integration interval [0, 10]</span>
<span class="k">double</span> integrate<span class="n">1</span>D <span class="o">=</span> GaussLegendreRule.Integrate(x <span class="o">=</span><span class="o">&gt;</span> x <span class="o">*</span> x, <span class="n">0.0</span>, <span class="n">10.0</span>, <span class="n">5</span>);
<span class="c">// Approximate value of the 1D integral is: 333.333333333333</span>
@ -259,88 +245,16 @@ Console.WriteLine(<span class="s">"Approximate value of the 2D integral is: "</s
</code></pre></td></tr></table>
<p>where we used <span class="math">\(\int_0^{10}\int_1^2 x^2 y^2 \,dydx = \frac{7000}{9} \approx 777.\overline{7}\)</span> for the 2D integral example.</p>
</div>
<div class="span3">
<ul class="nav nav-list" id="menu">
<li class="nav-header">Math.NET Numerics</li>
<li><a href="https://numerics.mathdotnet.com/Packages.html">NuGet & Binaries</a></li>
<li><a href="https://numerics.mathdotnet.com/ReleaseNotes.html">Release Notes</a></li>
<li><a href="https://numerics.mathdotnet.com/License.html">MIT License</a></li>
<li><a href="https://numerics.mathdotnet.com/Compatibility.html">Platform Support</a></li>
<li><a href="https://numerics.mathdotnet.com/api/">Class Reference</a></li>
<li><a href="https://github.com/mathnet/mathnet-numerics/issues">Issues & Bugs</a></li>
<li><a href="https://numerics.mathdotnet.com/Users.html">Who is using Math.NET?</a></li>
<li class="nav-header">Contributing</li>
<li><a href="https://numerics.mathdotnet.com/Contributors.html">Contributors</a></li>
<li><a href="https://numerics.mathdotnet.com/Contributing.html">Contributing</a></li>
<li><a href="https://numerics.mathdotnet.com/Build.html">Build & Tools</a></li>
<li><a href="http://feedback.mathdotnet.com/forums/2060-math-net-numerics">Your Ideas</a></li>
<li class="nav-header">Getting Help</li>
<li><a href="https://discuss.mathdotnet.com/c/numerics">Discuss</a></li>
<li><a href="https://stackoverflow.com/questions/tagged/mathdotnet">Stack Overflow</a></li>
<li class="nav-header">Getting Started</li>
<li><a href="https://numerics.mathdotnet.com/">Getting started</a></li>
<li><a href="https://numerics.mathdotnet.com/Constants.html">Constants</a></li>
<li>Floating-Point Numbers</li>
<li>Arbitrary Precision Numbers</li>
<li>Complex Numbers</li>
<li><a href="https://numerics.mathdotnet.com/Matrix.html">Matrices and Vectors</a></li>
<li><a href="https://numerics.mathdotnet.com/Euclid.html">Euclid & Number Theory</a></li>
<li>Combinatorics</li>
<li class="nav-header">Evaluation</li>
<li><a href="https://numerics.mathdotnet.com/Functions.html">Special Functions</a></li>
<li>Differentiation</li>
<li><a href="https://numerics.mathdotnet.com/Integration.html">Integration</a></li>
<li class="nav-header">Statistics/Probability</li>
<li><a href="https://numerics.mathdotnet.com/DescriptiveStatistics.html">Descriptive Statistics</a></li>
<li><a href="https://numerics.mathdotnet.com/Probability.html">Probability Distributions</a></li>
<li class="nav-header">Generation</li>
<li><a href="https://numerics.mathdotnet.com/Generate.html">Generating Data</a></li>
<li><a href="https://numerics.mathdotnet.com/Random.html">Random Numbers</a></li>
<li class="nav-header">Transformation</li>
<li>Fourier Transform (FFT)</li>
<li>Filtering & DSP</li>
<li>Window Functions</li>
<li class="nav-header">Solving Equations</li>
<li><a href="https://numerics.mathdotnet.com/LinearEquations.html">Linear Equation Systems</a></li>
<li>Nonlinear Root Finding</li>
<li class="nav-header">Optimization</li>
<li>Linear Least Squares</li>
<li>Nonlinear Optimization</li>
<li><a href="https://numerics.mathdotnet.com/Distance.html">Distance Metrics</a></li>
<li class="nav-header">Curve Fitting</li>
<li><a href="https://numerics.mathdotnet.com/Regression.html">Regression</a></li>
<li>Interpolation</li>
<li>Fourier Approximation</li>
<li class="nav-header">Native Providers</li>
<li><a href="https://numerics.mathdotnet.com/MKL.html">Intel MKL</a></li>
<li class="nav-header">Working Together</li>
<li><a href="https://numerics.mathdotnet.com/CSV.html">Delimited Text Files (CSV)</a></li>
<li><a href="https://numerics.mathdotnet.com/MatrixMarket.html">NIST MatrixMarket</a></li>
<li><a href="https://numerics.mathdotnet.com/MatlabFiles.html">MATLAB</a></li>
<li><a href="https://numerics.mathdotnet.com/IFSharpNotebook.html">IF# Notebook</a></li>
<li>FsLab & Deedle</li>
<li>Microsoft Excel</li>
<li>numl.net machine learning</li>
<li>R-project</li>
</ul>
</div>
</div>
</div>
</body>
<!-- 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>

281
Interpolation.html

@ -1,63 +1,138 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>Interpolation
<head>
<meta charset="utf-8">
<title>Interpolation
</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta name="description" content="Math.NET Numerics, providing methods and algorithms for numerical computations in science, engineering and every day use. .Net 4, .Net 3.5, SL5, Win8, WP8, PCL 47 and 136, Mono, Xamarin Android/iOS."/>
<meta name="author" content="Christoph Ruegg, Marcus Cuda, Jurgen Van Gael"/>
<script src="https://code.jquery.com/jquery-1.8.0.js"></script>
<script src="https://code.jquery.com/ui/1.8.23/jquery-ui.js"></script>
<script src="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/js/bootstrap.min.js"></script>
<link href="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap-combined.min.css" rel="stylesheet"/>
<link type="text/css" rel="stylesheet" href="https://numerics.mathdotnet.com/content/style.css" />
<style>
#main table:not(.pre) {
border: 1px solid #dddddd;
max-width: 100%;
border-style: solid;
border-width: 1px;
border-color: gray;
border-collapse: collapse;
border-right-width: 1px;
border-bottom-width: 1px;
margin-top: 15px;
margin-bottom: 25px;
}
#main table:not(.pre) th, #main table:not(.pre) td {
border: 1px solid #dddddd;
padding: 6px;
}
#main table:not(.pre) th p, #main table:not(.pre) td p {
margin-bottom: 5px;
}
</style>
<script type="text/javascript" src="https://numerics.mathdotnet.com/content/tips.js"></script>
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<![endif]-->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
</head>
<body>
<div class="container">
<div class="masthead">
<ul class="nav nav-pills pull-right">
<li><a href="https://www.mathdotnet.com">Math.NET Project</a></li>
<li><a href="https://numerics.mathdotnet.com">Math.NET Numerics</a></li>
<li><a href="https://github.com/mathnet/mathnet-numerics">GitHub</a></li>
</ul>
<h3 class="muted">Math.NET Numerics</h3>
<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>
<hr />
<div class="row">
<div class="span9" id="main">
<h1><a name="Interpolation" class="anchor" href="#Interpolation">Interpolation</a></h1>
<!-- 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">Floating-Point Numbers</li>
<li class="nav-item">Arbitrary Precision Numbers</li>
<li class="nav-item">Complex Numbers</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">Differentiation</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">Transformation</li>
<li class="nav-item">Fourier Transform (FFT)</li>
<li class="nav-item">Filtering & DSP</li>
<li class="nav-item">Window Functions</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-item">Nonlinear Root Finding</li>
<li class="nav-header">Optimization</li>
<li class="nav-item">Linear Least Squares</li>
<li class="nav-item">Nonlinear 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-item">Interpolation</li>
<li class="nav-item">Fourier Approximation</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://www.mathdotnet.com">Math.NET Project</a> |
<a href="https://numerics.mathdotnet.com">Math.NET Numerics</a> |
<a href="https://github.com/mathnet/mathnet-numerics">GitHub</a>
</h3>
</div>
<hr />
<div class="container" id="fsdocs-content">
<h1><a name="Interpolation" class="anchor" href="#Interpolation">Interpolation</a></h1>
<p>Namespace: MathNet.Numerics.Interpolation</p>
<p>Interpolation is a two-phased operation in Math.NET Numerics:</p>
<ol>
@ -94,88 +169,16 @@
<li><em>Generic Cubic Hermite Spline</em>, requires the derivatives</li>
</ul>
</div>
<div class="span3">
<ul class="nav nav-list" id="menu">
<li class="nav-header">Math.NET Numerics</li>
<li><a href="https://numerics.mathdotnet.com/Packages.html">NuGet & Binaries</a></li>
<li><a href="https://numerics.mathdotnet.com/ReleaseNotes.html">Release Notes</a></li>
<li><a href="https://numerics.mathdotnet.com/License.html">MIT License</a></li>
<li><a href="https://numerics.mathdotnet.com/Compatibility.html">Platform Support</a></li>
<li><a href="https://numerics.mathdotnet.com/api/">Class Reference</a></li>
<li><a href="https://github.com/mathnet/mathnet-numerics/issues">Issues & Bugs</a></li>
<li><a href="https://numerics.mathdotnet.com/Users.html">Who is using Math.NET?</a></li>
<li class="nav-header">Contributing</li>
<li><a href="https://numerics.mathdotnet.com/Contributors.html">Contributors</a></li>
<li><a href="https://numerics.mathdotnet.com/Contributing.html">Contributing</a></li>
<li><a href="https://numerics.mathdotnet.com/Build.html">Build & Tools</a></li>
<li><a href="http://feedback.mathdotnet.com/forums/2060-math-net-numerics">Your Ideas</a></li>
<li class="nav-header">Getting Help</li>
<li><a href="https://discuss.mathdotnet.com/c/numerics">Discuss</a></li>
<li><a href="https://stackoverflow.com/questions/tagged/mathdotnet">Stack Overflow</a></li>
<li class="nav-header">Getting Started</li>
<li><a href="https://numerics.mathdotnet.com/">Getting started</a></li>
<li><a href="https://numerics.mathdotnet.com/Constants.html">Constants</a></li>
<li>Floating-Point Numbers</li>
<li>Arbitrary Precision Numbers</li>
<li>Complex Numbers</li>
<li><a href="https://numerics.mathdotnet.com/Matrix.html">Matrices and Vectors</a></li>
<li><a href="https://numerics.mathdotnet.com/Euclid.html">Euclid & Number Theory</a></li>
<li>Combinatorics</li>
<li class="nav-header">Evaluation</li>
<li><a href="https://numerics.mathdotnet.com/Functions.html">Special Functions</a></li>
<li>Differentiation</li>
<li><a href="https://numerics.mathdotnet.com/Integration.html">Integration</a></li>
<li class="nav-header">Statistics/Probability</li>
<li><a href="https://numerics.mathdotnet.com/DescriptiveStatistics.html">Descriptive Statistics</a></li>
<li><a href="https://numerics.mathdotnet.com/Probability.html">Probability Distributions</a></li>
<li class="nav-header">Generation</li>
<li><a href="https://numerics.mathdotnet.com/Generate.html">Generating Data</a></li>
<li><a href="https://numerics.mathdotnet.com/Random.html">Random Numbers</a></li>
<li class="nav-header">Transformation</li>
<li>Fourier Transform (FFT)</li>
<li>Filtering & DSP</li>
<li>Window Functions</li>
<li class="nav-header">Solving Equations</li>
<li><a href="https://numerics.mathdotnet.com/LinearEquations.html">Linear Equation Systems</a></li>
<li>Nonlinear Root Finding</li>
<li class="nav-header">Optimization</li>
<li>Linear Least Squares</li>
<li>Nonlinear Optimization</li>
<li><a href="https://numerics.mathdotnet.com/Distance.html">Distance Metrics</a></li>
<li class="nav-header">Curve Fitting</li>
<li><a href="https://numerics.mathdotnet.com/Regression.html">Regression</a></li>
<li>Interpolation</li>
<li>Fourier Approximation</li>
<li class="nav-header">Native Providers</li>
<li><a href="https://numerics.mathdotnet.com/MKL.html">Intel MKL</a></li>
<li class="nav-header">Working Together</li>
<li><a href="https://numerics.mathdotnet.com/CSV.html">Delimited Text Files (CSV)</a></li>
<li><a href="https://numerics.mathdotnet.com/MatrixMarket.html">NIST MatrixMarket</a></li>
<li><a href="https://numerics.mathdotnet.com/MatlabFiles.html">MATLAB</a></li>
<li><a href="https://numerics.mathdotnet.com/IFSharpNotebook.html">IF# Notebook</a></li>
<li>FsLab & Deedle</li>
<li>Microsoft Excel</li>
<li>numl.net machine learning</li>
<li>R-project</li>
</ul>
</div>
</div>
</div>
</body>
<!-- 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>

346
LinearEquations.html

@ -1,63 +1,138 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>Linear Equation Systems
</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta name="description" content="Math.NET Numerics, providing methods and algorithms for numerical computations in science, engineering and every day use. .Net 4, .Net 3.5, SL5, Win8, WP8, PCL 47 and 136, Mono, Xamarin Android/iOS."/>
<meta name="author" content="Christoph Ruegg, Marcus Cuda, Jurgen Van Gael"/>
<script src="https://code.jquery.com/jquery-1.8.0.js"></script>
<script src="https://code.jquery.com/ui/1.8.23/jquery-ui.js"></script>
<script src="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/js/bootstrap.min.js"></script>
<link href="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap-combined.min.css" rel="stylesheet"/>
<link type="text/css" rel="stylesheet" href="https://numerics.mathdotnet.com/content/style.css" />
<style>
#main table:not(.pre) {
border: 1px solid #dddddd;
max-width: 100%;
border-style: solid;
border-width: 1px;
border-color: gray;
border-collapse: collapse;
border-right-width: 1px;
border-bottom-width: 1px;
margin-top: 15px;
margin-bottom: 25px;
}
#main table:not(.pre) th, #main table:not(.pre) td {
border: 1px solid #dddddd;
padding: 6px;
}
#main table:not(.pre) th p, #main table:not(.pre) td p {
margin-bottom: 5px;
}
</style>
<script type="text/javascript" src="https://numerics.mathdotnet.com/content/tips.js"></script>
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<![endif]-->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
</head>
<body>
<div class="container">
<div class="masthead">
<ul class="nav nav-pills pull-right">
<li><a href="https://www.mathdotnet.com">Math.NET Project</a></li>
<li><a href="https://numerics.mathdotnet.com">Math.NET Numerics</a></li>
<li><a href="https://github.com/mathnet/mathnet-numerics">GitHub</a></li>
</ul>
<h3 class="muted">Math.NET Numerics</h3>
<head>
<meta charset="utf-8">
<title>Linear Equation Systems
</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>
<hr />
<div class="row">
<div class="span9" id="main">
<h1><a name="Linear-Equation-Systems" class="anchor" href="#Linear-Equation-Systems">Linear Equation Systems</a></h1>
<!-- 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">Floating-Point Numbers</li>
<li class="nav-item">Arbitrary Precision Numbers</li>
<li class="nav-item">Complex Numbers</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">Differentiation</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">Transformation</li>
<li class="nav-item">Fourier Transform (FFT)</li>
<li class="nav-item">Filtering & DSP</li>
<li class="nav-item">Window Functions</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-item">Nonlinear Root Finding</li>
<li class="nav-header">Optimization</li>
<li class="nav-item">Linear Least Squares</li>
<li class="nav-item">Nonlinear 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-item">Interpolation</li>
<li class="nav-item">Fourier Approximation</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://www.mathdotnet.com">Math.NET Project</a> |
<a href="https://numerics.mathdotnet.com">Math.NET Numerics</a> |
<a href="https://github.com/mathnet/mathnet-numerics">GitHub</a>
</h3>
</div>
<hr />
<div class="container" id="fsdocs-content">
<h1><a name="Linear-Equation-Systems" class="anchor" href="#Linear-Equation-Systems">Linear Equation Systems</a></h1>
<p>A system of linear equations is a collection of linear equations involving the same set of variables:</p>
<p><span class="math">\[\begin{alignat}{7}
3x &amp;\; + \;&amp; 2y &amp;\; - \;&amp; z &amp;\; = \;&amp; 1 &amp; \\
@ -93,15 +168,7 @@ a_{m1} &amp; a_{m2} &amp; \cdots &amp; a_{mn}
\;=\;
\begin{bmatrix}1\\-2\\0\end{bmatrix}\]</span></p>
<p>Which we can solve explicitly with the LU-decomposition, or simply by using the Solve method:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
<span class="l">4: </span>
<span class="l">5: </span>
<span class="l">6: </span>
<span class="l">7: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">var</span> A <span class="o">=</span> Matrix&lt;<span class="k">double</span>&gt;.Build.DenseOfArray(<span class="k">new</span> <span class="k">double</span>[,] {
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">var</span> A <span class="o">=</span> Matrix&lt;<span class="k">double</span>&gt;.Build.DenseOfArray(<span class="k">new</span> <span class="k">double</span>[,] {
{ <span class="n">3</span>, <span class="n">2</span>, <span class="n">-1</span> },
{ <span class="n">2</span>, <span class="n">-2</span>, <span class="n">4</span> },
{ <span class="n">-1</span>, <span class="n">0.5</span>, <span class="n">-1</span> }
@ -111,20 +178,12 @@ a_{m1} &amp; a_{m2} &amp; \cdots &amp; a_{mn}
</code></pre></td></tr></table>
<p>The resulting <span class="math">\(\mathbf{x}\)</span> is <span class="math">\([1,\;-2,\;-2]\)</span>, hence the solution <span class="math">\(x=1,\;y=-2,\;z=-2\)</span>.</p>
<p>In F# the syntax is a bit lighter:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
<span class="l">4: </span>
<span class="l">5: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="k">let</span> <span onmouseout="hideTip(event, 'fs1', 1)" onmouseover="showTip(event, 'fs1', 1)" class="i">A</span> <span class="o">=</span> <span class="i">matrix</span> [[ <span class="n">3.0</span>; <span class="n">2.0</span>; <span class="o">-</span><span class="n">1.0</span> ]
[ <span class="n">2.0</span>; <span class="o">-</span><span class="n">2.0</span>; <span class="n">4.0</span> ]
[ <span class="o">-</span><span class="n">1.0</span>; <span class="n">0.5</span>; <span class="o">-</span><span class="n">1.0</span> ]]
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs2', 2)" onmouseover="showTip(event, 'fs2', 2)" class="i">b</span> <span class="o">=</span> <span class="i">vector</span> [ <span class="n">1.0</span>; <span class="o">-</span><span class="n">2.0</span>; <span class="n">0.0</span> ]
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs3', 3)" onmouseover="showTip(event, 'fs3', 3)" class="i">x</span> <span class="o">=</span> <span onmouseout="hideTip(event, 'fs1', 4)" onmouseover="showTip(event, 'fs1', 4)" class="i">A</span><span class="o">.</span><span class="i">Solve</span>(<span onmouseout="hideTip(event, 'fs2', 5)" onmouseover="showTip(event, 'fs2', 5)" class="i">b</span>) <span class="c">// 1;-2;-2</span>
</code></pre></td>
</tr>
</table>
<pre class="fssnip highlighted"><code lang="fsharp"><span class="k">let</span> <span onmouseout="hideTip(event, 'fs1', 1)" onmouseover="showTip(event, 'fs1', 1)" class="id">A</span> <span class="o">=</span> <span class="id">matrix</span> <span class="pn">[</span><span class="pn">[</span> <span class="n">3.0</span><span class="pn">;</span> <span class="n">2.0</span><span class="pn">;</span> <span class="o">-</span><span class="n">1.0</span> <span class="pn">]</span>
<span class="pn">[</span> <span class="n">2.0</span><span class="pn">;</span> <span class="o">-</span><span class="n">2.0</span><span class="pn">;</span> <span class="n">4.0</span> <span class="pn">]</span>
<span class="pn">[</span> <span class="o">-</span><span class="n">1.0</span><span class="pn">;</span> <span class="n">0.5</span><span class="pn">;</span> <span class="o">-</span><span class="n">1.0</span> <span class="pn">]</span><span class="pn">]</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs2', 2)" onmouseover="showTip(event, 'fs2', 2)" class="id">b</span> <span class="o">=</span> <span class="id">vector</span> <span class="pn">[</span> <span class="n">1.0</span><span class="pn">;</span> <span class="o">-</span><span class="n">2.0</span><span class="pn">;</span> <span class="n">0.0</span> <span class="pn">]</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs3', 3)" onmouseover="showTip(event, 'fs3', 3)" class="id">x</span> <span class="o">=</span> <span onmouseout="hideTip(event, 'fs1', 4)" onmouseover="showTip(event, 'fs1', 4)" class="id">A</span><span class="pn">.</span><span class="id">Solve</span><span class="pn">(</span><span onmouseout="hideTip(event, 'fs2', 5)" onmouseover="showTip(event, 'fs2', 5)" class="id">b</span><span class="pn">)</span> <span class="c">// 1;-2;-2</span>
</code></pre>
<h2><a name="Normalizing-Equation-Systems" class="anchor" href="#Normalizing-Equation-Systems">Normalizing Equation Systems</a></h2>
<p>In practice, a linear equation system to be solved is often not in the standard form required
to use the linear algebra approach. For example, let's have a look at the following system:</p>
@ -151,111 +210,30 @@ become zero on the right side), by introducing a new column each. First we subtr
\;=\;
\begin{bmatrix}0\\0\\20\\0\end{bmatrix}\]</span></p>
<p>Which is in standard from, so we can solve normally:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
<span class="l">4: </span>
<span class="l">5: </span>
<span class="l">6: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="k">let</span> <span onmouseout="hideTip(event, 'fs4', 6)" onmouseover="showTip(event, 'fs4', 6)" class="i">A&#39;</span> <span class="o">=</span> <span class="i">matrix</span> [[ <span class="n">3.0</span>; <span class="n">4.0</span>; <span class="o">-</span><span class="n">1.0</span>; <span class="n">0.0</span> ]
[ <span class="n">4.0</span>; <span class="n">5.0</span>; <span class="n">0.0</span>; <span class="o">-</span><span class="n">1.0</span> ]
[ <span class="n">5.0</span>; <span class="n">6.0</span>; <span class="n">0.0</span>; <span class="n">0.0</span>; ]
[ <span class="n">6.0</span>; <span class="n">7.0</span>; <span class="n">0.0</span>; <span class="n">0.0</span> ]]
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs5', 7)" onmouseover="showTip(event, 'fs5', 7)" class="i">b&#39;</span> <span class="o">=</span> <span class="i">vector</span> [ <span class="n">0.0</span>; <span class="n">0.0</span>; <span class="n">20.0</span>; <span class="n">0.0</span> ]
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs6', 8)" onmouseover="showTip(event, 'fs6', 8)" class="i">x&#39;</span> <span class="o">=</span> <span onmouseout="hideTip(event, 'fs4', 9)" onmouseover="showTip(event, 'fs4', 9)" class="i">A&#39;</span><span class="o">.</span><span class="i">Solve</span>(<span onmouseout="hideTip(event, 'fs5', 10)" onmouseover="showTip(event, 'fs5', 10)" class="i">b&#39;</span>) <span class="c">// -140; 120; 60; 40</span>
</code></pre></td>
</tr>
</table>
<div class="tip" id="fs1">val A : obj<br /><br />Full name: LinearEquations.A</div>
<div class="tip" id="fs2">val b : obj<br /><br />Full name: LinearEquations.b</div>
<div class="tip" id="fs3">val x : obj<br /><br />Full name: LinearEquations.x</div>
<div class="tip" id="fs4">val A&#39; : obj<br /><br />Full name: LinearEquations.A&#39;</div>
<div class="tip" id="fs5">val b&#39; : obj<br /><br />Full name: LinearEquations.b&#39;</div>
<div class="tip" id="fs6">val x&#39; : obj<br /><br />Full name: LinearEquations.x&#39;</div>
</div>
<div class="span3">
<ul class="nav nav-list" id="menu">
<li class="nav-header">Math.NET Numerics</li>
<li><a href="https://numerics.mathdotnet.com/Packages.html">NuGet & Binaries</a></li>
<li><a href="https://numerics.mathdotnet.com/ReleaseNotes.html">Release Notes</a></li>
<li><a href="https://numerics.mathdotnet.com/License.html">MIT License</a></li>
<li><a href="https://numerics.mathdotnet.com/Compatibility.html">Platform Support</a></li>
<li><a href="https://numerics.mathdotnet.com/api/">Class Reference</a></li>
<li><a href="https://github.com/mathnet/mathnet-numerics/issues">Issues & Bugs</a></li>
<li><a href="https://numerics.mathdotnet.com/Users.html">Who is using Math.NET?</a></li>
<li class="nav-header">Contributing</li>
<li><a href="https://numerics.mathdotnet.com/Contributors.html">Contributors</a></li>
<li><a href="https://numerics.mathdotnet.com/Contributing.html">Contributing</a></li>
<li><a href="https://numerics.mathdotnet.com/Build.html">Build & Tools</a></li>
<li><a href="http://feedback.mathdotnet.com/forums/2060-math-net-numerics">Your Ideas</a></li>
<li class="nav-header">Getting Help</li>
<li><a href="https://discuss.mathdotnet.com/c/numerics">Discuss</a></li>
<li><a href="https://stackoverflow.com/questions/tagged/mathdotnet">Stack Overflow</a></li>
<pre class="fssnip highlighted"><code lang="fsharp"><span class="k">let</span> <span onmouseout="hideTip(event, 'fs4', 6)" onmouseover="showTip(event, 'fs4', 6)" class="id">A&#39;</span> <span class="o">=</span> <span class="id">matrix</span> <span class="pn">[</span><span class="pn">[</span> <span class="n">3.0</span><span class="pn">;</span> <span class="n">4.0</span><span class="pn">;</span> <span class="o">-</span><span class="n">1.0</span><span class="pn">;</span> <span class="n">0.0</span> <span class="pn">]</span>
<span class="pn">[</span> <span class="n">4.0</span><span class="pn">;</span> <span class="n">5.0</span><span class="pn">;</span> <span class="n">0.0</span><span class="pn">;</span> <span class="o">-</span><span class="n">1.0</span> <span class="pn">]</span>
<span class="pn">[</span> <span class="n">5.0</span><span class="pn">;</span> <span class="n">6.0</span><span class="pn">;</span> <span class="n">0.0</span><span class="pn">;</span> <span class="n">0.0</span><span class="pn">;</span> <span class="pn">]</span>
<span class="pn">[</span> <span class="n">6.0</span><span class="pn">;</span> <span class="n">7.0</span><span class="pn">;</span> <span class="n">0.0</span><span class="pn">;</span> <span class="n">0.0</span> <span class="pn">]</span><span class="pn">]</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs5', 7)" onmouseover="showTip(event, 'fs5', 7)" class="id">b&#39;</span> <span class="o">=</span> <span class="id">vector</span> <span class="pn">[</span> <span class="n">0.0</span><span class="pn">;</span> <span class="n">0.0</span><span class="pn">;</span> <span class="n">20.0</span><span class="pn">;</span> <span class="n">0.0</span> <span class="pn">]</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs6', 8)" onmouseover="showTip(event, 'fs6', 8)" class="id">x&#39;</span> <span class="o">=</span> <span onmouseout="hideTip(event, 'fs4', 9)" onmouseover="showTip(event, 'fs4', 9)" class="id">A&#39;</span><span class="pn">.</span><span class="id">Solve</span><span class="pn">(</span><span onmouseout="hideTip(event, 'fs5', 10)" onmouseover="showTip(event, 'fs5', 10)" class="id">b&#39;</span><span class="pn">)</span> <span class="c">// -140; 120; 60; 40</span>
</code></pre>
<div class="fsdocs-tip" id="fs1">val A : obj</div>
<div class="fsdocs-tip" id="fs2">val b : obj</div>
<div class="fsdocs-tip" id="fs3">val x : obj</div>
<div class="fsdocs-tip" id="fs4">val A&#39; : obj</div>
<div class="fsdocs-tip" id="fs5">val b&#39; : obj</div>
<div class="fsdocs-tip" id="fs6">val x&#39; : obj</div>
<li class="nav-header">Getting Started</li>
<li><a href="https://numerics.mathdotnet.com/">Getting started</a></li>
<li><a href="https://numerics.mathdotnet.com/Constants.html">Constants</a></li>
<li>Floating-Point Numbers</li>
<li>Arbitrary Precision Numbers</li>
<li>Complex Numbers</li>
<li><a href="https://numerics.mathdotnet.com/Matrix.html">Matrices and Vectors</a></li>
<li><a href="https://numerics.mathdotnet.com/Euclid.html">Euclid & Number Theory</a></li>
<li>Combinatorics</li>
<li class="nav-header">Evaluation</li>
<li><a href="https://numerics.mathdotnet.com/Functions.html">Special Functions</a></li>
<li>Differentiation</li>
<li><a href="https://numerics.mathdotnet.com/Integration.html">Integration</a></li>
<li class="nav-header">Statistics/Probability</li>
<li><a href="https://numerics.mathdotnet.com/DescriptiveStatistics.html">Descriptive Statistics</a></li>
<li><a href="https://numerics.mathdotnet.com/Probability.html">Probability Distributions</a></li>
<li class="nav-header">Generation</li>
<li><a href="https://numerics.mathdotnet.com/Generate.html">Generating Data</a></li>
<li><a href="https://numerics.mathdotnet.com/Random.html">Random Numbers</a></li>
<li class="nav-header">Transformation</li>
<li>Fourier Transform (FFT)</li>
<li>Filtering & DSP</li>
<li>Window Functions</li>
<li class="nav-header">Solving Equations</li>
<li><a href="https://numerics.mathdotnet.com/LinearEquations.html">Linear Equation Systems</a></li>
<li>Nonlinear Root Finding</li>
<li class="nav-header">Optimization</li>
<li>Linear Least Squares</li>
<li>Nonlinear Optimization</li>
<li><a href="https://numerics.mathdotnet.com/Distance.html">Distance Metrics</a></li>
<li class="nav-header">Curve Fitting</li>
<li><a href="https://numerics.mathdotnet.com/Regression.html">Regression</a></li>
<li>Interpolation</li>
<li>Fourier Approximation</li>
<li class="nav-header">Native Providers</li>
<li><a href="https://numerics.mathdotnet.com/MKL.html">Intel MKL</a></li>
<li class="nav-header">Working Together</li>
<li><a href="https://numerics.mathdotnet.com/CSV.html">Delimited Text Files (CSV)</a></li>
<li><a href="https://numerics.mathdotnet.com/MatrixMarket.html">NIST MatrixMarket</a></li>
<li><a href="https://numerics.mathdotnet.com/MatlabFiles.html">MATLAB</a></li>
<li><a href="https://numerics.mathdotnet.com/IFSharpNotebook.html">IF# Notebook</a></li>
<li>FsLab & Deedle</li>
<li>Microsoft Excel</li>
<li>numl.net machine learning</li>
<li>R-project</li>
</ul>
</div>
</div>
</div>
</body>
<!-- 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>

400
MKL.html

@ -1,63 +1,138 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>Intel Math Kernel Library (MKL)
<head>
<meta charset="utf-8">
<title>Intel Math Kernel Library (MKL)
</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta name="description" content="Math.NET Numerics, providing methods and algorithms for numerical computations in science, engineering and every day use. .Net 4, .Net 3.5, SL5, Win8, WP8, PCL 47 and 136, Mono, Xamarin Android/iOS."/>
<meta name="author" content="Christoph Ruegg, Marcus Cuda, Jurgen Van Gael"/>
<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 src="https://code.jquery.com/jquery-1.8.0.js"></script>
<script src="https://code.jquery.com/ui/1.8.23/jquery-ui.js"></script>
<script src="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/js/bootstrap.min.js"></script>
<link href="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap-combined.min.css" rel="stylesheet"/>
<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 type="text/css" rel="stylesheet" href="https://numerics.mathdotnet.com/content/style.css" />
<style>
#main table:not(.pre) {
border: 1px solid #dddddd;
max-width: 100%;
border-style: solid;
border-width: 1px;
border-color: gray;
border-collapse: collapse;
border-right-width: 1px;
border-bottom-width: 1px;
margin-top: 15px;
margin-bottom: 25px;
}
#main table:not(.pre) th, #main table:not(.pre) td {
border: 1px solid #dddddd;
padding: 6px;
}
#main table:not(.pre) th p, #main table:not(.pre) td p {
margin-bottom: 5px;
}
</style>
<script type="text/javascript" src="https://numerics.mathdotnet.com/content/tips.js"></script>
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<![endif]-->
<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>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
</head>
<body>
<div class="container">
<div class="masthead">
<ul class="nav nav-pills pull-right">
<li><a href="https://www.mathdotnet.com">Math.NET Project</a></li>
<li><a href="https://numerics.mathdotnet.com">Math.NET Numerics</a></li>
<li><a href="https://github.com/mathnet/mathnet-numerics">GitHub</a></li>
</ul>
<h3 class="muted">Math.NET Numerics</h3>
<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>
<hr />
<div class="row">
<div class="span9" id="main">
<h1><a name="Intel-Math-Kernel-Library-MKL" class="anchor" href="#Intel-Math-Kernel-Library-MKL">Intel Math Kernel Library (MKL)</a></h1>
<!-- 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">Floating-Point Numbers</li>
<li class="nav-item">Arbitrary Precision Numbers</li>
<li class="nav-item">Complex Numbers</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">Differentiation</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">Transformation</li>
<li class="nav-item">Fourier Transform (FFT)</li>
<li class="nav-item">Filtering & DSP</li>
<li class="nav-item">Window Functions</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-item">Nonlinear Root Finding</li>
<li class="nav-header">Optimization</li>
<li class="nav-item">Linear Least Squares</li>
<li class="nav-item">Nonlinear 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-item">Interpolation</li>
<li class="nav-item">Fourier Approximation</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://www.mathdotnet.com">Math.NET Project</a> |
<a href="https://numerics.mathdotnet.com">Math.NET Numerics</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
@ -77,15 +152,11 @@ only a single platform, for example:</p>
</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="lines"><pre class="fssnip"><span class="l">1: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp">Control.UseNativeMKL();
<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="lines"><pre class="fssnip"><span class="l">1: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp">Control.UseManaged();
<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>
@ -147,12 +218,7 @@ If not, you can get a free trial on intel's web site.
<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="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
<span class="l">4: </span>
</pre></td>
<td class="snippet"><pre class="fssnip"><code lang="sh">lionel:~ Lionel$ cd /Users/Lionel/Public/Git/GitHub/mathnet-numerics/src/NativeProviders/OSX
<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
@ -160,10 +226,7 @@ lionel:OSX Lionel$ sh mkl_build.sh
<p>Check the /x86 and /x64 folders in mathnet-numerics/out/MKL: you should now find the <code>libiomp5.dylib</code> and <code>MathNet.Numerics.MKL.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="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
</pre></td>
<td class="snippet"><pre class="fssnip"><code lang="sh">export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/Users/Lionel/../mathnet-numerics/out/MKL/OSX/x64
<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>
@ -171,32 +234,19 @@ export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/Users/Lionel/../mathnet-numerics/ou
<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>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span onmouseout="hideTip(event, 'fs1', 1)" onmouseover="showTip(event, 'fs1', 1)" class="i">Control</span><span class="o">.</span><span class="i">NativeProviderPath</span> <span class="o">&lt;-</span> <span class="s">@&quot;C:\MKL&quot;</span>
<span onmouseout="hideTip(event, 'fs1', 2)" onmouseover="showTip(event, 'fs1', 2)" class="i">Control</span><span class="o">.</span><span class="i">UseNativeMKL</span>()
</code></pre></td>
</tr>
</table>
<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">&lt;-</span> <span class="s">@&quot;C:\MKL&quot;</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>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
<span class="l">4: </span>
<span class="l">5: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="k">open</span> <span onmouseout="hideTip(event, 'fs2', 3)" onmouseover="showTip(event, 'fs2', 3)" class="i">System</span><span class="o">.</span><span onmouseout="hideTip(event, 'fs3', 4)" onmouseover="showTip(event, 'fs3', 4)" class="i">IO</span>
<span class="k">open</span> <span class="i">MathNet</span><span class="o">.</span><span class="i">Numerics</span>
<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="i">Control</span><span class="o">.</span><span class="i">NativeProviderPath</span> <span class="o">&lt;-</span> <span onmouseout="hideTip(event, 'fs4', 6)" onmouseover="showTip(event, 'fs4', 6)" class="i">Path</span><span class="o">.</span><span onmouseout="hideTip(event, 'fs5', 7)" onmouseover="showTip(event, 'fs5', 7)" class="i">Combine</span>(<span class="k">__SOURCE_DIRECTORY__</span>,<span class="s">&quot;../&quot;</span>)
<span onmouseout="hideTip(event, 'fs1', 8)" onmouseover="showTip(event, 'fs1', 8)" class="i">Control</span><span class="o">.</span><span class="i">UseNativeMKL</span>()
</code></pre></td>
</tr>
</table>
<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">&lt;-</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">&quot;../&quot;</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>
@ -206,66 +256,25 @@ for more alternatives.</p>
<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="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp">Control.NativeProviderPath <span class="o">=</span> <span class="s">@"C:\MKL"</span>;
<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="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
</pre></td>
<td class="snippet"><pre class="fssnip"><code lang="sh">mono nuget.exe install MathNet.Numerics -Pre -OutputDirectory packages
<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="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
</pre></td>
<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/
<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/MathNet.Numerics.MKL.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="lines"><pre class="fssnip"><span class="l"> 1: </span>
<span class="l"> 2: </span>
<span class="l"> 3: </span>
<span class="l"> 4: </span>
<span class="l"> 5: </span>
<span class="l"> 6: </span>
<span class="l"> 7: </span>
<span class="l"> 8: </span>
<span class="l"> 9: </span>
<span class="l">10: </span>
<span class="l">11: </span>
<span class="l">12: </span>
<span class="l">13: </span>
<span class="l">14: </span>
<span class="l">15: </span>
<span class="l">16: </span>
<span class="l">17: </span>
<span class="l">18: </span>
<span class="l">19: </span>
<span class="l">20: </span>
<span class="l">21: </span>
<span class="l">22: </span>
<span class="l">23: </span>
<span class="l">24: </span>
<span class="l">25: </span>
<span class="l">26: </span>
<span class="l">27: </span>
<span class="l">28: </span>
<span class="l">29: </span>
<span class="l">30: </span>
<span class="l">31: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">using</span> System;
<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;
@ -298,13 +307,7 @@ Let's create the following C# file <code>Example.cs</code>:</p>
}
</code></pre></td></tr></table>
<p>Compile and run:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
<span class="l">4: </span>
<span class="l">5: </span>
</pre></td>
<td class="snippet"><pre class="fssnip"><code lang="sh"># single line:
<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:
@ -320,93 +323,32 @@ Numerics MKL native provider for free for your own use. However, it does <em>not
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="tip" id="fs1">namespace Microsoft.FSharp.Control</div>
<div class="tip" id="fs2">namespace System</div>
<div class="tip" id="fs3">namespace System.IO</div>
<div class="tip" id="fs4">type Path =<br />&#160;&#160;static val DirectorySeparatorChar : char<br />&#160;&#160;static val AltDirectorySeparatorChar : char<br />&#160;&#160;static val VolumeSeparatorChar : char<br />&#160;&#160;static val InvalidPathChars : char[]<br />&#160;&#160;static val PathSeparator : char<br />&#160;&#160;static member ChangeExtension : path:string * extension:string -&gt; string<br />&#160;&#160;static member Combine : [&lt;ParamArray&gt;] paths:string[] -&gt; string + 3 overloads<br />&#160;&#160;static member GetDirectoryName : path:string -&gt; string<br />&#160;&#160;static member GetExtension : path:string -&gt; string<br />&#160;&#160;static member GetFileName : path:string -&gt; string<br />&#160;&#160;...<br /><br />Full name: System.IO.Path</div>
<div class="tip" id="fs5">Path.Combine([&lt;System.ParamArray&gt;] 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 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 -&gt; string
static member Combine : path1: string * path2: string -&gt; string + 3 &#220;berladungen
static member EndsInDirectorySeparator : path: ReadOnlySpan&lt;char&gt; -&gt; bool + 1 &#220;berladung
static member GetDirectoryName : path: ReadOnlySpan&lt;char&gt; -&gt; ReadOnlySpan&lt;char&gt; + 1 &#220;berladung
static member GetExtension : path: ReadOnlySpan&lt;char&gt; -&gt; ReadOnlySpan&lt;char&gt; + 1 &#220;berladung
static member GetFileName : path: ReadOnlySpan&lt;char&gt; -&gt; ReadOnlySpan&lt;char&gt; + 1 &#220;berladung
static member GetFileNameWithoutExtension : path: ReadOnlySpan&lt;char&gt; -&gt; ReadOnlySpan&lt;char&gt; + 1 &#220;berladung
static member GetFullPath : path: string -&gt; string + 1 &#220;berladung
static member GetInvalidFileNameChars : unit -&gt; char []
static member GetInvalidPathChars : unit -&gt; char []
...<br /><em>&lt;summary&gt;Performs operations on &lt;see cref=&quot;T:System.String&quot; /&gt; instances that contain file or directory path information. These operations are performed in a cross-platform manner.&lt;/summary&gt;</em></div>
<div class="fsdocs-tip" id="fs5">Path.Combine([&lt;System.ParamArray&gt;] 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>
<div class="span3">
<ul class="nav nav-list" id="menu">
<li class="nav-header">Math.NET Numerics</li>
<li><a href="https://numerics.mathdotnet.com/Packages.html">NuGet & Binaries</a></li>
<li><a href="https://numerics.mathdotnet.com/ReleaseNotes.html">Release Notes</a></li>
<li><a href="https://numerics.mathdotnet.com/License.html">MIT License</a></li>
<li><a href="https://numerics.mathdotnet.com/Compatibility.html">Platform Support</a></li>
<li><a href="https://numerics.mathdotnet.com/api/">Class Reference</a></li>
<li><a href="https://github.com/mathnet/mathnet-numerics/issues">Issues & Bugs</a></li>
<li><a href="https://numerics.mathdotnet.com/Users.html">Who is using Math.NET?</a></li>
<li class="nav-header">Contributing</li>
<li><a href="https://numerics.mathdotnet.com/Contributors.html">Contributors</a></li>
<li><a href="https://numerics.mathdotnet.com/Contributing.html">Contributing</a></li>
<li><a href="https://numerics.mathdotnet.com/Build.html">Build & Tools</a></li>
<li><a href="http://feedback.mathdotnet.com/forums/2060-math-net-numerics">Your Ideas</a></li>
<li class="nav-header">Getting Help</li>
<li><a href="https://discuss.mathdotnet.com/c/numerics">Discuss</a></li>
<li><a href="https://stackoverflow.com/questions/tagged/mathdotnet">Stack Overflow</a></li>
<li class="nav-header">Getting Started</li>
<li><a href="https://numerics.mathdotnet.com/">Getting started</a></li>
<li><a href="https://numerics.mathdotnet.com/Constants.html">Constants</a></li>
<li>Floating-Point Numbers</li>
<li>Arbitrary Precision Numbers</li>
<li>Complex Numbers</li>
<li><a href="https://numerics.mathdotnet.com/Matrix.html">Matrices and Vectors</a></li>
<li><a href="https://numerics.mathdotnet.com/Euclid.html">Euclid & Number Theory</a></li>
<li>Combinatorics</li>
<li class="nav-header">Evaluation</li>
<li><a href="https://numerics.mathdotnet.com/Functions.html">Special Functions</a></li>
<li>Differentiation</li>
<li><a href="https://numerics.mathdotnet.com/Integration.html">Integration</a></li>
<li class="nav-header">Statistics/Probability</li>
<li><a href="https://numerics.mathdotnet.com/DescriptiveStatistics.html">Descriptive Statistics</a></li>
<li><a href="https://numerics.mathdotnet.com/Probability.html">Probability Distributions</a></li>
<li class="nav-header">Generation</li>
<li><a href="https://numerics.mathdotnet.com/Generate.html">Generating Data</a></li>
<li><a href="https://numerics.mathdotnet.com/Random.html">Random Numbers</a></li>
<li class="nav-header">Transformation</li>
<li>Fourier Transform (FFT)</li>
<li>Filtering & DSP</li>
<li>Window Functions</li>
<li class="nav-header">Solving Equations</li>
<li><a href="https://numerics.mathdotnet.com/LinearEquations.html">Linear Equation Systems</a></li>
<li>Nonlinear Root Finding</li>
<li class="nav-header">Optimization</li>
<li>Linear Least Squares</li>
<li>Nonlinear Optimization</li>
<li><a href="https://numerics.mathdotnet.com/Distance.html">Distance Metrics</a></li>
<li class="nav-header">Curve Fitting</li>
<li><a href="https://numerics.mathdotnet.com/Regression.html">Regression</a></li>
<li>Interpolation</li>
<li>Fourier Approximation</li>
<li class="nav-header">Native Providers</li>
<li><a href="https://numerics.mathdotnet.com/MKL.html">Intel MKL</a></li>
<li class="nav-header">Working Together</li>
<li><a href="https://numerics.mathdotnet.com/CSV.html">Delimited Text Files (CSV)</a></li>
<li><a href="https://numerics.mathdotnet.com/MatrixMarket.html">NIST MatrixMarket</a></li>
<li><a href="https://numerics.mathdotnet.com/MatlabFiles.html">MATLAB</a></li>
<li><a href="https://numerics.mathdotnet.com/IFSharpNotebook.html">IF# Notebook</a></li>
<li>FsLab & Deedle</li>
<li>Microsoft Excel</li>
<li>numl.net machine learning</li>
<li>R-project</li>
</ul>
</div>
</div>
</div>
</body>
<!-- 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>

329
MatlabFiles.html

@ -1,89 +1,145 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>MATLAB Level-5 Mat Files
<head>
<meta charset="utf-8">
<title>MATLAB Level-5 Mat Files
</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta name="description" content="Math.NET Numerics, providing methods and algorithms for numerical computations in science, engineering and every day use. .Net 4, .Net 3.5, SL5, Win8, WP8, PCL 47 and 136, Mono, Xamarin Android/iOS."/>
<meta name="author" content="Christoph Ruegg, Marcus Cuda, Jurgen Van Gael"/>
<script src="https://code.jquery.com/jquery-1.8.0.js"></script>
<script src="https://code.jquery.com/ui/1.8.23/jquery-ui.js"></script>
<script src="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/js/bootstrap.min.js"></script>
<link href="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap-combined.min.css" rel="stylesheet"/>
<link type="text/css" rel="stylesheet" href="https://numerics.mathdotnet.com/content/style.css" />
<style>
#main table:not(.pre) {
border: 1px solid #dddddd;
max-width: 100%;
border-style: solid;
border-width: 1px;
border-color: gray;
border-collapse: collapse;
border-right-width: 1px;
border-bottom-width: 1px;
margin-top: 15px;
margin-bottom: 25px;
}
#main table:not(.pre) th, #main table:not(.pre) td {
border: 1px solid #dddddd;
padding: 6px;
}
#main table:not(.pre) th p, #main table:not(.pre) td p {
margin-bottom: 5px;
}
</style>
<script type="text/javascript" src="https://numerics.mathdotnet.com/content/tips.js"></script>
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<![endif]-->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
</head>
<body>
<div class="container">
<div class="masthead">
<ul class="nav nav-pills pull-right">
<li><a href="https://www.mathdotnet.com">Math.NET Project</a></li>
<li><a href="https://numerics.mathdotnet.com">Math.NET Numerics</a></li>
<li><a href="https://github.com/mathnet/mathnet-numerics">GitHub</a></li>
</ul>
<h3 class="muted">Math.NET Numerics</h3>
<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>
<hr />
<div class="row">
<div class="span9" id="main">
<h1><a name="MATLAB-Level-5-Mat-Files" class="anchor" href="#MATLAB-Level-5-Mat-Files">MATLAB Level-5 Mat Files</a></h1>
<!-- 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">Floating-Point Numbers</li>
<li class="nav-item">Arbitrary Precision Numbers</li>
<li class="nav-item">Complex Numbers</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">Differentiation</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">Transformation</li>
<li class="nav-item">Fourier Transform (FFT)</li>
<li class="nav-item">Filtering & DSP</li>
<li class="nav-item">Window Functions</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-item">Nonlinear Root Finding</li>
<li class="nav-header">Optimization</li>
<li class="nav-item">Linear Least Squares</li>
<li class="nav-item">Nonlinear 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-item">Interpolation</li>
<li class="nav-item">Fourier Approximation</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://www.mathdotnet.com">Math.NET Project</a> |
<a href="https://numerics.mathdotnet.com">Math.NET Numerics</a> |
<a href="https://github.com/mathnet/mathnet-numerics">GitHub</a>
</h3>
</div>
<hr />
<div class="container" id="fsdocs-content">
<h1><a name="MATLAB-Level-5-Mat-Files" class="anchor" href="#MATLAB-Level-5-Mat-Files">MATLAB Level-5 Mat Files</a></h1>
<p>Level-5 MATLAB Mat files are popular as binary file container for storing one or more matrices.
Math.NET Numerics provides basic support for such Mat files with the <strong>MathNet.Numerics.Data.Matlab</strong> package,
which is available on NuGet as separate package and not included in the basic distribution.</p>
<h2><a name="Reading-matrices-from-a-MATLAB-file" class="anchor" href="#Reading-matrices-from-a-MATLAB-file">Reading matrices from a MATLAB file</a></h2>
<p>The <code>MatlabReader</code> class provides static functions to list all matrices stored in a MAT file or stream,
and to read them individually as Math.NET matrices:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l"> 1: </span>
<span class="l"> 2: </span>
<span class="l"> 3: </span>
<span class="l"> 4: </span>
<span class="l"> 5: </span>
<span class="l"> 6: </span>
<span class="l"> 7: </span>
<span class="l"> 8: </span>
<span class="l"> 9: </span>
<span class="l">10: </span>
<span class="l">11: </span>
<span class="l">12: </span>
<span class="l">13: </span>
<span class="l">14: </span>
<span class="l">15: </span>
<span class="l">16: </span>
<span class="l">17: </span>
<span class="l">18: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">using</span> MathNet.Numerics.LinearAlgebra;
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">using</span> MathNet.Numerics.LinearAlgebra;
<span class="k">using</span> MathNet.Numerics.Data.Matlab;
<span class="c">// read the first matrix as double</span>
@ -105,11 +161,7 @@ Dictionary&lt;<span class="k">string</span>,Matrix&lt;<span class="k">double</sp
<p>Alternatively the reader can list all matrices of a file into named data elements,
which can then be read into matrices individually. This is useful e.g. if we need to
read some of the matrices to a different type:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp">List&lt;MatlabMatrix&gt; ms <span class="o">=</span> MatlabReader.List(<span class="s">"collection.mat"</span>);
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp">List&lt;MatlabMatrix&gt; ms <span class="o">=</span> MatlabReader.List(<span class="s">"collection.mat"</span>);
Matrix&lt;<span class="k">double</span>&gt; Ad <span class="o">=</span> MatlabReader.Unpack&lt;<span class="k">double</span>&gt;(ms.Find(m <span class="o">=</span><span class="o">&gt;</span> m.Name <span class="o">=</span><span class="o">=</span> <span class="s">"Ad"</span>));
Matrix&lt;<span class="k">float</span>&gt; vd <span class="o">=</span> MatlabReader.Unpack&lt;<span class="k">float</span>&gt;(ms.Find(m <span class="o">=</span><span class="o">&gt;</span> m.Name <span class="o">=</span><span class="o">=</span> <span class="s">"vd"</span>));
</code></pre></td></tr></table>
@ -117,31 +169,14 @@ Matrix&lt;<span class="k">float</span>&gt; vd <span class="o">=</span> MatlabRea
<p>The dual to the reader above is the <code>MatlabWriter</code> class that can serialize matrices
to a MATLAB file or stream. Like the reader, the writer can use <code>MatlabMatrix</code> data elements
to compose packed matrices into a file. Each matrix has a name which must not contain spaces.</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
<span class="l">4: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">var</span> matrices <span class="o">=</span> <span class="k">new</span> List&lt;MatlabMatrix&gt;();
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">var</span> matrices <span class="o">=</span> <span class="k">new</span> List&lt;MatlabMatrix&gt;();
m.Add(MatlabWriter.Pack(myFirstMatrix, <span class="s">"m1"</span>);
m.Add(MatlabWriter.Pack(mySecondMatrix, <span class="s">"m2"</span>);
MatlabWrier.Store(<span class="s">"file.mat"</span>, matrices);
</code></pre></td></tr></table>
<p>But there are also direct routines if only a single matrix or matrices of all the same data type
are to be stored in a file:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l"> 1: </span>
<span class="l"> 2: </span>
<span class="l"> 3: </span>
<span class="l"> 4: </span>
<span class="l"> 5: </span>
<span class="l"> 6: </span>
<span class="l"> 7: </span>
<span class="l"> 8: </span>
<span class="l"> 9: </span>
<span class="l">10: </span>
<span class="l">11: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="c">// write a single matrix "myMatrix" and name it "m1".</span>
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="c">// write a single matrix "myMatrix" and name it "m1".</span>
MatlabWriter.Write(<span class="s">"file.mat"</span>, myMatrix, <span class="s">"m1"</span>);
<span class="c">// write multiple matrices, from a list of matrices and a list of their names:</span>
@ -161,88 +196,16 @@ Among others:</p>
<li><a href="MatrixMarket.html">NIST MatrixMarket text files</a></li>
</ul>
</div>
<div class="span3">
<ul class="nav nav-list" id="menu">
<li class="nav-header">Math.NET Numerics</li>
<li><a href="https://numerics.mathdotnet.com/Packages.html">NuGet & Binaries</a></li>
<li><a href="https://numerics.mathdotnet.com/ReleaseNotes.html">Release Notes</a></li>
<li><a href="https://numerics.mathdotnet.com/License.html">MIT License</a></li>
<li><a href="https://numerics.mathdotnet.com/Compatibility.html">Platform Support</a></li>
<li><a href="https://numerics.mathdotnet.com/api/">Class Reference</a></li>
<li><a href="https://github.com/mathnet/mathnet-numerics/issues">Issues & Bugs</a></li>
<li><a href="https://numerics.mathdotnet.com/Users.html">Who is using Math.NET?</a></li>
<li class="nav-header">Contributing</li>
<li><a href="https://numerics.mathdotnet.com/Contributors.html">Contributors</a></li>
<li><a href="https://numerics.mathdotnet.com/Contributing.html">Contributing</a></li>
<li><a href="https://numerics.mathdotnet.com/Build.html">Build & Tools</a></li>
<li><a href="http://feedback.mathdotnet.com/forums/2060-math-net-numerics">Your Ideas</a></li>
<li class="nav-header">Getting Help</li>
<li><a href="https://discuss.mathdotnet.com/c/numerics">Discuss</a></li>
<li><a href="https://stackoverflow.com/questions/tagged/mathdotnet">Stack Overflow</a></li>
<li class="nav-header">Getting Started</li>
<li><a href="https://numerics.mathdotnet.com/">Getting started</a></li>
<li><a href="https://numerics.mathdotnet.com/Constants.html">Constants</a></li>
<li>Floating-Point Numbers</li>
<li>Arbitrary Precision Numbers</li>
<li>Complex Numbers</li>
<li><a href="https://numerics.mathdotnet.com/Matrix.html">Matrices and Vectors</a></li>
<li><a href="https://numerics.mathdotnet.com/Euclid.html">Euclid & Number Theory</a></li>
<li>Combinatorics</li>
<li class="nav-header">Evaluation</li>
<li><a href="https://numerics.mathdotnet.com/Functions.html">Special Functions</a></li>
<li>Differentiation</li>
<li><a href="https://numerics.mathdotnet.com/Integration.html">Integration</a></li>
<li class="nav-header">Statistics/Probability</li>
<li><a href="https://numerics.mathdotnet.com/DescriptiveStatistics.html">Descriptive Statistics</a></li>
<li><a href="https://numerics.mathdotnet.com/Probability.html">Probability Distributions</a></li>
<li class="nav-header">Generation</li>
<li><a href="https://numerics.mathdotnet.com/Generate.html">Generating Data</a></li>
<li><a href="https://numerics.mathdotnet.com/Random.html">Random Numbers</a></li>
<li class="nav-header">Transformation</li>
<li>Fourier Transform (FFT)</li>
<li>Filtering & DSP</li>
<li>Window Functions</li>
<li class="nav-header">Solving Equations</li>
<li><a href="https://numerics.mathdotnet.com/LinearEquations.html">Linear Equation Systems</a></li>
<li>Nonlinear Root Finding</li>
<li class="nav-header">Optimization</li>
<li>Linear Least Squares</li>
<li>Nonlinear Optimization</li>
<li><a href="https://numerics.mathdotnet.com/Distance.html">Distance Metrics</a></li>
<li class="nav-header">Curve Fitting</li>
<li><a href="https://numerics.mathdotnet.com/Regression.html">Regression</a></li>
<li>Interpolation</li>
<li>Fourier Approximation</li>
<li class="nav-header">Native Providers</li>
<li><a href="https://numerics.mathdotnet.com/MKL.html">Intel MKL</a></li>
<li class="nav-header">Working Together</li>
<li><a href="https://numerics.mathdotnet.com/CSV.html">Delimited Text Files (CSV)</a></li>
<li><a href="https://numerics.mathdotnet.com/MatrixMarket.html">NIST MatrixMarket</a></li>
<li><a href="https://numerics.mathdotnet.com/MatlabFiles.html">MATLAB</a></li>
<li><a href="https://numerics.mathdotnet.com/IFSharpNotebook.html">IF# Notebook</a></li>
<li>FsLab & Deedle</li>
<li>Microsoft Excel</li>
<li>numl.net machine learning</li>
<li>R-project</li>
</ul>
</div>
</div>
</div>
</body>
<!-- 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>

804
Matrix.html

@ -1,63 +1,138 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>Matrices and Vectors
</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta name="description" content="Math.NET Numerics, providing methods and algorithms for numerical computations in science, engineering and every day use. .Net 4, .Net 3.5, SL5, Win8, WP8, PCL 47 and 136, Mono, Xamarin Android/iOS."/>
<meta name="author" content="Christoph Ruegg, Marcus Cuda, Jurgen Van Gael"/>
<script src="https://code.jquery.com/jquery-1.8.0.js"></script>
<script src="https://code.jquery.com/ui/1.8.23/jquery-ui.js"></script>
<script src="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/js/bootstrap.min.js"></script>
<link href="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap-combined.min.css" rel="stylesheet"/>
<link type="text/css" rel="stylesheet" href="https://numerics.mathdotnet.com/content/style.css" />
<style>
#main table:not(.pre) {
border: 1px solid #dddddd;
max-width: 100%;
border-style: solid;
border-width: 1px;
border-color: gray;
border-collapse: collapse;
border-right-width: 1px;
border-bottom-width: 1px;
margin-top: 15px;
margin-bottom: 25px;
}
#main table:not(.pre) th, #main table:not(.pre) td {
border: 1px solid #dddddd;
padding: 6px;
}
#main table:not(.pre) th p, #main table:not(.pre) td p {
margin-bottom: 5px;
}
</style>
<script type="text/javascript" src="https://numerics.mathdotnet.com/content/tips.js"></script>
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<![endif]-->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
</head>
<body>
<div class="container">
<div class="masthead">
<ul class="nav nav-pills pull-right">
<li><a href="https://www.mathdotnet.com">Math.NET Project</a></li>
<li><a href="https://numerics.mathdotnet.com">Math.NET Numerics</a></li>
<li><a href="https://github.com/mathnet/mathnet-numerics">GitHub</a></li>
</ul>
<h3 class="muted">Math.NET Numerics</h3>
<head>
<meta charset="utf-8">
<title>Matrices and Vectors
</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>
<hr />
<div class="row">
<div class="span9" id="main">
<h1><a name="Matrices-and-Vectors" class="anchor" href="#Matrices-and-Vectors">Matrices and Vectors</a></h1>
<!-- 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">Floating-Point Numbers</li>
<li class="nav-item">Arbitrary Precision Numbers</li>
<li class="nav-item">Complex Numbers</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">Differentiation</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">Transformation</li>
<li class="nav-item">Fourier Transform (FFT)</li>
<li class="nav-item">Filtering & DSP</li>
<li class="nav-item">Window Functions</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-item">Nonlinear Root Finding</li>
<li class="nav-header">Optimization</li>
<li class="nav-item">Linear Least Squares</li>
<li class="nav-item">Nonlinear 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-item">Interpolation</li>
<li class="nav-item">Fourier Approximation</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://www.mathdotnet.com">Math.NET Project</a> |
<a href="https://numerics.mathdotnet.com">Math.NET Numerics</a> |
<a href="https://github.com/mathnet/mathnet-numerics">GitHub</a>
</h3>
</div>
<hr />
<div class="container" id="fsdocs-content">
<h1><a name="Matrices-and-Vectors" class="anchor" href="#Matrices-and-Vectors">Matrices and Vectors</a></h1>
<p>Math.NET Numerics includes rich types for matrices and vectors.
They support both single and double precision, real and complex floating point numbers.</p>
<p><span class="math">\[\mathbf{A}=
@ -109,14 +184,7 @@ For example, for double precision numbers there is a <code>DenseMatrix</code> cl
namespace. You do not normally need to be aware of that, but as consequence the generic <code>Matrix&lt;T&gt;</code> type is abstract
and we need other ways to create a matrix or vector instance.</p>
<p>The matrix and vector builder provide functions to create instances from a variety of formats or approaches.</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
<span class="l">4: </span>
<span class="l">5: </span>
<span class="l">6: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="c">// create a dense matrix with 3 rows and 4 columns</span>
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="c">// create a dense matrix with 3 rows and 4 columns</span>
<span class="c">// filled with random numbers sampled from the standard distribution</span>
Matrix&lt;<span class="k">double</span>&gt; m <span class="o">=</span> Matrix&lt;<span class="k">double</span>&gt;.Build.Random(<span class="n">3</span>, <span class="n">4</span>);
@ -125,14 +193,7 @@ Vector&lt;<span class="k">double</span>&gt; v <span class="o">=</span> Vector&lt
</code></pre></td></tr></table>
<p>Since within an application you often only work with one specific data type, a common trick to keep this a bit shorter
is to define shortcuts to the builders:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
<span class="l">4: </span>
<span class="l">5: </span>
<span class="l">6: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">var</span> M <span class="o">=</span> Matrix&lt;<span class="k">double</span>&gt;.Build;
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">var</span> M <span class="o">=</span> Matrix&lt;<span class="k">double</span>&gt;.Build;
<span class="k">var</span> V <span class="o">=</span> Vector&lt;<span class="k">double</span>&gt;.Build;
<span class="c">// build the same as above</span>
@ -143,25 +204,7 @@ is to define shortcuts to the builders:</p>
so if we'd like to build a sparse matrix, intellisense will list all available options
together once you type <code>M.Sparse</code>.</p>
<p>There are variants to generate synthetic matrices, for example:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l"> 1: </span>
<span class="l"> 2: </span>
<span class="l"> 3: </span>
<span class="l"> 4: </span>
<span class="l"> 5: </span>
<span class="l"> 6: </span>
<span class="l"> 7: </span>
<span class="l"> 8: </span>
<span class="l"> 9: </span>
<span class="l">10: </span>
<span class="l">11: </span>
<span class="l">12: </span>
<span class="l">13: </span>
<span class="l">14: </span>
<span class="l">15: </span>
<span class="l">16: </span>
<span class="l">17: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="c">// 3x4 dense matrix filled with zeros</span>
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="c">// 3x4 dense matrix filled with zeros</span>
M.Dense(<span class="n">3</span>, <span class="n">4</span>);
<span class="c">// 3x4 dense matrix filled with 1.0.</span>
@ -182,46 +225,7 @@ M.Random(<span class="n">3</span>, <span class="n">4</span>, <span class="k">new
<p>But often we already have data available in some format and
need a matrix representing the same data. Whenever a function contains
"Of" in its name it does create a copy of the original data.</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l"> 1: </span>
<span class="l"> 2: </span>
<span class="l"> 3: </span>
<span class="l"> 4: </span>
<span class="l"> 5: </span>
<span class="l"> 6: </span>
<span class="l"> 7: </span>
<span class="l"> 8: </span>
<span class="l"> 9: </span>
<span class="l">10: </span>
<span class="l">11: </span>
<span class="l">12: </span>
<span class="l">13: </span>
<span class="l">14: </span>
<span class="l">15: </span>
<span class="l">16: </span>
<span class="l">17: </span>
<span class="l">18: </span>
<span class="l">19: </span>
<span class="l">20: </span>
<span class="l">21: </span>
<span class="l">22: </span>
<span class="l">23: </span>
<span class="l">24: </span>
<span class="l">25: </span>
<span class="l">26: </span>
<span class="l">27: </span>
<span class="l">28: </span>
<span class="l">29: </span>
<span class="l">30: </span>
<span class="l">31: </span>
<span class="l">32: </span>
<span class="l">33: </span>
<span class="l">34: </span>
<span class="l">35: </span>
<span class="l">36: </span>
<span class="l">37: </span>
<span class="l">38: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="c">// Copy of an existing matrix (can also be sparse or diagonal)</span>
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="c">// Copy of an existing matrix (can also be sparse or diagonal)</span>
Matrix&lt;<span class="k">double</span>&gt; x <span class="o">=</span> <span class="o">.</span><span class="o">.</span><span class="o">.</span>
M.DenseOfMatrix(x);
@ -263,24 +267,7 @@ M.DenseOfMatrixArray(x);
<p>Very similar variants also exist for sparse and diagonal matrices, prefixed
with <code>Sparse</code> and <code>Diagonal</code> respectively.</p>
<p>The approach for vectors is exactly the same:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l"> 1: </span>
<span class="l"> 2: </span>
<span class="l"> 3: </span>
<span class="l"> 4: </span>
<span class="l"> 5: </span>
<span class="l"> 6: </span>
<span class="l"> 7: </span>
<span class="l"> 8: </span>
<span class="l"> 9: </span>
<span class="l">10: </span>
<span class="l">11: </span>
<span class="l">12: </span>
<span class="l">13: </span>
<span class="l">14: </span>
<span class="l">15: </span>
<span class="l">16: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="c">// Standard-distributed random vector of length 10</span>
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="c">// Standard-distributed random vector of length 10</span>
V.Random(<span class="n">10</span>);
<span class="c">// All-zero vector of length 10</span>
@ -299,104 +286,59 @@ V.Dense(x);
</code></pre></td></tr></table>
<h3><a name="Creating-matrices-and-vectors-in-F" class="anchor" href="#Creating-matrices-and-vectors-in-F">Creating matrices and vectors in F#</a></h3>
<p>In F# we can use the builders just like in C#, but we can also use the F# modules:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l"> 1: </span>
<span class="l"> 2: </span>
<span class="l"> 3: </span>
<span class="l"> 4: </span>
<span class="l"> 5: </span>
<span class="l"> 6: </span>
<span class="l"> 7: </span>
<span class="l"> 8: </span>
<span class="l"> 9: </span>
<span class="l">10: </span>
<span class="l">11: </span>
<span class="l">12: </span>
<span class="l">13: </span>
<span class="l">14: </span>
<span class="l">15: </span>
<span class="l">16: </span>
<span class="l">17: </span>
<span class="l">18: </span>
<span class="l">19: </span>
<span class="l">20: </span>
<span class="l">21: </span>
<span class="l">22: </span>
<span class="l">23: </span>
<span class="l">24: </span>
<span class="l">25: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="k">let</span> <span onmouseout="hideTip(event, 'fs1', 1)" onmouseover="showTip(event, 'fs1', 1)" class="i">m1</span> <span class="o">=</span> <span class="i">matrix</span> [[ <span class="n">2.0</span>; <span class="n">3.0</span> ]
[ <span class="n">4.0</span>; <span class="n">5.0</span> ]]
<pre class="fssnip highlighted"><code lang="fsharp"><span class="k">let</span> <span onmouseout="hideTip(event, 'fs1', 1)" onmouseover="showTip(event, 'fs1', 1)" class="id">m1</span> <span class="o">=</span> <span class="id">matrix</span> <span class="pn">[</span><span class="pn">[</span> <span class="n">2.0</span><span class="pn">;</span> <span class="n">3.0</span> <span class="pn">]</span>
<span class="pn">[</span> <span class="n">4.0</span><span class="pn">;</span> <span class="n">5.0</span> <span class="pn">]</span><span class="pn">]</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs2', 2)" onmouseover="showTip(event, 'fs2', 2)" class="i">v1</span> <span class="o">=</span> <span class="i">vector</span> [ <span class="n">1.0</span>; <span class="n">2.0</span>; <span class="n">3.0</span> ]
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs2', 2)" onmouseover="showTip(event, 'fs2', 2)" class="id">v1</span> <span class="o">=</span> <span class="id">vector</span> <span class="pn">[</span> <span class="n">1.0</span><span class="pn">;</span> <span class="n">2.0</span><span class="pn">;</span> <span class="n">3.0</span> <span class="pn">]</span>
<span class="c">// dense 3x4 matrix filled with zeros.</span>
<span class="c">// (usually the type is inferred, but not for zero matrices)</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs3', 3)" onmouseover="showTip(event, 'fs3', 3)" class="i">m2</span> <span class="o">=</span> <span class="i">DenseMatrix</span><span class="o">.</span><span class="i">zero</span><span class="o">&lt;</span><span onmouseout="hideTip(event, 'fs4', 4)" onmouseover="showTip(event, 'fs4', 4)" class="i">float</span><span class="o">&gt;</span> <span class="n">3</span> <span class="n">4</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs3', 3)" onmouseover="showTip(event, 'fs3', 3)" class="id">m2</span> <span class="o">=</span> <span class="id">DenseMatrix</span><span class="pn">.</span><span class="id">zero</span><span class="pn">&lt;</span><span onmouseout="hideTip(event, 'fs4', 4)" onmouseover="showTip(event, 'fs4', 4)" class="id">float</span><span class="pn">&gt;</span> <span class="n">3</span> <span class="n">4</span>
<span class="c">// dense 3x4 matrix initialized by a function</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs5', 5)" onmouseover="showTip(event, 'fs5', 5)" class="i">m3</span> <span class="o">=</span> <span class="i">DenseMatrix</span><span class="o">.</span><span class="i">init</span> <span class="n">3</span> <span class="n">4</span> (<span class="k">fun</span> <span class="i">i</span> <span class="i">j</span> <span class="k">-&gt;</span> <span onmouseout="hideTip(event, 'fs4', 6)" onmouseover="showTip(event, 'fs4', 6)" class="i">float</span> (<span class="i">i</span><span class="o">+</span><span class="i">j</span>))
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs5', 5)" onmouseover="showTip(event, 'fs5', 5)" class="id">m3</span> <span class="o">=</span> <span class="id">DenseMatrix</span><span class="pn">.</span><span class="id">init</span> <span class="n">3</span> <span class="n">4</span> <span class="pn">(</span><span class="k">fun</span> <span class="id">i</span> <span class="id">j</span> <span class="k">-&gt;</span> <span onmouseout="hideTip(event, 'fs4', 6)" onmouseover="showTip(event, 'fs4', 6)" class="id">float</span> <span class="pn">(</span><span class="id">i</span><span class="o">+</span><span class="id">j</span><span class="pn">)</span><span class="pn">)</span>
<span class="c">// diagonal 4x4 identity matrix of single precision</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs6', 7)" onmouseover="showTip(event, 'fs6', 7)" class="i">m4</span> <span class="o">=</span> <span class="i">DiagonalMatrix</span><span class="o">.</span><span class="i">identity</span><span class="o">&lt;</span><span onmouseout="hideTip(event, 'fs7', 8)" onmouseover="showTip(event, 'fs7', 8)" class="i">float32</span><span class="o">&gt;</span> <span class="n">4</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs6', 7)" onmouseover="showTip(event, 'fs6', 7)" class="id">m4</span> <span class="o">=</span> <span class="id">DiagonalMatrix</span><span class="pn">.</span><span class="id">identity</span><span class="pn">&lt;</span><span onmouseout="hideTip(event, 'fs7', 8)" onmouseover="showTip(event, 'fs7', 8)" class="id">float32</span><span class="pn">&gt;</span> <span class="n">4</span>
<span class="c">// dense 3x4 matrix created from a sequence of sequence-columns</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs8', 9)" onmouseover="showTip(event, 'fs8', 9)" class="i">x</span> <span class="o">=</span> <span onmouseout="hideTip(event, 'fs9', 10)" onmouseover="showTip(event, 'fs9', 10)" class="t">Seq</span><span class="o">.</span><span onmouseout="hideTip(event, 'fs10', 11)" onmouseover="showTip(event, 'fs10', 11)" class="f">init</span> <span class="n">4</span> (<span class="k">fun</span> <span onmouseout="hideTip(event, 'fs11', 12)" onmouseover="showTip(event, 'fs11', 12)" class="i">c</span> <span class="k">-&gt;</span> <span onmouseout="hideTip(event, 'fs9', 13)" onmouseover="showTip(event, 'fs9', 13)" class="t">Seq</span><span class="o">.</span><span onmouseout="hideTip(event, 'fs10', 14)" onmouseover="showTip(event, 'fs10', 14)" class="f">init</span> <span class="n">3</span> (<span class="k">fun</span> <span onmouseout="hideTip(event, 'fs12', 15)" onmouseover="showTip(event, 'fs12', 15)" class="i">r</span> <span class="k">-&gt;</span> <span onmouseout="hideTip(event, 'fs4', 16)" onmouseover="showTip(event, 'fs4', 16)" class="f">float</span> (<span class="n">100</span><span class="o">*</span><span onmouseout="hideTip(event, 'fs12', 17)" onmouseover="showTip(event, 'fs12', 17)" class="i">r</span> <span class="o">+</span> <span onmouseout="hideTip(event, 'fs11', 18)" onmouseover="showTip(event, 'fs11', 18)" class="i">c</span>)))
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs13', 19)" onmouseover="showTip(event, 'fs13', 19)" class="i">m5</span> <span class="o">=</span> <span class="i">DenseMatrix</span><span class="o">.</span><span class="i">ofColumnSeq</span> <span onmouseout="hideTip(event, 'fs8', 20)" onmouseover="showTip(event, 'fs8', 20)" class="i">x</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs8', 9)" onmouseover="showTip(event, 'fs8', 9)" class="id">x</span> <span class="o">=</span> <span onmouseout="hideTip(event, 'fs9', 10)" onmouseover="showTip(event, 'fs9', 10)" class="m">Seq</span><span class="pn">.</span><span onmouseout="hideTip(event, 'fs10', 11)" onmouseover="showTip(event, 'fs10', 11)" class="id">init</span> <span class="n">4</span> <span class="pn">(</span><span class="k">fun</span> <span onmouseout="hideTip(event, 'fs11', 12)" onmouseover="showTip(event, 'fs11', 12)" class="fn">c</span> <span class="k">-&gt;</span> <span onmouseout="hideTip(event, 'fs9', 13)" onmouseover="showTip(event, 'fs9', 13)" class="m">Seq</span><span class="pn">.</span><span onmouseout="hideTip(event, 'fs10', 14)" onmouseover="showTip(event, 'fs10', 14)" class="id">init</span> <span class="n">3</span> <span class="pn">(</span><span class="k">fun</span> <span onmouseout="hideTip(event, 'fs12', 15)" onmouseover="showTip(event, 'fs12', 15)" class="fn">r</span> <span class="k">-&gt;</span> <span onmouseout="hideTip(event, 'fs4', 16)" onmouseover="showTip(event, 'fs4', 16)" class="fn">float</span> <span class="pn">(</span><span class="n">100</span><span class="o">*</span><span onmouseout="hideTip(event, 'fs12', 17)" onmouseover="showTip(event, 'fs12', 17)" class="fn">r</span> <span class="o">+</span> <span onmouseout="hideTip(event, 'fs11', 18)" onmouseover="showTip(event, 'fs11', 18)" class="fn">c</span><span class="pn">)</span><span class="pn">)</span><span class="pn">)</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs13', 19)" onmouseover="showTip(event, 'fs13', 19)" class="id">m5</span> <span class="o">=</span> <span class="id">DenseMatrix</span><span class="pn">.</span><span class="id">ofColumnSeq</span> <span onmouseout="hideTip(event, 'fs8', 20)" onmouseover="showTip(event, 'fs8', 20)" class="id">x</span>
<span class="c">// random matrix with standard distribution:</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs14', 21)" onmouseover="showTip(event, 'fs14', 21)" class="i">m6</span> <span class="o">=</span> <span class="i">DenseMatrix</span><span class="o">.</span><span class="i">randomStandard</span><span class="o">&lt;</span><span onmouseout="hideTip(event, 'fs4', 22)" onmouseover="showTip(event, 'fs4', 22)" class="i">float</span><span class="o">&gt;</span> <span class="n">3</span> <span class="n">4</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs14', 21)" onmouseover="showTip(event, 'fs14', 21)" class="id">m6</span> <span class="o">=</span> <span class="id">DenseMatrix</span><span class="pn">.</span><span class="id">randomStandard</span><span class="pn">&lt;</span><span onmouseout="hideTip(event, 'fs4', 22)" onmouseover="showTip(event, 'fs4', 22)" class="id">float</span><span class="pn">&gt;</span> <span class="n">3</span> <span class="n">4</span>
<span class="c">// random matrix with a uniform and one with a Gamma distribution:</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs15', 23)" onmouseover="showTip(event, 'fs15', 23)" class="i">m7a</span> <span class="o">=</span> <span class="i">DenseMatrix</span><span class="o">.</span><span class="i">random</span><span class="o">&lt;</span><span onmouseout="hideTip(event, 'fs4', 24)" onmouseover="showTip(event, 'fs4', 24)" class="i">float</span><span class="o">&gt;</span> <span class="n">3</span> <span class="n">4</span> (<span class="i">ContinuousUniform</span>(<span class="o">-</span><span class="n">2.0</span>, <span class="n">4.0</span>))
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs16', 25)" onmouseover="showTip(event, 'fs16', 25)" class="i">m7b</span> <span class="o">=</span> <span class="i">DenseMatrix</span><span class="o">.</span><span class="i">random</span><span class="o">&lt;</span><span onmouseout="hideTip(event, 'fs4', 26)" onmouseover="showTip(event, 'fs4', 26)" class="i">float</span><span class="o">&gt;</span> <span class="n">3</span> <span class="n">4</span> (<span class="i">Gamma</span>(<span class="n">1.0</span>, <span class="n">2.0</span>))
</code></pre></td>
</tr>
</table>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs15', 23)" onmouseover="showTip(event, 'fs15', 23)" class="id">m7a</span> <span class="o">=</span> <span class="id">DenseMatrix</span><span class="pn">.</span><span class="id">random</span><span class="pn">&lt;</span><span onmouseout="hideTip(event, 'fs4', 24)" onmouseover="showTip(event, 'fs4', 24)" class="id">float</span><span class="pn">&gt;</span> <span class="n">3</span> <span class="n">4</span> <span class="pn">(</span><span class="id">ContinuousUniform</span><span class="pn">(</span><span class="o">-</span><span class="n">2.0</span><span class="pn">,</span> <span class="n">4.0</span><span class="pn">)</span><span class="pn">)</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs16', 25)" onmouseover="showTip(event, 'fs16', 25)" class="id">m7b</span> <span class="o">=</span> <span class="id">DenseMatrix</span><span class="pn">.</span><span class="id">random</span><span class="pn">&lt;</span><span onmouseout="hideTip(event, 'fs4', 26)" onmouseover="showTip(event, 'fs4', 26)" class="id">float</span><span class="pn">&gt;</span> <span class="n">3</span> <span class="n">4</span> <span class="pn">(</span><span class="id">Gamma</span><span class="pn">(</span><span class="n">1.0</span><span class="pn">,</span> <span class="n">2.0</span><span class="pn">)</span><span class="pn">)</span>
</code></pre>
<p>Or using any other of all the available functions.</p>
<h2><a name="Arithmetics" class="anchor" href="#Arithmetics">Arithmetics</a></h2>
<p>All the common arithmetic operators like <code>+</code>, <code>-</code>, <code>*</code>, <code>/</code> and <code>%</code> are provided,
between matrices, vectors and scalars. In F# there are additional pointwise
operators <code>.*</code>, <code>./</code> and <code>.%</code> available for convenience.</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
<span class="l">4: </span>
<span class="l">5: </span>
<span class="l">6: </span>
<span class="l">7: </span>
<span class="l">8: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="k">let</span> <span onmouseout="hideTip(event, 'fs17', 27)" onmouseover="showTip(event, 'fs17', 27)" class="i">m</span> <span class="o">=</span> <span class="i">matrix</span> [[ <span class="n">1.0</span>; <span class="n">4.0</span>; <span class="n">7.0</span> ]
[ <span class="n">2.0</span>; <span class="n">5.0</span>; <span class="n">8.0</span> ]
[ <span class="n">3.0</span>; <span class="n">6.0</span>; <span class="n">9.0</span> ]]
<pre class="fssnip highlighted"><code lang="fsharp"><span class="k">let</span> <span onmouseout="hideTip(event, 'fs17', 27)" onmouseover="showTip(event, 'fs17', 27)" class="id">m</span> <span class="o">=</span> <span class="id">matrix</span> <span class="pn">[</span><span class="pn">[</span> <span class="n">1.0</span><span class="pn">;</span> <span class="n">4.0</span><span class="pn">;</span> <span class="n">7.0</span> <span class="pn">]</span>
<span class="pn">[</span> <span class="n">2.0</span><span class="pn">;</span> <span class="n">5.0</span><span class="pn">;</span> <span class="n">8.0</span> <span class="pn">]</span>
<span class="pn">[</span> <span class="n">3.0</span><span class="pn">;</span> <span class="n">6.0</span><span class="pn">;</span> <span class="n">9.0</span> <span class="pn">]</span><span class="pn">]</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs18', 28)" onmouseover="showTip(event, 'fs18', 28)" class="i">v</span> <span class="o">=</span> <span class="i">vector</span> [ <span class="n">10.0</span>; <span class="n">20.0</span>; <span class="n">30.0</span> ]
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs18', 28)" onmouseover="showTip(event, 'fs18', 28)" class="id">v</span> <span class="o">=</span> <span class="id">vector</span> <span class="pn">[</span> <span class="n">10.0</span><span class="pn">;</span> <span class="n">20.0</span><span class="pn">;</span> <span class="n">30.0</span> <span class="pn">]</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs19', 29)" onmouseover="showTip(event, 'fs19', 29)" class="i">v&#39;</span> <span class="o">=</span> <span onmouseout="hideTip(event, 'fs17', 30)" onmouseover="showTip(event, 'fs17', 30)" class="i">m</span> <span class="o">*</span> <span onmouseout="hideTip(event, 'fs18', 31)" onmouseover="showTip(event, 'fs18', 31)" class="i">v</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs20', 32)" onmouseover="showTip(event, 'fs20', 32)" class="i">m&#39;</span> <span class="o">=</span> <span onmouseout="hideTip(event, 'fs17', 33)" onmouseover="showTip(event, 'fs17', 33)" class="i">m</span> <span class="o">+</span> <span class="n">2.0</span><span class="o">*</span><span onmouseout="hideTip(event, 'fs17', 34)" onmouseover="showTip(event, 'fs17', 34)" class="i">m</span>
</code></pre></td>
</tr>
</table>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs19', 29)" onmouseover="showTip(event, 'fs19', 29)" class="id">v&#39;</span> <span class="o">=</span> <span onmouseout="hideTip(event, 'fs17', 30)" onmouseover="showTip(event, 'fs17', 30)" class="id">m</span> <span class="o">*</span> <span onmouseout="hideTip(event, 'fs18', 31)" onmouseover="showTip(event, 'fs18', 31)" class="id">v</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs20', 32)" onmouseover="showTip(event, 'fs20', 32)" class="id">m&#39;</span> <span class="o">=</span> <span onmouseout="hideTip(event, 'fs17', 33)" onmouseover="showTip(event, 'fs17', 33)" class="id">m</span> <span class="o">+</span> <span class="n">2.0</span><span class="o">*</span><span onmouseout="hideTip(event, 'fs17', 34)" onmouseover="showTip(event, 'fs17', 34)" class="id">m</span>
</code></pre>
<h3><a name="Arithmetic-Instance-Methods" class="anchor" href="#Arithmetic-Instance-Methods">Arithmetic Instance Methods</a></h3>
<p>All other operations are covered by methods, like <code>Transpose</code> and <code>Conjugate</code>,
or in F# as functions in the Matrix module, e.g. <code>Matrix.transpose</code>.
But even the operators have equivalent methods. The equivalent code from
above when using instance methods:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">var</span> v<span class="n">2</span> <span class="o">=</span> m.Multiply(v);
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">var</span> v<span class="n">2</span> <span class="o">=</span> m.Multiply(v);
<span class="k">var</span> m<span class="n">2</span> <span class="o">=</span> m.Add(m.Multiply(<span class="n">2</span>));
</code></pre></td></tr></table>
<p>These methods also have an overload that accepts the result data structure as last argument,
allowing to avoid allocating new structures for every single operation. Provided the
dimensions match, most also allow one of the arguments to be passed as result,
resulting in an in-place application. For example, an in-place version of the code above:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp">m.Multiply(v, v); <span class="c">// v &lt;- m*v</span>
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp">m.Multiply(v, v); <span class="c">// v &lt;- m*v</span>
m.Multiply(<span class="n">3</span>, m); <span class="c">// m &lt;- 3*m</span>
</code></pre></td></tr></table>
<h3><a name="Shortcut-Methods" class="anchor" href="#Shortcut-Methods">Shortcut Methods</a></h3>
@ -404,23 +346,14 @@ m.Multiply(<span class="n">3</span>, m); <span class="c">// m &lt;- 3*m</span>
<span class="math">\(\mathbf{X}^T\mathbf y = \mathbf{X}^T\mathbf X \mathbf p\)</span> which we would like to solve
for <span class="math">\(p\)</span>. By matrix inversion we get <span class="math">\(\mathbf p = (\mathbf{X}^T\mathbf X)^{-1}(\mathbf{X}^T\mathbf y)\)</span>.
This can directly be translated to the following code:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp">(X.Transpose() <span class="o">*</span> X).Inverse() <span class="o">*</span> (X.Transpose() <span class="o">*</span> y)
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp">(X.Transpose() <span class="o">*</span> X).Inverse() <span class="o">*</span> (X.Transpose() <span class="o">*</span> y)
</code></pre></td></tr></table>
<p>Since products where one of the arguments is transposed are common, there are a few shortcut routines
that are more efficient:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp">X.TransposeThisAndMultiply(X).Inverse() <span class="o">*</span> X.TransposeThisAndMultiply(y)
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp">X.TransposeThisAndMultiply(X).Inverse() <span class="o">*</span> X.TransposeThisAndMultiply(y)
</code></pre></td></tr></table>
<p>Of course in practice you would not use the matrix inverse but a decomposition:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
<span class="l">4: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp">X.TransposeThisAndMultiply(X).Cholesky().Solve(X.TransposeThisAndMultiply(y))
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp">X.TransposeThisAndMultiply(X).Cholesky().Solve(X.TransposeThisAndMultiply(y))
<span class="c">// or if the problem is small enough, simply:</span>
X.Solve(y);
@ -464,9 +397,7 @@ is said to be <em>well-conditioned</em>, with a high condition number <em>ill-co
For a linear equation <span class="math">\(Ax=b\)</span> the condition number is the maximum ratio of the
relative error in <span class="math">\(x\)</span> divided by the relative error in <span class="math">\(b\)</span>. It therefore gives a bound on how
inaccurate the solution <span class="math">\(x\)</span> will be after approximation.</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp">M.Random(<span class="n">4</span>,<span class="n">4</span>).ConditionNumber(); <span class="c">// e.g. 14.829</span>
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp">M.Random(<span class="n">4</span>,<span class="n">4</span>).ConditionNumber(); <span class="c">// e.g. 14.829</span>
</code></pre></td></tr></table>
<h2><a name="Trace-and-Determinant" class="anchor" href="#Trace-and-Determinant">Trace and Determinant</a></h2>
<p>For a square matrix, the trace of a matrix is the sum of the elements on the main diagonal,
@ -475,14 +406,7 @@ of a square matrix is the product of all its eigenvalues with multiplicities.
A matrix is said to be <em>singular</em> if its determinant is zero and <em>non-singular</em> otherwise.
In the latter case the matrix is invertible and the linear equation system it
represents has a single unique solution.</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
<span class="l">4: </span>
<span class="l">5: </span>
<span class="l">6: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">var</span> m <span class="o">=</span> M.DenseOfArray(<span class="k">new</span>[,] {{ <span class="n">1.0</span>, <span class="n">2.0</span>, <span class="n">1.0</span>},
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">var</span> m <span class="o">=</span> M.DenseOfArray(<span class="k">new</span>[,] {{ <span class="n">1.0</span>, <span class="n">2.0</span>, <span class="n">1.0</span>},
{<span class="n">-2.0</span>, <span class="n">-3.0</span>, <span class="n">1.0</span>},
{ <span class="n">3.0</span>, <span class="n">5.0</span>, <span class="n">0.0</span>}});
@ -494,11 +418,7 @@ m.Determinant(); <span class="c">// ~0 hence not invertible, either none or mult
number of linearly independent column and row vectors of the matrix. It is a measure
of the non-degenerateness of the linear equation system the matrix represents.</p>
<p>An orthonormal basis of the column space can be computed with the range method.</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="c">// with the same m as above</span>
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="c">// with the same m as above</span>
m.Rank(); <span class="c">// 2</span>
m.Range(); <span class="c">// [-0.30519,0.503259,-0.808449], [-0.757315,-0.64296,-0.114355]</span>
</code></pre></td></tr></table>
@ -507,14 +427,7 @@ m.Range(); <span class="c">// [-0.30519,0.503259,-0.808449], [-0.757315,-0.64296
It is the orthogonal complement to the row space of the matrix.</p>
<p>The nullity of a matrix is the dimension of its null space.
An orthonormal basis of the null space can be computed with the kernel method.</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
<span class="l">4: </span>
<span class="l">5: </span>
<span class="l">6: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="c">// with the same m as above</span>
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="c">// with the same m as above</span>
m.Nullity(); <span class="c">// 1</span>
m.Kernel(); <span class="c">// [0.845154,-0.507093,0.169031]</span>
@ -554,14 +467,7 @@ If the symmetricity of the matrix is known, the algorithm can optionally skip it
<p>Individual values can be get and set in matrices and vectors using the indexers
or the <code>At</code> methods. Using <code>At</code> instead of the indexers is slightly faster but
skips some range checks, so use it only after checking the range yourself.</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
<span class="l">4: </span>
<span class="l">5: </span>
<span class="l">6: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">var</span> m <span class="o">=</span> Matrix&lt;<span class="k">double</span>&gt;.Build.Dense(<span class="n">3</span>,<span class="n">4</span>,(i,j) <span class="o">=</span><span class="o">&gt;</span> <span class="n">10</span>*i <span class="o">+</span> j);
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">var</span> m <span class="o">=</span> Matrix&lt;<span class="k">double</span>&gt;.Build.Dense(<span class="n">3</span>,<span class="n">4</span>,(i,j) <span class="o">=</span><span class="o">&gt;</span> <span class="n">10</span>*i <span class="o">+</span> j);
m[<span class="n">0</span>,<span class="n">0</span>]; <span class="c">// 0 (row 0, column 0)</span>
m[<span class="n">2</span>,<span class="n">0</span>]; <span class="c">// 20 (row 2, column 0)</span>
m[<span class="n">0</span>,<span class="n">2</span>]; <span class="c">// 2 (row 0, column 2)</span>
@ -569,73 +475,39 @@ m[<span class="n">0</span>,<span class="n">2</span>] <span class="o">=</span> <s
m[<span class="n">0</span>,<span class="n">2</span>]; <span class="c">// -1</span>
</code></pre></td></tr></table>
<p>In F#:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span onmouseout="hideTip(event, 'fs17', 35)" onmouseover="showTip(event, 'fs17', 35)" class="i">m</span><span class="o">.</span>[<span class="n">2</span>,<span class="n">0</span>] <span class="c">// 20</span>
</code></pre></td>
</tr>
</table>
<pre class="fssnip highlighted"><code lang="fsharp"><span onmouseout="hideTip(event, 'fs17', 35)" onmouseover="showTip(event, 'fs17', 35)" class="id">m</span><span class="pn">.</span><span class="pn">[</span><span class="n">2</span><span class="pn">,</span><span class="n">0</span><span class="pn">]</span> <span class="c">// 20</span>
</code></pre>
<p>We can also get entire column or row vectors, or a new matrix from parts of an existing one.</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
<span class="l">4: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">var</span> m <span class="o">=</span> M.Dense(<span class="n">6</span>,<span class="n">4</span>,(i,j) <span class="o">=</span><span class="o">&gt;</span> <span class="n">10</span>*i <span class="o">+</span> j);
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">var</span> m <span class="o">=</span> M.Dense(<span class="n">6</span>,<span class="n">4</span>,(i,j) <span class="o">=</span><span class="o">&gt;</span> <span class="n">10</span>*i <span class="o">+</span> j);
m.Column(<span class="n">2</span>); <span class="c">// [2,12,22,32,42,52]</span>
m.Row(<span class="n">3</span>); <span class="c">// [30,31,32,33]</span>
m.SubMatrix(<span class="n">1</span>,<span class="n">2</span>,<span class="n">1</span>,<span class="n">2</span>); <span class="c">// [11,12; 21,22]</span>
</code></pre></td></tr></table>
<p>For each of these methods there is also a variant prefixed with <code>Set</code> that can be used
to overwrite those elements with the provided data.</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp">m.SetRow(<span class="n">3</span>, V.Random(<span class="n">4</span>));
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp">m.SetRow(<span class="n">3</span>, V.Random(<span class="n">4</span>));
</code></pre></td></tr></table>
<p>In F# we can also use its slicing syntax:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
<span class="l">4: </span>
<span class="l">5: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="k">let</span> <span onmouseout="hideTip(event, 'fs21', 36)" onmouseover="showTip(event, 'fs21', 36)" class="i">m</span> <span class="o">=</span> <span class="i">DenseMatrix</span><span class="o">.</span><span class="i">init</span> <span class="n">6</span> <span class="n">4</span> (<span class="k">fun</span> <span class="i">i</span> <span class="i">j</span> <span class="k">-&gt;</span> <span onmouseout="hideTip(event, 'fs4', 37)" onmouseover="showTip(event, 'fs4', 37)" class="i">float</span> (<span class="n">10</span><span class="o">*</span><span class="i">i</span> <span class="o">+</span> <span class="i">j</span>))
<span onmouseout="hideTip(event, 'fs21', 38)" onmouseover="showTip(event, 'fs21', 38)" class="i">m</span><span class="o">.</span>[<span class="n">0</span>,<span class="n">0..</span><span class="n">3</span>] <span class="c">// vector [0,1,2,3]</span>
<span onmouseout="hideTip(event, 'fs21', 39)" onmouseover="showTip(event, 'fs21', 39)" class="i">m</span><span class="o">.</span>[<span class="n">1..</span><span class="n">2</span>,<span class="n">0..</span><span class="n">3</span>] <span class="c">// matrix [10,11,12,13; 20,21,22,23]</span>
<pre class="fssnip highlighted"><code lang="fsharp"><span class="k">let</span> <span onmouseout="hideTip(event, 'fs21', 36)" onmouseover="showTip(event, 'fs21', 36)" class="id">m</span> <span class="o">=</span> <span class="id">DenseMatrix</span><span class="pn">.</span><span class="id">init</span> <span class="n">6</span> <span class="n">4</span> <span class="pn">(</span><span class="k">fun</span> <span class="id">i</span> <span class="id">j</span> <span class="k">-&gt;</span> <span onmouseout="hideTip(event, 'fs4', 37)" onmouseover="showTip(event, 'fs4', 37)" class="id">float</span> <span class="pn">(</span><span class="n">10</span><span class="pn">*</span><span class="id">i</span> <span class="o">+</span> <span class="id">j</span><span class="pn">)</span><span class="pn">)</span>
<span onmouseout="hideTip(event, 'fs21', 38)" onmouseover="showTip(event, 'fs21', 38)" class="id">m</span><span class="pn">.</span><span class="pn">[</span><span class="n">0</span><span class="pn">,</span><span class="n">0..</span><span class="n">3</span><span class="pn">]</span> <span class="c">// vector [0,1,2,3]</span>
<span onmouseout="hideTip(event, 'fs21', 39)" onmouseover="showTip(event, 'fs21', 39)" class="id">m</span><span class="pn">.</span><span class="pn">[</span><span class="n">1..</span><span class="n">2</span><span class="pn">,</span><span class="n">0..</span><span class="n">3</span><span class="pn">]</span> <span class="c">// matrix [10,11,12,13; 20,21,22,23]</span>
<span class="c">// overwrite a sub-matrix with the content of another matrix:</span>
<span onmouseout="hideTip(event, 'fs21', 40)" onmouseover="showTip(event, 'fs21', 40)" class="i">m</span><span class="o">.</span>[<span class="n">0..</span><span class="n">1</span>,<span class="n">1..</span><span class="n">2</span>] <span class="o">&lt;-</span> <span class="i">matrix</span> [[ <span class="n">3.0</span>; <span class="n">4.0</span> ]; [ <span class="n">5.0</span>; <span class="n">6.0</span> ]]
</code></pre></td>
</tr>
</table>
<span onmouseout="hideTip(event, 'fs21', 40)" onmouseover="showTip(event, 'fs21', 40)" class="id">m</span><span class="pn">.</span><span class="pn">[</span><span class="n">0..</span><span class="n">1</span><span class="pn">,</span><span class="n">1..</span><span class="n">2</span><span class="pn">]</span> <span class="k">&lt;-</span> <span class="id">matrix</span> <span class="pn">[</span><span class="pn">[</span> <span class="n">3.0</span><span class="pn">;</span> <span class="n">4.0</span> <span class="pn">]</span><span class="pn">;</span> <span class="pn">[</span> <span class="n">5.0</span><span class="pn">;</span> <span class="n">6.0</span> <span class="pn">]</span><span class="pn">]</span>
</code></pre>
<p>To set the whole matrix or some of its columns or rows to zero, use one of the clear methods:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
<span class="l">4: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp">m.Clear(); <span class="c">// set all elements to 0</span>
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp">m.Clear(); <span class="c">// set all elements to 0</span>
m.ClearColumn(<span class="n">2</span>); <span class="c">// set the 3rd column to 0 (0-based indexing)</span>
m.ClearColumns(<span class="n">1</span>,<span class="n">3</span>); <span class="c">// set the 2nd and 4th columns to 0 (params-array)</span>
m.ClearSubMatrix(<span class="n">1</span>,<span class="n">2</span>,<span class="n">1</span>,<span class="n">2</span>); <span class="c">// set the 2x2 submatrix with offset 1,1 to zero</span>
</code></pre></td></tr></table>
<p>Because of the limitations of floating point numbers, we may want to set very small numbers to zero:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp">m.CoerceZero(<span class="n">1</span>e<span class="n">-14</span>); <span class="c">// set all elements smaller than 1e-14 to 0</span>
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp">m.CoerceZero(<span class="n">1</span>e<span class="n">-14</span>); <span class="c">// set all elements smaller than 1e-14 to 0</span>
m.CoerceZero(x <span class="o">=</span><span class="o">&gt;</span> x <span class="o">&lt;</span> <span class="n">10</span>); <span class="c">// set all elements that match a predicate function to 0.</span>
</code></pre></td></tr></table>
<p>Even though matrices and vectors are mutable, their dimension is fixed and cannot be changed
after creation. However, we can still insert or remove rows or columns, or concatenate matrices together.
But all these operations will create and return a new instance.</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
<span class="l">4: </span>
<span class="l">5: </span>
<span class="l">6: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">var</span> m<span class="n">2</span> <span class="o">=</span> m.RemoveRow(<span class="n">2</span>); <span class="c">// remove the 3rd rows</span>
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">var</span> m<span class="n">2</span> <span class="o">=</span> m.RemoveRow(<span class="n">2</span>); <span class="c">// remove the 3rd rows</span>
<span class="k">var</span> m<span class="n">3</span> <span class="o">=</span> m<span class="n">2</span>.RemoveColumn(<span class="n">3</span>); <span class="c">// remove the 4th column</span>
<span class="k">var</span> m<span class="n">4</span> <span class="o">=</span> m.Stack(m<span class="n">2</span>); <span class="c">// new matrix with m on top and m2 on the bottom</span>
@ -679,21 +551,13 @@ of applying a function to its value. Or, if indexed, to its index and value.</p>
<li><strong>MapIndexed(f,zeros)</strong>: indexed variant of Map.</li>
</ul>
<p>Example: Convert a complex vector to a real vector containing only the real parts in C#:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp">Vector&lt;Complex&gt; u <span class="o">=</span> Vector&lt;Complex&gt;.Build.Random(<span class="n">10</span>);
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp">Vector&lt;Complex&gt; u <span class="o">=</span> Vector&lt;Complex&gt;.Build.Random(<span class="n">10</span>);
Vector&lt;Double&gt; v <span class="o">=</span> u.Map(c <span class="o">=</span><span class="o">&gt;</span> c.Real);
</code></pre></td></tr></table>
<p>Or in F#:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="k">let</span> <span onmouseout="hideTip(event, 'fs22', 41)" onmouseover="showTip(event, 'fs22', 41)" class="i">u</span> <span class="o">=</span> <span class="i">DenseVector</span><span class="o">.</span><span class="i">randomStandard</span><span class="o">&lt;</span><span onmouseout="hideTip(event, 'fs23', 42)" onmouseover="showTip(event, 'fs23', 42)" class="i">Complex</span><span class="o">&gt;</span> <span class="n">10</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs24', 43)" onmouseover="showTip(event, 'fs24', 43)" class="i">v</span> <span class="o">=</span> <span onmouseout="hideTip(event, 'fs22', 44)" onmouseover="showTip(event, 'fs22', 44)" class="i">u</span> <span class="o">|&gt;</span> <span class="i">Vector</span><span class="o">.</span><span class="i">map</span> (<span class="k">fun</span> <span class="i">c</span> <span class="k">-&gt;</span> <span class="i">c</span><span class="o">.</span><span class="i">Real</span>)
</code></pre></td>
</tr>
</table>
<pre class="fssnip highlighted"><code lang="fsharp"><span class="k">let</span> <span onmouseout="hideTip(event, 'fs22', 41)" onmouseover="showTip(event, 'fs22', 41)" class="id">u</span> <span class="o">=</span> <span class="id">DenseVector</span><span class="pn">.</span><span class="id">randomStandard</span><span class="pn">&lt;</span><span onmouseout="hideTip(event, 'fs23', 42)" onmouseover="showTip(event, 'fs23', 42)" class="id">Complex</span><span class="pn">&gt;</span> <span class="n">10</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs24', 43)" onmouseover="showTip(event, 'fs24', 43)" class="id">v</span> <span class="o">=</span> <span onmouseout="hideTip(event, 'fs22', 44)" onmouseover="showTip(event, 'fs22', 44)" class="id">u</span> <span class="o">|&gt;</span> <span onmouseout="hideTip(event, 'fs25', 45)" onmouseover="showTip(event, 'fs25', 45)" class="id">Vector</span><span class="pn">.</span><span class="id">map</span> <span class="pn">(</span><span class="k">fun</span> <span class="id">c</span> <span class="k">-&gt;</span> <span class="id">c</span><span class="pn">.</span><span class="id">Real</span><span class="pn">)</span>
</code></pre>
<h3><a name="Fold-and-Reduce" class="anchor" href="#Fold-and-Reduce">Fold and Reduce</a></h3>
<p>Matrices also provide column/row fold and reduce routines:</p>
<ul>
@ -708,43 +572,7 @@ in a reasonable way, without overflowing the output device on a large matrix.</p
file, but to give an informative summary about it. For data import/export,
use one of the MathNet.Numerics.Data packages instead.</p>
<p>Some matrix examples:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l"> 1: </span>
<span class="l"> 2: </span>
<span class="l"> 3: </span>
<span class="l"> 4: </span>
<span class="l"> 5: </span>
<span class="l"> 6: </span>
<span class="l"> 7: </span>
<span class="l"> 8: </span>
<span class="l"> 9: </span>
<span class="l">10: </span>
<span class="l">11: </span>
<span class="l">12: </span>
<span class="l">13: </span>
<span class="l">14: </span>
<span class="l">15: </span>
<span class="l">16: </span>
<span class="l">17: </span>
<span class="l">18: </span>
<span class="l">19: </span>
<span class="l">20: </span>
<span class="l">21: </span>
<span class="l">22: </span>
<span class="l">23: </span>
<span class="l">24: </span>
<span class="l">25: </span>
<span class="l">26: </span>
<span class="l">27: </span>
<span class="l">28: </span>
<span class="l">29: </span>
<span class="l">30: </span>
<span class="l">31: </span>
<span class="l">32: </span>
<span class="l">33: </span>
<span class="l">34: </span>
<span class="l">35: </span>
</pre></td>
<td class="snippet"><pre class="fssnip"><code lang="text">// Matrix&lt;double&gt;.Build.Dense(3,4,(i,j) =&gt; i*10*j).ToString()
<table class="pre"><tr><td class="snippet"><pre class="fssnip"><code lang="text">// Matrix&lt;double&gt;.Build.Dense(3,4,(i,j) =&gt; i*10*j).ToString()
DenseMatrix 3x4-Double
0 0 0 0
0 10 20 30
@ -781,37 +609,7 @@ SparseMatrix 4x100-Double 0.25% Filled
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .. 0 0
</code></pre></td></tr></table>
<p>Vectors are printed as a column that can wrap over to multiple columns if needed:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l"> 1: </span>
<span class="l"> 2: </span>
<span class="l"> 3: </span>
<span class="l"> 4: </span>
<span class="l"> 5: </span>
<span class="l"> 6: </span>
<span class="l"> 7: </span>
<span class="l"> 8: </span>
<span class="l"> 9: </span>
<span class="l">10: </span>
<span class="l">11: </span>
<span class="l">12: </span>
<span class="l">13: </span>
<span class="l">14: </span>
<span class="l">15: </span>
<span class="l">16: </span>
<span class="l">17: </span>
<span class="l">18: </span>
<span class="l">19: </span>
<span class="l">20: </span>
<span class="l">21: </span>
<span class="l">22: </span>
<span class="l">23: </span>
<span class="l">24: </span>
<span class="l">25: </span>
<span class="l">26: </span>
<span class="l">27: </span>
<span class="l">28: </span>
<span class="l">29: </span>
</pre></td>
<td class="snippet"><pre class="fssnip"><code lang="text">// Vector&lt;double&gt;.Build.Random(15).ToString()
<table class="pre"><tr><td class="snippet"><pre class="fssnip"><code lang="text">// Vector&lt;double&gt;.Build.Random(15).ToString()
DenseVector 15-Double
0.519184 0.0950414
1.65913 2.56783
@ -843,42 +641,7 @@ DenseVector 500-Double
</code></pre></td></tr></table>
<p>The format is customizable to some degree, for example we can choose the
floating point format and culture, or how many rows or columns should be shown:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l"> 1: </span>
<span class="l"> 2: </span>
<span class="l"> 3: </span>
<span class="l"> 4: </span>
<span class="l"> 5: </span>
<span class="l"> 6: </span>
<span class="l"> 7: </span>
<span class="l"> 8: </span>
<span class="l"> 9: </span>
<span class="l">10: </span>
<span class="l">11: </span>
<span class="l">12: </span>
<span class="l">13: </span>
<span class="l">14: </span>
<span class="l">15: </span>
<span class="l">16: </span>
<span class="l">17: </span>
<span class="l">18: </span>
<span class="l">19: </span>
<span class="l">20: </span>
<span class="l">21: </span>
<span class="l">22: </span>
<span class="l">23: </span>
<span class="l">24: </span>
<span class="l">25: </span>
<span class="l">26: </span>
<span class="l">27: </span>
<span class="l">28: </span>
<span class="l">29: </span>
<span class="l">30: </span>
<span class="l">31: </span>
<span class="l">32: </span>
<span class="l">33: </span>
<span class="l">34: </span>
</pre></td>
<td class="snippet"><pre class="fssnip"><code lang="text">// var m = Matrix&lt;double&gt;.Build.Random(5,100,42); // 42 = random seed
<table class="pre"><tr><td class="snippet"><pre class="fssnip"><code lang="text">// var m = Matrix&lt;double&gt;.Build.Random(5,100,42); // 42 = random seed
// m.ToString()
DenseMatrix 5x100-Double
@ -917,112 +680,99 @@ DenseMatrix 5x100-Double
to load the MathNet.Numerics.fsx script of the F# package. Besides loading
the assemblies it also adds proper FSI printers for both matrices and vectors.</p>
<div class="tip" id="fs1">val m1 : obj<br /><br />Full name: Matrix.m1</div>
<div class="tip" id="fs2">val v1 : obj<br /><br />Full name: Matrix.v1</div>
<div class="tip" id="fs3">val m2 : obj<br /><br />Full name: Matrix.m2</div>
<div class="tip" id="fs4">Multiple items<br />val float : value:&#39;T -&gt; float (requires member op_Explicit)<br /><br />Full name: Microsoft.FSharp.Core.Operators.float<br /><br />--------------------<br />type float = System.Double<br /><br />Full name: Microsoft.FSharp.Core.float<br /><br />--------------------<br />type float&lt;&#39;Measure&gt; = float<br /><br />Full name: Microsoft.FSharp.Core.float&lt;_&gt;</div>
<div class="tip" id="fs5">val m3 : obj<br /><br />Full name: Matrix.m3</div>
<div class="tip" id="fs6">val m4 : obj<br /><br />Full name: Matrix.m4</div>
<div class="tip" id="fs7">Multiple items<br />val float32 : value:&#39;T -&gt; float32 (requires member op_Explicit)<br /><br />Full name: Microsoft.FSharp.Core.Operators.float32<br /><br />--------------------<br />type float32 = System.Single<br /><br />Full name: Microsoft.FSharp.Core.float32<br /><br />--------------------<br />type float32&lt;&#39;Measure&gt; = float32<br /><br />Full name: Microsoft.FSharp.Core.float32&lt;_&gt;</div>
<div class="tip" id="fs8">val x : seq&lt;seq&lt;float&gt;&gt;<br /><br />Full name: Matrix.x</div>
<div class="tip" id="fs9">module Seq<br /><br />from Microsoft.FSharp.Collections</div>
<div class="tip" id="fs10">val init : count:int -&gt; initializer:(int -&gt; &#39;T) -&gt; seq&lt;&#39;T&gt;<br /><br />Full name: Microsoft.FSharp.Collections.Seq.init</div>
<div class="tip" id="fs11">val c : int</div>
<div class="tip" id="fs12">val r : int</div>
<div class="tip" id="fs13">val m5 : obj<br /><br />Full name: Matrix.m5</div>
<div class="tip" id="fs14">val m6 : obj<br /><br />Full name: Matrix.m6</div>
<div class="tip" id="fs15">val m7a : obj<br /><br />Full name: Matrix.m7a</div>
<div class="tip" id="fs16">val m7b : obj<br /><br />Full name: Matrix.m7b</div>
<div class="tip" id="fs17">val m : float<br /><br />Full name: Matrix.m</div>
<div class="tip" id="fs18">val v : float<br /><br />Full name: Matrix.v</div>
<div class="tip" id="fs19">val v&#39; : float<br /><br />Full name: Matrix.v&#39;</div>
<div class="tip" id="fs20">val m&#39; : float<br /><br />Full name: Matrix.m&#39;</div>
<div class="tip" id="fs21">val m : obj<br /><br />Full name: Matrix.m</div>
<div class="tip" id="fs22">val u : obj<br /><br />Full name: Matrix.u</div>
<div class="tip" id="fs23">Multiple items<br />type Complex =<br />&#160;&#160;struct<br />&#160;&#160;&#160;&#160;new : real:float * imaginary:float -&gt; Complex<br />&#160;&#160;&#160;&#160;member Equals : obj:obj -&gt; bool + 1 overload<br />&#160;&#160;&#160;&#160;member GetHashCode : unit -&gt; int<br />&#160;&#160;&#160;&#160;member Imaginary : float<br />&#160;&#160;&#160;&#160;member Magnitude : float<br />&#160;&#160;&#160;&#160;member Phase : float<br />&#160;&#160;&#160;&#160;member Real : float<br />&#160;&#160;&#160;&#160;member ToString : unit -&gt; string + 3 overloads<br />&#160;&#160;&#160;&#160;static val Zero : Complex<br />&#160;&#160;&#160;&#160;static val One : Complex<br />&#160;&#160;&#160;&#160;...<br />&#160;&#160;end<br /><br />Full name: System.Numerics.Complex<br /><br />--------------------<br />Complex()<br />Complex(real: float, imaginary: float) : unit</div>
<div class="tip" id="fs24">val v : obj<br /><br />Full name: Matrix.v</div>
</div>
<div class="span3">
<ul class="nav nav-list" id="menu">
<li class="nav-header">Math.NET Numerics</li>
<li><a href="https://numerics.mathdotnet.com/Packages.html">NuGet & Binaries</a></li>
<li><a href="https://numerics.mathdotnet.com/ReleaseNotes.html">Release Notes</a></li>
<li><a href="https://numerics.mathdotnet.com/License.html">MIT License</a></li>
<li><a href="https://numerics.mathdotnet.com/Compatibility.html">Platform Support</a></li>
<li><a href="https://numerics.mathdotnet.com/api/">Class Reference</a></li>
<li><a href="https://github.com/mathnet/mathnet-numerics/issues">Issues & Bugs</a></li>
<li><a href="https://numerics.mathdotnet.com/Users.html">Who is using Math.NET?</a></li>
<li class="nav-header">Contributing</li>
<li><a href="https://numerics.mathdotnet.com/Contributors.html">Contributors</a></li>
<li><a href="https://numerics.mathdotnet.com/Contributing.html">Contributing</a></li>
<li><a href="https://numerics.mathdotnet.com/Build.html">Build & Tools</a></li>
<li><a href="http://feedback.mathdotnet.com/forums/2060-math-net-numerics">Your Ideas</a></li>
<li class="nav-header">Getting Help</li>
<li><a href="https://discuss.mathdotnet.com/c/numerics">Discuss</a></li>
<li><a href="https://stackoverflow.com/questions/tagged/mathdotnet">Stack Overflow</a></li>
<li class="nav-header">Getting Started</li>
<li><a href="https://numerics.mathdotnet.com/">Getting started</a></li>
<li><a href="https://numerics.mathdotnet.com/Constants.html">Constants</a></li>
<li>Floating-Point Numbers</li>
<li>Arbitrary Precision Numbers</li>
<li>Complex Numbers</li>
<li><a href="https://numerics.mathdotnet.com/Matrix.html">Matrices and Vectors</a></li>
<li><a href="https://numerics.mathdotnet.com/Euclid.html">Euclid & Number Theory</a></li>
<li>Combinatorics</li>
<div class="fsdocs-tip" id="fs1">val m1 : obj</div>
<div class="fsdocs-tip" id="fs2">val v1 : obj</div>
<div class="fsdocs-tip" id="fs3">val m2 : obj</div>
<div class="fsdocs-tip" id="fs4">Multiple items<br />val float : value:&#39;T -&gt; float (requires member op_Explicit)<br /><em>&lt;summary&gt;Converts the argument to 64-bit float. This is a direct conversion for all
primitive numeric types. For strings, the input is converted using &lt;c&gt;Double.Parse()&lt;/c&gt;
with InvariantCulture settings. Otherwise the operation requires an appropriate
static conversion method on the input type.&lt;/summary&gt;<br />&lt;param name=&quot;value&quot;&gt;The input value.&lt;/param&gt;<br />&lt;returns&gt;The converted float&lt;/returns&gt;</em><br /><br />--------------------<br />[&lt;Struct&gt;]
type float = System.Double<br /><em>&lt;summary&gt;An abbreviation for the CLI type &lt;see cref=&quot;T:System.Double&quot; /&gt;.&lt;/summary&gt;<br />&lt;category&gt;Basic Types&lt;/category&gt;</em><br /><br />--------------------<br />type float&lt;&#39;Measure&gt; =
float<br /><em>&lt;summary&gt;The type of double-precision floating point numbers, annotated with a unit of measure.
The unit of measure is erased in compiled code and when values of this type
are analyzed using reflection. The type is representationally equivalent to
&lt;see cref=&quot;T:System.Double&quot; /&gt;.&lt;/summary&gt;<br />&lt;category index=&quot;6&quot;&gt;Basic Types with Units of Measure&lt;/category&gt;</em></div>
<div class="fsdocs-tip" id="fs5">val m3 : obj</div>
<div class="fsdocs-tip" id="fs6">val m4 : obj</div>
<div class="fsdocs-tip" id="fs7">Multiple items<br />val float32 : value:&#39;T -&gt; float32 (requires member op_Explicit)<br /><em>&lt;summary&gt;Converts the argument to 32-bit float. This is a direct conversion for all
primitive numeric types. For strings, the input is converted using &lt;c&gt;Single.Parse()&lt;/c&gt;
with InvariantCulture settings. Otherwise the operation requires an appropriate
static conversion method on the input type.&lt;/summary&gt;<br />&lt;param name=&quot;value&quot;&gt;The input value.&lt;/param&gt;<br />&lt;returns&gt;The converted float32&lt;/returns&gt;</em><br /><br />--------------------<br />[&lt;Struct&gt;]
type float32 = System.Single<br /><em>&lt;summary&gt;An abbreviation for the CLI type &lt;see cref=&quot;T:System.Single&quot; /&gt;.&lt;/summary&gt;<br />&lt;category&gt;Basic Types&lt;/category&gt;</em><br /><br />--------------------<br />type float32&lt;&#39;Measure&gt; =
float32<br /><em>&lt;summary&gt;The type of single-precision floating point numbers, annotated with a unit of measure.
The unit of measure is erased in compiled code and when values of this type
are analyzed using reflection. The type is representationally equivalent to
&lt;see cref=&quot;T:System.Single&quot; /&gt;.
&lt;/summary&gt;<br />&lt;category&gt;Basic Types with Units of Measure&lt;/category&gt;</em></div>
<div class="fsdocs-tip" id="fs8">val x : seq&lt;seq&lt;float&gt;&gt;</div>
<div class="fsdocs-tip" id="fs9">Modul Seq
aus Microsoft.FSharp.Collections<br /><em>&lt;summary&gt;Contains operations for working with values of type &lt;see cref=&quot;T:Microsoft.FSharp.Collections.seq`1&quot; /&gt;.&lt;/summary&gt;</em></div>
<div class="fsdocs-tip" id="fs10">val init : count:int -&gt; initializer:(int -&gt; &#39;T) -&gt; seq&lt;&#39;T&gt;<br /><em>&lt;summary&gt;Generates a new sequence which, when iterated, will return successive
elements by calling the given function, up to the given count. Each element is saved after its
initialization. The function is passed the index of the item being
generated.&lt;/summary&gt;<br />&lt;remarks&gt;The returned sequence may be passed between threads safely. However,
individual IEnumerator values generated from the returned sequence should not be accessed concurrently.&lt;/remarks&gt;<br />&lt;param name=&quot;count&quot;&gt;The maximum number of items to generate for the sequence.&lt;/param&gt;<br />&lt;param name=&quot;initializer&quot;&gt;A function that generates an item in the sequence from a given index.&lt;/param&gt;<br />&lt;returns&gt;The result sequence.&lt;/returns&gt;<br />&lt;exception cref=&quot;T:System.ArgumentException&quot;&gt;Thrown when count is negative.&lt;/exception&gt;</em></div>
<div class="fsdocs-tip" id="fs11">val c : int</div>
<div class="fsdocs-tip" id="fs12">val r : int</div>
<div class="fsdocs-tip" id="fs13">val m5 : obj</div>
<div class="fsdocs-tip" id="fs14">val m6 : obj</div>
<div class="fsdocs-tip" id="fs15">val m7a : obj</div>
<div class="fsdocs-tip" id="fs16">val m7b : obj</div>
<div class="fsdocs-tip" id="fs17">val m : float</div>
<div class="fsdocs-tip" id="fs18">val v : float</div>
<div class="fsdocs-tip" id="fs19">val v&#39; : float</div>
<div class="fsdocs-tip" id="fs20">val m&#39; : float</div>
<div class="fsdocs-tip" id="fs21">val m : obj</div>
<div class="fsdocs-tip" id="fs22">val u : obj</div>
<div class="fsdocs-tip" id="fs23">Multiple items<br />[&lt;Struct&gt;]
type Complex =
new : real: float * imaginary: float -&gt; unit
member Equals : value: Complex -&gt; bool + 1 &#220;berladung
member GetHashCode : unit -&gt; int
member ToString : unit -&gt; string + 3 &#220;berladungen
static member Abs : value: Complex -&gt; float
static member Acos : value: Complex -&gt; Complex
static member Add : left: float * right: Complex -&gt; Complex + 2 &#220;berladungen
static member Asin : value: Complex -&gt; Complex
static member Atan : value: Complex -&gt; Complex
static member Conjugate : value: Complex -&gt; Complex
...<br /><em>&lt;summary&gt;Represents a complex number.&lt;/summary&gt;</em><br /><br />--------------------<br />Complex ()<br />Complex(real: float, imaginary: float) : Complex</div>
<div class="fsdocs-tip" id="fs24">val v : obj</div>
<div class="fsdocs-tip" id="fs25">Multiple items<br />type Vector =
static member Abs&lt;&#39;T (requires default constructor and value type and &#39;T :&gt; ValueType)&gt; : value: Vector&lt;&#39;T&gt; -&gt; Vector&lt;&#39;T&gt;
static member Add&lt;&#39;T (requires default constructor and value type and &#39;T :&gt; ValueType)&gt; : left: Vector&lt;&#39;T&gt; * right: Vector&lt;&#39;T&gt; -&gt; Vector&lt;&#39;T&gt;
static member AndNot&lt;&#39;T (requires default constructor and value type and &#39;T :&gt; ValueType)&gt; : left: Vector&lt;&#39;T&gt; * right: Vector&lt;&#39;T&gt; -&gt; Vector&lt;&#39;T&gt;
static member AsVectorByte&lt;&#39;T (requires default constructor and value type and &#39;T :&gt; ValueType)&gt; : value: Vector&lt;&#39;T&gt; -&gt; Vector&lt;byte&gt;
static member AsVectorDouble&lt;&#39;T (requires default constructor and value type and &#39;T :&gt; ValueType)&gt; : value: Vector&lt;&#39;T&gt; -&gt; Vector&lt;float&gt;
static member AsVectorInt16&lt;&#39;T (requires default constructor and value type and &#39;T :&gt; ValueType)&gt; : value: Vector&lt;&#39;T&gt; -&gt; Vector&lt;int16&gt;
static member AsVectorInt32&lt;&#39;T (requires default constructor and value type and &#39;T :&gt; ValueType)&gt; : value: Vector&lt;&#39;T&gt; -&gt; Vector&lt;int&gt;
static member AsVectorInt64&lt;&#39;T (requires default constructor and value type and &#39;T :&gt; ValueType)&gt; : value: Vector&lt;&#39;T&gt; -&gt; Vector&lt;int64&gt;
static member AsVectorSByte&lt;&#39;T (requires default constructor and value type and &#39;T :&gt; ValueType)&gt; : value: Vector&lt;&#39;T&gt; -&gt; Vector&lt;sbyte&gt;
static member AsVectorSingle&lt;&#39;T (requires default constructor and value type and &#39;T :&gt; ValueType)&gt; : value: Vector&lt;&#39;T&gt; -&gt; Vector&lt;float32&gt;
...<br /><em>&lt;summary&gt;Provides a collection of static convenience methods for creating, manipulating, combining, and converting generic vectors.&lt;/summary&gt;</em><br /><br />--------------------<br />[&lt;Struct&gt;]
type Vector&lt;&#39;T (requires default constructor and value type and &#39;T :&gt; ValueType)&gt; =
new : values: ReadOnlySpan&lt;byte&gt; -&gt; unit + 5 &#220;berladungen
member CopyTo : destination: Span&lt;byte&gt; -&gt; unit + 3 &#220;berladungen
member Equals : other: Vector&lt;&#39;T&gt; -&gt; bool + 1 &#220;berladung
member GetHashCode : unit -&gt; int
member ToString : unit -&gt; string + 2 &#220;berladungen
member TryCopyTo : destination: Span&lt;byte&gt; -&gt; bool + 1 &#220;berladung
static member op_Addition : left: Vector&lt;&#39;T&gt; * right: Vector&lt;&#39;T&gt; -&gt; Vector&lt;&#39;T&gt;
static member op_BitwiseAnd : left: Vector&lt;&#39;T&gt; * right: Vector&lt;&#39;T&gt; -&gt; Vector&lt;&#39;T&gt;
static member op_BitwiseOr : left: Vector&lt;&#39;T&gt; * right: Vector&lt;&#39;T&gt; -&gt; Vector&lt;&#39;T&gt;
static member op_Division : left: Vector&lt;&#39;T&gt; * right: Vector&lt;&#39;T&gt; -&gt; Vector&lt;&#39;T&gt;
...<br /><em>&lt;summary&gt;Represents a single vector of a specified numeric type that is suitable for low-level optimization of parallel algorithms.&lt;/summary&gt;<br />&lt;typeparam name=&quot;T&quot;&gt;The vector type. &lt;c&gt;T&lt;/c&gt; can be any primitive numeric type.&lt;/typeparam&gt;</em><br /><br />--------------------<br />Vector ()<br />Vector(values: System.ReadOnlySpan&lt;byte&gt;) : Vector&lt;&#39;T&gt;<br />Vector(values: System.ReadOnlySpan&lt;&#39;T&gt;) : Vector&lt;&#39;T&gt;<br />Vector(values: System.Span&lt;&#39;T&gt;) : Vector&lt;&#39;T&gt;<br />Vector(value: &#39;T) : Vector&lt;&#39;T&gt;<br />Vector(values: &#39;T []) : Vector&lt;&#39;T&gt;<br />Vector(values: &#39;T [], index: int) : Vector&lt;&#39;T&gt;</div>
<li class="nav-header">Evaluation</li>
<li><a href="https://numerics.mathdotnet.com/Functions.html">Special Functions</a></li>
<li>Differentiation</li>
<li><a href="https://numerics.mathdotnet.com/Integration.html">Integration</a></li>
<li class="nav-header">Statistics/Probability</li>
<li><a href="https://numerics.mathdotnet.com/DescriptiveStatistics.html">Descriptive Statistics</a></li>
<li><a href="https://numerics.mathdotnet.com/Probability.html">Probability Distributions</a></li>
<li class="nav-header">Generation</li>
<li><a href="https://numerics.mathdotnet.com/Generate.html">Generating Data</a></li>
<li><a href="https://numerics.mathdotnet.com/Random.html">Random Numbers</a></li>
<li class="nav-header">Transformation</li>
<li>Fourier Transform (FFT)</li>
<li>Filtering & DSP</li>
<li>Window Functions</li>
<li class="nav-header">Solving Equations</li>
<li><a href="https://numerics.mathdotnet.com/LinearEquations.html">Linear Equation Systems</a></li>
<li>Nonlinear Root Finding</li>
<li class="nav-header">Optimization</li>
<li>Linear Least Squares</li>
<li>Nonlinear Optimization</li>
<li><a href="https://numerics.mathdotnet.com/Distance.html">Distance Metrics</a></li>
<li class="nav-header">Curve Fitting</li>
<li><a href="https://numerics.mathdotnet.com/Regression.html">Regression</a></li>
<li>Interpolation</li>
<li>Fourier Approximation</li>
<li class="nav-header">Native Providers</li>
<li><a href="https://numerics.mathdotnet.com/MKL.html">Intel MKL</a></li>
<li class="nav-header">Working Together</li>
<li><a href="https://numerics.mathdotnet.com/CSV.html">Delimited Text Files (CSV)</a></li>
<li><a href="https://numerics.mathdotnet.com/MatrixMarket.html">NIST MatrixMarket</a></li>
<li><a href="https://numerics.mathdotnet.com/MatlabFiles.html">MATLAB</a></li>
<li><a href="https://numerics.mathdotnet.com/IFSharpNotebook.html">IF# Notebook</a></li>
<li>FsLab & Deedle</li>
<li>Microsoft Excel</li>
<li>numl.net machine learning</li>
<li>R-project</li>
</ul>
</div>
</div>
</div>
</body>
<!-- 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>

291
MatrixMarket.html

@ -1,63 +1,138 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>NIST MatrixMarket Text Files
<head>
<meta charset="utf-8">
<title>NIST MatrixMarket Text Files
</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta name="description" content="Math.NET Numerics, providing methods and algorithms for numerical computations in science, engineering and every day use. .Net 4, .Net 3.5, SL5, Win8, WP8, PCL 47 and 136, Mono, Xamarin Android/iOS."/>
<meta name="author" content="Christoph Ruegg, Marcus Cuda, Jurgen Van Gael"/>
<script src="https://code.jquery.com/jquery-1.8.0.js"></script>
<script src="https://code.jquery.com/ui/1.8.23/jquery-ui.js"></script>
<script src="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/js/bootstrap.min.js"></script>
<link href="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap-combined.min.css" rel="stylesheet"/>
<link type="text/css" rel="stylesheet" href="https://numerics.mathdotnet.com/content/style.css" />
<style>
#main table:not(.pre) {
border: 1px solid #dddddd;
max-width: 100%;
border-style: solid;
border-width: 1px;
border-color: gray;
border-collapse: collapse;
border-right-width: 1px;
border-bottom-width: 1px;
margin-top: 15px;
margin-bottom: 25px;
}
#main table:not(.pre) th, #main table:not(.pre) td {
border: 1px solid #dddddd;
padding: 6px;
}
#main table:not(.pre) th p, #main table:not(.pre) td p {
margin-bottom: 5px;
}
</style>
<script type="text/javascript" src="https://numerics.mathdotnet.com/content/tips.js"></script>
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<![endif]-->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
</head>
<body>
<div class="container">
<div class="masthead">
<ul class="nav nav-pills pull-right">
<li><a href="https://www.mathdotnet.com">Math.NET Project</a></li>
<li><a href="https://numerics.mathdotnet.com">Math.NET Numerics</a></li>
<li><a href="https://github.com/mathnet/mathnet-numerics">GitHub</a></li>
</ul>
<h3 class="muted">Math.NET Numerics</h3>
<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>
<hr />
<div class="row">
<div class="span9" id="main">
<h1><a name="NIST-MatrixMarket-Text-Files" class="anchor" href="#NIST-MatrixMarket-Text-Files">NIST MatrixMarket Text Files</a></h1>
<!-- 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">Floating-Point Numbers</li>
<li class="nav-item">Arbitrary Precision Numbers</li>
<li class="nav-item">Complex Numbers</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">Differentiation</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">Transformation</li>
<li class="nav-item">Fourier Transform (FFT)</li>
<li class="nav-item">Filtering & DSP</li>
<li class="nav-item">Window Functions</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-item">Nonlinear Root Finding</li>
<li class="nav-header">Optimization</li>
<li class="nav-item">Linear Least Squares</li>
<li class="nav-item">Nonlinear 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-item">Interpolation</li>
<li class="nav-item">Fourier Approximation</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://www.mathdotnet.com">Math.NET Project</a> |
<a href="https://numerics.mathdotnet.com">Math.NET Numerics</a> |
<a href="https://github.com/mathnet/mathnet-numerics">GitHub</a>
</h3>
</div>
<hr />
<div class="container" id="fsdocs-content">
<h1><a name="NIST-MatrixMarket-Text-Files" class="anchor" href="#NIST-MatrixMarket-Text-Files">NIST MatrixMarket Text Files</a></h1>
<p>MatrixMarket is both a <a href="https://math.nist.gov/MatrixMarket/">vast repository of test data</a>
and a text-based <a href="https://math.nist.gov/MatrixMarket/formats.html">exchange file format</a> provided by NIST.
Being text-based makes it convenient to deal with and program against, and also works well with versioning
@ -78,11 +153,7 @@ you can use this method using a StringReader.
<p>All these functions expect the data type of the matrix to be generated as generic type argument.
Only Double, Single, Complex and Complex32 are supported.</p>
<p>Example:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">using</span> MathNet.Numerics.Data.Text;
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">using</span> MathNet.Numerics.Data.Text;
Matrix&lt;<span class="k">double</span>&gt; matrix <span class="o">=</span> MatrixMarketReader.ReadMatrix&lt;<span class="k">double</span>&gt;(<span class="s">"fidap007.mtx"</span>);
</code></pre></td></tr></table>
@ -90,9 +161,7 @@ Matrix&lt;<span class="k">double</span>&gt; matrix <span class="o">=</span> Matr
<p>The dual to the reader above is the <code>MatrixMarketWriter</code> class that can serialize a matrix or vector
to a MatrixMarket text file, stream or TextWriter.</p>
<p>Example:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp">MatrixMarketWriter.WriteMatrix(<span class="s">"matrix.mtx"</span>, m);
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp">MatrixMarketWriter.WriteMatrix(<span class="s">"matrix.mtx"</span>, m);
</code></pre></td></tr></table>
<h2><a name="Alternatives" class="anchor" href="#Alternatives">Alternatives</a></h2>
<p>The data extension packages also offer other ways to serialize a matrix to a binary stream or file.
@ -102,88 +171,16 @@ Among others:</p>
<li><a href="MatlabFiles.html">MATLAB Level-5 Mat files</a></li>
</ul>
</div>
<div class="span3">
<ul class="nav nav-list" id="menu">
<li class="nav-header">Math.NET Numerics</li>
<li><a href="https://numerics.mathdotnet.com/Packages.html">NuGet & Binaries</a></li>
<li><a href="https://numerics.mathdotnet.com/ReleaseNotes.html">Release Notes</a></li>
<li><a href="https://numerics.mathdotnet.com/License.html">MIT License</a></li>
<li><a href="https://numerics.mathdotnet.com/Compatibility.html">Platform Support</a></li>
<li><a href="https://numerics.mathdotnet.com/api/">Class Reference</a></li>
<li><a href="https://github.com/mathnet/mathnet-numerics/issues">Issues & Bugs</a></li>
<li><a href="https://numerics.mathdotnet.com/Users.html">Who is using Math.NET?</a></li>
<li class="nav-header">Contributing</li>
<li><a href="https://numerics.mathdotnet.com/Contributors.html">Contributors</a></li>
<li><a href="https://numerics.mathdotnet.com/Contributing.html">Contributing</a></li>
<li><a href="https://numerics.mathdotnet.com/Build.html">Build & Tools</a></li>
<li><a href="http://feedback.mathdotnet.com/forums/2060-math-net-numerics">Your Ideas</a></li>
<li class="nav-header">Getting Help</li>
<li><a href="https://discuss.mathdotnet.com/c/numerics">Discuss</a></li>
<li><a href="https://stackoverflow.com/questions/tagged/mathdotnet">Stack Overflow</a></li>
<li class="nav-header">Getting Started</li>
<li><a href="https://numerics.mathdotnet.com/">Getting started</a></li>
<li><a href="https://numerics.mathdotnet.com/Constants.html">Constants</a></li>
<li>Floating-Point Numbers</li>
<li>Arbitrary Precision Numbers</li>
<li>Complex Numbers</li>
<li><a href="https://numerics.mathdotnet.com/Matrix.html">Matrices and Vectors</a></li>
<li><a href="https://numerics.mathdotnet.com/Euclid.html">Euclid & Number Theory</a></li>
<li>Combinatorics</li>
<li class="nav-header">Evaluation</li>
<li><a href="https://numerics.mathdotnet.com/Functions.html">Special Functions</a></li>
<li>Differentiation</li>
<li><a href="https://numerics.mathdotnet.com/Integration.html">Integration</a></li>
<li class="nav-header">Statistics/Probability</li>
<li><a href="https://numerics.mathdotnet.com/DescriptiveStatistics.html">Descriptive Statistics</a></li>
<li><a href="https://numerics.mathdotnet.com/Probability.html">Probability Distributions</a></li>
<li class="nav-header">Generation</li>
<li><a href="https://numerics.mathdotnet.com/Generate.html">Generating Data</a></li>
<li><a href="https://numerics.mathdotnet.com/Random.html">Random Numbers</a></li>
<li class="nav-header">Transformation</li>
<li>Fourier Transform (FFT)</li>
<li>Filtering & DSP</li>
<li>Window Functions</li>
<li class="nav-header">Solving Equations</li>
<li><a href="https://numerics.mathdotnet.com/LinearEquations.html">Linear Equation Systems</a></li>
<li>Nonlinear Root Finding</li>
<li class="nav-header">Optimization</li>
<li>Linear Least Squares</li>
<li>Nonlinear Optimization</li>
<li><a href="https://numerics.mathdotnet.com/Distance.html">Distance Metrics</a></li>
<li class="nav-header">Curve Fitting</li>
<li><a href="https://numerics.mathdotnet.com/Regression.html">Regression</a></li>
<li>Interpolation</li>
<li>Fourier Approximation</li>
<li class="nav-header">Native Providers</li>
<li><a href="https://numerics.mathdotnet.com/MKL.html">Intel MKL</a></li>
<li class="nav-header">Working Together</li>
<li><a href="https://numerics.mathdotnet.com/CSV.html">Delimited Text Files (CSV)</a></li>
<li><a href="https://numerics.mathdotnet.com/MatrixMarket.html">NIST MatrixMarket</a></li>
<li><a href="https://numerics.mathdotnet.com/MatlabFiles.html">MATLAB</a></li>
<li><a href="https://numerics.mathdotnet.com/IFSharpNotebook.html">IF# Notebook</a></li>
<li>FsLab & Deedle</li>
<li>Microsoft Excel</li>
<li>numl.net machine learning</li>
<li>R-project</li>
</ul>
</div>
</div>
</div>
</body>
<!-- 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>

14
NuGet.config

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<solution>
<add key="disableSourceControlIntegration" value="true" />
</solution>
<packageSources>
<clear />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
<add key="dotnet3-dev" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet3.1/nuget/v3/index.json" />
<add key="dotnet-core" value="https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json" />
<add key="dotnet-tools" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json" />
<add key="PSGallery" value="https://www.powershellgallery.com/api/v2/" />
</packageSources>
</configuration>

281
Packages.html

@ -1,63 +1,138 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>NuGet Packages &amp; Binaries
<head>
<meta charset="utf-8">
<title>NuGet Packages &amp; Binaries
</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta name="description" content="Math.NET Numerics, providing methods and algorithms for numerical computations in science, engineering and every day use. .Net 4, .Net 3.5, SL5, Win8, WP8, PCL 47 and 136, Mono, Xamarin Android/iOS."/>
<meta name="author" content="Christoph Ruegg, Marcus Cuda, Jurgen Van Gael"/>
<script src="https://code.jquery.com/jquery-1.8.0.js"></script>
<script src="https://code.jquery.com/ui/1.8.23/jquery-ui.js"></script>
<script src="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/js/bootstrap.min.js"></script>
<link href="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap-combined.min.css" rel="stylesheet"/>
<link type="text/css" rel="stylesheet" href="https://numerics.mathdotnet.com/content/style.css" />
<style>
#main table:not(.pre) {
border: 1px solid #dddddd;
max-width: 100%;
border-style: solid;
border-width: 1px;
border-color: gray;
border-collapse: collapse;
border-right-width: 1px;
border-bottom-width: 1px;
margin-top: 15px;
margin-bottom: 25px;
}
#main table:not(.pre) th, #main table:not(.pre) td {
border: 1px solid #dddddd;
padding: 6px;
}
#main table:not(.pre) th p, #main table:not(.pre) td p {
margin-bottom: 5px;
}
</style>
<script type="text/javascript" src="https://numerics.mathdotnet.com/content/tips.js"></script>
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<![endif]-->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
</head>
<body>
<div class="container">
<div class="masthead">
<ul class="nav nav-pills pull-right">
<li><a href="https://www.mathdotnet.com">Math.NET Project</a></li>
<li><a href="https://numerics.mathdotnet.com">Math.NET Numerics</a></li>
<li><a href="https://github.com/mathnet/mathnet-numerics">GitHub</a></li>
</ul>
<h3 class="muted">Math.NET Numerics</h3>
<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>
<hr />
<div class="row">
<div class="span9" id="main">
<h1><a name="NuGet-Packages-amp-Binaries" class="anchor" href="#NuGet-Packages-amp-Binaries">NuGet Packages &amp; Binaries</a></h1>
<!-- 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">Floating-Point Numbers</li>
<li class="nav-item">Arbitrary Precision Numbers</li>
<li class="nav-item">Complex Numbers</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">Differentiation</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">Transformation</li>
<li class="nav-item">Fourier Transform (FFT)</li>
<li class="nav-item">Filtering & DSP</li>
<li class="nav-item">Window Functions</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-item">Nonlinear Root Finding</li>
<li class="nav-header">Optimization</li>
<li class="nav-item">Linear Least Squares</li>
<li class="nav-item">Nonlinear 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-item">Interpolation</li>
<li class="nav-item">Fourier Approximation</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://www.mathdotnet.com">Math.NET Project</a> |
<a href="https://numerics.mathdotnet.com">Math.NET Numerics</a> |
<a href="https://github.com/mathnet/mathnet-numerics">GitHub</a>
</h3>
</div>
<hr />
<div class="container" id="fsdocs-content">
<h1><a name="NuGet-Packages-amp-Binaries" class="anchor" href="#NuGet-Packages-amp-Binaries">NuGet Packages &amp; Binaries</a></h1>
<p>The recommended way to get Math.NET Numerics is NuGet. The following packages are
provided and maintained in the public <a href="https://nuget.org/profiles/mathnet/">NuGet Gallery</a>.
The complete set of Zip and NuGet packages including symbol packages is also available in the
@ -102,88 +177,16 @@ it may be easier to download the Zip file in the <a href="https://archive.mathdo
<li><a href="https://www.nuget.org/packages/MathNet.Numerics.Data.Matlab/"><strong>MathNet.Numerics.Data.Matlab</strong></a> - <a href="MatlabFiles.html">MATLAB Level-5</a> matrix file format.</li>
</ul>
</div>
<div class="span3">
<ul class="nav nav-list" id="menu">
<li class="nav-header">Math.NET Numerics</li>
<li><a href="https://numerics.mathdotnet.com/Packages.html">NuGet & Binaries</a></li>
<li><a href="https://numerics.mathdotnet.com/ReleaseNotes.html">Release Notes</a></li>
<li><a href="https://numerics.mathdotnet.com/License.html">MIT License</a></li>
<li><a href="https://numerics.mathdotnet.com/Compatibility.html">Platform Support</a></li>
<li><a href="https://numerics.mathdotnet.com/api/">Class Reference</a></li>
<li><a href="https://github.com/mathnet/mathnet-numerics/issues">Issues & Bugs</a></li>
<li><a href="https://numerics.mathdotnet.com/Users.html">Who is using Math.NET?</a></li>
<li class="nav-header">Contributing</li>
<li><a href="https://numerics.mathdotnet.com/Contributors.html">Contributors</a></li>
<li><a href="https://numerics.mathdotnet.com/Contributing.html">Contributing</a></li>
<li><a href="https://numerics.mathdotnet.com/Build.html">Build & Tools</a></li>
<li><a href="http://feedback.mathdotnet.com/forums/2060-math-net-numerics">Your Ideas</a></li>
<li class="nav-header">Getting Help</li>
<li><a href="https://discuss.mathdotnet.com/c/numerics">Discuss</a></li>
<li><a href="https://stackoverflow.com/questions/tagged/mathdotnet">Stack Overflow</a></li>
<li class="nav-header">Getting Started</li>
<li><a href="https://numerics.mathdotnet.com/">Getting started</a></li>
<li><a href="https://numerics.mathdotnet.com/Constants.html">Constants</a></li>
<li>Floating-Point Numbers</li>
<li>Arbitrary Precision Numbers</li>
<li>Complex Numbers</li>
<li><a href="https://numerics.mathdotnet.com/Matrix.html">Matrices and Vectors</a></li>
<li><a href="https://numerics.mathdotnet.com/Euclid.html">Euclid & Number Theory</a></li>
<li>Combinatorics</li>
<li class="nav-header">Evaluation</li>
<li><a href="https://numerics.mathdotnet.com/Functions.html">Special Functions</a></li>
<li>Differentiation</li>
<li><a href="https://numerics.mathdotnet.com/Integration.html">Integration</a></li>
<li class="nav-header">Statistics/Probability</li>
<li><a href="https://numerics.mathdotnet.com/DescriptiveStatistics.html">Descriptive Statistics</a></li>
<li><a href="https://numerics.mathdotnet.com/Probability.html">Probability Distributions</a></li>
<li class="nav-header">Generation</li>
<li><a href="https://numerics.mathdotnet.com/Generate.html">Generating Data</a></li>
<li><a href="https://numerics.mathdotnet.com/Random.html">Random Numbers</a></li>
<li class="nav-header">Transformation</li>
<li>Fourier Transform (FFT)</li>
<li>Filtering & DSP</li>
<li>Window Functions</li>
<li class="nav-header">Solving Equations</li>
<li><a href="https://numerics.mathdotnet.com/LinearEquations.html">Linear Equation Systems</a></li>
<li>Nonlinear Root Finding</li>
<li class="nav-header">Optimization</li>
<li>Linear Least Squares</li>
<li>Nonlinear Optimization</li>
<li><a href="https://numerics.mathdotnet.com/Distance.html">Distance Metrics</a></li>
<li class="nav-header">Curve Fitting</li>
<li><a href="https://numerics.mathdotnet.com/Regression.html">Regression</a></li>
<li>Interpolation</li>
<li>Fourier Approximation</li>
<li class="nav-header">Native Providers</li>
<li><a href="https://numerics.mathdotnet.com/MKL.html">Intel MKL</a></li>
<li class="nav-header">Working Together</li>
<li><a href="https://numerics.mathdotnet.com/CSV.html">Delimited Text Files (CSV)</a></li>
<li><a href="https://numerics.mathdotnet.com/MatrixMarket.html">NIST MatrixMarket</a></li>
<li><a href="https://numerics.mathdotnet.com/MatlabFiles.html">MATLAB</a></li>
<li><a href="https://numerics.mathdotnet.com/IFSharpNotebook.html">IF# Notebook</a></li>
<li>FsLab & Deedle</li>
<li>Microsoft Excel</li>
<li>numl.net machine learning</li>
<li>R-project</li>
</ul>
</div>
</div>
</div>
</body>
<!-- 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>

638
Probability.html

@ -1,63 +1,138 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>Probability Distributions
<head>
<meta charset="utf-8">
<title>Probability Distributions
</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta name="description" content="Math.NET Numerics, providing methods and algorithms for numerical computations in science, engineering and every day use. .Net 4, .Net 3.5, SL5, Win8, WP8, PCL 47 and 136, Mono, Xamarin Android/iOS."/>
<meta name="author" content="Christoph Ruegg, Marcus Cuda, Jurgen Van Gael"/>
<script src="https://code.jquery.com/jquery-1.8.0.js"></script>
<script src="https://code.jquery.com/ui/1.8.23/jquery-ui.js"></script>
<script src="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/js/bootstrap.min.js"></script>
<link href="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap-combined.min.css" rel="stylesheet"/>
<link type="text/css" rel="stylesheet" href="https://numerics.mathdotnet.com/content/style.css" />
<style>
#main table:not(.pre) {
border: 1px solid #dddddd;
max-width: 100%;
border-style: solid;
border-width: 1px;
border-color: gray;
border-collapse: collapse;
border-right-width: 1px;
border-bottom-width: 1px;
margin-top: 15px;
margin-bottom: 25px;
}
#main table:not(.pre) th, #main table:not(.pre) td {
border: 1px solid #dddddd;
padding: 6px;
}
#main table:not(.pre) th p, #main table:not(.pre) td p {
margin-bottom: 5px;
}
</style>
<script type="text/javascript" src="https://numerics.mathdotnet.com/content/tips.js"></script>
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<![endif]-->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
</head>
<body>
<div class="container">
<div class="masthead">
<ul class="nav nav-pills pull-right">
<li><a href="https://www.mathdotnet.com">Math.NET Project</a></li>
<li><a href="https://numerics.mathdotnet.com">Math.NET Numerics</a></li>
<li><a href="https://github.com/mathnet/mathnet-numerics">GitHub</a></li>
</ul>
<h3 class="muted">Math.NET Numerics</h3>
<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>
<hr />
<div class="row">
<div class="span9" id="main">
<h1><a name="Probability-Distributions" class="anchor" href="#Probability-Distributions">Probability Distributions</a></h1>
<!-- 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">Floating-Point Numbers</li>
<li class="nav-item">Arbitrary Precision Numbers</li>
<li class="nav-item">Complex Numbers</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">Differentiation</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">Transformation</li>
<li class="nav-item">Fourier Transform (FFT)</li>
<li class="nav-item">Filtering & DSP</li>
<li class="nav-item">Window Functions</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-item">Nonlinear Root Finding</li>
<li class="nav-header">Optimization</li>
<li class="nav-item">Linear Least Squares</li>
<li class="nav-item">Nonlinear 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-item">Interpolation</li>
<li class="nav-item">Fourier Approximation</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://www.mathdotnet.com">Math.NET Project</a> |
<a href="https://numerics.mathdotnet.com">Math.NET Numerics</a> |
<a href="https://github.com/mathnet/mathnet-numerics">GitHub</a>
</h3>
</div>
<hr />
<div class="container" id="fsdocs-content">
<h1><a name="Probability-Distributions" class="anchor" href="#Probability-Distributions">Probability Distributions</a></h1>
<p>Math.NET Numerics provides a wide range of probability distributions. Given the
distribution parameters they can be used to investigate their statistical properties
or to sample non-uniform random numbers.</p>
@ -67,26 +142,7 @@ at a given point, or to compute the mean, standard deviation and other propertie
Because it is often numerically more stable and faster to compute such statistical quantities
in the logarithmic domain, we also provide a selection of them in the log domain with the "Ln" suffix,
e.g. DensityLn for the logarithmic density.</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l"> 1: </span>
<span class="l"> 2: </span>
<span class="l"> 3: </span>
<span class="l"> 4: </span>
<span class="l"> 5: </span>
<span class="l"> 6: </span>
<span class="l"> 7: </span>
<span class="l"> 8: </span>
<span class="l"> 9: </span>
<span class="l">10: </span>
<span class="l">11: </span>
<span class="l">12: </span>
<span class="l">13: </span>
<span class="l">14: </span>
<span class="l">15: </span>
<span class="l">16: </span>
<span class="l">17: </span>
<span class="l">18: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">using</span> MathNet.Numerics.Distributions;
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">using</span> MathNet.Numerics.Distributions;
<span class="k">using</span> MathNet.Numerics.Random;
<span class="c">// create a parametrized distribution instance</span>
@ -107,11 +163,7 @@ e.g. DensityLn for the logarithmic density.</p>
</code></pre></td></tr></table>
<p>Both probability functions and sampling are also available as static functions
for simpler usage scenarios:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="c">// distribution parameters must be passed as arguments</span>
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="c">// distribution parameters must be passed as arguments</span>
<span class="k">double</span> a<span class="n">2</span> <span class="o">=</span> Gamma.PDF(<span class="n">2.0</span>, <span class="n">1.5</span>, <span class="n">2.3</span>);
<span class="k">double</span> randomSample<span class="n">2</span> <span class="o">=</span> Gamma.Sample(<span class="n">2.0</span>, <span class="n">1.5</span>);
</code></pre></td></tr></table>
@ -171,60 +223,33 @@ default constructor, read carefully which parameters it requires. For distributi
multiple ways are common there are also static methods, so you can use the one that fits best.
For example, a normal distribution is usually parametrized with mean and standard deviation,
but if you'd rather use mean and precision:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">var</span> normal <span class="o">=</span> Normal.WithMeanPrecision(<span class="n">0.0</span>, <span class="n">0.5</span>);
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">var</span> normal <span class="o">=</span> Normal.WithMeanPrecision(<span class="n">0.0</span>, <span class="n">0.5</span>);
</code></pre></td></tr></table>
<p>Since probability distributions can also be sampled to generate random numbers
with the configured distribution, all constructors optionally accept a random generator
as last argument.</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
<span class="l">4: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">var</span> gamma<span class="n">2</span> <span class="o">=</span> <span class="k">new</span> Gamma(<span class="n">2.0</span>, <span class="n">1.5</span>, <span class="k">new</span> MersenneTwister());
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">var</span> gamma<span class="n">2</span> <span class="o">=</span> <span class="k">new</span> Gamma(<span class="n">2.0</span>, <span class="n">1.5</span>, <span class="k">new</span> MersenneTwister());
<span class="c">// the random generator can also be replaced on an existing instance</span>
gamma<span class="n">2</span>.RandomSource <span class="o">=</span> <span class="k">new</span> Mrg<span class="n">32</span>k<span class="n">3</span>a();
</code></pre></td></tr></table>
<p>A few more examples, this time in F#:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
<span class="l">4: </span>
<span class="l">5: </span>
<span class="l">6: </span>
<span class="l">7: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="c">// some probability distributions</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs1', 1)" onmouseover="showTip(event, 'fs1', 1)" class="i">normal</span> <span class="o">=</span> <span class="i">Normal</span><span class="o">.</span><span class="i">WithMeanVariance</span>(<span class="n">3.0</span>, <span class="n">1.5</span>, <span class="i">a</span>)
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs2', 2)" onmouseover="showTip(event, 'fs2', 2)" class="i">exponential</span> <span class="o">=</span> <span class="i">Exponential</span>(<span class="n">2.4</span>)
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs3', 3)" onmouseover="showTip(event, 'fs3', 3)" class="i">gamma</span> <span class="o">=</span> <span class="i">Gamma</span>(<span class="n">2.0</span>, <span class="n">1.5</span>, <span class="i">Random</span><span class="o">.</span><span class="i">crypto</span>())
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs4', 4)" onmouseover="showTip(event, 'fs4', 4)" class="i">cauchy</span> <span class="o">=</span> <span class="i">Cauchy</span>(<span class="n">0.0</span>, <span class="n">1.0</span>, <span class="i">Random</span><span class="o">.</span><span class="i">mrg32k3aWith</span> <span class="n">10</span> <span class="k">false</span>)
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs5', 5)" onmouseover="showTip(event, 'fs5', 5)" class="i">poisson</span> <span class="o">=</span> <span class="i">Poisson</span>(<span class="n">3.0</span>)
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs6', 6)" onmouseover="showTip(event, 'fs6', 6)" class="i">geometric</span> <span class="o">=</span> <span class="i">Geometric</span>(<span class="n">0.8</span>, <span class="i">Random</span><span class="o">.</span><span class="i">system</span>())
</code></pre></td>
</tr>
</table>
<pre class="fssnip highlighted"><code lang="fsharp"><span class="c">// some probability distributions</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs1', 1)" onmouseover="showTip(event, 'fs1', 1)" class="id">normal</span> <span class="o">=</span> <span class="id">Normal</span><span class="pn">.</span><span class="id">WithMeanVariance</span><span class="pn">(</span><span class="n">3.0</span><span class="pn">,</span> <span class="n">1.5</span><span class="pn">,</span> <span class="id">a</span><span class="pn">)</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs2', 2)" onmouseover="showTip(event, 'fs2', 2)" class="id">exponential</span> <span class="o">=</span> <span class="id">Exponential</span><span class="pn">(</span><span class="n">2.4</span><span class="pn">)</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs3', 3)" onmouseover="showTip(event, 'fs3', 3)" class="id">gamma</span> <span class="o">=</span> <span class="id">Gamma</span><span class="pn">(</span><span class="n">2.0</span><span class="pn">,</span> <span class="n">1.5</span><span class="pn">,</span> <span class="id">Random</span><span class="pn">.</span><span class="id">crypto</span><span class="pn">(</span><span class="pn">)</span><span class="pn">)</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs4', 4)" onmouseover="showTip(event, 'fs4', 4)" class="id">cauchy</span> <span class="o">=</span> <span class="id">Cauchy</span><span class="pn">(</span><span class="n">0.0</span><span class="pn">,</span> <span class="n">1.0</span><span class="pn">,</span> <span class="id">Random</span><span class="pn">.</span><span class="id">mrg32k3aWith</span> <span class="n">10</span> <span class="k">false</span><span class="pn">)</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs5', 5)" onmouseover="showTip(event, 'fs5', 5)" class="id">poisson</span> <span class="o">=</span> <span class="id">Poisson</span><span class="pn">(</span><span class="n">3.0</span><span class="pn">)</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs6', 6)" onmouseover="showTip(event, 'fs6', 6)" class="id">geometric</span> <span class="o">=</span> <span class="id">Geometric</span><span class="pn">(</span><span class="n">0.8</span><span class="pn">,</span> <span class="id">Random</span><span class="pn">.</span><span class="id">system</span><span class="pn">(</span><span class="pn">)</span><span class="pn">)</span>
</code></pre>
<p>Some of the distributions also have routines for maximum-likelihood parameter
estimation from a set of samples:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="k">let</span> <span onmouseout="hideTip(event, 'fs7', 7)" onmouseover="showTip(event, 'fs7', 7)" class="i">estimation</span> <span class="o">=</span> <span class="i">LogNormal</span><span class="o">.</span><span class="i">Estimate</span>([| <span class="n">2.0</span>; <span class="n">1.5</span>; <span class="n">2.1</span>; <span class="n">1.2</span>; <span class="n">3.0</span>; <span class="n">2.4</span>; <span class="n">1.8</span> |])
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs8', 8)" onmouseover="showTip(event, 'fs8', 8)" class="i">mean</span>, <span onmouseout="hideTip(event, 'fs9', 9)" onmouseover="showTip(event, 'fs9', 9)" class="i">variance</span> <span class="o">=</span> <span onmouseout="hideTip(event, 'fs7', 10)" onmouseover="showTip(event, 'fs7', 10)" class="i">estimation</span><span class="o">.</span><span class="i">Mean</span>, <span onmouseout="hideTip(event, 'fs7', 11)" onmouseover="showTip(event, 'fs7', 11)" class="i">estimation</span><span class="o">.</span><span class="i">Variance</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs10', 12)" onmouseover="showTip(event, 'fs10', 12)" class="i">moreSamples</span> <span class="o">=</span> <span onmouseout="hideTip(event, 'fs7', 13)" onmouseover="showTip(event, 'fs7', 13)" class="i">estimation</span><span class="o">.</span><span class="i">Samples</span>() <span class="o">|&gt;</span> <span onmouseout="hideTip(event, 'fs11', 14)" onmouseover="showTip(event, 'fs11', 14)" class="t">Seq</span><span class="o">.</span><span onmouseout="hideTip(event, 'fs12', 15)" onmouseover="showTip(event, 'fs12', 15)" class="f">take</span> <span class="n">10</span> <span class="o">|&gt;</span> <span onmouseout="hideTip(event, 'fs11', 16)" onmouseover="showTip(event, 'fs11', 16)" class="t">Seq</span><span class="o">.</span><span onmouseout="hideTip(event, 'fs13', 17)" onmouseover="showTip(event, 'fs13', 17)" class="f">toArray</span>
</code></pre></td>
</tr>
</table>
<pre class="fssnip highlighted"><code lang="fsharp"><span class="k">let</span> <span onmouseout="hideTip(event, 'fs7', 7)" onmouseover="showTip(event, 'fs7', 7)" class="id">estimation</span> <span class="o">=</span> <span class="id">LogNormal</span><span class="pn">.</span><span class="id">Estimate</span><span class="pn">(</span><span class="pn">[|</span> <span class="n">2.0</span><span class="pn">;</span> <span class="n">1.5</span><span class="pn">;</span> <span class="n">2.1</span><span class="pn">;</span> <span class="n">1.2</span><span class="pn">;</span> <span class="n">3.0</span><span class="pn">;</span> <span class="n">2.4</span><span class="pn">;</span> <span class="n">1.8</span> <span class="pn">|]</span><span class="pn">)</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs8', 8)" onmouseover="showTip(event, 'fs8', 8)" class="id">mean</span><span class="pn">,</span> <span onmouseout="hideTip(event, 'fs9', 9)" onmouseover="showTip(event, 'fs9', 9)" class="id">variance</span> <span class="o">=</span> <span onmouseout="hideTip(event, 'fs7', 10)" onmouseover="showTip(event, 'fs7', 10)" class="id">estimation</span><span class="pn">.</span><span class="id">Mean</span><span class="pn">,</span> <span onmouseout="hideTip(event, 'fs7', 11)" onmouseover="showTip(event, 'fs7', 11)" class="id">estimation</span><span class="pn">.</span><span class="id">Variance</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs10', 12)" onmouseover="showTip(event, 'fs10', 12)" class="id">moreSamples</span> <span class="o">=</span> <span onmouseout="hideTip(event, 'fs7', 13)" onmouseover="showTip(event, 'fs7', 13)" class="id">estimation</span><span class="pn">.</span><span class="id">Samples</span><span class="pn">(</span><span class="pn">)</span> <span class="o">|&gt;</span> <span onmouseout="hideTip(event, 'fs11', 14)" onmouseover="showTip(event, 'fs11', 14)" class="m">Seq</span><span class="pn">.</span><span onmouseout="hideTip(event, 'fs12', 15)" onmouseover="showTip(event, 'fs12', 15)" class="id">take</span> <span class="n">10</span> <span class="o">|&gt;</span> <span onmouseout="hideTip(event, 'fs11', 16)" onmouseover="showTip(event, 'fs11', 16)" class="m">Seq</span><span class="pn">.</span><span onmouseout="hideTip(event, 'fs13', 17)" onmouseover="showTip(event, 'fs13', 17)" class="id">toArray</span>
</code></pre>
<p>or in C#:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp">LogNormal estimation <span class="o">=</span> LogNormal.Estimate(<span class="k">new</span> [] {<span class="n">2.0</span>, <span class="n">1.5</span>, <span class="n">2.1</span>, <span class="n">1.2</span>, <span class="n">3.0</span>, <span class="n">2.4</span>, <span class="n">1.8</span>});
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp">LogNormal estimation <span class="o">=</span> LogNormal.Estimate(<span class="k">new</span> [] {<span class="n">2.0</span>, <span class="n">1.5</span>, <span class="n">2.1</span>, <span class="n">1.2</span>, <span class="n">3.0</span>, <span class="n">2.4</span>, <span class="n">1.8</span>});
<span class="k">double</span> mean <span class="o">=</span> estimation.Mean, variance <span class="o">=</span> estimation.Variance;
<span class="k">double</span>[] moreSamples <span class="o">=</span> estimation.Samples().Take(<span class="n">10</span>).ToArray();
</code></pre></td></tr></table>
@ -234,289 +259,166 @@ These random variate generators work by accessing the distribution's member Rand
to provide uniform random numbers. By default, this member is an instance of System.Random
but one can easily replace this with more sophisticated random number generators from
<code>MathNet.Numerics.Random</code> (see <a href="Random.html">Random Numbers</a> for details).</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l"> 1: </span>
<span class="l"> 2: </span>
<span class="l"> 3: </span>
<span class="l"> 4: </span>
<span class="l"> 5: </span>
<span class="l"> 6: </span>
<span class="l"> 7: </span>
<span class="l"> 8: </span>
<span class="l"> 9: </span>
<span class="l">10: </span>
<span class="l">11: </span>
<span class="l">12: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="c">// sample some random numbers from these distributions</span>
<pre class="fssnip highlighted"><code lang="fsharp"><span class="c">// sample some random numbers from these distributions</span>
<span class="c">// continuous distributions sample to floating-point numbers:</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs14', 18)" onmouseover="showTip(event, 'fs14', 18)" class="i">continuous</span> <span class="o">=</span>
[ <span class="k">yield</span> <span onmouseout="hideTip(event, 'fs1', 19)" onmouseover="showTip(event, 'fs1', 19)" class="i">normal</span><span class="o">.</span><span class="i">Sample</span>()
<span class="k">yield</span> <span onmouseout="hideTip(event, 'fs2', 20)" onmouseover="showTip(event, 'fs2', 20)" class="i">exponential</span><span class="o">.</span><span class="i">Sample</span>()
<span class="k">yield!</span> <span onmouseout="hideTip(event, 'fs3', 21)" onmouseover="showTip(event, 'fs3', 21)" class="i">gamma</span><span class="o">.</span><span class="i">Samples</span>() <span class="o">|&gt;</span> <span onmouseout="hideTip(event, 'fs11', 22)" onmouseover="showTip(event, 'fs11', 22)" class="t">Seq</span><span class="o">.</span><span onmouseout="hideTip(event, 'fs12', 23)" onmouseover="showTip(event, 'fs12', 23)" class="f">take</span> <span class="n">10</span> ]
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs14', 18)" onmouseover="showTip(event, 'fs14', 18)" class="id">continuous</span> <span class="o">=</span>
<span class="pn">[</span> <span class="k">yield</span> <span onmouseout="hideTip(event, 'fs1', 19)" onmouseover="showTip(event, 'fs1', 19)" class="id">normal</span><span class="pn">.</span><span class="id">Sample</span><span class="pn">(</span><span class="pn">)</span>
<span class="k">yield</span> <span onmouseout="hideTip(event, 'fs2', 20)" onmouseover="showTip(event, 'fs2', 20)" class="id">exponential</span><span class="pn">.</span><span class="id">Sample</span><span class="pn">(</span><span class="pn">)</span>
<span class="k">yield!</span> <span onmouseout="hideTip(event, 'fs3', 21)" onmouseover="showTip(event, 'fs3', 21)" class="id">gamma</span><span class="pn">.</span><span class="id">Samples</span><span class="pn">(</span><span class="pn">)</span> <span class="o">|&gt;</span> <span onmouseout="hideTip(event, 'fs11', 22)" onmouseover="showTip(event, 'fs11', 22)" class="m">Seq</span><span class="pn">.</span><span onmouseout="hideTip(event, 'fs12', 23)" onmouseover="showTip(event, 'fs12', 23)" class="id">take</span> <span class="n">10</span> <span class="pn">]</span>
<span class="c">// discrete distributions on the other hand sample to integers:</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs15', 24)" onmouseover="showTip(event, 'fs15', 24)" class="i">discrete</span> <span class="o">=</span>
[ <span onmouseout="hideTip(event, 'fs5', 25)" onmouseover="showTip(event, 'fs5', 25)" class="i">poisson</span><span class="o">.</span><span class="i">Sample</span>()
<span onmouseout="hideTip(event, 'fs5', 26)" onmouseover="showTip(event, 'fs5', 26)" class="i">poisson</span><span class="o">.</span><span class="i">Sample</span>()
<span onmouseout="hideTip(event, 'fs6', 27)" onmouseover="showTip(event, 'fs6', 27)" class="i">geometric</span><span class="o">.</span><span class="i">Sample</span>() ]
</code></pre></td>
</tr>
</table>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs15', 24)" onmouseover="showTip(event, 'fs15', 24)" class="id">discrete</span> <span class="o">=</span>
<span class="pn">[</span> <span onmouseout="hideTip(event, 'fs5', 25)" onmouseover="showTip(event, 'fs5', 25)" class="id">poisson</span><span class="pn">.</span><span class="id">Sample</span><span class="pn">(</span><span class="pn">)</span>
<span onmouseout="hideTip(event, 'fs5', 26)" onmouseover="showTip(event, 'fs5', 26)" class="id">poisson</span><span class="pn">.</span><span class="id">Sample</span><span class="pn">(</span><span class="pn">)</span>
<span onmouseout="hideTip(event, 'fs6', 27)" onmouseover="showTip(event, 'fs6', 27)" class="id">geometric</span><span class="pn">.</span><span class="id">Sample</span><span class="pn">(</span><span class="pn">)</span> <span class="pn">]</span>
</code></pre>
<p>Instead of creating a distribution object we can also sample directly with static functions.
Note that no intermediate value caching is possible this way and parameters must be validated on each call.</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
<span class="l">4: </span>
<span class="l">5: </span>
<span class="l">6: </span>
<span class="l">7: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="c">// using the default number generator (SystemRandomSource.Default)</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs16', 28)" onmouseover="showTip(event, 'fs16', 28)" class="i">w</span> <span class="o">=</span> <span class="i">Rayleigh</span><span class="o">.</span><span class="i">Sample</span>(<span class="n">1.5</span>)
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs17', 29)" onmouseover="showTip(event, 'fs17', 29)" class="i">x</span> <span class="o">=</span> <span class="i">Hypergeometric</span><span class="o">.</span><span class="i">Sample</span>(<span class="n">100</span>, <span class="n">20</span>, <span class="n">5</span>)
<pre class="fssnip highlighted"><code lang="fsharp"><span class="c">// using the default number generator (SystemRandomSource.Default)</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs16', 28)" onmouseover="showTip(event, 'fs16', 28)" class="id">w</span> <span class="o">=</span> <span class="id">Rayleigh</span><span class="pn">.</span><span class="id">Sample</span><span class="pn">(</span><span class="n">1.5</span><span class="pn">)</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs17', 29)" onmouseover="showTip(event, 'fs17', 29)" class="id">x</span> <span class="o">=</span> <span class="id">Hypergeometric</span><span class="pn">.</span><span class="id">Sample</span><span class="pn">(</span><span class="n">100</span><span class="pn">,</span> <span class="n">20</span><span class="pn">,</span> <span class="n">5</span><span class="pn">)</span>
<span class="c">// or by manually providing the uniform random number generator</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs18', 30)" onmouseover="showTip(event, 'fs18', 30)" class="i">u</span> <span class="o">=</span> <span class="i">Normal</span><span class="o">.</span><span class="i">Sample</span>(<span class="i">Random</span><span class="o">.</span><span class="i">system</span>(), <span class="n">2.0</span>, <span class="n">4.0</span>)
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs19', 31)" onmouseover="showTip(event, 'fs19', 31)" class="i">v</span> <span class="o">=</span> <span class="i">Laplace</span><span class="o">.</span><span class="i">Samples</span>(<span class="i">Random</span><span class="o">.</span><span class="i">mersenneTwister</span>(), <span class="n">1.0</span>, <span class="n">3.0</span>) <span class="o">|&gt;</span> <span onmouseout="hideTip(event, 'fs11', 32)" onmouseover="showTip(event, 'fs11', 32)" class="t">Seq</span><span class="o">.</span><span onmouseout="hideTip(event, 'fs12', 33)" onmouseover="showTip(event, 'fs12', 33)" class="f">take</span> <span class="n">100</span> <span class="o">|&gt;</span> <span onmouseout="hideTip(event, 'fs20', 34)" onmouseover="showTip(event, 'fs20', 34)" class="t">List</span><span class="o">.</span><span onmouseout="hideTip(event, 'fs21', 35)" onmouseover="showTip(event, 'fs21', 35)" class="f">ofSeq</span>
</code></pre></td>
</tr>
</table>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs18', 30)" onmouseover="showTip(event, 'fs18', 30)" class="id">u</span> <span class="o">=</span> <span class="id">Normal</span><span class="pn">.</span><span class="id">Sample</span><span class="pn">(</span><span class="id">Random</span><span class="pn">.</span><span class="id">system</span><span class="pn">(</span><span class="pn">)</span><span class="pn">,</span> <span class="n">2.0</span><span class="pn">,</span> <span class="n">4.0</span><span class="pn">)</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs19', 31)" onmouseover="showTip(event, 'fs19', 31)" class="id">v</span> <span class="o">=</span> <span class="id">Laplace</span><span class="pn">.</span><span class="id">Samples</span><span class="pn">(</span><span class="id">Random</span><span class="pn">.</span><span class="id">mersenneTwister</span><span class="pn">(</span><span class="pn">)</span><span class="pn">,</span> <span class="n">1.0</span><span class="pn">,</span> <span class="n">3.0</span><span class="pn">)</span> <span class="o">|&gt;</span> <span onmouseout="hideTip(event, 'fs11', 32)" onmouseover="showTip(event, 'fs11', 32)" class="m">Seq</span><span class="pn">.</span><span onmouseout="hideTip(event, 'fs12', 33)" onmouseover="showTip(event, 'fs12', 33)" class="id">take</span> <span class="n">100</span> <span class="o">|&gt;</span> <span onmouseout="hideTip(event, 'fs20', 34)" onmouseover="showTip(event, 'fs20', 34)" class="m">List</span><span class="pn">.</span><span onmouseout="hideTip(event, 'fs21', 35)" onmouseover="showTip(event, 'fs21', 35)" class="id">ofSeq</span>
</code></pre>
<p>If you need to sample not just one or two values but a large number of them,
there are routines that either fill an existing array or return an enumerable.
The variant that fills an array is generally the fastest. Routines to sample
more than one value use the plural form <code>Samples</code> instead of <code>Sample</code>.</p>
<p>Let's sample 100'000 values from a laplace distribution with mean 1.0 and scale 2.0 in C#:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">var</span> samples <span class="o">=</span> <span class="k">new</span> <span class="k">double</span>[<span class="n">100000</span>];
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">var</span> samples <span class="o">=</span> <span class="k">new</span> <span class="k">double</span>[<span class="n">100000</span>];
Laplace.Samples(samples, <span class="n">1.0</span>, <span class="n">2.0</span>);
</code></pre></td></tr></table>
<p>Let's do some random walks in F# (TODO: Graph):</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span onmouseout="hideTip(event, 'fs11', 36)" onmouseover="showTip(event, 'fs11', 36)" class="t">Seq</span><span class="o">.</span><span onmouseout="hideTip(event, 'fs22', 37)" onmouseover="showTip(event, 'fs22', 37)" class="f">scan</span> (<span class="o">+</span>) <span class="n">0.0</span> (<span class="i">Normal</span><span class="o">.</span><span class="i">Samples</span>(<span class="n">0.0</span>, <span class="n">1.0</span>)) <span class="o">|&gt;</span> <span onmouseout="hideTip(event, 'fs11', 38)" onmouseover="showTip(event, 'fs11', 38)" class="t">Seq</span><span class="o">.</span><span onmouseout="hideTip(event, 'fs12', 39)" onmouseover="showTip(event, 'fs12', 39)" class="f">take</span> <span class="n">10</span> <span class="o">|&gt;</span> <span onmouseout="hideTip(event, 'fs11', 40)" onmouseover="showTip(event, 'fs11', 40)" class="t">Seq</span><span class="o">.</span><span onmouseout="hideTip(event, 'fs13', 41)" onmouseover="showTip(event, 'fs13', 41)" class="f">toArray</span>
<span onmouseout="hideTip(event, 'fs11', 42)" onmouseover="showTip(event, 'fs11', 42)" class="t">Seq</span><span class="o">.</span><span onmouseout="hideTip(event, 'fs22', 43)" onmouseover="showTip(event, 'fs22', 43)" class="f">scan</span> (<span class="o">+</span>) <span class="n">0.0</span> (<span class="i">Cauchy</span><span class="o">.</span><span class="i">Samples</span>(<span class="n">0.0</span>, <span class="n">1.0</span>)) <span class="o">|&gt;</span> <span onmouseout="hideTip(event, 'fs11', 44)" onmouseover="showTip(event, 'fs11', 44)" class="t">Seq</span><span class="o">.</span><span onmouseout="hideTip(event, 'fs12', 45)" onmouseover="showTip(event, 'fs12', 45)" class="f">take</span> <span class="n">10</span> <span class="o">|&gt;</span> <span onmouseout="hideTip(event, 'fs11', 46)" onmouseover="showTip(event, 'fs11', 46)" class="t">Seq</span><span class="o">.</span><span onmouseout="hideTip(event, 'fs13', 47)" onmouseover="showTip(event, 'fs13', 47)" class="f">toArray</span>
</code></pre></td>
</tr>
</table>
<pre class="fssnip highlighted"><code lang="fsharp"><span onmouseout="hideTip(event, 'fs11', 36)" onmouseover="showTip(event, 'fs11', 36)" class="m">Seq</span><span class="pn">.</span><span onmouseout="hideTip(event, 'fs22', 37)" onmouseover="showTip(event, 'fs22', 37)" class="id">scan</span> <span class="pn">(</span><span class="o">+</span><span class="pn">)</span> <span class="n">0.0</span> <span class="pn">(</span><span class="id">Normal</span><span class="pn">.</span><span class="id">Samples</span><span class="pn">(</span><span class="n">0.0</span><span class="pn">,</span> <span class="n">1.0</span><span class="pn">)</span><span class="pn">)</span> <span class="o">|&gt;</span> <span onmouseout="hideTip(event, 'fs11', 38)" onmouseover="showTip(event, 'fs11', 38)" class="m">Seq</span><span class="pn">.</span><span onmouseout="hideTip(event, 'fs12', 39)" onmouseover="showTip(event, 'fs12', 39)" class="id">take</span> <span class="n">10</span> <span class="o">|&gt;</span> <span onmouseout="hideTip(event, 'fs11', 40)" onmouseover="showTip(event, 'fs11', 40)" class="m">Seq</span><span class="pn">.</span><span onmouseout="hideTip(event, 'fs13', 41)" onmouseover="showTip(event, 'fs13', 41)" class="id">toArray</span>
<span onmouseout="hideTip(event, 'fs11', 42)" onmouseover="showTip(event, 'fs11', 42)" class="m">Seq</span><span class="pn">.</span><span onmouseout="hideTip(event, 'fs22', 43)" onmouseover="showTip(event, 'fs22', 43)" class="id">scan</span> <span class="pn">(</span><span class="o">+</span><span class="pn">)</span> <span class="n">0.0</span> <span class="pn">(</span><span class="id">Cauchy</span><span class="pn">.</span><span class="id">Samples</span><span class="pn">(</span><span class="n">0.0</span><span class="pn">,</span> <span class="n">1.0</span><span class="pn">)</span><span class="pn">)</span> <span class="o">|&gt;</span> <span onmouseout="hideTip(event, 'fs11', 44)" onmouseover="showTip(event, 'fs11', 44)" class="m">Seq</span><span class="pn">.</span><span onmouseout="hideTip(event, 'fs12', 45)" onmouseover="showTip(event, 'fs12', 45)" class="id">take</span> <span class="n">10</span> <span class="o">|&gt;</span> <span onmouseout="hideTip(event, 'fs11', 46)" onmouseover="showTip(event, 'fs11', 46)" class="m">Seq</span><span class="pn">.</span><span onmouseout="hideTip(event, 'fs13', 47)" onmouseover="showTip(event, 'fs13', 47)" class="id">toArray</span>
</code></pre>
<h2><a name="Distribution-Functions-and-Properties" class="anchor" href="#Distribution-Functions-and-Properties">Distribution Functions and Properties</a></h2>
<p>Distributions can not just be used to generate non-uniform random samples.
Once parametrized they can compute a variety of distribution properties
or evaluate distribution functions. Because it is often numerically more stable
and faster to compute and work with such quantities in the logarithmic domain,
some of them are also available with the <code>Ln</code>-suffix.</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l"> 1: </span>
<span class="l"> 2: </span>
<span class="l"> 3: </span>
<span class="l"> 4: </span>
<span class="l"> 5: </span>
<span class="l"> 6: </span>
<span class="l"> 7: </span>
<span class="l"> 8: </span>
<span class="l"> 9: </span>
<span class="l">10: </span>
<span class="l">11: </span>
<span class="l">12: </span>
<span class="l">13: </span>
<span class="l">14: </span>
<span class="l">15: </span>
<span class="l">16: </span>
<span class="l">17: </span>
<span class="l">18: </span>
<span class="l">19: </span>
<span class="l">20: </span>
<span class="l">21: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="c">// distribution properties of the gamma we&#39;ve configured above</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs23', 48)" onmouseover="showTip(event, 'fs23', 48)" class="i">gammaStats</span> <span class="o">=</span>
( <span onmouseout="hideTip(event, 'fs3', 49)" onmouseover="showTip(event, 'fs3', 49)" class="i">gamma</span><span class="o">.</span><span class="i">Mean</span>,
<span onmouseout="hideTip(event, 'fs3', 50)" onmouseover="showTip(event, 'fs3', 50)" class="i">gamma</span><span class="o">.</span><span class="i">Variance</span>,
<span onmouseout="hideTip(event, 'fs3', 51)" onmouseover="showTip(event, 'fs3', 51)" class="i">gamma</span><span class="o">.</span><span class="i">StdDev</span>,
<span onmouseout="hideTip(event, 'fs3', 52)" onmouseover="showTip(event, 'fs3', 52)" class="i">gamma</span><span class="o">.</span><span class="i">Entropy</span>,
<span onmouseout="hideTip(event, 'fs3', 53)" onmouseover="showTip(event, 'fs3', 53)" class="i">gamma</span><span class="o">.</span><span class="i">Skewness</span>,
<span onmouseout="hideTip(event, 'fs3', 54)" onmouseover="showTip(event, 'fs3', 54)" class="i">gamma</span><span class="o">.</span><span class="i">Mode</span> )
<pre class="fssnip highlighted"><code lang="fsharp"><span class="c">// distribution properties of the gamma we&#39;ve configured above</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs23', 48)" onmouseover="showTip(event, 'fs23', 48)" class="id">gammaStats</span> <span class="o">=</span>
<span class="pn">(</span> <span onmouseout="hideTip(event, 'fs3', 49)" onmouseover="showTip(event, 'fs3', 49)" class="id">gamma</span><span class="pn">.</span><span class="id">Mean</span><span class="pn">,</span>
<span onmouseout="hideTip(event, 'fs3', 50)" onmouseover="showTip(event, 'fs3', 50)" class="id">gamma</span><span class="pn">.</span><span class="id">Variance</span><span class="pn">,</span>
<span onmouseout="hideTip(event, 'fs3', 51)" onmouseover="showTip(event, 'fs3', 51)" class="id">gamma</span><span class="pn">.</span><span class="id">StdDev</span><span class="pn">,</span>
<span onmouseout="hideTip(event, 'fs3', 52)" onmouseover="showTip(event, 'fs3', 52)" class="id">gamma</span><span class="pn">.</span><span class="id">Entropy</span><span class="pn">,</span>
<span onmouseout="hideTip(event, 'fs3', 53)" onmouseover="showTip(event, 'fs3', 53)" class="id">gamma</span><span class="pn">.</span><span class="id">Skewness</span><span class="pn">,</span>
<span onmouseout="hideTip(event, 'fs3', 54)" onmouseover="showTip(event, 'fs3', 54)" class="id">gamma</span><span class="pn">.</span><span class="id">Mode</span> <span class="pn">)</span>
<span class="c">// probability distribution functions of the normal we&#39;ve configured above.</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs24', 55)" onmouseover="showTip(event, 'fs24', 55)" class="i">nd</span> <span class="o">=</span> <span onmouseout="hideTip(event, 'fs1', 56)" onmouseover="showTip(event, 'fs1', 56)" class="i">normal</span><span class="o">.</span><span class="i">Density</span>(<span class="n">4.0</span>) <span class="c">(* PDF *)</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs25', 57)" onmouseover="showTip(event, 'fs25', 57)" class="i">ndLn</span> <span class="o">=</span> <span onmouseout="hideTip(event, 'fs1', 58)" onmouseover="showTip(event, 'fs1', 58)" class="i">normal</span><span class="o">.</span><span class="i">DensityLn</span>(<span class="n">4.0</span>) <span class="c">(* ln(PDF) *)</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs26', 59)" onmouseover="showTip(event, 'fs26', 59)" class="i">nc</span> <span class="o">=</span> <span onmouseout="hideTip(event, 'fs1', 60)" onmouseover="showTip(event, 'fs1', 60)" class="i">normal</span><span class="o">.</span><span class="i">CumulativeDistribution</span>(<span class="n">4.0</span>) <span class="c">(* CDF *)</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs27', 61)" onmouseover="showTip(event, 'fs27', 61)" class="i">nic</span> <span class="o">=</span> <span onmouseout="hideTip(event, 'fs1', 62)" onmouseover="showTip(event, 'fs1', 62)" class="i">normal</span><span class="o">.</span><span class="i">InverseCumulativeDistribution</span>(<span class="n">0.7</span>) <span class="c">(* CDF^(-1) *)</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs24', 55)" onmouseover="showTip(event, 'fs24', 55)" class="id">nd</span> <span class="o">=</span> <span onmouseout="hideTip(event, 'fs1', 56)" onmouseover="showTip(event, 'fs1', 56)" class="id">normal</span><span class="pn">.</span><span class="id">Density</span><span class="pn">(</span><span class="n">4.0</span><span class="pn">)</span> <span class="c">(* PDF *)</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs25', 57)" onmouseover="showTip(event, 'fs25', 57)" class="id">ndLn</span> <span class="o">=</span> <span onmouseout="hideTip(event, 'fs1', 58)" onmouseover="showTip(event, 'fs1', 58)" class="id">normal</span><span class="pn">.</span><span class="id">DensityLn</span><span class="pn">(</span><span class="n">4.0</span><span class="pn">)</span> <span class="c">(* ln(PDF) *)</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs26', 59)" onmouseover="showTip(event, 'fs26', 59)" class="id">nc</span> <span class="o">=</span> <span onmouseout="hideTip(event, 'fs1', 60)" onmouseover="showTip(event, 'fs1', 60)" class="id">normal</span><span class="pn">.</span><span class="id">CumulativeDistribution</span><span class="pn">(</span><span class="n">4.0</span><span class="pn">)</span> <span class="c">(* CDF *)</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs27', 61)" onmouseover="showTip(event, 'fs27', 61)" class="id">nic</span> <span class="o">=</span> <span onmouseout="hideTip(event, 'fs1', 62)" onmouseover="showTip(event, 'fs1', 62)" class="id">normal</span><span class="pn">.</span><span class="id">InverseCumulativeDistribution</span><span class="pn">(</span><span class="n">0.7</span><span class="pn">)</span> <span class="c">(* CDF^(-1) *)</span>
<span class="c">// Distribution functions can also be evaluated without creating an object,</span>
<span class="c">// but then you have to pass in the distribution parameters as first arguments:</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs28', 63)" onmouseover="showTip(event, 'fs28', 63)" class="i">nd2</span> <span class="o">=</span> <span class="i">Normal</span><span class="o">.</span><span class="i">PDF</span>(<span class="n">3.0</span>, <span onmouseout="hideTip(event, 'fs29', 64)" onmouseover="showTip(event, 'fs29', 64)" class="i">sqrt</span> <span class="n">1.5</span>, <span class="n">4.0</span>)
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs30', 65)" onmouseover="showTip(event, 'fs30', 65)" class="i">ndLn2</span> <span class="o">=</span> <span class="i">Normal</span><span class="o">.</span><span class="i">PDFLn</span>(<span class="n">3.0</span>, <span onmouseout="hideTip(event, 'fs29', 66)" onmouseover="showTip(event, 'fs29', 66)" class="i">sqrt</span> <span class="n">1.5</span>, <span class="n">4.0</span>)
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs31', 67)" onmouseover="showTip(event, 'fs31', 67)" class="i">nc2</span> <span class="o">=</span> <span class="i">Normal</span><span class="o">.</span><span class="i">CDF</span>(<span class="n">3.0</span>, <span onmouseout="hideTip(event, 'fs29', 68)" onmouseover="showTip(event, 'fs29', 68)" class="i">sqrt</span> <span class="n">1.5</span>, <span class="n">4.0</span>)
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs32', 69)" onmouseover="showTip(event, 'fs32', 69)" class="i">nic2</span> <span class="o">=</span> <span class="i">Normal</span><span class="o">.</span><span class="i">InvCDF</span>(<span class="n">3.0</span>, <span onmouseout="hideTip(event, 'fs29', 70)" onmouseover="showTip(event, 'fs29', 70)" class="i">sqrt</span> <span class="n">1.5</span>, <span class="n">0.7</span>)
</code></pre></td>
</tr>
</table>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs28', 63)" onmouseover="showTip(event, 'fs28', 63)" class="id">nd2</span> <span class="o">=</span> <span class="id">Normal</span><span class="pn">.</span><span class="id">PDF</span><span class="pn">(</span><span class="n">3.0</span><span class="pn">,</span> <span onmouseout="hideTip(event, 'fs29', 64)" onmouseover="showTip(event, 'fs29', 64)" class="id">sqrt</span> <span class="n">1.5</span><span class="pn">,</span> <span class="n">4.0</span><span class="pn">)</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs30', 65)" onmouseover="showTip(event, 'fs30', 65)" class="id">ndLn2</span> <span class="o">=</span> <span class="id">Normal</span><span class="pn">.</span><span class="id">PDFLn</span><span class="pn">(</span><span class="n">3.0</span><span class="pn">,</span> <span onmouseout="hideTip(event, 'fs29', 66)" onmouseover="showTip(event, 'fs29', 66)" class="id">sqrt</span> <span class="n">1.5</span><span class="pn">,</span> <span class="n">4.0</span><span class="pn">)</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs31', 67)" onmouseover="showTip(event, 'fs31', 67)" class="id">nc2</span> <span class="o">=</span> <span class="id">Normal</span><span class="pn">.</span><span class="id">CDF</span><span class="pn">(</span><span class="n">3.0</span><span class="pn">,</span> <span onmouseout="hideTip(event, 'fs29', 68)" onmouseover="showTip(event, 'fs29', 68)" class="id">sqrt</span> <span class="n">1.5</span><span class="pn">,</span> <span class="n">4.0</span><span class="pn">)</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs32', 69)" onmouseover="showTip(event, 'fs32', 69)" class="id">nic2</span> <span class="o">=</span> <span class="id">Normal</span><span class="pn">.</span><span class="id">InvCDF</span><span class="pn">(</span><span class="n">3.0</span><span class="pn">,</span> <span onmouseout="hideTip(event, 'fs29', 70)" onmouseover="showTip(event, 'fs29', 70)" class="id">sqrt</span> <span class="n">1.5</span><span class="pn">,</span> <span class="n">0.7</span><span class="pn">)</span>
</code></pre>
<h2><a name="Composing-Distributions" class="anchor" href="#Composing-Distributions">Composing Distributions</a></h2>
<p>Specifically for F# there is also a <code>Sample</code> module that allows a somewhat more functional
view on distribution sampling functions by having the random source passed in as last argument.
This way they can be composed and transformed arbitrarily if curried:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l"> 1: </span>
<span class="l"> 2: </span>
<span class="l"> 3: </span>
<span class="l"> 4: </span>
<span class="l"> 5: </span>
<span class="l"> 6: </span>
<span class="l"> 7: </span>
<span class="l"> 8: </span>
<span class="l"> 9: </span>
<span class="l">10: </span>
<span class="l">11: </span>
<span class="l">12: </span>
<span class="l">13: </span>
<span class="l">14: </span>
<span class="l">15: </span>
<span class="l">16: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="c">/// Transform a sample from a distribution</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs33', 71)" onmouseover="showTip(event, 'fs33', 71)" class="f">s1</span> <span onmouseout="hideTip(event, 'fs34', 72)" onmouseover="showTip(event, 'fs34', 72)" class="i">rng</span> <span class="o">=</span> <span onmouseout="hideTip(event, 'fs35', 73)" onmouseover="showTip(event, 'fs35', 73)" class="f">tanh</span> (<span class="i">Sample</span><span class="o">.</span><span onmouseout="hideTip(event, 'fs1', 74)" onmouseover="showTip(event, 'fs1', 74)" class="i">normal</span> <span class="n">2.0</span> <span class="n">0.5</span> <span onmouseout="hideTip(event, 'fs34', 75)" onmouseover="showTip(event, 'fs34', 75)" class="i">rng</span>)
<pre class="fssnip highlighted"><code lang="fsharp"><span class="c">/// Transform a sample from a distribution</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs33', 71)" onmouseover="showTip(event, 'fs33', 71)" class="fn">s1</span> <span onmouseout="hideTip(event, 'fs34', 72)" onmouseover="showTip(event, 'fs34', 72)" class="fn">rng</span> <span class="o">=</span> <span onmouseout="hideTip(event, 'fs35', 73)" onmouseover="showTip(event, 'fs35', 73)" class="fn">tanh</span> <span class="pn">(</span><span class="id">Sample</span><span class="pn">.</span><span class="id">normal</span> <span class="n">2.0</span> <span class="n">0.5</span> <span onmouseout="hideTip(event, 'fs34', 74)" onmouseover="showTip(event, 'fs34', 74)" class="id">rng</span><span class="pn">)</span>
<span class="c">/// But we really want to transform the function, not the resulting sample:</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs36', 76)" onmouseover="showTip(event, 'fs36', 76)" class="f">s1f</span> <span onmouseout="hideTip(event, 'fs34', 77)" onmouseover="showTip(event, 'fs34', 77)" class="i">rng</span> <span class="o">=</span> <span class="i">Sample</span><span class="o">.</span><span class="i">map</span> <span onmouseout="hideTip(event, 'fs35', 78)" onmouseover="showTip(event, 'fs35', 78)" class="i">tanh</span> (<span class="i">Sample</span><span class="o">.</span><span onmouseout="hideTip(event, 'fs1', 79)" onmouseover="showTip(event, 'fs1', 79)" class="i">normal</span> <span class="n">2.0</span> <span class="n">0.5</span>) <span onmouseout="hideTip(event, 'fs34', 80)" onmouseover="showTip(event, 'fs34', 80)" class="i">rng</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs36', 75)" onmouseover="showTip(event, 'fs36', 75)" class="fn">s1f</span> <span onmouseout="hideTip(event, 'fs34', 76)" onmouseover="showTip(event, 'fs34', 76)" class="fn">rng</span> <span class="o">=</span> <span class="id">Sample</span><span class="pn">.</span><span class="id">map</span> <span onmouseout="hideTip(event, 'fs35', 77)" onmouseover="showTip(event, 'fs35', 77)" class="id">tanh</span> <span class="pn">(</span><span class="id">Sample</span><span class="pn">.</span><span class="id">normal</span> <span class="n">2.0</span> <span class="n">0.5</span><span class="pn">)</span> <span onmouseout="hideTip(event, 'fs34', 78)" onmouseover="showTip(event, 'fs34', 78)" class="id">rng</span>
<span class="c">/// Exactly the same also works with functions generating full sequences</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs37', 81)" onmouseover="showTip(event, 'fs37', 81)" class="f">s1s</span> <span onmouseout="hideTip(event, 'fs34', 82)" onmouseover="showTip(event, 'fs34', 82)" class="i">rng</span> <span class="o">=</span> <span class="i">Sample</span><span class="o">.</span><span class="i">mapSeq</span> <span onmouseout="hideTip(event, 'fs35', 83)" onmouseover="showTip(event, 'fs35', 83)" class="i">tanh</span> (<span class="i">Sample</span><span class="o">.</span><span class="i">normalSeq</span> <span class="n">2.0</span> <span class="n">0.5</span>) <span onmouseout="hideTip(event, 'fs34', 84)" onmouseover="showTip(event, 'fs34', 84)" class="i">rng</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs37', 79)" onmouseover="showTip(event, 'fs37', 79)" class="fn">s1s</span> <span onmouseout="hideTip(event, 'fs34', 80)" onmouseover="showTip(event, 'fs34', 80)" class="fn">rng</span> <span class="o">=</span> <span class="id">Sample</span><span class="pn">.</span><span class="id">mapSeq</span> <span onmouseout="hideTip(event, 'fs35', 81)" onmouseover="showTip(event, 'fs35', 81)" class="id">tanh</span> <span class="pn">(</span><span class="id">Sample</span><span class="pn">.</span><span class="id">normalSeq</span> <span class="n">2.0</span> <span class="n">0.5</span><span class="pn">)</span> <span onmouseout="hideTip(event, 'fs34', 82)" onmouseover="showTip(event, 'fs34', 82)" class="id">rng</span>
<span class="c">/// Now with multiple distributions, e.g. their product:</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs38', 85)" onmouseover="showTip(event, 'fs38', 85)" class="f">s2</span> <span onmouseout="hideTip(event, 'fs34', 86)" onmouseover="showTip(event, 'fs34', 86)" class="i">rng</span> <span class="o">=</span> (<span class="i">Sample</span><span class="o">.</span><span onmouseout="hideTip(event, 'fs1', 87)" onmouseover="showTip(event, 'fs1', 87)" class="i">normal</span> <span class="n">2.0</span> <span class="n">1.5</span> <span onmouseout="hideTip(event, 'fs34', 88)" onmouseover="showTip(event, 'fs34', 88)" class="i">rng</span>) <span class="o">*</span> (<span class="i">Sample</span><span class="o">.</span><span onmouseout="hideTip(event, 'fs4', 89)" onmouseover="showTip(event, 'fs4', 89)" class="i">cauchy</span> <span class="n">2.0</span> <span class="n">0.5</span> <span onmouseout="hideTip(event, 'fs34', 90)" onmouseover="showTip(event, 'fs34', 90)" class="i">rng</span>)
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs39', 91)" onmouseover="showTip(event, 'fs39', 91)" class="f">s2f</span> <span onmouseout="hideTip(event, 'fs34', 92)" onmouseover="showTip(event, 'fs34', 92)" class="i">rng</span> <span class="o">=</span> <span class="i">Sample</span><span class="o">.</span><span class="i">map2</span> <span class="o">(*)</span> (<span class="i">Sample</span><span class="o">.</span><span onmouseout="hideTip(event, 'fs1', 93)" onmouseover="showTip(event, 'fs1', 93)" class="i">normal</span> <span class="n">2.0</span> <span class="n">1.5</span>) (<span class="i">Sample</span><span class="o">.</span><span onmouseout="hideTip(event, 'fs4', 94)" onmouseover="showTip(event, 'fs4', 94)" class="i">cauchy</span> <span class="n">2.0</span> <span class="n">0.5</span>) <span onmouseout="hideTip(event, 'fs34', 95)" onmouseover="showTip(event, 'fs34', 95)" class="i">rng</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs40', 96)" onmouseover="showTip(event, 'fs40', 96)" class="f">s2s</span> <span onmouseout="hideTip(event, 'fs34', 97)" onmouseover="showTip(event, 'fs34', 97)" class="i">rng</span> <span class="o">=</span> <span class="i">Sample</span><span class="o">.</span><span class="i">mapSeq2</span> <span class="o">(*)</span> (<span class="i">Sample</span><span class="o">.</span><span class="i">normalSeq</span> <span class="n">2.0</span> <span class="n">1.5</span>) (<span class="i">Sample</span><span class="o">.</span><span class="i">cauchySeq</span> <span class="n">2.0</span> <span class="n">0.5</span>) <span onmouseout="hideTip(event, 'fs34', 98)" onmouseover="showTip(event, 'fs34', 98)" class="i">rng</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs38', 83)" onmouseover="showTip(event, 'fs38', 83)" class="fn">s2</span> <span onmouseout="hideTip(event, 'fs34', 84)" onmouseover="showTip(event, 'fs34', 84)" class="fn">rng</span> <span class="o">=</span> <span class="pn">(</span><span class="id">Sample</span><span class="pn">.</span><span class="id">normal</span> <span class="n">2.0</span> <span class="n">1.5</span> <span onmouseout="hideTip(event, 'fs34', 85)" onmouseover="showTip(event, 'fs34', 85)" class="id">rng</span><span class="pn">)</span> <span class="o">*</span> <span class="pn">(</span><span class="id">Sample</span><span class="pn">.</span><span class="id">cauchy</span> <span class="n">2.0</span> <span class="n">0.5</span> <span onmouseout="hideTip(event, 'fs34', 86)" onmouseover="showTip(event, 'fs34', 86)" class="id">rng</span><span class="pn">)</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs39', 87)" onmouseover="showTip(event, 'fs39', 87)" class="fn">s2f</span> <span onmouseout="hideTip(event, 'fs34', 88)" onmouseover="showTip(event, 'fs34', 88)" class="fn">rng</span> <span class="o">=</span> <span class="id">Sample</span><span class="pn">.</span><span class="id">map2</span> <span class="o">(*)</span> <span class="pn">(</span><span class="id">Sample</span><span class="pn">.</span><span class="id">normal</span> <span class="n">2.0</span> <span class="n">1.5</span><span class="pn">)</span> <span class="pn">(</span><span class="id">Sample</span><span class="pn">.</span><span class="id">cauchy</span> <span class="n">2.0</span> <span class="n">0.5</span><span class="pn">)</span> <span onmouseout="hideTip(event, 'fs34', 89)" onmouseover="showTip(event, 'fs34', 89)" class="id">rng</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs40', 90)" onmouseover="showTip(event, 'fs40', 90)" class="fn">s2s</span> <span onmouseout="hideTip(event, 'fs34', 91)" onmouseover="showTip(event, 'fs34', 91)" class="fn">rng</span> <span class="o">=</span> <span class="id">Sample</span><span class="pn">.</span><span class="id">mapSeq2</span> <span class="o">(*)</span> <span class="pn">(</span><span class="id">Sample</span><span class="pn">.</span><span class="id">normalSeq</span> <span class="n">2.0</span> <span class="n">1.5</span><span class="pn">)</span> <span class="pn">(</span><span class="id">Sample</span><span class="pn">.</span><span class="id">cauchySeq</span> <span class="n">2.0</span> <span class="n">0.5</span><span class="pn">)</span> <span onmouseout="hideTip(event, 'fs34', 92)" onmouseover="showTip(event, 'fs34', 92)" class="id">rng</span>
<span class="c">// Taking some samples from the composed function</span>
<span onmouseout="hideTip(event, 'fs11', 99)" onmouseover="showTip(event, 'fs11', 99)" class="t">Seq</span><span class="o">.</span><span onmouseout="hideTip(event, 'fs12', 100)" onmouseover="showTip(event, 'fs12', 100)" class="f">take</span> <span class="n">10</span> (<span onmouseout="hideTip(event, 'fs40', 101)" onmouseover="showTip(event, 'fs40', 101)" class="f">s2s</span> (<span class="i">Random</span><span class="o">.</span><span class="i">system</span>())) <span class="o">|&gt;</span> <span onmouseout="hideTip(event, 'fs11', 102)" onmouseover="showTip(event, 'fs11', 102)" class="t">Seq</span><span class="o">.</span><span onmouseout="hideTip(event, 'fs13', 103)" onmouseover="showTip(event, 'fs13', 103)" class="f">toArray</span>
</code></pre></td>
</tr>
</table>
<div class="tip" id="fs1">val normal : obj<br /><br />Full name: Probability.normal</div>
<div class="tip" id="fs2">val exponential : obj<br /><br />Full name: Probability.exponential</div>
<div class="tip" id="fs3">val gamma : obj<br /><br />Full name: Probability.gamma</div>
<div class="tip" id="fs4">val cauchy : obj<br /><br />Full name: Probability.cauchy</div>
<div class="tip" id="fs5">val poisson : obj<br /><br />Full name: Probability.poisson</div>
<div class="tip" id="fs6">val geometric : obj<br /><br />Full name: Probability.geometric</div>
<div class="tip" id="fs7">val estimation : obj<br /><br />Full name: Probability.estimation</div>
<div class="tip" id="fs8">val mean : obj<br /><br />Full name: Probability.mean</div>
<div class="tip" id="fs9">val variance : obj<br /><br />Full name: Probability.variance</div>
<div class="tip" id="fs10">val moreSamples : obj []<br /><br />Full name: Probability.moreSamples</div>
<div class="tip" id="fs11">module Seq<br /><br />from Microsoft.FSharp.Collections</div>
<div class="tip" id="fs12">val take : count:int -&gt; source:seq&lt;&#39;T&gt; -&gt; seq&lt;&#39;T&gt;<br /><br />Full name: Microsoft.FSharp.Collections.Seq.take</div>
<div class="tip" id="fs13">val toArray : source:seq&lt;&#39;T&gt; -&gt; &#39;T []<br /><br />Full name: Microsoft.FSharp.Collections.Seq.toArray</div>
<div class="tip" id="fs14">val continuous : obj list<br /><br />Full name: Probability.continuous</div>
<div class="tip" id="fs15">val discrete : obj list<br /><br />Full name: Probability.discrete</div>
<div class="tip" id="fs16">val w : obj<br /><br />Full name: Probability.w</div>
<div class="tip" id="fs17">val x : obj<br /><br />Full name: Probability.x</div>
<div class="tip" id="fs18">val u : obj<br /><br />Full name: Probability.u</div>
<div class="tip" id="fs19">val v : obj list<br /><br />Full name: Probability.v</div>
<div class="tip" id="fs20">Multiple items<br />module List<br /><br />from Microsoft.FSharp.Collections<br /><br />--------------------<br />type List&lt;&#39;T&gt; =<br />&#160;&#160;| ( [] )<br />&#160;&#160;| ( :: ) of Head: &#39;T * Tail: &#39;T list<br />&#160;&#160;interface IEnumerable<br />&#160;&#160;interface IEnumerable&lt;&#39;T&gt;<br />&#160;&#160;member GetSlice : startIndex:int option * endIndex:int option -&gt; &#39;T list<br />&#160;&#160;member Head : &#39;T<br />&#160;&#160;member IsEmpty : bool<br />&#160;&#160;member Item : index:int -&gt; &#39;T with get<br />&#160;&#160;member Length : int<br />&#160;&#160;member Tail : &#39;T list<br />&#160;&#160;static member Cons : head:&#39;T * tail:&#39;T list -&gt; &#39;T list<br />&#160;&#160;static member Empty : &#39;T list<br /><br />Full name: Microsoft.FSharp.Collections.List&lt;_&gt;</div>
<div class="tip" id="fs21">val ofSeq : source:seq&lt;&#39;T&gt; -&gt; &#39;T list<br /><br />Full name: Microsoft.FSharp.Collections.List.ofSeq</div>
<div class="tip" id="fs22">val scan : folder:(&#39;State -&gt; &#39;T -&gt; &#39;State) -&gt; state:&#39;State -&gt; source:seq&lt;&#39;T&gt; -&gt; seq&lt;&#39;State&gt;<br /><br />Full name: Microsoft.FSharp.Collections.Seq.scan</div>
<div class="tip" id="fs23">val gammaStats : obj * obj * obj * obj * obj * obj<br /><br />Full name: Probability.gammaStats</div>
<div class="tip" id="fs24">val nd : obj<br /><br />Full name: Probability.nd</div>
<div class="tip" id="fs25">val ndLn : obj<br /><br />Full name: Probability.ndLn</div>
<div class="tip" id="fs26">val nc : obj<br /><br />Full name: Probability.nc</div>
<div class="tip" id="fs27">val nic : obj<br /><br />Full name: Probability.nic</div>
<div class="tip" id="fs28">val nd2 : obj<br /><br />Full name: Probability.nd2</div>
<div class="tip" id="fs29">val sqrt : value:&#39;T -&gt; &#39;U (requires member Sqrt)<br /><br />Full name: Microsoft.FSharp.Core.Operators.sqrt</div>
<div class="tip" id="fs30">val ndLn2 : obj<br /><br />Full name: Probability.ndLn2</div>
<div class="tip" id="fs31">val nc2 : obj<br /><br />Full name: Probability.nc2</div>
<div class="tip" id="fs32">val nic2 : obj<br /><br />Full name: Probability.nic2</div>
<div class="tip" id="fs33">val s1 : rng:&#39;a -&gt; float<br /><br />Full name: Probability.s1<br /><em><br /><br />&#160;Transform a sample from a distribution</em></div>
<div class="tip" id="fs34">val rng : &#39;a</div>
<div class="tip" id="fs35">val tanh : value:&#39;T -&gt; &#39;T (requires member Tanh)<br /><br />Full name: Microsoft.FSharp.Core.Operators.tanh</div>
<div class="tip" id="fs36">val s1f : rng:&#39;a -&gt; &#39;b<br /><br />Full name: Probability.s1f<br /><em><br /><br />&#160;But we really want to transform the function, not the resulting sample:</em></div>
<div class="tip" id="fs37">val s1s : rng:&#39;a -&gt; &#39;b<br /><br />Full name: Probability.s1s<br /><em><br /><br />&#160;Exactly the same also works with functions generating full sequences</em></div>
<div class="tip" id="fs38">val s2 : rng:&#39;a -&gt; obj<br /><br />Full name: Probability.s2<br /><em><br /><br />&#160;Now with multiple distributions, e.g. their product:</em></div>
<div class="tip" id="fs39">val s2f : rng:&#39;a -&gt; &#39;b<br /><br />Full name: Probability.s2f</div>
<div class="tip" id="fs40">val s2s : rng:&#39;a -&gt; &#39;b<br /><br />Full name: Probability.s2s</div>
<span onmouseout="hideTip(event, 'fs11', 93)" onmouseover="showTip(event, 'fs11', 93)" class="m">Seq</span><span class="pn">.</span><span onmouseout="hideTip(event, 'fs12', 94)" onmouseover="showTip(event, 'fs12', 94)" class="id">take</span> <span class="n">10</span> <span class="pn">(</span><span onmouseout="hideTip(event, 'fs40', 95)" onmouseover="showTip(event, 'fs40', 95)" class="fn">s2s</span> <span class="pn">(</span><span class="id">Random</span><span class="pn">.</span><span class="id">system</span><span class="pn">(</span><span class="pn">)</span><span class="pn">)</span><span class="pn">)</span> <span class="o">|&gt;</span> <span onmouseout="hideTip(event, 'fs11', 96)" onmouseover="showTip(event, 'fs11', 96)" class="m">Seq</span><span class="pn">.</span><span onmouseout="hideTip(event, 'fs13', 97)" onmouseover="showTip(event, 'fs13', 97)" class="id">toArray</span>
</code></pre>
<div class="fsdocs-tip" id="fs1">val normal : obj</div>
<div class="fsdocs-tip" id="fs2">val exponential : obj</div>
<div class="fsdocs-tip" id="fs3">val gamma : obj</div>
<div class="fsdocs-tip" id="fs4">val cauchy : obj</div>
<div class="fsdocs-tip" id="fs5">val poisson : obj</div>
<div class="fsdocs-tip" id="fs6">val geometric : obj</div>
<div class="fsdocs-tip" id="fs7">val estimation : obj</div>
<div class="fsdocs-tip" id="fs8">val mean : obj</div>
<div class="fsdocs-tip" id="fs9">val variance : obj</div>
<div class="fsdocs-tip" id="fs10">val moreSamples : obj []</div>
<div class="fsdocs-tip" id="fs11">Modul Seq
aus Microsoft.FSharp.Collections<br /><em>&lt;summary&gt;Contains operations for working with values of type &lt;see cref=&quot;T:Microsoft.FSharp.Collections.seq`1&quot; /&gt;.&lt;/summary&gt;</em></div>
<div class="fsdocs-tip" id="fs12">val take : count:int -&gt; source:seq&lt;&#39;T&gt; -&gt; seq&lt;&#39;T&gt;<br /><em>&lt;summary&gt;Returns the first N elements of the sequence.&lt;/summary&gt;<br />&lt;remarks&gt;Throws &lt;c&gt;InvalidOperationException&lt;/c&gt;
if the count exceeds the number of elements in the sequence. &lt;c&gt;Seq.truncate&lt;/c&gt;
returns as many items as the sequence contains instead of throwing an exception.&lt;/remarks&gt;<br />&lt;param name=&quot;count&quot;&gt;The number of items to take.&lt;/param&gt;<br />&lt;param name=&quot;source&quot;&gt;The input sequence.&lt;/param&gt;<br />&lt;returns&gt;The result sequence.&lt;/returns&gt;<br />&lt;exception cref=&quot;T:System.ArgumentNullException&quot;&gt;Thrown when the input sequence is null.&lt;/exception&gt;<br />&lt;exception cref=&quot;T:System.ArgumentException&quot;&gt;Thrown when the input sequence is empty.&lt;/exception&gt;<br />&lt;exception cref=&quot;T:System.InvalidOperationException&quot;&gt;Thrown when count exceeds the number of elements
in the sequence.&lt;/exception&gt;</em></div>
<div class="fsdocs-tip" id="fs13">val toArray : source:seq&lt;&#39;T&gt; -&gt; &#39;T []<br /><em>&lt;summary&gt;Builds an array from the given collection.&lt;/summary&gt;<br />&lt;param name=&quot;source&quot;&gt;The input sequence.&lt;/param&gt;<br />&lt;returns&gt;The result array.&lt;/returns&gt;<br />&lt;exception cref=&quot;T:System.ArgumentNullException&quot;&gt;Thrown when the input sequence is null.&lt;/exception&gt;</em></div>
<div class="fsdocs-tip" id="fs14">val continuous : obj list</div>
<div class="fsdocs-tip" id="fs15">val discrete : obj list</div>
<div class="fsdocs-tip" id="fs16">val w : obj</div>
<div class="fsdocs-tip" id="fs17">val x : obj</div>
<div class="fsdocs-tip" id="fs18">val u : obj</div>
<div class="fsdocs-tip" id="fs19">val v : obj list</div>
<div class="fsdocs-tip" id="fs20">Multiple items<br />Modul List
aus Microsoft.FSharp.Collections<br /><em>&lt;summary&gt;Contains operations for working with values of type &lt;see cref=&quot;T:Microsoft.FSharp.Collections.list`1&quot; /&gt;.&lt;/summary&gt;<br />&lt;namespacedoc&gt;&lt;summary&gt;Operations for collections such as lists, arrays, sets, maps and sequences. See also
&lt;a href=&quot;https://docs.microsoft.com/dotnet/fsharp/language-reference/fsharp-collection-types&quot;&gt;F# Collection Types&lt;/a&gt; in the F# Language Guide.
&lt;/summary&gt;&lt;/namespacedoc&gt;</em><br /><br />--------------------<br />type List&lt;&#39;T&gt; =
| ( [] )
| ( :: ) of Head: &#39;T * Tail: &#39;T list
interface IReadOnlyList&lt;&#39;T&gt;
interface IReadOnlyCollection&lt;&#39;T&gt;
interface IEnumerable
interface IEnumerable&lt;&#39;T&gt;
member GetReverseIndex : rank:int * offset:int -&gt; int
member GetSlice : startIndex:int option * endIndex:int option -&gt; &#39;T list
static member Cons : head:&#39;T * tail:&#39;T list -&gt; &#39;T list
member Head : &#39;T
member IsEmpty : bool
member Item : index:int -&gt; &#39;T with get
...<br /><em>&lt;summary&gt;The type of immutable singly-linked lists.&lt;/summary&gt;<br />&lt;remarks&gt;Use the constructors &lt;c&gt;[]&lt;/c&gt; and &lt;c&gt;::&lt;/c&gt; (infix) to create values of this type, or
the notation &lt;c&gt;[1;2;3]&lt;/c&gt;. Use the values in the &lt;c&gt;List&lt;/c&gt; module to manipulate
values of this type, or pattern match against the values directly.
&lt;/remarks&gt;<br />&lt;exclude /&gt;</em></div>
<div class="fsdocs-tip" id="fs21">val ofSeq : source:seq&lt;&#39;T&gt; -&gt; &#39;T list<br /><em>&lt;summary&gt;Builds a new list from the given enumerable object.&lt;/summary&gt;<br />&lt;param name=&quot;source&quot;&gt;The input sequence.&lt;/param&gt;<br />&lt;returns&gt;The list of elements from the sequence.&lt;/returns&gt;</em></div>
<div class="fsdocs-tip" id="fs22">val scan : folder:(&#39;State -&gt; &#39;T -&gt; &#39;State) -&gt; state:&#39;State -&gt; source:seq&lt;&#39;T&gt; -&gt; seq&lt;&#39;State&gt;<br /><em>&lt;summary&gt;Like fold, but computes on-demand and returns the sequence of intermediary and final results.&lt;/summary&gt;<br />&lt;param name=&quot;folder&quot;&gt;A function that updates the state with each element from the sequence.&lt;/param&gt;<br />&lt;param name=&quot;state&quot;&gt;The initial state.&lt;/param&gt;<br />&lt;param name=&quot;source&quot;&gt;The input sequence.&lt;/param&gt;<br />&lt;returns&gt;The resulting sequence of computed states.&lt;/returns&gt;<br />&lt;exception cref=&quot;T:System.ArgumentNullException&quot;&gt;Thrown when the input sequence is null.&lt;/exception&gt;</em></div>
<div class="fsdocs-tip" id="fs23">val gammaStats : obj * obj * obj * obj * obj * obj</div>
<div class="fsdocs-tip" id="fs24">val nd : obj</div>
<div class="fsdocs-tip" id="fs25">val ndLn : obj</div>
<div class="fsdocs-tip" id="fs26">val nc : obj</div>
<div class="fsdocs-tip" id="fs27">val nic : obj</div>
<div class="fsdocs-tip" id="fs28">val nd2 : obj</div>
<div class="fsdocs-tip" id="fs29">val sqrt : value:&#39;T -&gt; &#39;U (requires member Sqrt)<br /><em>&lt;summary&gt;Square root of the given number&lt;/summary&gt;<br />&lt;param name=&quot;value&quot;&gt;The input value.&lt;/param&gt;<br />&lt;returns&gt;The square root of the input.&lt;/returns&gt;</em></div>
<div class="fsdocs-tip" id="fs30">val ndLn2 : obj</div>
<div class="fsdocs-tip" id="fs31">val nc2 : obj</div>
<div class="fsdocs-tip" id="fs32">val nic2 : obj</div>
<div class="fsdocs-tip" id="fs33">val s1 : rng:&#39;a -&gt; float<br /><em>&#160;Transform a sample from a distribution</em></div>
<div class="fsdocs-tip" id="fs34">val rng : &#39;a</div>
<div class="fsdocs-tip" id="fs35">val tanh : value:&#39;T -&gt; &#39;T (requires member Tanh)<br /><em>&lt;summary&gt;Hyperbolic tangent of the given number&lt;/summary&gt;<br />&lt;param name=&quot;value&quot;&gt;The input value.&lt;/param&gt;<br />&lt;returns&gt;The hyperbolic tangent of the input.&lt;/returns&gt;</em></div>
<div class="fsdocs-tip" id="fs36">val s1f : rng:&#39;a -&gt; &#39;b<br /><em>&#160;But we really want to transform the function, not the resulting sample:</em></div>
<div class="fsdocs-tip" id="fs37">val s1s : rng:&#39;a -&gt; &#39;b<br /><em>&#160;Exactly the same also works with functions generating full sequences</em></div>
<div class="fsdocs-tip" id="fs38">val s2 : rng:&#39;a -&gt; obj<br /><em>&#160;Now with multiple distributions, e.g. their product:</em></div>
<div class="fsdocs-tip" id="fs39">val s2f : rng:&#39;a -&gt; &#39;b</div>
<div class="fsdocs-tip" id="fs40">val s2s : rng:&#39;a -&gt; &#39;b</div>
</div>
<div class="span3">
<ul class="nav nav-list" id="menu">
<li class="nav-header">Math.NET Numerics</li>
<li><a href="https://numerics.mathdotnet.com/Packages.html">NuGet & Binaries</a></li>
<li><a href="https://numerics.mathdotnet.com/ReleaseNotes.html">Release Notes</a></li>
<li><a href="https://numerics.mathdotnet.com/License.html">MIT License</a></li>
<li><a href="https://numerics.mathdotnet.com/Compatibility.html">Platform Support</a></li>
<li><a href="https://numerics.mathdotnet.com/api/">Class Reference</a></li>
<li><a href="https://github.com/mathnet/mathnet-numerics/issues">Issues & Bugs</a></li>
<li><a href="https://numerics.mathdotnet.com/Users.html">Who is using Math.NET?</a></li>
<li class="nav-header">Contributing</li>
<li><a href="https://numerics.mathdotnet.com/Contributors.html">Contributors</a></li>
<li><a href="https://numerics.mathdotnet.com/Contributing.html">Contributing</a></li>
<li><a href="https://numerics.mathdotnet.com/Build.html">Build & Tools</a></li>
<li><a href="http://feedback.mathdotnet.com/forums/2060-math-net-numerics">Your Ideas</a></li>
<li class="nav-header">Getting Help</li>
<li><a href="https://discuss.mathdotnet.com/c/numerics">Discuss</a></li>
<li><a href="https://stackoverflow.com/questions/tagged/mathdotnet">Stack Overflow</a></li>
<li class="nav-header">Getting Started</li>
<li><a href="https://numerics.mathdotnet.com/">Getting started</a></li>
<li><a href="https://numerics.mathdotnet.com/Constants.html">Constants</a></li>
<li>Floating-Point Numbers</li>
<li>Arbitrary Precision Numbers</li>
<li>Complex Numbers</li>
<li><a href="https://numerics.mathdotnet.com/Matrix.html">Matrices and Vectors</a></li>
<li><a href="https://numerics.mathdotnet.com/Euclid.html">Euclid & Number Theory</a></li>
<li>Combinatorics</li>
<li class="nav-header">Evaluation</li>
<li><a href="https://numerics.mathdotnet.com/Functions.html">Special Functions</a></li>
<li>Differentiation</li>
<li><a href="https://numerics.mathdotnet.com/Integration.html">Integration</a></li>
<li class="nav-header">Statistics/Probability</li>
<li><a href="https://numerics.mathdotnet.com/DescriptiveStatistics.html">Descriptive Statistics</a></li>
<li><a href="https://numerics.mathdotnet.com/Probability.html">Probability Distributions</a></li>
<li class="nav-header">Generation</li>
<li><a href="https://numerics.mathdotnet.com/Generate.html">Generating Data</a></li>
<li><a href="https://numerics.mathdotnet.com/Random.html">Random Numbers</a></li>
<li class="nav-header">Transformation</li>
<li>Fourier Transform (FFT)</li>
<li>Filtering & DSP</li>
<li>Window Functions</li>
<li class="nav-header">Solving Equations</li>
<li><a href="https://numerics.mathdotnet.com/LinearEquations.html">Linear Equation Systems</a></li>
<li>Nonlinear Root Finding</li>
<li class="nav-header">Optimization</li>
<li>Linear Least Squares</li>
<li>Nonlinear Optimization</li>
<li><a href="https://numerics.mathdotnet.com/Distance.html">Distance Metrics</a></li>
<li class="nav-header">Curve Fitting</li>
<li><a href="https://numerics.mathdotnet.com/Regression.html">Regression</a></li>
<li>Interpolation</li>
<li>Fourier Approximation</li>
<li class="nav-header">Native Providers</li>
<li><a href="https://numerics.mathdotnet.com/MKL.html">Intel MKL</a></li>
<li class="nav-header">Working Together</li>
<li><a href="https://numerics.mathdotnet.com/CSV.html">Delimited Text Files (CSV)</a></li>
<li><a href="https://numerics.mathdotnet.com/MatrixMarket.html">NIST MatrixMarket</a></li>
<li><a href="https://numerics.mathdotnet.com/MatlabFiles.html">MATLAB</a></li>
<li><a href="https://numerics.mathdotnet.com/IFSharpNotebook.html">IF# Notebook</a></li>
<li>FsLab & Deedle</li>
<li>Microsoft Excel</li>
<li>numl.net machine learning</li>
<li>R-project</li>
</ul>
</div>
</div>
</div>
</body>
<!-- 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>

495
Random.html

@ -1,63 +1,138 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>Pseudo-Random Numbers
<head>
<meta charset="utf-8">
<title>Pseudo-Random Numbers
</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta name="description" content="Math.NET Numerics, providing methods and algorithms for numerical computations in science, engineering and every day use. .Net 4, .Net 3.5, SL5, Win8, WP8, PCL 47 and 136, Mono, Xamarin Android/iOS."/>
<meta name="author" content="Christoph Ruegg, Marcus Cuda, Jurgen Van Gael"/>
<script src="https://code.jquery.com/jquery-1.8.0.js"></script>
<script src="https://code.jquery.com/ui/1.8.23/jquery-ui.js"></script>
<script src="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/js/bootstrap.min.js"></script>
<link href="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap-combined.min.css" rel="stylesheet"/>
<link type="text/css" rel="stylesheet" href="https://numerics.mathdotnet.com/content/style.css" />
<style>
#main table:not(.pre) {
border: 1px solid #dddddd;
max-width: 100%;
border-style: solid;
border-width: 1px;
border-color: gray;
border-collapse: collapse;
border-right-width: 1px;
border-bottom-width: 1px;
margin-top: 15px;
margin-bottom: 25px;
}
#main table:not(.pre) th, #main table:not(.pre) td {
border: 1px solid #dddddd;
padding: 6px;
}
#main table:not(.pre) th p, #main table:not(.pre) td p {
margin-bottom: 5px;
}
</style>
<script type="text/javascript" src="https://numerics.mathdotnet.com/content/tips.js"></script>
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<![endif]-->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
</head>
<body>
<div class="container">
<div class="masthead">
<ul class="nav nav-pills pull-right">
<li><a href="https://www.mathdotnet.com">Math.NET Project</a></li>
<li><a href="https://numerics.mathdotnet.com">Math.NET Numerics</a></li>
<li><a href="https://github.com/mathnet/mathnet-numerics">GitHub</a></li>
</ul>
<h3 class="muted">Math.NET Numerics</h3>
<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>
<hr />
<div class="row">
<div class="span9" id="main">
<h1><a name="Pseudo-Random-Numbers" class="anchor" href="#Pseudo-Random-Numbers">Pseudo-Random Numbers</a></h1>
<!-- 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">Floating-Point Numbers</li>
<li class="nav-item">Arbitrary Precision Numbers</li>
<li class="nav-item">Complex Numbers</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">Differentiation</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">Transformation</li>
<li class="nav-item">Fourier Transform (FFT)</li>
<li class="nav-item">Filtering & DSP</li>
<li class="nav-item">Window Functions</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-item">Nonlinear Root Finding</li>
<li class="nav-header">Optimization</li>
<li class="nav-item">Linear Least Squares</li>
<li class="nav-item">Nonlinear 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-item">Interpolation</li>
<li class="nav-item">Fourier Approximation</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://www.mathdotnet.com">Math.NET Project</a> |
<a href="https://numerics.mathdotnet.com">Math.NET Numerics</a> |
<a href="https://github.com/mathnet/mathnet-numerics">GitHub</a>
</h3>
</div>
<hr />
<div class="container" id="fsdocs-content">
<h1><a name="Pseudo-Random-Numbers" class="anchor" href="#Pseudo-Random-Numbers">Pseudo-Random Numbers</a></h1>
<p>The .Net Framework base class library (BCL) includes a pseudo-random number generator
for non-cryptography use in the form of the <code>System.Random</code> class.
Math.NET Numerics provides a few alternatives with different characteristics
@ -73,30 +148,13 @@ distributions, like evaluating statistical distribution properties or functions.
<h2><a name="Initialization" class="anchor" href="#Initialization">Initialization</a></h2>
<p>We need to reference Math.NET Numerics and open the namespaces for
random numbers and probability distributions:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">using</span> MathNet.Numerics.Random;
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">using</span> MathNet.Numerics.Random;
<span class="k">using</span> MathNet.Numerics.Distributions;
</code></pre></td></tr></table>
<h2><a name="Generating-Random-Numbers" class="anchor" href="#Generating-Random-Numbers">Generating Random Numbers</a></h2>
<p>Let's sample a few random values from a uniform distributed variable
<span class="math">\(X\sim\mathcal{U}(0,1)\)</span>, such that <span class="math">\(0 \le x &lt; 1\)</span>:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l"> 1: </span>
<span class="l"> 2: </span>
<span class="l"> 3: </span>
<span class="l"> 4: </span>
<span class="l"> 5: </span>
<span class="l"> 6: </span>
<span class="l"> 7: </span>
<span class="l"> 8: </span>
<span class="l"> 9: </span>
<span class="l">10: </span>
<span class="l">11: </span>
<span class="l">12: </span>
<span class="l">13: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="c">// create an array with 1000 random values</span>
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="c">// create an array with 1000 random values</span>
<span class="k">double</span>[] samples <span class="o">=</span> SystemRandomSource.Doubles(<span class="n">1000</span>);
<span class="c">// now overwrite the existing array with new random values</span>
@ -111,34 +169,19 @@ System.Random rng <span class="o">=</span> SystemRandomSource.Default;
<span class="k">decimal</span> sampled <span class="o">=</span> rng.NextDecimal();
</code></pre></td></tr></table>
<p>In F# we can do exactly the same, or alternatively use the <code>Random</code> module:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l"> 1: </span>
<span class="l"> 2: </span>
<span class="l"> 3: </span>
<span class="l"> 4: </span>
<span class="l"> 5: </span>
<span class="l"> 6: </span>
<span class="l"> 7: </span>
<span class="l"> 8: </span>
<span class="l"> 9: </span>
<span class="l">10: </span>
<span class="l">11: </span>
<span class="l">12: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="k">let</span> <span onmouseout="hideTip(event, 'fs1', 1)" onmouseover="showTip(event, 'fs1', 1)" class="i">samples</span> <span class="o">=</span> <span class="i">Random</span><span class="o">.</span><span class="i">doubles</span> <span class="n">1000</span>
<pre class="fssnip highlighted"><code lang="fsharp"><span class="k">let</span> <span onmouseout="hideTip(event, 'fs1', 1)" onmouseover="showTip(event, 'fs1', 1)" class="id">samples</span> <span class="o">=</span> <span class="id">Random</span><span class="pn">.</span><span class="id">doubles</span> <span class="n">1000</span>
<span class="c">// overwrite the whole array with new random values</span>
<span class="i">Random</span><span class="o">.</span><span class="i">doubleFill</span> <span onmouseout="hideTip(event, 'fs1', 2)" onmouseover="showTip(event, 'fs1', 2)" class="i">samples</span>
<span class="id">Random</span><span class="pn">.</span><span class="id">doubleFill</span> <span onmouseout="hideTip(event, 'fs1', 2)" onmouseover="showTip(event, 'fs1', 2)" class="id">samples</span>
<span class="c">// create an infinite sequence:</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs2', 3)" onmouseover="showTip(event, 'fs2', 3)" class="i">sampleSeq</span> <span class="o">=</span> <span class="i">Random</span><span class="o">.</span><span class="i">doubleSeq</span> ()
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs2', 3)" onmouseover="showTip(event, 'fs2', 3)" class="id">sampleSeq</span> <span class="o">=</span> <span class="id">Random</span><span class="pn">.</span><span class="id">doubleSeq</span> <span class="pn">(</span><span class="pn">)</span>
<span class="c">// take a single random value</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs3', 4)" onmouseover="showTip(event, 'fs3', 4)" class="i">rng</span> <span class="o">=</span> <span class="i">Random</span><span class="o">.</span><span class="i">shared</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs4', 5)" onmouseover="showTip(event, 'fs4', 5)" class="i">sample</span> <span class="o">=</span> <span onmouseout="hideTip(event, 'fs3', 6)" onmouseover="showTip(event, 'fs3', 6)" class="i">rng</span><span class="o">.</span><span class="i">NextDouble</span>()
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs5', 7)" onmouseover="showTip(event, 'fs5', 7)" class="i">sampled</span> <span class="o">=</span> <span onmouseout="hideTip(event, 'fs3', 8)" onmouseover="showTip(event, 'fs3', 8)" class="i">rng</span><span class="o">.</span><span class="i">NextDecimal</span>()
</code></pre></td>
</tr>
</table>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs3', 4)" onmouseover="showTip(event, 'fs3', 4)" class="id">rng</span> <span class="o">=</span> <span class="id">Random</span><span class="pn">.</span><span class="id">shared</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs4', 5)" onmouseover="showTip(event, 'fs4', 5)" class="id">sample</span> <span class="o">=</span> <span onmouseout="hideTip(event, 'fs3', 6)" onmouseover="showTip(event, 'fs3', 6)" class="id">rng</span><span class="pn">.</span><span class="id">NextDouble</span><span class="pn">(</span><span class="pn">)</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs5', 7)" onmouseover="showTip(event, 'fs5', 7)" class="id">sampled</span> <span class="o">=</span> <span onmouseout="hideTip(event, 'fs3', 8)" onmouseover="showTip(event, 'fs3', 8)" class="id">rng</span><span class="pn">.</span><span class="id">NextDecimal</span><span class="pn">(</span><span class="pn">)</span>
</code></pre>
<p>If you have used the .Net BCL random number generators before, you have likely
noticed a few differences: we used special routines to create a full array or
sequence in one go, we were able to sample a decimal number, an we used static functions
@ -146,10 +189,7 @@ and a shared default instance instead of creating our own instance.</p>
<p>Math.NET Numerics provides a few alternative random number generators in their own types.
For example, <code>MersenneTwister</code> implements the very popular mersenne twister algorithm. All these types
inherit from <code>System.Random</code>, are fully compatible to it and can also be used exactly the same way:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp">System.Random random <span class="o">=</span> <span class="k">new</span> SystemRandomSource();
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp">System.Random random <span class="o">=</span> <span class="k">new</span> SystemRandomSource();
<span class="k">var</span> sample <span class="o">=</span> random.NextDouble();
</code></pre></td></tr></table>
<p>However, unlike System.Random they can be made thread safe, use much more reasonable
@ -183,33 +223,17 @@ and is often unwanted. That's why all Math.NET Numerics RNGs are by default
initialized with a robust seed taken from the <code>CryptoRandomSource</code> if available,
or else a combination of a random number from a shared RNG, the time and a Guid
(which are supposed to be generated uniquely, worldwide).</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="k">let</span> <span onmouseout="hideTip(event, 'fs6', 9)" onmouseover="showTip(event, 'fs6', 9)" class="i">someTimeSeed</span> <span class="o">=</span> <span class="i">RandomSeed</span><span class="o">.</span><span class="i">Time</span>() <span class="c">// not recommended</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs7', 10)" onmouseover="showTip(event, 'fs7', 10)" class="i">someGuidSeed</span> <span class="o">=</span> <span class="i">RandomSeed</span><span class="o">.</span><span class="i">Guid</span>()
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs8', 11)" onmouseover="showTip(event, 'fs8', 11)" class="i">someRobustSeed</span> <span class="o">=</span> <span class="i">RandomSeed</span><span class="o">.</span><span class="i">Robust</span>() <span class="c">// recommended, used by default</span>
</code></pre></td>
</tr>
</table>
<pre class="fssnip highlighted"><code lang="fsharp"><span class="k">let</span> <span onmouseout="hideTip(event, 'fs6', 9)" onmouseover="showTip(event, 'fs6', 9)" class="id">someTimeSeed</span> <span class="o">=</span> <span class="id">RandomSeed</span><span class="pn">.</span><span class="id">Time</span><span class="pn">(</span><span class="pn">)</span> <span class="c">// not recommended</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs7', 10)" onmouseover="showTip(event, 'fs7', 10)" class="id">someGuidSeed</span> <span class="o">=</span> <span class="id">RandomSeed</span><span class="pn">.</span><span class="id">Guid</span><span class="pn">(</span><span class="pn">)</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs8', 11)" onmouseover="showTip(event, 'fs8', 11)" class="id">someRobustSeed</span> <span class="o">=</span> <span class="id">RandomSeed</span><span class="pn">.</span><span class="id">Robust</span><span class="pn">(</span><span class="pn">)</span> <span class="c">// recommended, used by default</span>
</code></pre>
<p>Let's generate random numbers like before, but this time with custom seed 42:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="k">let</span> <span onmouseout="hideTip(event, 'fs9', 12)" onmouseover="showTip(event, 'fs9', 12)" class="i">samplesSeeded</span> <span class="o">=</span> <span class="i">Random</span><span class="o">.</span><span class="i">doublesSeed</span> <span class="n">42</span> <span class="n">1000</span>
<span class="i">Random</span><span class="o">.</span><span class="i">doubleFillSeed</span> <span class="n">42</span> <span onmouseout="hideTip(event, 'fs9', 13)" onmouseover="showTip(event, 'fs9', 13)" class="i">samplesSeeded</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs10', 14)" onmouseover="showTip(event, 'fs10', 14)" class="i">samplesSeqSeeded</span> <span class="o">=</span> <span class="i">Random</span><span class="o">.</span><span class="i">doubleSeqSeed</span> <span class="n">42</span>
</code></pre></td>
</tr>
</table>
<pre class="fssnip highlighted"><code lang="fsharp"><span class="k">let</span> <span onmouseout="hideTip(event, 'fs9', 12)" onmouseover="showTip(event, 'fs9', 12)" class="id">samplesSeeded</span> <span class="o">=</span> <span class="id">Random</span><span class="pn">.</span><span class="id">doublesSeed</span> <span class="n">42</span> <span class="n">1000</span>
<span class="id">Random</span><span class="pn">.</span><span class="id">doubleFillSeed</span> <span class="n">42</span> <span onmouseout="hideTip(event, 'fs9', 13)" onmouseover="showTip(event, 'fs9', 13)" class="id">samplesSeeded</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs10', 14)" onmouseover="showTip(event, 'fs10', 14)" class="id">samplesSeqSeeded</span> <span class="o">=</span> <span class="id">Random</span><span class="pn">.</span><span class="id">doubleSeqSeed</span> <span class="n">42</span>
</code></pre>
<p>Or without the F# Random module, e.g. in C#:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">double</span>[] samplesSeeded <span class="o">=</span> SystemRandomSource.Doubles(<span class="n">1000</span>, <span class="n">42</span>);
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">double</span>[] samplesSeeded <span class="o">=</span> SystemRandomSource.Doubles(<span class="n">1000</span>, <span class="n">42</span>);
SystemRandomSource.Doubles(samplesSeeded, <span class="n">42</span>);
IEnumerable&lt;<span class="k">double</span>&gt; sampleSeqSeeded <span class="o">=</span> SystemRandomSource.DoubleSequence(<span class="n">42</span>);
</code></pre></td></tr></table>
@ -228,19 +252,7 @@ IEnumerable&lt;<span class="k">double</span>&gt; sampleSeqSeeded <span class="o"
<li><strong>Palf</strong>: Parallel Additive Lagged Fibonacci generator</li>
</ul>
<p>Let's sample a few uniform random values using Mersenne Twister in C#:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l"> 1: </span>
<span class="l"> 2: </span>
<span class="l"> 3: </span>
<span class="l"> 4: </span>
<span class="l"> 5: </span>
<span class="l"> 6: </span>
<span class="l"> 7: </span>
<span class="l"> 8: </span>
<span class="l"> 9: </span>
<span class="l">10: </span>
<span class="l">11: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="c">// Typical way with an instance:</span>
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="c">// Typical way with an instance:</span>
<span class="k">var</span> random <span class="o">=</span> <span class="k">new</span> MersenneTwister(<span class="n">42</span>); <span class="c">// seed 42</span>
<span class="k">int</span> sampleInt <span class="o">=</span> random.Next();
<span class="k">double</span> sampleDouble <span class="o">=</span> random.NextDouble();
@ -254,36 +266,20 @@ IEnumerable&lt;<span class="k">double</span>&gt; sampleSeq <span class="o">=</sp
</code></pre></td></tr></table>
<p>In F# you can use the constructor as well, or alternatively use the <code>Random</code> module.
In case of the latter, all objects will be cast to their common base type <code>System.Random</code>:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l"> 1: </span>
<span class="l"> 2: </span>
<span class="l"> 3: </span>
<span class="l"> 4: </span>
<span class="l"> 5: </span>
<span class="l"> 6: </span>
<span class="l"> 7: </span>
<span class="l"> 8: </span>
<span class="l"> 9: </span>
<span class="l">10: </span>
<span class="l">11: </span>
<span class="l">12: </span>
<span class="l">13: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="c">// By using the normal constructor (random1 has type MersenneTwister) </span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs11', 15)" onmouseover="showTip(event, 'fs11', 15)" class="i">random1</span> <span class="o">=</span> <span class="i">MersenneTwister</span>()
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs12', 16)" onmouseover="showTip(event, 'fs12', 16)" class="i">random1b</span> <span class="o">=</span> <span class="i">MersenneTwister</span>(<span class="n">42</span>) <span class="c">// with seed</span>
<pre class="fssnip highlighted"><code lang="fsharp"><span class="c">// By using the normal constructor (random1 has type MersenneTwister) </span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs11', 15)" onmouseover="showTip(event, 'fs11', 15)" class="id">random1</span> <span class="o">=</span> <span class="id">MersenneTwister</span><span class="pn">(</span><span class="pn">)</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs12', 16)" onmouseover="showTip(event, 'fs12', 16)" class="id">random1b</span> <span class="o">=</span> <span class="id">MersenneTwister</span><span class="pn">(</span><span class="n">42</span><span class="pn">)</span> <span class="c">// with seed</span>
<span class="c">// By using the Random module (random2 has type System.Random)</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs13', 17)" onmouseover="showTip(event, 'fs13', 17)" class="i">random2</span> <span class="o">=</span> <span class="i">Random</span><span class="o">.</span><span class="i">mersenneTwister</span> ()
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs14', 18)" onmouseover="showTip(event, 'fs14', 18)" class="i">random2b</span> <span class="o">=</span> <span class="i">Random</span><span class="o">.</span><span class="i">mersenneTwisterSeed</span> <span class="n">42</span> <span class="c">// with seed</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs15', 19)" onmouseover="showTip(event, 'fs15', 19)" class="i">random2c</span> <span class="o">=</span> <span class="i">Random</span><span class="o">.</span><span class="i">mersenneTwisterWith</span> <span class="n">42</span> <span class="k">false</span> <span class="c">// opt-out of thread-safety</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs13', 17)" onmouseover="showTip(event, 'fs13', 17)" class="id">random2</span> <span class="o">=</span> <span class="id">Random</span><span class="pn">.</span><span class="id">mersenneTwister</span> <span class="pn">(</span><span class="pn">)</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs14', 18)" onmouseover="showTip(event, 'fs14', 18)" class="id">random2b</span> <span class="o">=</span> <span class="id">Random</span><span class="pn">.</span><span class="id">mersenneTwisterSeed</span> <span class="n">42</span> <span class="c">// with seed</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs15', 19)" onmouseover="showTip(event, 'fs15', 19)" class="id">random2c</span> <span class="o">=</span> <span class="id">Random</span><span class="pn">.</span><span class="id">mersenneTwisterWith</span> <span class="n">42</span> <span class="k">false</span> <span class="c">// opt-out of thread-safety</span>
<span class="c">// Using some other algorithms:</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs16', 20)" onmouseover="showTip(event, 'fs16', 20)" class="i">random3</span> <span class="o">=</span> <span class="i">Random</span><span class="o">.</span><span class="i">crypto</span> ()
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs17', 21)" onmouseover="showTip(event, 'fs17', 21)" class="i">random4</span> <span class="o">=</span> <span class="i">Random</span><span class="o">.</span><span class="i">xorshift</span> ()
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs18', 22)" onmouseover="showTip(event, 'fs18', 22)" class="i">random5</span> <span class="o">=</span> <span class="i">Random</span><span class="o">.</span><span class="i">wh2006</span> ()
</code></pre></td>
</tr>
</table>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs16', 20)" onmouseover="showTip(event, 'fs16', 20)" class="id">random3</span> <span class="o">=</span> <span class="id">Random</span><span class="pn">.</span><span class="id">crypto</span> <span class="pn">(</span><span class="pn">)</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs17', 21)" onmouseover="showTip(event, 'fs17', 21)" class="id">random4</span> <span class="o">=</span> <span class="id">Random</span><span class="pn">.</span><span class="id">xorshift</span> <span class="pn">(</span><span class="pn">)</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs18', 22)" onmouseover="showTip(event, 'fs18', 22)" class="id">random5</span> <span class="o">=</span> <span class="id">Random</span><span class="pn">.</span><span class="id">wh2006</span> <span class="pn">(</span><span class="pn">)</span>
</code></pre>
<h2><a name="Shared-Instances-and-Thread-Safety" class="anchor" href="#Shared-Instances-and-Thread-Safety">Shared Instances and Thread Safety</a></h2>
<p>Generators make certain claims about how many random numbers they can generate
until the whole sequence repeats itself. However, this only applies if you
@ -301,43 +297,20 @@ including the <code>SystemRandomSource</code> and <code>CryptoRandomSource</code
unless explicitly disabled by a constructor argument or by setting <code>Control.ThreadSafeRandomNumberGenerators</code>
(which is used if the constructor argument is omitted).</p>
<p>For convenience a few generators provide a thread-safe shared instance</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">var</span> a <span class="o">=</span> SystemRandomSource.Default;
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">var</span> a <span class="o">=</span> SystemRandomSource.Default;
<span class="k">var</span> b <span class="o">=</span> MersenneTwister.Default;
</code></pre></td></tr></table>
<p>Or with the F# module:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
<span class="l">4: </span>
<span class="l">5: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="k">let</span> <span onmouseout="hideTip(event, 'fs19', 23)" onmouseover="showTip(event, 'fs19', 23)" class="i">a</span> <span class="o">=</span> <span class="i">Random</span><span class="o">.</span><span class="i">systemShared</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs20', 24)" onmouseover="showTip(event, 'fs20', 24)" class="i">b</span> <span class="o">=</span> <span class="i">Random</span><span class="o">.</span><span class="i">mersenneTwisterShared</span>
<pre class="fssnip highlighted"><code lang="fsharp"><span class="k">let</span> <span onmouseout="hideTip(event, 'fs19', 23)" onmouseover="showTip(event, 'fs19', 23)" class="id">a</span> <span class="o">=</span> <span class="id">Random</span><span class="pn">.</span><span class="id">systemShared</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs20', 24)" onmouseover="showTip(event, 'fs20', 24)" class="id">b</span> <span class="o">=</span> <span class="id">Random</span><span class="pn">.</span><span class="id">mersenneTwisterShared</span>
<span class="c">// or if you don&#39;t care, simply</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs21', 25)" onmouseover="showTip(event, 'fs21', 25)" class="i">c</span> <span class="o">=</span> <span class="i">Random</span><span class="o">.</span><span class="i">shared</span>;
</code></pre></td>
</tr>
</table>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs21', 25)" onmouseover="showTip(event, 'fs21', 25)" class="id">c</span> <span class="o">=</span> <span class="id">Random</span><span class="pn">.</span><span class="id">shared</span><span class="pn">;</span>
</code></pre>
<h2><a name="Non-Uniform-Random-Numbers" class="anchor" href="#Non-Uniform-Random-Numbers">Non-Uniform Random Numbers</a></h2>
<p>For non-uniform random number generation you can use the wide range of probability
distributions in the <code>MathNet.Numerics.Distributions</code> namespace.</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l"> 1: </span>
<span class="l"> 2: </span>
<span class="l"> 3: </span>
<span class="l"> 4: </span>
<span class="l"> 5: </span>
<span class="l"> 6: </span>
<span class="l"> 7: </span>
<span class="l"> 8: </span>
<span class="l"> 9: </span>
<span class="l">10: </span>
<span class="l">11: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">using</span> MathNet.Numerics.Distributions;
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">using</span> MathNet.Numerics.Distributions;
<span class="c">// sample a single value from a standard distribution</span>
<span class="k">double</span> a <span class="o">=</span> Normal.Sample(<span class="n">0.0</span>, <span class="n">1.0</span>);
@ -351,109 +324,37 @@ Normal.Samples(c, <span class="n">0.0</span>, <span class="n">1.0</span>);
</code></pre></td></tr></table>
<p>See <a href="Probability.html">Probability Distributions</a> for details.</p>
<div class="tip" id="fs1">val samples : obj<br /><br />Full name: Random.samples</div>
<div class="tip" id="fs2">val sampleSeq : obj<br /><br />Full name: Random.sampleSeq</div>
<div class="tip" id="fs3">val rng : obj<br /><br />Full name: Random.rng</div>
<div class="tip" id="fs4">val sample : obj<br /><br />Full name: Random.sample</div>
<div class="tip" id="fs5">val sampled : obj<br /><br />Full name: Random.sampled</div>
<div class="tip" id="fs6">val someTimeSeed : obj<br /><br />Full name: Random.someTimeSeed</div>
<div class="tip" id="fs7">val someGuidSeed : obj<br /><br />Full name: Random.someGuidSeed</div>
<div class="tip" id="fs8">val someRobustSeed : obj<br /><br />Full name: Random.someRobustSeed</div>
<div class="tip" id="fs9">val samplesSeeded : obj<br /><br />Full name: Random.samplesSeeded</div>
<div class="tip" id="fs10">val samplesSeqSeeded : obj<br /><br />Full name: Random.samplesSeqSeeded</div>
<div class="tip" id="fs11">val random1 : obj<br /><br />Full name: Random.random1</div>
<div class="tip" id="fs12">val random1b : obj<br /><br />Full name: Random.random1b</div>
<div class="tip" id="fs13">val random2 : obj<br /><br />Full name: Random.random2</div>
<div class="tip" id="fs14">val random2b : obj<br /><br />Full name: Random.random2b</div>
<div class="tip" id="fs15">val random2c : obj<br /><br />Full name: Random.random2c</div>
<div class="tip" id="fs16">val random3 : obj<br /><br />Full name: Random.random3</div>
<div class="tip" id="fs17">val random4 : obj<br /><br />Full name: Random.random4</div>
<div class="tip" id="fs18">val random5 : obj<br /><br />Full name: Random.random5</div>
<div class="tip" id="fs19">val a : obj<br /><br />Full name: Random.a</div>
<div class="tip" id="fs20">val b : obj<br /><br />Full name: Random.b</div>
<div class="tip" id="fs21">val c : obj<br /><br />Full name: Random.c</div>
<div class="fsdocs-tip" id="fs1">val samples : obj</div>
<div class="fsdocs-tip" id="fs2">val sampleSeq : obj</div>
<div class="fsdocs-tip" id="fs3">val rng : obj</div>
<div class="fsdocs-tip" id="fs4">val sample : obj</div>
<div class="fsdocs-tip" id="fs5">val sampled : obj</div>
<div class="fsdocs-tip" id="fs6">val someTimeSeed : obj</div>
<div class="fsdocs-tip" id="fs7">val someGuidSeed : obj</div>
<div class="fsdocs-tip" id="fs8">val someRobustSeed : obj</div>
<div class="fsdocs-tip" id="fs9">val samplesSeeded : obj</div>
<div class="fsdocs-tip" id="fs10">val samplesSeqSeeded : obj</div>
<div class="fsdocs-tip" id="fs11">val random1 : obj</div>
<div class="fsdocs-tip" id="fs12">val random1b : obj</div>
<div class="fsdocs-tip" id="fs13">val random2 : obj</div>
<div class="fsdocs-tip" id="fs14">val random2b : obj</div>
<div class="fsdocs-tip" id="fs15">val random2c : obj</div>
<div class="fsdocs-tip" id="fs16">val random3 : obj</div>
<div class="fsdocs-tip" id="fs17">val random4 : obj</div>
<div class="fsdocs-tip" id="fs18">val random5 : obj</div>
<div class="fsdocs-tip" id="fs19">val a : obj</div>
<div class="fsdocs-tip" id="fs20">val b : obj</div>
<div class="fsdocs-tip" id="fs21">val c : obj</div>
</div>
<div class="span3">
<ul class="nav nav-list" id="menu">
<li class="nav-header">Math.NET Numerics</li>
<li><a href="https://numerics.mathdotnet.com/Packages.html">NuGet & Binaries</a></li>
<li><a href="https://numerics.mathdotnet.com/ReleaseNotes.html">Release Notes</a></li>
<li><a href="https://numerics.mathdotnet.com/License.html">MIT License</a></li>
<li><a href="https://numerics.mathdotnet.com/Compatibility.html">Platform Support</a></li>
<li><a href="https://numerics.mathdotnet.com/api/">Class Reference</a></li>
<li><a href="https://github.com/mathnet/mathnet-numerics/issues">Issues & Bugs</a></li>
<li><a href="https://numerics.mathdotnet.com/Users.html">Who is using Math.NET?</a></li>
<li class="nav-header">Contributing</li>
<li><a href="https://numerics.mathdotnet.com/Contributors.html">Contributors</a></li>
<li><a href="https://numerics.mathdotnet.com/Contributing.html">Contributing</a></li>
<li><a href="https://numerics.mathdotnet.com/Build.html">Build & Tools</a></li>
<li><a href="http://feedback.mathdotnet.com/forums/2060-math-net-numerics">Your Ideas</a></li>
<li class="nav-header">Getting Help</li>
<li><a href="https://discuss.mathdotnet.com/c/numerics">Discuss</a></li>
<li><a href="https://stackoverflow.com/questions/tagged/mathdotnet">Stack Overflow</a></li>
<li class="nav-header">Getting Started</li>
<li><a href="https://numerics.mathdotnet.com/">Getting started</a></li>
<li><a href="https://numerics.mathdotnet.com/Constants.html">Constants</a></li>
<li>Floating-Point Numbers</li>
<li>Arbitrary Precision Numbers</li>
<li>Complex Numbers</li>
<li><a href="https://numerics.mathdotnet.com/Matrix.html">Matrices and Vectors</a></li>
<li><a href="https://numerics.mathdotnet.com/Euclid.html">Euclid & Number Theory</a></li>
<li>Combinatorics</li>
<li class="nav-header">Evaluation</li>
<li><a href="https://numerics.mathdotnet.com/Functions.html">Special Functions</a></li>
<li>Differentiation</li>
<li><a href="https://numerics.mathdotnet.com/Integration.html">Integration</a></li>
<li class="nav-header">Statistics/Probability</li>
<li><a href="https://numerics.mathdotnet.com/DescriptiveStatistics.html">Descriptive Statistics</a></li>
<li><a href="https://numerics.mathdotnet.com/Probability.html">Probability Distributions</a></li>
<li class="nav-header">Generation</li>
<li><a href="https://numerics.mathdotnet.com/Generate.html">Generating Data</a></li>
<li><a href="https://numerics.mathdotnet.com/Random.html">Random Numbers</a></li>
<li class="nav-header">Transformation</li>
<li>Fourier Transform (FFT)</li>
<li>Filtering & DSP</li>
<li>Window Functions</li>
<li class="nav-header">Solving Equations</li>
<li><a href="https://numerics.mathdotnet.com/LinearEquations.html">Linear Equation Systems</a></li>
<li>Nonlinear Root Finding</li>
<li class="nav-header">Optimization</li>
<li>Linear Least Squares</li>
<li>Nonlinear Optimization</li>
<li><a href="https://numerics.mathdotnet.com/Distance.html">Distance Metrics</a></li>
<li class="nav-header">Curve Fitting</li>
<li><a href="https://numerics.mathdotnet.com/Regression.html">Regression</a></li>
<li>Interpolation</li>
<li>Fourier Approximation</li>
<li class="nav-header">Native Providers</li>
<li><a href="https://numerics.mathdotnet.com/MKL.html">Intel MKL</a></li>
<li class="nav-header">Working Together</li>
<li><a href="https://numerics.mathdotnet.com/CSV.html">Delimited Text Files (CSV)</a></li>
<li><a href="https://numerics.mathdotnet.com/MatrixMarket.html">NIST MatrixMarket</a></li>
<li><a href="https://numerics.mathdotnet.com/MatlabFiles.html">MATLAB</a></li>
<li><a href="https://numerics.mathdotnet.com/IFSharpNotebook.html">IF# Notebook</a></li>
<li>FsLab & Deedle</li>
<li>Microsoft Excel</li>
<li>numl.net machine learning</li>
<li>R-project</li>
</ul>
</div>
</div>
</div>
</body>
<!-- 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>

373
Regression.html

@ -1,63 +1,138 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>Curve Fitting: Linear Regression
<head>
<meta charset="utf-8">
<title>Curve Fitting: Linear Regression
</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta name="description" content="Math.NET Numerics, providing methods and algorithms for numerical computations in science, engineering and every day use. .Net 4, .Net 3.5, SL5, Win8, WP8, PCL 47 and 136, Mono, Xamarin Android/iOS."/>
<meta name="author" content="Christoph Ruegg, Marcus Cuda, Jurgen Van Gael"/>
<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 src="https://code.jquery.com/jquery-1.8.0.js"></script>
<script src="https://code.jquery.com/ui/1.8.23/jquery-ui.js"></script>
<script src="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/js/bootstrap.min.js"></script>
<link href="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap-combined.min.css" rel="stylesheet"/>
<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 type="text/css" rel="stylesheet" href="https://numerics.mathdotnet.com/content/style.css" />
<style>
#main table:not(.pre) {
border: 1px solid #dddddd;
max-width: 100%;
border-style: solid;
border-width: 1px;
border-color: gray;
border-collapse: collapse;
border-right-width: 1px;
border-bottom-width: 1px;
margin-top: 15px;
margin-bottom: 25px;
}
#main table:not(.pre) th, #main table:not(.pre) td {
border: 1px solid #dddddd;
padding: 6px;
}
#main table:not(.pre) th p, #main table:not(.pre) td p {
margin-bottom: 5px;
}
</style>
<script type="text/javascript" src="https://numerics.mathdotnet.com/content/tips.js"></script>
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<![endif]-->
<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>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
</head>
<body>
<div class="container">
<div class="masthead">
<ul class="nav nav-pills pull-right">
<li><a href="https://www.mathdotnet.com">Math.NET Project</a></li>
<li><a href="https://numerics.mathdotnet.com">Math.NET Numerics</a></li>
<li><a href="https://github.com/mathnet/mathnet-numerics">GitHub</a></li>
</ul>
<h3 class="muted">Math.NET Numerics</h3>
<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>
<hr />
<div class="row">
<div class="span9" id="main">
<h1><a name="Curve-Fitting-Linear-Regression" class="anchor" href="#Curve-Fitting-Linear-Regression">Curve Fitting: Linear Regression</a></h1>
<!-- 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">Floating-Point Numbers</li>
<li class="nav-item">Arbitrary Precision Numbers</li>
<li class="nav-item">Complex Numbers</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">Differentiation</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">Transformation</li>
<li class="nav-item">Fourier Transform (FFT)</li>
<li class="nav-item">Filtering & DSP</li>
<li class="nav-item">Window Functions</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-item">Nonlinear Root Finding</li>
<li class="nav-header">Optimization</li>
<li class="nav-item">Linear Least Squares</li>
<li class="nav-item">Nonlinear 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-item">Interpolation</li>
<li class="nav-item">Fourier Approximation</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://www.mathdotnet.com">Math.NET Project</a> |
<a href="https://numerics.mathdotnet.com">Math.NET Numerics</a> |
<a href="https://github.com/mathnet/mathnet-numerics">GitHub</a>
</h3>
</div>
<hr />
<div class="container" id="fsdocs-content">
<h1><a name="Curve-Fitting-Linear-Regression" class="anchor" href="#Curve-Fitting-Linear-Regression">Curve Fitting: Linear Regression</a></h1>
<p>Regression is all about fitting a low order parametric model or curve to data, so we can
reason about it or make predictions on points not covered by the data. Both data and
model are known, but we'd like to find the model parameters that make the model fit best
@ -72,14 +147,7 @@ if you need the data to be reproduced exactly, have a look at interpolation inst
<span class="math">\(y : x \mapsto a + b x\)</span> to a set of points <span class="math">\((x_j,y_j)\)</span>, where <span class="math">\(x_j\)</span> and <span class="math">\(y_j\)</span> are scalars.
Assuming we have two double arrays for x and y, we can use <code>Fit.Line</code> to evaluate the <span class="math">\(a\)</span> and <span class="math">\(b\)</span>
parameters of the least squares fit:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
<span class="l">4: </span>
<span class="l">5: </span>
<span class="l">6: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">double</span>[] xdata <span class="o">=</span> <span class="k">new</span> <span class="k">double</span>[] { <span class="n">10</span>, <span class="n">20</span>, <span class="n">30</span> };
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">double</span>[] xdata <span class="o">=</span> <span class="k">new</span> <span class="k">double</span>[] { <span class="n">10</span>, <span class="n">20</span>, <span class="n">30</span> };
<span class="k">double</span>[] ydata <span class="o">=</span> <span class="k">new</span> <span class="k">double</span>[] { <span class="n">15</span>, <span class="n">20</span>, <span class="n">25</span> };
Tuple&lt;<span class="k">double</span>, <span class="k">double</span>&gt; p <span class="o">=</span> Fit.Line(xdata, ydata);
@ -87,18 +155,12 @@ Tuple&lt;<span class="k">double</span>, <span class="k">double</span>&gt; p <spa
<span class="k">double</span> b <span class="o">=</span> p.Item<span class="n">2</span>; <span class="c">// == 0.5; slope</span>
</code></pre></td></tr></table>
<p>Or in F#:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="k">let</span> <span onmouseout="hideTip(event, 'fs1', 1)" onmouseover="showTip(event, 'fs1', 1)" class="i">a</span>, <span onmouseout="hideTip(event, 'fs2', 2)" onmouseover="showTip(event, 'fs2', 2)" class="i">b</span> <span class="o">=</span> <span class="i">Fit</span><span class="o">.</span><span class="i">Line</span> ([|<span class="n">10.0</span>;<span class="n">20.0</span>;<span class="n">30.0</span>|], [|<span class="n">15.0</span>;<span class="n">20.0</span>;<span class="n">25.0</span>|])
</code></pre></td>
</tr>
</table>
<pre class="fssnip highlighted"><code lang="fsharp"><span class="k">let</span> <span onmouseout="hideTip(event, 'fs1', 1)" onmouseover="showTip(event, 'fs1', 1)" class="id">a</span><span class="pn">,</span> <span onmouseout="hideTip(event, 'fs2', 2)" onmouseover="showTip(event, 'fs2', 2)" class="id">b</span> <span class="o">=</span> <span class="id">Fit</span><span class="pn">.</span><span class="id">Line</span> <span class="pn">(</span><span class="pn">[|</span><span class="n">10.0</span><span class="pn">;</span><span class="n">20.0</span><span class="pn">;</span><span class="n">30.0</span><span class="pn">|]</span><span class="pn">,</span> <span class="pn">[|</span><span class="n">15.0</span><span class="pn">;</span><span class="n">20.0</span><span class="pn">;</span><span class="n">25.0</span><span class="pn">|]</span><span class="pn">)</span>
</code></pre>
<p>How well do these parameters fit the data? The data points happen to be positioned
exactly on a line. Indeed, the <a href="https://en.wikipedia.org/wiki/Coefficient_of_determination">coefficient of determination</a>
confirms the perfect fit:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp">GoodnessOfFit.RSquared(xdata.Select(x <span class="o">=</span><span class="o">&gt;</span> a+b*x), ydata); <span class="c">// == 1.0</span>
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp">GoodnessOfFit.RSquared(xdata.Select(x <span class="o">=</span><span class="o">&gt;</span> a+b*x), ydata); <span class="c">// == 1.0</span>
</code></pre></td></tr></table>
<h2><a name="Linear-Model" class="anchor" href="#Linear-Model">Linear Model</a></h2>
<p>In practice, a line is often not an adequate model. But if we can choose a model that is linear,
@ -126,9 +188,7 @@ overdefined system of <span class="math">\(M\)</span> equations:</p>
<p>Provided the dataset is small enough, if transformed to the normal equation
<span class="math">\(\mathbf{X}^T\mathbf y = \mathbf{X}^T\mathbf X \mathbf p\)</span> this can be solved efficiently by the
Cholesky decomposition (do not use matrix inversion!).</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp">Vector&lt;<span class="k">double</span>&gt; p <span class="o">=</span> MultipleRegression.NormalEquations(X, y);
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp">Vector&lt;<span class="k">double</span>&gt; p <span class="o">=</span> MultipleRegression.NormalEquations(X, y);
</code></pre></td></tr></table>
<p>Using normal equations is comparably fast as it can dramatically reduce the linear algebra problem
to be solved, but that comes at the cost of less precision. If you need more precision, try using
@ -139,9 +199,7 @@ to be solved, but that comes at the cost of less precision. If you need more pre
<p>The predictor matrix of this model is the <a href="https://en.wikipedia.org/wiki/Vandermonde_matrix">Vandermonde matrix</a>.
There is a special function in the <code>Fit</code> class for regressions to a polynomial,
but note that regression to high order polynomials is numerically problematic.</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">double</span>[] p <span class="o">=</span> Fit.Polynomial(xdata, ydata, <span class="n">3</span>); <span class="c">// polynomial of order 3</span>
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">double</span>[] p <span class="o">=</span> Fit.Polynomial(xdata, ydata, <span class="n">3</span>); <span class="c">// polynomial of order 3</span>
</code></pre></td></tr></table>
<h2><a name="Multiple-Regression" class="anchor" href="#Multiple-Regression">Multiple Regression</a></h2>
<p>The <span class="math">\(x\)</span> in the linear model can also be a vector <span class="math">\(\mathbf x = [x^{(1)}\; x^{(2)} \cdots x^{(k)}]\)</span>
@ -151,24 +209,14 @@ we end up at the simplest form of ordinary multiple regression:</p>
<p><span class="math">\[y : x \mapsto p_0 + p_1 x^{(1)} + p_2 x^{(2)} + \cdots + p_N x^{(N)}\]</span></p>
<p>For example, for the data points <span class="math">\((\mathbf{x}_j = [x^{(1)}_j\; x^{(2)}_j], y_j)\)</span> with values
<code>([1,4],15)</code>, <code>([2,5],20)</code> and <code>([3,2],10)</code> we can evaluate the best fitting parameters with:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
<span class="l">4: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">double</span>[] p <span class="o">=</span> Fit.MultiDim(
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">double</span>[] p <span class="o">=</span> Fit.MultiDim(
<span class="k">new</span>[] {<span class="k">new</span>[] { <span class="n">1.0</span>, <span class="n">4.0</span> }, <span class="k">new</span>[] { <span class="n">2.0</span>, <span class="n">5.0</span> }, <span class="k">new</span>[] { <span class="n">3.0</span>, <span class="n">2.0</span> }},
<span class="k">new</span>[] { <span class="n">15.0</span>, <span class="n">20</span>, <span class="n">10</span> },
intercept: <span class="k">true</span>);
</code></pre></td></tr></table>
<p>The <code>Fit.MultiDim</code> routine uses normal equations, but you can always choose to explicitly use e.g.
the QR decomposition for more precision by using the <code>MultipleRegression</code> class directly:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
<span class="l">4: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">double</span>[] p <span class="o">=</span> MultipleRegression.QR(
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">double</span>[] p <span class="o">=</span> MultipleRegression.QR(
<span class="k">new</span>[] {<span class="k">new</span>[] { <span class="n">1.0</span>, <span class="n">4.0</span> }, <span class="k">new</span>[] { <span class="n">2.0</span>, <span class="n">5.0</span> }, <span class="k">new</span>[] { <span class="n">3.0</span>, <span class="n">2.0</span> }},
<span class="k">new</span>[] { <span class="n">15.0</span>, <span class="n">20</span>, <span class="n">10</span> },
intercept: <span class="k">true</span>);
@ -180,20 +228,11 @@ defined at all the data points. For example, let's have a look at the following
model in two dimensions:</p>
<p><span class="math">\[z : (x, y) \mapsto p_0 + p_1 \mathrm{tanh}(x) + p_2 \psi(x y) + p_3 x^y\]</span></p>
<p>Since we map (x,y) to (z) we need to organize the tuples in two arrays:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">double</span>[][] xy <span class="o">=</span> <span class="k">new</span>[] { <span class="k">new</span>[]{x<span class="n">1</span>,y<span class="n">1</span>}, <span class="k">new</span>[]{x<span class="n">2</span>,y<span class="n">2</span>}, <span class="k">new</span>[]{x<span class="n">3</span>,y<span class="n">3</span>}, <span class="o">.</span><span class="o">.</span><span class="o">.</span> };
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">double</span>[][] xy <span class="o">=</span> <span class="k">new</span>[] { <span class="k">new</span>[]{x<span class="n">1</span>,y<span class="n">1</span>}, <span class="k">new</span>[]{x<span class="n">2</span>,y<span class="n">2</span>}, <span class="k">new</span>[]{x<span class="n">3</span>,y<span class="n">3</span>}, <span class="o">.</span><span class="o">.</span><span class="o">.</span> };
<span class="k">double</span>[] z <span class="o">=</span> <span class="k">new</span>[] { z<span class="n">1</span>, z<span class="n">2</span>, z<span class="n">3</span>, <span class="o">.</span><span class="o">.</span><span class="o">.</span> };
</code></pre></td></tr></table>
<p>Then we can call Fit.LinearMultiDim with our model, which will return an array with the best fitting 4 parameters <span class="math">\(p_0, p_1, p_2, p_3\)</span>:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
<span class="l">4: </span>
<span class="l">5: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">double</span>[] p <span class="o">=</span> Fit.LinearMultiDim(xy, z,
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">double</span>[] p <span class="o">=</span> Fit.LinearMultiDim(xy, z,
d <span class="o">=</span><span class="o">&gt;</span> <span class="n">1.0</span>, <span class="c">// p0*1.0</span>
d <span class="o">=</span><span class="o">&gt;</span> Math.Tanh(d[<span class="n">0</span>]), <span class="c">// p1*tanh(x)</span>
d <span class="o">=</span><span class="o">&gt;</span> SpecialFunctions.DiGamma(d[<span class="n">0</span>]*d[<span class="n">1</span>]), <span class="c">// p2*psi(x*y)</span>
@ -203,13 +242,7 @@ model in two dimensions:</p>
<p>Let's say we have the following model:</p>
<p><span class="math">\[y : x \mapsto a + b \ln x\]</span></p>
<p>For this case we can use the <code>Fit.LinearCombination</code> function:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
<span class="l">4: </span>
<span class="l">5: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">double</span>[] p <span class="o">=</span> Fit.LinearCombination(
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">double</span>[] p <span class="o">=</span> Fit.LinearCombination(
<span class="k">new</span>[] {<span class="n">61.0</span>, <span class="n">62.0</span>, <span class="n">63.0</span>, <span class="n">65.0</span>},
<span class="k">new</span>[] {<span class="n">3.6</span>,<span class="n">3.8</span>, <span class="n">4.8</span>, <span class="n">4.1</span>},
x <span class="o">=</span><span class="o">&gt;</span> <span class="n">1.0</span>,
@ -219,14 +252,7 @@ model in two dimensions:</p>
the values of p to the model function, or we can use an alternative function with the <code>Func</code>
suffix that returns a function instead of the model parameters. The returned function
can then be used to evaluate the parametrized model:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
<span class="l">4: </span>
<span class="l">5: </span>
<span class="l">6: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp">Func&lt;<span class="k">double</span>,<span class="k">double</span>&gt; f <span class="o">=</span> Fit.LinearCombinationFunc(
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp">Func&lt;<span class="k">double</span>,<span class="k">double</span>&gt; f <span class="o">=</span> Fit.LinearCombinationFunc(
<span class="k">new</span>[] {<span class="n">61.0</span>, <span class="n">62.0</span>, <span class="n">63.0</span>, <span class="n">65.0</span>},
<span class="k">new</span>[] {<span class="n">3.6</span>, <span class="n">3.8</span>, <span class="n">4.8</span>, <span class="n">4.1</span>},
x <span class="o">=</span><span class="o">&gt;</span> <span class="n">1.0</span>,
@ -239,19 +265,7 @@ For example, the following power function</p>
<p><span class="math">\[z : (x, y) \mapsto u x^v y^w\]</span></p>
<p>can be transformed into the following linear model with <span class="math">\(\hat{z} = \ln z\)</span> and <span class="math">\(t = \ln u\)</span></p>
<p><span class="math">\[\hat{z} : (x, y) \mapsto t + v \ln x + w \ln y\]</span></p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l"> 1: </span>
<span class="l"> 2: </span>
<span class="l"> 3: </span>
<span class="l"> 4: </span>
<span class="l"> 5: </span>
<span class="l"> 6: </span>
<span class="l"> 7: </span>
<span class="l"> 8: </span>
<span class="l"> 9: </span>
<span class="l">10: </span>
<span class="l">11: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">var</span> xy <span class="o">=</span> <span class="k">new</span>[] {<span class="k">new</span>[] { <span class="n">1.0</span>, <span class="n">4.0</span> }, <span class="k">new</span>[] { <span class="n">2.0</span>, <span class="n">5.0</span> }, <span class="k">new</span>[] { <span class="n">3.0</span>, <span class="n">2.0</span> }};
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">var</span> xy <span class="o">=</span> <span class="k">new</span>[] {<span class="k">new</span>[] { <span class="n">1.0</span>, <span class="n">4.0</span> }, <span class="k">new</span>[] { <span class="n">2.0</span>, <span class="n">5.0</span> }, <span class="k">new</span>[] { <span class="n">3.0</span>, <span class="n">2.0</span> }};
<span class="k">var</span> z <span class="o">=</span> <span class="k">new</span>[] { <span class="n">15.0</span>, <span class="n">20</span>, <span class="n">10</span> };
<span class="k">var</span> z_hat <span class="o">=</span> z.Select(r <span class="o">=</span><span class="o">&gt;</span> Math.Log(r)).ToArray(); <span class="c">// transform z_hat = ln(z)</span>
@ -269,106 +283,29 @@ We can achieve this by introducing a weight matrix <span class="math">\(W\)</spa
<span class="math">\(\mathbf{X}^T\mathbf{y} = \mathbf{X}^T\mathbf{X}\mathbf{p}\)</span>. Such weight matrices
are often diagonal, with a separate weight for each data point on the diagonal.</p>
<p><span class="math">\[\mathbf{X}^T\mathbf{W}\mathbf{y} = \mathbf{X}^T\mathbf{W}\mathbf{X}\mathbf{p}\]</span></p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">var</span> p <span class="o">=</span> WeightedRegression.Weighted(X,y,W);
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">var</span> p <span class="o">=</span> WeightedRegression.Weighted(X,y,W);
</code></pre></td></tr></table>
<p>Weighter regression becomes interesting if we can adapt them to the point of interest
and e.g. dampen all data points far away. Unfortunately this way the model parameters
are dependent on the point of interest <span class="math">\(t\)</span>.</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="c">// warning: preliminary api</span>
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="c">// warning: preliminary api</span>
<span class="k">var</span> p <span class="o">=</span> WeightedRegression.Local(X,y,t,radius,kernel);
</code></pre></td></tr></table>
<h2><a name="Regularization" class="anchor" href="#Regularization">Regularization</a></h2>
<h2><a name="Iterative-Methods" class="anchor" href="#Iterative-Methods">Iterative Methods</a></h2>
<div class="tip" id="fs1">val a : obj<br /><br />Full name: Regression.a</div>
<div class="tip" id="fs2">val b : obj<br /><br />Full name: Regression.b</div>
<div class="fsdocs-tip" id="fs1">val a : obj</div>
<div class="fsdocs-tip" id="fs2">val b : obj</div>
</div>
<div class="span3">
<ul class="nav nav-list" id="menu">
<li class="nav-header">Math.NET Numerics</li>
<li><a href="https://numerics.mathdotnet.com/Packages.html">NuGet & Binaries</a></li>
<li><a href="https://numerics.mathdotnet.com/ReleaseNotes.html">Release Notes</a></li>
<li><a href="https://numerics.mathdotnet.com/License.html">MIT License</a></li>
<li><a href="https://numerics.mathdotnet.com/Compatibility.html">Platform Support</a></li>
<li><a href="https://numerics.mathdotnet.com/api/">Class Reference</a></li>
<li><a href="https://github.com/mathnet/mathnet-numerics/issues">Issues & Bugs</a></li>
<li><a href="https://numerics.mathdotnet.com/Users.html">Who is using Math.NET?</a></li>
<li class="nav-header">Contributing</li>
<li><a href="https://numerics.mathdotnet.com/Contributors.html">Contributors</a></li>
<li><a href="https://numerics.mathdotnet.com/Contributing.html">Contributing</a></li>
<li><a href="https://numerics.mathdotnet.com/Build.html">Build & Tools</a></li>
<li><a href="http://feedback.mathdotnet.com/forums/2060-math-net-numerics">Your Ideas</a></li>
<li class="nav-header">Getting Help</li>
<li><a href="https://discuss.mathdotnet.com/c/numerics">Discuss</a></li>
<li><a href="https://stackoverflow.com/questions/tagged/mathdotnet">Stack Overflow</a></li>
<li class="nav-header">Getting Started</li>
<li><a href="https://numerics.mathdotnet.com/">Getting started</a></li>
<li><a href="https://numerics.mathdotnet.com/Constants.html">Constants</a></li>
<li>Floating-Point Numbers</li>
<li>Arbitrary Precision Numbers</li>
<li>Complex Numbers</li>
<li><a href="https://numerics.mathdotnet.com/Matrix.html">Matrices and Vectors</a></li>
<li><a href="https://numerics.mathdotnet.com/Euclid.html">Euclid & Number Theory</a></li>
<li>Combinatorics</li>
<li class="nav-header">Evaluation</li>
<li><a href="https://numerics.mathdotnet.com/Functions.html">Special Functions</a></li>
<li>Differentiation</li>
<li><a href="https://numerics.mathdotnet.com/Integration.html">Integration</a></li>
<li class="nav-header">Statistics/Probability</li>
<li><a href="https://numerics.mathdotnet.com/DescriptiveStatistics.html">Descriptive Statistics</a></li>
<li><a href="https://numerics.mathdotnet.com/Probability.html">Probability Distributions</a></li>
<li class="nav-header">Generation</li>
<li><a href="https://numerics.mathdotnet.com/Generate.html">Generating Data</a></li>
<li><a href="https://numerics.mathdotnet.com/Random.html">Random Numbers</a></li>
<li class="nav-header">Transformation</li>
<li>Fourier Transform (FFT)</li>
<li>Filtering & DSP</li>
<li>Window Functions</li>
<li class="nav-header">Solving Equations</li>
<li><a href="https://numerics.mathdotnet.com/LinearEquations.html">Linear Equation Systems</a></li>
<li>Nonlinear Root Finding</li>
<li class="nav-header">Optimization</li>
<li>Linear Least Squares</li>
<li>Nonlinear Optimization</li>
<li><a href="https://numerics.mathdotnet.com/Distance.html">Distance Metrics</a></li>
<li class="nav-header">Curve Fitting</li>
<li><a href="https://numerics.mathdotnet.com/Regression.html">Regression</a></li>
<li>Interpolation</li>
<li>Fourier Approximation</li>
<li class="nav-header">Native Providers</li>
<li><a href="https://numerics.mathdotnet.com/MKL.html">Intel MKL</a></li>
<li class="nav-header">Working Together</li>
<li><a href="https://numerics.mathdotnet.com/CSV.html">Delimited Text Files (CSV)</a></li>
<li><a href="https://numerics.mathdotnet.com/MatrixMarket.html">NIST MatrixMarket</a></li>
<li><a href="https://numerics.mathdotnet.com/MatlabFiles.html">MATLAB</a></li>
<li><a href="https://numerics.mathdotnet.com/IFSharpNotebook.html">IF# Notebook</a></li>
<li>FsLab & Deedle</li>
<li>Microsoft Excel</li>
<li>numl.net machine learning</li>
<li>R-project</li>
</ul>
</div>
</div>
</div>
</body>
<!-- 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>

281
ReleaseNotes-MKL.html

@ -1,63 +1,138 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>MKL Provider Release Notes
<head>
<meta charset="utf-8">
<title>MKL Provider Release Notes
</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta name="description" content="Math.NET Numerics, providing methods and algorithms for numerical computations in science, engineering and every day use. .Net 4, .Net 3.5, SL5, Win8, WP8, PCL 47 and 136, Mono, Xamarin Android/iOS."/>
<meta name="author" content="Christoph Ruegg, Marcus Cuda, Jurgen Van Gael"/>
<script src="https://code.jquery.com/jquery-1.8.0.js"></script>
<script src="https://code.jquery.com/ui/1.8.23/jquery-ui.js"></script>
<script src="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/js/bootstrap.min.js"></script>
<link href="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap-combined.min.css" rel="stylesheet"/>
<link type="text/css" rel="stylesheet" href="https://numerics.mathdotnet.com/content/style.css" />
<style>
#main table:not(.pre) {
border: 1px solid #dddddd;
max-width: 100%;
border-style: solid;
border-width: 1px;
border-color: gray;
border-collapse: collapse;
border-right-width: 1px;
border-bottom-width: 1px;
margin-top: 15px;
margin-bottom: 25px;
}
#main table:not(.pre) th, #main table:not(.pre) td {
border: 1px solid #dddddd;
padding: 6px;
}
#main table:not(.pre) th p, #main table:not(.pre) td p {
margin-bottom: 5px;
}
</style>
<script type="text/javascript" src="https://numerics.mathdotnet.com/content/tips.js"></script>
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<![endif]-->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
</head>
<body>
<div class="container">
<div class="masthead">
<ul class="nav nav-pills pull-right">
<li><a href="https://www.mathdotnet.com">Math.NET Project</a></li>
<li><a href="https://numerics.mathdotnet.com">Math.NET Numerics</a></li>
<li><a href="https://github.com/mathnet/mathnet-numerics">GitHub</a></li>
</ul>
<h3 class="muted">Math.NET Numerics</h3>
<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>
<hr />
<div class="row">
<div class="span9" id="main">
<h1><a name="MKL-Provider-Release-Notes" class="anchor" href="#MKL-Provider-Release-Notes">MKL Provider Release Notes</a></h1>
<!-- 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">Floating-Point Numbers</li>
<li class="nav-item">Arbitrary Precision Numbers</li>
<li class="nav-item">Complex Numbers</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">Differentiation</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">Transformation</li>
<li class="nav-item">Fourier Transform (FFT)</li>
<li class="nav-item">Filtering & DSP</li>
<li class="nav-item">Window Functions</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-item">Nonlinear Root Finding</li>
<li class="nav-header">Optimization</li>
<li class="nav-item">Linear Least Squares</li>
<li class="nav-item">Nonlinear 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-item">Interpolation</li>
<li class="nav-item">Fourier Approximation</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://www.mathdotnet.com">Math.NET Project</a> |
<a href="https://numerics.mathdotnet.com">Math.NET Numerics</a> |
<a href="https://github.com/mathnet/mathnet-numerics">GitHub</a>
</h3>
</div>
<hr />
<div class="container" id="fsdocs-content">
<h1><a name="MKL-Provider-Release-Notes" class="anchor" href="#MKL-Provider-Release-Notes">MKL Provider Release Notes</a></h1>
<p><a href="ReleaseNotes.html">Math.NET Numerics</a> | <a href="ReleaseNotes-MKL.html">MKL Provider</a> | <a href="ReleaseNotes-OpenBLAS.html">OpenBLAS Provider</a></p>
<h3><a name="2-5-0-2021-01-01" class="anchor" href="#2-5-0-2021-01-01">2.5.0 - 2021-01-01</a></h3>
<ul>
@ -112,88 +187,16 @@
<li>Capability querying support</li>
</ul>
</div>
<div class="span3">
<ul class="nav nav-list" id="menu">
<li class="nav-header">Math.NET Numerics</li>
<li><a href="https://numerics.mathdotnet.com/Packages.html">NuGet & Binaries</a></li>
<li><a href="https://numerics.mathdotnet.com/ReleaseNotes.html">Release Notes</a></li>
<li><a href="https://numerics.mathdotnet.com/License.html">MIT License</a></li>
<li><a href="https://numerics.mathdotnet.com/Compatibility.html">Platform Support</a></li>
<li><a href="https://numerics.mathdotnet.com/api/">Class Reference</a></li>
<li><a href="https://github.com/mathnet/mathnet-numerics/issues">Issues & Bugs</a></li>
<li><a href="https://numerics.mathdotnet.com/Users.html">Who is using Math.NET?</a></li>
<li class="nav-header">Contributing</li>
<li><a href="https://numerics.mathdotnet.com/Contributors.html">Contributors</a></li>
<li><a href="https://numerics.mathdotnet.com/Contributing.html">Contributing</a></li>
<li><a href="https://numerics.mathdotnet.com/Build.html">Build & Tools</a></li>
<li><a href="http://feedback.mathdotnet.com/forums/2060-math-net-numerics">Your Ideas</a></li>
<li class="nav-header">Getting Help</li>
<li><a href="https://discuss.mathdotnet.com/c/numerics">Discuss</a></li>
<li><a href="https://stackoverflow.com/questions/tagged/mathdotnet">Stack Overflow</a></li>
<li class="nav-header">Getting Started</li>
<li><a href="https://numerics.mathdotnet.com/">Getting started</a></li>
<li><a href="https://numerics.mathdotnet.com/Constants.html">Constants</a></li>
<li>Floating-Point Numbers</li>
<li>Arbitrary Precision Numbers</li>
<li>Complex Numbers</li>
<li><a href="https://numerics.mathdotnet.com/Matrix.html">Matrices and Vectors</a></li>
<li><a href="https://numerics.mathdotnet.com/Euclid.html">Euclid & Number Theory</a></li>
<li>Combinatorics</li>
<li class="nav-header">Evaluation</li>
<li><a href="https://numerics.mathdotnet.com/Functions.html">Special Functions</a></li>
<li>Differentiation</li>
<li><a href="https://numerics.mathdotnet.com/Integration.html">Integration</a></li>
<li class="nav-header">Statistics/Probability</li>
<li><a href="https://numerics.mathdotnet.com/DescriptiveStatistics.html">Descriptive Statistics</a></li>
<li><a href="https://numerics.mathdotnet.com/Probability.html">Probability Distributions</a></li>
<li class="nav-header">Generation</li>
<li><a href="https://numerics.mathdotnet.com/Generate.html">Generating Data</a></li>
<li><a href="https://numerics.mathdotnet.com/Random.html">Random Numbers</a></li>
<li class="nav-header">Transformation</li>
<li>Fourier Transform (FFT)</li>
<li>Filtering & DSP</li>
<li>Window Functions</li>
<li class="nav-header">Solving Equations</li>
<li><a href="https://numerics.mathdotnet.com/LinearEquations.html">Linear Equation Systems</a></li>
<li>Nonlinear Root Finding</li>
<li class="nav-header">Optimization</li>
<li>Linear Least Squares</li>
<li>Nonlinear Optimization</li>
<li><a href="https://numerics.mathdotnet.com/Distance.html">Distance Metrics</a></li>
<li class="nav-header">Curve Fitting</li>
<li><a href="https://numerics.mathdotnet.com/Regression.html">Regression</a></li>
<li>Interpolation</li>
<li>Fourier Approximation</li>
<li class="nav-header">Native Providers</li>
<li><a href="https://numerics.mathdotnet.com/MKL.html">Intel MKL</a></li>
<li class="nav-header">Working Together</li>
<li><a href="https://numerics.mathdotnet.com/CSV.html">Delimited Text Files (CSV)</a></li>
<li><a href="https://numerics.mathdotnet.com/MatrixMarket.html">NIST MatrixMarket</a></li>
<li><a href="https://numerics.mathdotnet.com/MatlabFiles.html">MATLAB</a></li>
<li><a href="https://numerics.mathdotnet.com/IFSharpNotebook.html">IF# Notebook</a></li>
<li>FsLab & Deedle</li>
<li>Microsoft Excel</li>
<li>numl.net machine learning</li>
<li>R-project</li>
</ul>
</div>
</div>
</div>
</body>
<!-- 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>

281
ReleaseNotes-OpenBLAS.html

@ -1,151 +1,154 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>OpenBLAS Provider Release Notes
<head>
<meta charset="utf-8">
<title>OpenBLAS Provider Release Notes
</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta name="description" content="Math.NET Numerics, providing methods and algorithms for numerical computations in science, engineering and every day use. .Net 4, .Net 3.5, SL5, Win8, WP8, PCL 47 and 136, Mono, Xamarin Android/iOS."/>
<meta name="author" content="Christoph Ruegg, Marcus Cuda, Jurgen Van Gael"/>
<script src="https://code.jquery.com/jquery-1.8.0.js"></script>
<script src="https://code.jquery.com/ui/1.8.23/jquery-ui.js"></script>
<script src="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/js/bootstrap.min.js"></script>
<link href="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap-combined.min.css" rel="stylesheet"/>
<link type="text/css" rel="stylesheet" href="https://numerics.mathdotnet.com/content/style.css" />
<style>
#main table:not(.pre) {
border: 1px solid #dddddd;
max-width: 100%;
border-style: solid;
border-width: 1px;
border-color: gray;
border-collapse: collapse;
border-right-width: 1px;
border-bottom-width: 1px;
margin-top: 15px;
margin-bottom: 25px;
}
#main table:not(.pre) th, #main table:not(.pre) td {
border: 1px solid #dddddd;
padding: 6px;
}
#main table:not(.pre) th p, #main table:not(.pre) td p {
margin-bottom: 5px;
}
</style>
<script type="text/javascript" src="https://numerics.mathdotnet.com/content/tips.js"></script>
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<![endif]-->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
</head>
<body>
<div class="container">
<div class="masthead">
<ul class="nav nav-pills pull-right">
<li><a href="https://www.mathdotnet.com">Math.NET Project</a></li>
<li><a href="https://numerics.mathdotnet.com">Math.NET Numerics</a></li>
<li><a href="https://github.com/mathnet/mathnet-numerics">GitHub</a></li>
</ul>
<h3 class="muted">Math.NET Numerics</h3>
<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>
<hr />
<div class="row">
<div class="span9" id="main">
<h1><a name="OpenBLAS-Provider-Release-Notes" class="anchor" href="#OpenBLAS-Provider-Release-Notes">OpenBLAS Provider Release Notes</a></h1>
<!-- 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">Floating-Point Numbers</li>
<li class="nav-item">Arbitrary Precision Numbers</li>
<li class="nav-item">Complex Numbers</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">Differentiation</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">Transformation</li>
<li class="nav-item">Fourier Transform (FFT)</li>
<li class="nav-item">Filtering & DSP</li>
<li class="nav-item">Window Functions</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-item">Nonlinear Root Finding</li>
<li class="nav-header">Optimization</li>
<li class="nav-item">Linear Least Squares</li>
<li class="nav-item">Nonlinear 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-item">Interpolation</li>
<li class="nav-item">Fourier Approximation</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://www.mathdotnet.com">Math.NET Project</a> |
<a href="https://numerics.mathdotnet.com">Math.NET Numerics</a> |
<a href="https://github.com/mathnet/mathnet-numerics">GitHub</a>
</h3>
</div>
<hr />
<div class="container" id="fsdocs-content">
<h1><a name="OpenBLAS-Provider-Release-Notes" class="anchor" href="#OpenBLAS-Provider-Release-Notes">OpenBLAS Provider Release Notes</a></h1>
<p><a href="ReleaseNotes.html">Math.NET Numerics</a> | <a href="ReleaseNotes-MKL.html">MKL Provider</a> | <a href="ReleaseNotes-OpenBLAS.html">OpenBLAS Provider</a></p>
<h3><a name="0-2-0-2015-09-26" class="anchor" href="#0-2-0-2015-09-26">0.2.0 - 2015-09-26</a></h3>
<ul>
<li>Initial version</li>
</ul>
</div>
<div class="span3">
<ul class="nav nav-list" id="menu">
<li class="nav-header">Math.NET Numerics</li>
<li><a href="https://numerics.mathdotnet.com/Packages.html">NuGet & Binaries</a></li>
<li><a href="https://numerics.mathdotnet.com/ReleaseNotes.html">Release Notes</a></li>
<li><a href="https://numerics.mathdotnet.com/License.html">MIT License</a></li>
<li><a href="https://numerics.mathdotnet.com/Compatibility.html">Platform Support</a></li>
<li><a href="https://numerics.mathdotnet.com/api/">Class Reference</a></li>
<li><a href="https://github.com/mathnet/mathnet-numerics/issues">Issues & Bugs</a></li>
<li><a href="https://numerics.mathdotnet.com/Users.html">Who is using Math.NET?</a></li>
<li class="nav-header">Contributing</li>
<li><a href="https://numerics.mathdotnet.com/Contributors.html">Contributors</a></li>
<li><a href="https://numerics.mathdotnet.com/Contributing.html">Contributing</a></li>
<li><a href="https://numerics.mathdotnet.com/Build.html">Build & Tools</a></li>
<li><a href="http://feedback.mathdotnet.com/forums/2060-math-net-numerics">Your Ideas</a></li>
<li class="nav-header">Getting Help</li>
<li><a href="https://discuss.mathdotnet.com/c/numerics">Discuss</a></li>
<li><a href="https://stackoverflow.com/questions/tagged/mathdotnet">Stack Overflow</a></li>
<li class="nav-header">Getting Started</li>
<li><a href="https://numerics.mathdotnet.com/">Getting started</a></li>
<li><a href="https://numerics.mathdotnet.com/Constants.html">Constants</a></li>
<li>Floating-Point Numbers</li>
<li>Arbitrary Precision Numbers</li>
<li>Complex Numbers</li>
<li><a href="https://numerics.mathdotnet.com/Matrix.html">Matrices and Vectors</a></li>
<li><a href="https://numerics.mathdotnet.com/Euclid.html">Euclid & Number Theory</a></li>
<li>Combinatorics</li>
<li class="nav-header">Evaluation</li>
<li><a href="https://numerics.mathdotnet.com/Functions.html">Special Functions</a></li>
<li>Differentiation</li>
<li><a href="https://numerics.mathdotnet.com/Integration.html">Integration</a></li>
<li class="nav-header">Statistics/Probability</li>
<li><a href="https://numerics.mathdotnet.com/DescriptiveStatistics.html">Descriptive Statistics</a></li>
<li><a href="https://numerics.mathdotnet.com/Probability.html">Probability Distributions</a></li>
<li class="nav-header">Generation</li>
<li><a href="https://numerics.mathdotnet.com/Generate.html">Generating Data</a></li>
<li><a href="https://numerics.mathdotnet.com/Random.html">Random Numbers</a></li>
<li class="nav-header">Transformation</li>
<li>Fourier Transform (FFT)</li>
<li>Filtering & DSP</li>
<li>Window Functions</li>
<li class="nav-header">Solving Equations</li>
<li><a href="https://numerics.mathdotnet.com/LinearEquations.html">Linear Equation Systems</a></li>
<li>Nonlinear Root Finding</li>
<li class="nav-header">Optimization</li>
<li>Linear Least Squares</li>
<li>Nonlinear Optimization</li>
<li><a href="https://numerics.mathdotnet.com/Distance.html">Distance Metrics</a></li>
<li class="nav-header">Curve Fitting</li>
<li><a href="https://numerics.mathdotnet.com/Regression.html">Regression</a></li>
<li>Interpolation</li>
<li>Fourier Approximation</li>
<li class="nav-header">Native Providers</li>
<li><a href="https://numerics.mathdotnet.com/MKL.html">Intel MKL</a></li>
<li class="nav-header">Working Together</li>
<li><a href="https://numerics.mathdotnet.com/CSV.html">Delimited Text Files (CSV)</a></li>
<li><a href="https://numerics.mathdotnet.com/MatrixMarket.html">NIST MatrixMarket</a></li>
<li><a href="https://numerics.mathdotnet.com/MatlabFiles.html">MATLAB</a></li>
<li><a href="https://numerics.mathdotnet.com/IFSharpNotebook.html">IF# Notebook</a></li>
<li>FsLab & Deedle</li>
<li>Microsoft Excel</li>
<li>numl.net machine learning</li>
<li>R-project</li>
</ul>
</div>
</div>
</div>
</body>
<!-- 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>

275
ReleaseNotes.html

@ -1,63 +1,138 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>Math.NET Numerics Release Notes
<head>
<meta charset="utf-8">
<title>Math.NET Numerics Release Notes
</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta name="description" content="Math.NET Numerics, providing methods and algorithms for numerical computations in science, engineering and every day use. .Net 4, .Net 3.5, SL5, Win8, WP8, PCL 47 and 136, Mono, Xamarin Android/iOS."/>
<meta name="author" content="Christoph Ruegg, Marcus Cuda, Jurgen Van Gael"/>
<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 src="https://code.jquery.com/jquery-1.8.0.js"></script>
<script src="https://code.jquery.com/ui/1.8.23/jquery-ui.js"></script>
<script src="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/js/bootstrap.min.js"></script>
<link href="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap-combined.min.css" rel="stylesheet"/>
<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 type="text/css" rel="stylesheet" href="https://numerics.mathdotnet.com/content/style.css" />
<style>
#main table:not(.pre) {
border: 1px solid #dddddd;
max-width: 100%;
border-style: solid;
border-width: 1px;
border-color: gray;
border-collapse: collapse;
border-right-width: 1px;
border-bottom-width: 1px;
margin-top: 15px;
margin-bottom: 25px;
}
#main table:not(.pre) th, #main table:not(.pre) td {
border: 1px solid #dddddd;
padding: 6px;
}
#main table:not(.pre) th p, #main table:not(.pre) td p {
margin-bottom: 5px;
}
</style>
<script type="text/javascript" src="https://numerics.mathdotnet.com/content/tips.js"></script>
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<![endif]-->
<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>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
</head>
<body>
<div class="container">
<div class="masthead">
<ul class="nav nav-pills pull-right">
<li><a href="https://www.mathdotnet.com">Math.NET Project</a></li>
<li><a href="https://numerics.mathdotnet.com">Math.NET Numerics</a></li>
<li><a href="https://github.com/mathnet/mathnet-numerics">GitHub</a></li>
</ul>
<h3 class="muted">Math.NET Numerics</h3>
<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>
<hr />
<div class="row">
<div class="span9" id="main">
<h1><a name="Math-NET-Numerics-Release-Notes" class="anchor" href="#Math-NET-Numerics-Release-Notes">Math.NET Numerics Release Notes</a></h1>
<!-- 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">Floating-Point Numbers</li>
<li class="nav-item">Arbitrary Precision Numbers</li>
<li class="nav-item">Complex Numbers</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">Differentiation</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">Transformation</li>
<li class="nav-item">Fourier Transform (FFT)</li>
<li class="nav-item">Filtering & DSP</li>
<li class="nav-item">Window Functions</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-item">Nonlinear Root Finding</li>
<li class="nav-header">Optimization</li>
<li class="nav-item">Linear Least Squares</li>
<li class="nav-item">Nonlinear 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-item">Interpolation</li>
<li class="nav-item">Fourier Approximation</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://www.mathdotnet.com">Math.NET Project</a> |
<a href="https://numerics.mathdotnet.com">Math.NET Numerics</a> |
<a href="https://github.com/mathnet/mathnet-numerics">GitHub</a>
</h3>
</div>
<hr />
<div class="container" id="fsdocs-content">
<h1><a name="Math-NET-Numerics-Release-Notes" class="anchor" href="#Math-NET-Numerics-Release-Notes">Math.NET Numerics Release Notes</a></h1>
<p><a href="ReleaseNotes.html">Math.NET Numerics</a> | <a href="ReleaseNotes-MKL.html">MKL Provider</a> | <a href="ReleaseNotes-OpenBLAS.html">OpenBLAS Provider</a></p>
<h3><a name="5-0-0-alpha02-2021-07-11" class="anchor" href="#5-0-0-alpha02-2021-07-11">5.0.0-alpha02 - 2021-07-11</a></h3>
<ul>
@ -918,88 +993,16 @@ Linear Algebra:
<li>Various bug, performance and usability fixes</li>
</ul>
</div>
<div class="span3">
<ul class="nav nav-list" id="menu">
<li class="nav-header">Math.NET Numerics</li>
<li><a href="https://numerics.mathdotnet.com/Packages.html">NuGet & Binaries</a></li>
<li><a href="https://numerics.mathdotnet.com/ReleaseNotes.html">Release Notes</a></li>
<li><a href="https://numerics.mathdotnet.com/License.html">MIT License</a></li>
<li><a href="https://numerics.mathdotnet.com/Compatibility.html">Platform Support</a></li>
<li><a href="https://numerics.mathdotnet.com/api/">Class Reference</a></li>
<li><a href="https://github.com/mathnet/mathnet-numerics/issues">Issues & Bugs</a></li>
<li><a href="https://numerics.mathdotnet.com/Users.html">Who is using Math.NET?</a></li>
<li class="nav-header">Contributing</li>
<li><a href="https://numerics.mathdotnet.com/Contributors.html">Contributors</a></li>
<li><a href="https://numerics.mathdotnet.com/Contributing.html">Contributing</a></li>
<li><a href="https://numerics.mathdotnet.com/Build.html">Build & Tools</a></li>
<li><a href="http://feedback.mathdotnet.com/forums/2060-math-net-numerics">Your Ideas</a></li>
<li class="nav-header">Getting Help</li>
<li><a href="https://discuss.mathdotnet.com/c/numerics">Discuss</a></li>
<li><a href="https://stackoverflow.com/questions/tagged/mathdotnet">Stack Overflow</a></li>
<li class="nav-header">Getting Started</li>
<li><a href="https://numerics.mathdotnet.com/">Getting started</a></li>
<li><a href="https://numerics.mathdotnet.com/Constants.html">Constants</a></li>
<li>Floating-Point Numbers</li>
<li>Arbitrary Precision Numbers</li>
<li>Complex Numbers</li>
<li><a href="https://numerics.mathdotnet.com/Matrix.html">Matrices and Vectors</a></li>
<li><a href="https://numerics.mathdotnet.com/Euclid.html">Euclid & Number Theory</a></li>
<li>Combinatorics</li>
<li class="nav-header">Evaluation</li>
<li><a href="https://numerics.mathdotnet.com/Functions.html">Special Functions</a></li>
<li>Differentiation</li>
<li><a href="https://numerics.mathdotnet.com/Integration.html">Integration</a></li>
<li class="nav-header">Statistics/Probability</li>
<li><a href="https://numerics.mathdotnet.com/DescriptiveStatistics.html">Descriptive Statistics</a></li>
<li><a href="https://numerics.mathdotnet.com/Probability.html">Probability Distributions</a></li>
<li class="nav-header">Generation</li>
<li><a href="https://numerics.mathdotnet.com/Generate.html">Generating Data</a></li>
<li><a href="https://numerics.mathdotnet.com/Random.html">Random Numbers</a></li>
<li class="nav-header">Transformation</li>
<li>Fourier Transform (FFT)</li>
<li>Filtering & DSP</li>
<li>Window Functions</li>
<li class="nav-header">Solving Equations</li>
<li><a href="https://numerics.mathdotnet.com/LinearEquations.html">Linear Equation Systems</a></li>
<li>Nonlinear Root Finding</li>
<li class="nav-header">Optimization</li>
<li>Linear Least Squares</li>
<li>Nonlinear Optimization</li>
<li><a href="https://numerics.mathdotnet.com/Distance.html">Distance Metrics</a></li>
<li class="nav-header">Curve Fitting</li>
<li><a href="https://numerics.mathdotnet.com/Regression.html">Regression</a></li>
<li>Interpolation</li>
<li>Fourier Approximation</li>
<li class="nav-header">Native Providers</li>
<li><a href="https://numerics.mathdotnet.com/MKL.html">Intel MKL</a></li>
<li class="nav-header">Working Together</li>
<li><a href="https://numerics.mathdotnet.com/CSV.html">Delimited Text Files (CSV)</a></li>
<li><a href="https://numerics.mathdotnet.com/MatrixMarket.html">NIST MatrixMarket</a></li>
<li><a href="https://numerics.mathdotnet.com/MatlabFiles.html">MATLAB</a></li>
<li><a href="https://numerics.mathdotnet.com/IFSharpNotebook.html">IF# Notebook</a></li>
<li>FsLab & Deedle</li>
<li>Microsoft Excel</li>
<li>numl.net machine learning</li>
<li>R-project</li>
</ul>
</div>
</div>
</div>
</body>
<!-- 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>

275
Users.html

@ -1,63 +1,138 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>Who is using Math.NET Numerics?
<head>
<meta charset="utf-8">
<title>Who is using Math.NET Numerics?
</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta name="description" content="Math.NET Numerics, providing methods and algorithms for numerical computations in science, engineering and every day use. .Net 4, .Net 3.5, SL5, Win8, WP8, PCL 47 and 136, Mono, Xamarin Android/iOS."/>
<meta name="author" content="Christoph Ruegg, Marcus Cuda, Jurgen Van Gael"/>
<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 src="https://code.jquery.com/jquery-1.8.0.js"></script>
<script src="https://code.jquery.com/ui/1.8.23/jquery-ui.js"></script>
<script src="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/js/bootstrap.min.js"></script>
<link href="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap-combined.min.css" rel="stylesheet"/>
<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 type="text/css" rel="stylesheet" href="https://numerics.mathdotnet.com/content/style.css" />
<style>
#main table:not(.pre) {
border: 1px solid #dddddd;
max-width: 100%;
border-style: solid;
border-width: 1px;
border-color: gray;
border-collapse: collapse;
border-right-width: 1px;
border-bottom-width: 1px;
margin-top: 15px;
margin-bottom: 25px;
}
#main table:not(.pre) th, #main table:not(.pre) td {
border: 1px solid #dddddd;
padding: 6px;
}
#main table:not(.pre) th p, #main table:not(.pre) td p {
margin-bottom: 5px;
}
</style>
<script type="text/javascript" src="https://numerics.mathdotnet.com/content/tips.js"></script>
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<![endif]-->
<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>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
</head>
<body>
<div class="container">
<div class="masthead">
<ul class="nav nav-pills pull-right">
<li><a href="https://www.mathdotnet.com">Math.NET Project</a></li>
<li><a href="https://numerics.mathdotnet.com">Math.NET Numerics</a></li>
<li><a href="https://github.com/mathnet/mathnet-numerics">GitHub</a></li>
</ul>
<h3 class="muted">Math.NET Numerics</h3>
<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>
<hr />
<div class="row">
<div class="span9" id="main">
<h1><a name="Who-is-using-Math-NET-Numerics" class="anchor" href="#Who-is-using-Math-NET-Numerics">Who is using Math.NET Numerics?</a></h1>
<!-- 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">Floating-Point Numbers</li>
<li class="nav-item">Arbitrary Precision Numbers</li>
<li class="nav-item">Complex Numbers</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">Differentiation</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">Transformation</li>
<li class="nav-item">Fourier Transform (FFT)</li>
<li class="nav-item">Filtering & DSP</li>
<li class="nav-item">Window Functions</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-item">Nonlinear Root Finding</li>
<li class="nav-header">Optimization</li>
<li class="nav-item">Linear Least Squares</li>
<li class="nav-item">Nonlinear 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-item">Interpolation</li>
<li class="nav-item">Fourier Approximation</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://www.mathdotnet.com">Math.NET Project</a> |
<a href="https://numerics.mathdotnet.com">Math.NET Numerics</a> |
<a href="https://github.com/mathnet/mathnet-numerics">GitHub</a>
</h3>
</div>
<hr />
<div class="container" id="fsdocs-content">
<h1><a name="Who-is-using-Math-NET-Numerics" class="anchor" href="#Who-is-using-Math-NET-Numerics">Who is using Math.NET Numerics?</a></h1>
<p><em>This page collects anything that references and/or uses Math.NET Numerics.
Feel free to <a href="https://github.com/mathnet/mathnet-numerics/blob/master/docs/content/Users.md">add, edit or remove your own work</a> by submitting a pull request.</em></p>
<h2><a name="Open-Source" class="anchor" href="#Open-Source">Open Source</a></h2>
@ -181,88 +256,16 @@ Feel free to <a href="https://github.com/mathnet/mathnet-numerics/blob/master/do
<li>Bischoff, Sebastian (2009). <em>Konzeption und Umsetzung einer RIA zur untersuchungsbegleitenden Erfassung von RNFLT-Scans und Untersuchung von Klassifikatoren für die diagnostische Unterstützung bei neurodegenerativen Erkrankungen am Beispiel der Multiplen Sklerose.</em> Fachhochschule Brandenburg.</li>
</ul>
</div>
<div class="span3">
<ul class="nav nav-list" id="menu">
<li class="nav-header">Math.NET Numerics</li>
<li><a href="https://numerics.mathdotnet.com/Packages.html">NuGet & Binaries</a></li>
<li><a href="https://numerics.mathdotnet.com/ReleaseNotes.html">Release Notes</a></li>
<li><a href="https://numerics.mathdotnet.com/License.html">MIT License</a></li>
<li><a href="https://numerics.mathdotnet.com/Compatibility.html">Platform Support</a></li>
<li><a href="https://numerics.mathdotnet.com/api/">Class Reference</a></li>
<li><a href="https://github.com/mathnet/mathnet-numerics/issues">Issues & Bugs</a></li>
<li><a href="https://numerics.mathdotnet.com/Users.html">Who is using Math.NET?</a></li>
<li class="nav-header">Contributing</li>
<li><a href="https://numerics.mathdotnet.com/Contributors.html">Contributors</a></li>
<li><a href="https://numerics.mathdotnet.com/Contributing.html">Contributing</a></li>
<li><a href="https://numerics.mathdotnet.com/Build.html">Build & Tools</a></li>
<li><a href="http://feedback.mathdotnet.com/forums/2060-math-net-numerics">Your Ideas</a></li>
<li class="nav-header">Getting Help</li>
<li><a href="https://discuss.mathdotnet.com/c/numerics">Discuss</a></li>
<li><a href="https://stackoverflow.com/questions/tagged/mathdotnet">Stack Overflow</a></li>
<li class="nav-header">Getting Started</li>
<li><a href="https://numerics.mathdotnet.com/">Getting started</a></li>
<li><a href="https://numerics.mathdotnet.com/Constants.html">Constants</a></li>
<li>Floating-Point Numbers</li>
<li>Arbitrary Precision Numbers</li>
<li>Complex Numbers</li>
<li><a href="https://numerics.mathdotnet.com/Matrix.html">Matrices and Vectors</a></li>
<li><a href="https://numerics.mathdotnet.com/Euclid.html">Euclid & Number Theory</a></li>
<li>Combinatorics</li>
<li class="nav-header">Evaluation</li>
<li><a href="https://numerics.mathdotnet.com/Functions.html">Special Functions</a></li>
<li>Differentiation</li>
<li><a href="https://numerics.mathdotnet.com/Integration.html">Integration</a></li>
<li class="nav-header">Statistics/Probability</li>
<li><a href="https://numerics.mathdotnet.com/DescriptiveStatistics.html">Descriptive Statistics</a></li>
<li><a href="https://numerics.mathdotnet.com/Probability.html">Probability Distributions</a></li>
<li class="nav-header">Generation</li>
<li><a href="https://numerics.mathdotnet.com/Generate.html">Generating Data</a></li>
<li><a href="https://numerics.mathdotnet.com/Random.html">Random Numbers</a></li>
<li class="nav-header">Transformation</li>
<li>Fourier Transform (FFT)</li>
<li>Filtering & DSP</li>
<li>Window Functions</li>
<li class="nav-header">Solving Equations</li>
<li><a href="https://numerics.mathdotnet.com/LinearEquations.html">Linear Equation Systems</a></li>
<li>Nonlinear Root Finding</li>
<li class="nav-header">Optimization</li>
<li>Linear Least Squares</li>
<li>Nonlinear Optimization</li>
<li><a href="https://numerics.mathdotnet.com/Distance.html">Distance Metrics</a></li>
<li class="nav-header">Curve Fitting</li>
<li><a href="https://numerics.mathdotnet.com/Regression.html">Regression</a></li>
<li>Interpolation</li>
<li>Fourier Approximation</li>
<li class="nav-header">Native Providers</li>
<li><a href="https://numerics.mathdotnet.com/MKL.html">Intel MKL</a></li>
<li class="nav-header">Working Together</li>
<li><a href="https://numerics.mathdotnet.com/CSV.html">Delimited Text Files (CSV)</a></li>
<li><a href="https://numerics.mathdotnet.com/MatrixMarket.html">NIST MatrixMarket</a></li>
<li><a href="https://numerics.mathdotnet.com/MatlabFiles.html">MATLAB</a></li>
<li><a href="https://numerics.mathdotnet.com/IFSharpNotebook.html">IF# Notebook</a></li>
<li>FsLab & Deedle</li>
<li>Microsoft Excel</li>
<li>numl.net machine learning</li>
<li>R-project</li>
</ul>
</div>
</div>
</div>
</body>
<!-- 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>

5
content/fsdocs-custom.css

@ -0,0 +1,5 @@
/*--------------------------------------------------------------------------
Customize your CSS here
/*--------------------------------------------------------------------------*/

594
content/fsdocs-default.css

@ -0,0 +1,594 @@
@import url('https://fonts.googleapis.com/css2?family=Hind+Vadodara&family=Roboto+Mono&display=swap');
/*--------------------------------------------------------------------------
Formatting for page & standard document content
/*--------------------------------------------------------------------------*/
body {
font-family: 'Hind Vadodara', sans-serif;
/* padding-top: 0px;
padding-bottom: 40px;
*/
}
/* Format the heading - nicer spacing etc. */
.masthead {
overflow: hidden;
}
.masthead .muted a {
text-decoration: none;
color: #999999;
}
.masthead ul, .masthead li {
margin-bottom: 0px;
}
.masthead .nav li {
margin-top: 15px;
font-size: 110%;
}
.masthead h3 {
margin-top: 15px;
margin-bottom: 5px;
font-size: 170%;
}
/*--------------------------------------------------------------------------
Formatting fsdocs-content
/*--------------------------------------------------------------------------*/
/* Change font sizes for headings etc. */
#fsdocs-content h1 {
margin: 30px 0px 15px 0px;
/* font-weight: 400; */
font-size: 2rem;
letter-spacing: 1.78px;
line-height: 2.5rem;
font-weight: 400;
}
#fsdocs-content h2 {
font-size: 1.6rem;
margin: 20px 0px 10px 0px;
font-weight: 400;
}
#fsdocs-content h3 {
font-size: 1.2rem;
margin: 15px 0px 10px 0px;
font-weight: 400;
}
#fsdocs-content hr {
margin: 0px 0px 20px 0px;
}
#fsdocs-content li {
font-size: 1.0rem;
line-height: 1.375rem;
letter-spacing: 0.01px;
font-weight: 500;
margin: 0px 0px 15px 0px;
}
#fsdocs-content p {
font-size: 1.0rem;
line-height: 1.375rem;
letter-spacing: 0.01px;
font-weight: 500;
color: #262626;
}
#fsdocs-content a {
color: #4974D1;
}
/* remove the default bootstrap bold on dt elements */
#fsdocs-content dt {
font-weight: normal;
}
/*--------------------------------------------------------------------------
Formatting tables in fsdocs-content, using docs.microsoft.com tables
/*--------------------------------------------------------------------------*/
#fsdocs-content .table {
table-layout: auto;
width: 100%;
font-size: 0.875rem;
}
#fsdocs-content .table caption {
font-size: 0.8rem;
font-weight: 600;
letter-spacing: 2px;
text-transform: uppercase;
padding: 1.125rem;
border-width: 0 0 1px;
border-style: solid;
border-color: #e3e3e3;
text-align: right;
}
#fsdocs-content .table td,
#fsdocs-content .table th {
display: table-cell;
word-wrap: break-word;
padding: 0.75rem 1rem 0.75rem 0rem;
line-height: 1.5;
vertical-align: top;
border-top: 1px solid #e3e3e3;
border-right: 0;
border-left: 0;
border-bottom: 0;
border-style: solid;
}
/* suppress the top line on inner lists such as tables of exceptions */
#fsdocs-content .table .fsdocs-exception-list td,
#fsdocs-content .table .fsdocs-exception-list th {
border-top: 0
}
#fsdocs-content .table td p:first-child,
#fsdocs-content .table th p:first-child {
margin-top: 0;
}
#fsdocs-content .table td.nowrap,
#fsdocs-content .table th.nowrap {
white-space: nowrap;
}
#fsdocs-content .table td.is-narrow,
#fsdocs-content .table th.is-narrow {
width: 15%;
}
#fsdocs-content .table th:not([scope='row']) {
border-top: 0;
border-bottom: 1px;
}
#fsdocs-content .table > caption + thead > tr:first-child > td,
#fsdocs-content .table > colgroup + thead > tr:first-child > td,
#fsdocs-content .table > thead:first-child > tr:first-child > td {
border-top: 0;
}
#fsdocs-content .table table-striped > tbody > tr:nth-of-type(odd) {
background-color: var(--box-shadow-light);
}
#fsdocs-content .table.min {
width: unset;
}
#fsdocs-content .table.is-left-aligned td:first-child,
#fsdocs-content .table.is-left-aligned th:first-child {
padding-left: 0;
}
#fsdocs-content .table.is-left-aligned td:first-child a,
#fsdocs-content .table.is-left-aligned th:first-child a {
outline-offset: -0.125rem;
}
@media screen and (max-width: 767px), screen and (min-resolution: 120dpi) and (max-width: 767.9px) {
#fsdocs-content .table.is-stacked-mobile td:nth-child(1) {
display: block;
width: 100%;
padding: 1rem 0;
}
#fsdocs-content .table.is-stacked-mobile td:not(:nth-child(1)) {
display: block;
border-width: 0;
padding: 0 0 1rem;
}
}
#fsdocs-content .table.has-inner-borders th,
#fsdocs-content .table.has-inner-borders td {
border-right: 1px solid #e3e3e3;
}
#fsdocs-content .table.has-inner-borders th:last-child,
#fsdocs-content .table.has-inner-borders td:last-child {
border-right: none;
}
.fsdocs-entity-list .fsdocs-entity-name {
width: 25%;
font-weight: bold;
}
.fsdocs-member-list .fsdocs-member-usage {
width: 35%;
}
/*--------------------------------------------------------------------------
Formatting xmldoc sections in fsdocs-content
/*--------------------------------------------------------------------------*/
.fsdocs-xmldoc, .fsdocs-entity-xmldoc, .fsdocs-member-xmldoc {
font-size: 1.0rem;
line-height: 1.375rem;
letter-spacing: 0.01px;
font-weight: 500;
color: #262626;
}
.fsdocs-xmldoc h1 {
font-size: 1.2rem;
margin: 10px 0px 0px 0px;
}
.fsdocs-xmldoc h2 {
font-size: 1.2rem;
margin: 10px 0px 0px 0px;
}
.fsdocs-xmldoc h3 {
font-size: 1.1rem;
margin: 10px 0px 0px 0px;
}
/* #fsdocs-nav .searchbox {
margin-top: 30px;
margin-bottom: 30px;
} */
#fsdocs-nav img.logo{
width:90%;
/* height:140px; */
/* margin:10px 0px 0px 20px; */
margin-top:40px;
border-style:none;
}
#fsdocs-nav input{
/* margin-left: 20px; */
margin-right: 20px;
margin-top: 20px;
margin-bottom: 20px;
width: 93%;
-webkit-border-radius: 0;
border-radius: 0;
}
#fsdocs-nav {
/* margin-left: -5px; */
/* width: 90%; */
font-size:0.95rem;
}
#fsdocs-nav li.nav-header{
/* margin-left: -5px; */
/* width: 90%; */
padding-left: 0;
color: #262626;
text-transform: none;
font-size:16px;
margin-top: 9px;
font-weight: bold;
}
#fsdocs-nav a{
padding-left: 0;
color: #6c6c6d;
/* margin-left: 5px; */
/* width: 90%; */
}
/*--------------------------------------------------------------------------
Formatting pre and code sections in fsdocs-content (code highlighting is
further below)
/*--------------------------------------------------------------------------*/
#fsdocs-content code {
/* font-size: 0.83rem; */
font: 0.85rem 'Roboto Mono', monospace;
background-color: #f7f7f900;
border: 0px;
padding: 0px;
/* word-wrap: break-word; */
/* white-space: pre; */
}
/* omitted */
#fsdocs-content span.omitted {
background: #3c4e52;
border-radius: 5px;
color: #808080;
padding: 0px 0px 1px 0px;
}
#fsdocs-content pre .fssnip code {
font: 0.86rem 'Roboto Mono', monospace;
}
#fsdocs-content table.pre,
#fsdocs-content pre.fssnip,
#fsdocs-content pre {
line-height: 13pt;
border: 0px solid #d8d8d8;
border-top: 0px solid #e3e3e3;
border-collapse: separate;
white-space: pre;
font: 0.86rem 'Roboto Mono', monospace;
width: 100%;
margin: 10px 0px 20px 0px;
background-color: #f3f4f7;
padding: 10px;
border-radius: 5px;
color: #8e0e2b;
max-width: none;
box-sizing: border-box;
}
#fsdocs-content pre.fssnip code {
font: 0.86rem 'Roboto Mono', monospace;
font-weight: 600;
}
#fsdocs-content table.pre {
background-color: #fff7ed;
}
#fsdocs-content table.pre pre {
padding: 0px;
margin: 0px;
border-radius: 0px;
width: 100%;
background-color: #fff7ed;
color: #837b79;
}
#fsdocs-content table.pre td {
padding: 0px;
white-space: normal;
margin: 0px;
width: 100%;
}
#fsdocs-content table.pre td.lines {
width: 30px;
}
#fsdocs-content pre {
word-wrap: inherit;
}
.fsdocs-example-header {
font-size: 1.0rem;
line-height: 1.375rem;
letter-spacing: 0.01px;
font-weight: 700;
color: #262626;
}
/*--------------------------------------------------------------------------
Formatting github source links
/*--------------------------------------------------------------------------*/
.fsdocs-source-link {
float: right;
text-decoration: none;
}
.fsdocs-source-link img {
border-style: none;
margin-left: 10px;
width: auto;
height: 1.4em;
}
.fsdocs-source-link .hover {
display: none;
}
.fsdocs-source-link:hover .hover {
display: block;
}
.fsdocs-source-link .normal {
display: block;
}
.fsdocs-source-link:hover .normal {
display: none;
}
/*--------------------------------------------------------------------------
Formatting logo
/*--------------------------------------------------------------------------*/
#fsdocs-logo {
width:140px;
height:140px;
margin:10px 0px 0px 0px;
border-style:none;
}
/*--------------------------------------------------------------------------
/*--------------------------------------------------------------------------*/
#fsdocs-content table.pre pre {
padding: 0px;
margin: 0px;
border: none;
}
/*--------------------------------------------------------------------------
Remove formatting from links
/*--------------------------------------------------------------------------*/
#fsdocs-content h1 a,
#fsdocs-content h1 a:hover,
#fsdocs-content h1 a:focus,
#fsdocs-content h2 a,
#fsdocs-content h2 a:hover,
#fsdocs-content h2 a:focus,
#fsdocs-content h3 a,
#fsdocs-content h3 a:hover,
#fsdocs-content h3 a:focus,
#fsdocs-content h4 a,
#fsdocs-content h4 a:hover, #fsdocs-content
#fsdocs-content h4 a:focus,
#fsdocs-content h5 a,
#fsdocs-content h5 a:hover,
#fsdocs-content h5 a:focus,
#fsdocs-content h6 a,
#fsdocs-content h6 a:hover,
#fsdocs-content h6 a:focus {
color: #262626;
text-decoration: none;
text-decoration-style: none;
/* outline: none */
}
/*--------------------------------------------------------------------------
Formatting for F# code snippets
/*--------------------------------------------------------------------------*/
.fsdocs-param-name,
.fsdocs-return-name,
.fsdocs-param {
font-weight: 900;
font-size: 0.85rem;
font-family: 'Roboto Mono', monospace;
}
/* strings --- and stlyes for other string related formats */
#fsdocs-content span.s {
color: #dd1144;
}
/* printf formatters */
#fsdocs-content span.pf {
color: #E0C57F;
}
/* escaped chars */
#fsdocs-content span.e {
color: #EA8675;
}
/* identifiers --- and styles for more specific identifier types */
#fsdocs-content span.id {
color: #262626;
}
/* module */
#fsdocs-content span.m {
color: #009999;
}
/* reference type */
#fsdocs-content span.rt {
color: #4974D1;
}
/* value type */
#fsdocs-content span.vt {
color: #43AEC6;
}
/* interface */
#fsdocs-content span.if {
color: #43AEC6;
}
/* type argument */
#fsdocs-content span.ta {
color: #43AEC6;
}
/* disposable */
#fsdocs-content span.d {
color: #43AEC6;
}
/* property */
#fsdocs-content span.prop {
color: #43AEC6;
}
/* punctuation */
#fsdocs-content span.p {
color: #43AEC6;
}
#fsdocs-content span.pn {
color: #262626;
}
/* function */
#fsdocs-content span.f {
color: #e1e1e1;
}
#fsdocs-content span.fn {
color: #990000;
}
/* active pattern */
#fsdocs-content span.pat {
color: #4ec9b0;
}
/* union case */
#fsdocs-content span.u {
color: #4ec9b0;
}
/* enumeration */
#fsdocs-content span.e {
color: #4ec9b0;
}
/* keywords */
#fsdocs-content span.k {
color: #b68015;
/* font-weight: bold; */
}
/* comment */
#fsdocs-content span.c {
color: #808080;
font-weight: 400;
font-style: italic;
}
/* operators */
#fsdocs-content span.o {
color: #af75c1;
}
/* numbers */
#fsdocs-content span.n {
color: #009999;
}
/* line number */
#fsdocs-content span.l {
color: #80b0b0;
}
/* mutable var or ref cell */
#fsdocs-content span.v {
color: #d1d1d1;
font-weight: bold;
}
/* inactive code */
#fsdocs-content span.inactive {
color: #808080;
}
/* preprocessor */
#fsdocs-content span.prep {
color: #af75c1;
}
/* fsi output */
#fsdocs-content span.fsi {
color: #808080;
}
/* tool tip */
div.fsdocs-tip {
background: #475b5f;
border-radius: 4px;
font: 0.85rem 'Roboto Mono', monospace;
padding: 6px 8px 6px 8px;
display: none;
color: #d1d1d1;
pointer-events: none;
}
div.fsdocs-tip code {
color: #d1d1d1;
font: 0.85rem 'Roboto Mono', monospace;
}

84
content/fsdocs-search.js

@ -0,0 +1,84 @@
var lunrIndex, pagesIndex;
function endsWith(str, suffix) {
return str.indexOf(suffix, str.length - suffix.length) !== -1;
}
// Initialize lunrjs using our generated index file
function initLunr() {
if (!endsWith(fsdocs_search_baseurl,"/")){
fsdocs_search_baseurl = fsdocs_search_baseurl+'/'
};
// First retrieve the index file
$.getJSON(fsdocs_search_baseurl +"index.json")
.done(function(index) {
pagesIndex = index;
// Set up lunrjs by declaring the fields we use
// Also provide their boost level for the ranking
lunrIndex = lunr(function() {
this.ref("uri");
this.field('title', {
boost: 15
});
this.field('tags', {
boost: 10
});
this.field("content", {
boost: 5
});
this.pipeline.remove(lunr.stemmer);
this.searchPipeline.remove(lunr.stemmer);
// Feed lunr with each file and let lunr actually index them
pagesIndex.forEach(function(page) {
this.add(page);
}, this);
})
})
.fail(function(jqxhr, textStatus, error) {
var err = textStatus + ", " + error;
console.error("Error getting Hugo index file:", err);
});
}
/**
* Trigger a search in lunr and transform the result
*
* @param {String} query
* @return {Array} results
*/
function search(queryTerm) {
// Find the item in our index corresponding to the lunr one to have more info
return lunrIndex.search(queryTerm+"^100"+" "+queryTerm+"*^10"+" "+"*"+queryTerm+"^10"+" "+queryTerm+"~2^1").map(function(result) {
return pagesIndex.filter(function(page) {
return page.uri === result.ref;
})[0];
});
}
// Let's get started
initLunr();
$( document ).ready(function() {
var searchList = new autoComplete({
/* selector for the search box element */
minChars: 1,
selector: $("#search-by").get(0),
/* source is the callback to perform the search */
source: function(term, response) {
response(search(term));
},
/* renderItem displays individual search results */
renderItem: function(item, search) {
search = search.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
var re = new RegExp("(" + search.split(' ').join('|') + ")", "gi");
return '<div class="autocomplete-suggestion" data-val="'+search+'" data-uri="' + item.uri + '">' + item.title.replace(re, "<b>$1</b>") + '</div>';
},
/* onSelect callback fires when a search suggestion is chosen */
onSelect: function(e, term, item) {
location.href = item.getAttribute('data-uri');
}
});
});

54
content/fsdocs-tips.js

@ -0,0 +1,54 @@
var currentTip = null;
var currentTipElement = null;
function hideTip(evt, name, unique) {
var el = document.getElementById(name);
el.style.display = "none";
currentTip = null;
}
function findPos(obj) {
// no idea why, but it behaves differently in webbrowser component
if (window.location.search == "?inapp")
return [obj.offsetLeft + 10, obj.offsetTop + 30];
var curleft = 0;
var curtop = obj.offsetHeight;
while (obj) {
curleft += obj.offsetLeft;
curtop += obj.offsetTop;
obj = obj.offsetParent;
};
return [curleft, curtop];
}
function hideUsingEsc(e) {
if (!e) { e = event; }
hideTip(e, currentTipElement, currentTip);
}
function showTip(evt, name, unique, owner) {
document.onkeydown = hideUsingEsc;
if (currentTip == unique) return;
currentTip = unique;
currentTipElement = name;
var pos = findPos(owner ? owner : (evt.srcElement ? evt.srcElement : evt.target));
var posx = pos[0];
var posy = pos[1];
var el = document.getElementById(name);
var parent = (document.documentElement == null) ? document.body : document.documentElement;
el.style.position = "absolute";
el.style.left = posx + "px";
el.style.top = posy + "px";
el.style.display = "block";
}
function Clipboard_CopyTo(value) {
var tempInput = document.createElement("input");
tempInput.value = value;
document.body.appendChild(tempInput);
tempInput.select();
document.execCommand("copy");
document.body.removeChild(tempInput);
}

BIN
content/img/copy-md-hover.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
content/img/copy-md.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

BIN
content/img/copy-xml-hover.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

BIN
content/img/copy-xml.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
content/img/github-hover.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

BIN
content/img/github.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 806 B

After

Width:  |  Height:  |  Size: 7.5 KiB

77
content/navbar-fixed-left.css

@ -0,0 +1,77 @@
body {
padding-top: 90px;
}
@media (min-width: 768px) {
body {
padding-top: 0;
}
}
@media (min-width: 768px) {
body {
margin-left: 252px;
}
}
.navbar {
overflow-y: auto;
overflow-x: hidden;
box-shadow: none;
}
.navbar.fixed-left {
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 1030;
}
.navbar-nav .nav-link {
padding-top: 0.3rem;
padding-bottom: 0.3rem;
}
@media (min-width: 768px) {
.navbar.fixed-left {
bottom: 0;
width: 252px;
flex-flow: column nowrap;
align-items: flex-start;
}
.navbar.fixed-left .navbar-collapse {
flex-grow: 0;
flex-direction: column;
width: 100%;
}
.navbar.fixed-left .navbar-collapse .navbar-nav {
flex-direction: column;
width: 100%;
}
.navbar.fixed-left .navbar-collapse .navbar-nav .nav-item {
width: 100%;
}
.navbar.fixed-left .navbar-collapse .navbar-nav .nav-item .dropdown-menu {
top: 0;
}
}
@media (min-width: 768px) {
.navbar.fixed-left {
right: auto;
}
.navbar.fixed-left .navbar-nav .nav-item .dropdown-toggle:after {
border-top: 0.3em solid transparent;
border-left: 0.3em solid;
border-bottom: 0.3em solid transparent;
border-right: none;
vertical-align: baseline;
}
.navbar.fixed-left .navbar-nav .nav-item .dropdown-menu {
left: 100%;
}
}

78
content/navbar-fixed-right.css

@ -0,0 +1,78 @@
body {
padding-top: 90px;
}
@media (min-width: 768px) {
body {
padding-top: 0;
}
}
@media (min-width: 768px) {
body {
margin-right: 252px;
}
}
.navbar {
overflow-y: auto;
overflow-x: hidden;
box-shadow: none;
}
.navbar.fixed-right {
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 1030;
}
.navbar-nav .nav-link {
padding-top: 0.3rem;
padding-bottom: 0.3rem;
}
@media (min-width: 768px) {
.navbar.fixed-right {
bottom: 0;
width: 252px;
flex-flow: column nowrap;
align-items: flex-start;
}
.navbar.fixed-right .navbar-collapse {
flex-grow: 0;
flex-direction: column;
width: 100%;
}
.navbar.fixed-right .navbar-collapse .navbar-nav {
flex-direction: column;
width: 100%;
}
.navbar.fixed-right .navbar-collapse .navbar-nav .nav-item {
width: 100%;
}
.navbar.fixed-right .navbar-collapse .navbar-nav .nav-item .dropdown-menu {
top: 0;
}
}
@media (min-width: 768px) {
.navbar.fixed-right {
left: auto;
}
.navbar.fixed-right .navbar-nav .nav-item .dropdown-toggle:after {
border-top: 0.3em solid transparent;
border-left: none;
border-bottom: 0.3em solid transparent;
border-right: 0.3em solid;
vertical-align: baseline;
}
.navbar.fixed-right .navbar-nav .nav-item .dropdown-menu {
left: auto;
right: 100%;
}
}

414
index.html

@ -1,63 +1,138 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>Math.NET Numerics
<head>
<meta charset="utf-8">
<title>Math.NET Numerics
</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta name="description" content="Math.NET Numerics, providing methods and algorithms for numerical computations in science, engineering and every day use. .Net 4, .Net 3.5, SL5, Win8, WP8, PCL 47 and 136, Mono, Xamarin Android/iOS."/>
<meta name="author" content="Christoph Ruegg, Marcus Cuda, Jurgen Van Gael"/>
<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 src="https://code.jquery.com/jquery-1.8.0.js"></script>
<script src="https://code.jquery.com/ui/1.8.23/jquery-ui.js"></script>
<script src="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/js/bootstrap.min.js"></script>
<link href="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap-combined.min.css" rel="stylesheet"/>
<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 type="text/css" rel="stylesheet" href="https://numerics.mathdotnet.com/content/style.css" />
<style>
#main table:not(.pre) {
border: 1px solid #dddddd;
max-width: 100%;
border-style: solid;
border-width: 1px;
border-color: gray;
border-collapse: collapse;
border-right-width: 1px;
border-bottom-width: 1px;
margin-top: 15px;
margin-bottom: 25px;
}
#main table:not(.pre) th, #main table:not(.pre) td {
border: 1px solid #dddddd;
padding: 6px;
}
#main table:not(.pre) th p, #main table:not(.pre) td p {
margin-bottom: 5px;
}
</style>
<script type="text/javascript" src="https://numerics.mathdotnet.com/content/tips.js"></script>
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<![endif]-->
<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>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
</head>
<body>
<div class="container">
<div class="masthead">
<ul class="nav nav-pills pull-right">
<li><a href="https://www.mathdotnet.com">Math.NET Project</a></li>
<li><a href="https://numerics.mathdotnet.com">Math.NET Numerics</a></li>
<li><a href="https://github.com/mathnet/mathnet-numerics">GitHub</a></li>
</ul>
<h3 class="muted">Math.NET Numerics</h3>
<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>
<hr />
<div class="row">
<div class="span9" id="main">
<h1><a name="Math-NET-Numerics" class="anchor" href="#Math-NET-Numerics">Math.NET Numerics</a></h1>
<!-- 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">Floating-Point Numbers</li>
<li class="nav-item">Arbitrary Precision Numbers</li>
<li class="nav-item">Complex Numbers</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">Differentiation</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">Transformation</li>
<li class="nav-item">Fourier Transform (FFT)</li>
<li class="nav-item">Filtering & DSP</li>
<li class="nav-item">Window Functions</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-item">Nonlinear Root Finding</li>
<li class="nav-header">Optimization</li>
<li class="nav-item">Linear Least Squares</li>
<li class="nav-item">Nonlinear 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-item">Interpolation</li>
<li class="nav-item">Fourier Approximation</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://www.mathdotnet.com">Math.NET Project</a> |
<a href="https://numerics.mathdotnet.com">Math.NET Numerics</a> |
<a href="https://github.com/mathnet/mathnet-numerics">GitHub</a>
</h3>
</div>
<hr />
<div class="container" id="fsdocs-content">
<h1><a name="Math-NET-Numerics" class="anchor" href="#Math-NET-Numerics">Math.NET Numerics</a></h1>
<p>Math.NET Numerics aims to provide methods and algorithms for numerical computations
in science, engineering and every day use. Covered topics include special functions,
linear algebra, probability models, random numbers, interpolation, integration,
@ -83,19 +158,7 @@ that package with the command line tool with <code>nuget.exe install MathNet.Num
or simply download the Zip package.</p>
<p>let's say we have a matrix <span class="math">\(\mathrm{A}\)</span> and want to find an orthonormal basis of the kernel or null-space
of that matrix, such that <span class="math">\(\mathrm{A}x = 0\)</span> for all <span class="math">\(x\)</span> in that subspace.</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l"> 1: </span>
<span class="l"> 2: </span>
<span class="l"> 3: </span>
<span class="l"> 4: </span>
<span class="l"> 5: </span>
<span class="l"> 6: </span>
<span class="l"> 7: </span>
<span class="l"> 8: </span>
<span class="l"> 9: </span>
<span class="l">10: </span>
<span class="l">11: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">using</span> MathNet.Numerics.LinearAlgebra;
<table class="pre"><tr><td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">using</span> MathNet.Numerics.LinearAlgebra;
<span class="k">using</span> MathNet.Numerics.LinearAlgebra.Double;
Matrix&lt;<span class="k">double</span>&gt; A <span class="o">=</span> DenseMatrix.OfArray(<span class="k">new</span> <span class="k">double</span>[,] {
@ -112,57 +175,29 @@ Vector&lt;<span class="k">double</span>&gt;[] nullspace <span class="o">=</span>
just as well. In order to achieve this we recommend to reference the <code>MathNet.Numerics.FSharp</code>
package in addition to <code>MathNet.Numerics</code>, which adds a few modules to make it more
idiomatic and includes arbitrary precision types (BigInteger, BigRational).</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
<span class="l">4: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="k">open</span> <span class="i">MathNet</span><span class="o">.</span><span class="i">Numerics</span><span class="o">.</span><span class="i">LinearAlgebra</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs1', 1)" onmouseover="showTip(event, 'fs1', 1)" class="i">m</span> <span class="o">=</span> <span class="i">matrix</span> [[ <span class="n">1.0</span>; <span class="n">2.0</span> ]
[ <span class="n">3.0</span>; <span class="n">4.0</span> ]]
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs2', 2)" onmouseover="showTip(event, 'fs2', 2)" class="i">m&#39;</span> <span class="o">=</span> <span onmouseout="hideTip(event, 'fs1', 3)" onmouseover="showTip(event, 'fs1', 3)" class="i">m</span><span class="o">.</span><span class="i">Inverse</span>()
</code></pre></td>
</tr>
</table>
<pre class="fssnip highlighted"><code lang="fsharp"><span class="k">open</span> <span class="id">MathNet</span><span class="pn">.</span><span class="id">Numerics</span><span class="pn">.</span><span class="id">LinearAlgebra</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs1', 1)" onmouseover="showTip(event, 'fs1', 1)" class="id">m</span> <span class="o">=</span> <span class="id">matrix</span> <span class="pn">[</span><span class="pn">[</span> <span class="n">1.0</span><span class="pn">;</span> <span class="n">2.0</span> <span class="pn">]</span>
<span class="pn">[</span> <span class="n">3.0</span><span class="pn">;</span> <span class="n">4.0</span> <span class="pn">]</span><span class="pn">]</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs2', 2)" onmouseover="showTip(event, 'fs2', 2)" class="id">m&#39;</span> <span class="o">=</span> <span onmouseout="hideTip(event, 'fs1', 3)" onmouseover="showTip(event, 'fs1', 3)" class="id">m</span><span class="pn">.</span><span class="id">Inverse</span><span class="pn">(</span><span class="pn">)</span>
</code></pre>
<p>It also works well in the interactive F# environment (REPL) which can be launched with
<code>fsharpi</code> on all platforms (including Linux). As a start let's enter the following lines
into F# interactive. Append <code>;;</code> to the end of a line to run all code up to there
immediately and print the result to the output. Use the tab key for auto-completion or <code>#help;;</code> for help.
For convenience our F# packages include a small script that sets everything up properly:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
<span class="l">4: </span>
<span class="l">5: </span>
<span class="l">6: </span>
<span class="l">7: </span>
<span class="l">8: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="prep">#load</span> <span class="s">&quot;../packages/MathNet.Numerics.FSharp/MathNet.Numerics.fsx&quot;</span>
<pre class="fssnip highlighted"><code lang="fsharp"><span class="pp">#load</span> <span class="s">&quot;../packages/MathNet.Numerics.FSharp/MathNet.Numerics.fsx&quot;</span>
<span class="k">open</span> <span class="i">MathNet</span><span class="o">.</span><span class="i">Numerics</span>
<span class="i">SpecialFunctions</span><span class="o">.</span><span class="i">Gamma</span>(<span class="n">0.5</span>)
<span class="k">open</span> <span class="id">MathNet</span><span class="pn">.</span><span class="id">Numerics</span>
<span class="id">SpecialFunctions</span><span class="pn">.</span><span class="id">Gamma</span><span class="pn">(</span><span class="n">0.5</span><span class="pn">)</span>
<span class="k">open</span> <span class="i">MathNet</span><span class="o">.</span><span class="i">Numerics</span><span class="o">.</span><span class="i">LinearAlgebra</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs1', 4)" onmouseover="showTip(event, 'fs1', 4)" class="i">m</span> <span class="o">:</span> <span class="i">Matrix</span><span class="o">&lt;</span><span onmouseout="hideTip(event, 'fs3', 5)" onmouseover="showTip(event, 'fs3', 5)" class="i">float</span><span class="o">&gt;</span> <span class="o">=</span> <span class="i">DenseMatrix</span><span class="o">.</span><span class="i">randomStandard</span> <span class="n">50</span> <span class="n">50</span>
(<span onmouseout="hideTip(event, 'fs1', 6)" onmouseover="showTip(event, 'fs1', 6)" class="i">m</span> <span class="o">*</span> <span onmouseout="hideTip(event, 'fs1', 7)" onmouseover="showTip(event, 'fs1', 7)" class="i">m</span><span class="o">.</span><span class="i">Transpose</span>())<span class="o">.</span><span class="i">Determinant</span>()
</code></pre></td>
</tr>
</table>
<span class="k">open</span> <span class="id">MathNet</span><span class="pn">.</span><span class="id">Numerics</span><span class="pn">.</span><span class="id">LinearAlgebra</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs1', 4)" onmouseover="showTip(event, 'fs1', 4)" class="id">m</span> <span class="pn">:</span> <span class="id">Matrix</span><span class="pn">&lt;</span><span onmouseout="hideTip(event, 'fs3', 5)" onmouseover="showTip(event, 'fs3', 5)" class="id">float</span><span class="pn">&gt;</span> <span class="o">=</span> <span class="id">DenseMatrix</span><span class="pn">.</span><span class="id">randomStandard</span> <span class="n">50</span> <span class="n">50</span>
<span class="pn">(</span><span onmouseout="hideTip(event, 'fs1', 6)" onmouseover="showTip(event, 'fs1', 6)" class="id">m</span> <span class="o">*</span> <span onmouseout="hideTip(event, 'fs1', 7)" onmouseover="showTip(event, 'fs1', 7)" class="id">m</span><span class="pn">.</span><span class="id">Transpose</span><span class="pn">(</span><span class="pn">)</span><span class="pn">)</span><span class="pn">.</span><span class="id">Determinant</span><span class="pn">(</span><span class="pn">)</span>
</code></pre>
<h2><a name="Visual-Basic" class="anchor" href="#Visual-Basic">Visual Basic</a></h2>
<p>Let's use Visual Basic to find the polynomial roots <span class="math">\(x\)</span> such that <span class="math">\(2x^2 - 2x - 2 = 0\)</span>
numerically. We already know there are two roots, one between -2 and 0, the other between 0 and 2:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
<span class="l">4: </span>
<span class="l">5: </span>
<span class="l">6: </span>
<span class="l">7: </span>
<span class="l">8: </span>
<span class="l">9: </span>
</pre></td>
<td class="snippet"><pre class="fssnip"><code lang="visualbasic">Imports MathNet.Numerics.RootFinding
<table class="pre"><tr><td class="snippet"><pre class="fssnip"><code lang="visualbasic">Imports MathNet.Numerics.RootFinding
Dim f As Func(Of Double, Double) = Function(x) 2*x^2 - 2*x - 2
@ -176,54 +211,24 @@ FindRoots.Quadratic(-2, -2, 2)
<p>You need a recent version of Mono in order to use Math.NET Numerics on anything other than Windows.
Luckily there has been great progress lately to make both Mono and F# available as proper Debian packages.
In Debian <em>testing</em> and Ubuntu <em>14.04 (trusty/universe)</em> you can install both of them with APT:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
</pre></td>
<td class="snippet"><pre class="fssnip"><code lang="sh">sudo apt-get update
<table class="pre"><tr><td class="snippet"><pre class="fssnip"><code lang="sh">sudo apt-get update
sudo apt-get install mono-complete
sudo apt-get install fsharp
</code></pre></td></tr></table>
<p>If you don't have NuGet yet:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
</pre></td>
<td class="snippet"><pre class="fssnip"><code lang="sh">sudo mozroots --import --sync
<table class="pre"><tr><td class="snippet"><pre class="fssnip"><code lang="sh">sudo mozroots --import --sync
curl -L https://nuget.org/nuget.exe -o nuget.exe
</code></pre></td></tr></table>
<p>Then you can use NuGet to fetch the latest binaries in your working directory.
The <code>-Pre</code> argument causes it to include pre-releases, omit it if you want stable releases only.</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
</pre></td>
<td class="snippet"><pre class="fssnip"><code lang="sh">mono nuget.exe install MathNet.Numerics -Pre -OutputDirectory packages
<table class="pre"><tr><td class="snippet"><pre class="fssnip"><code lang="sh">mono nuget.exe install MathNet.Numerics -Pre -OutputDirectory packages
# or if you intend to use F#:
mono nuget.exe install MathNet.Numerics.FSharp -Pre -OutputDirectory packages
</code></pre></td></tr></table>
<p>In practice you'd probably use the Monodevelop IDE instead which can take care of fetching and updating
NuGet packages and maintain assembly references. But for completeness let's use the compiler directly this time.
Let's create a C# file <code>Start.cs</code>:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l"> 1: </span>
<span class="l"> 2: </span>
<span class="l"> 3: </span>
<span class="l"> 4: </span>
<span class="l"> 5: </span>
<span class="l"> 6: </span>
<span class="l"> 7: </span>
<span class="l"> 8: </span>
<span class="l"> 9: </span>
<span class="l">10: </span>
<span class="l">11: </span>
<span class="l">12: </span>
<span class="l">13: </span>
<span class="l">14: </span>
<span class="l">15: </span>
<span class="l">16: </span>
<span class="l">17: </span>
<span class="l">18: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">using</span> System;
<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> MathNet.Numerics;
<span class="k">using</span> MathNet.Numerics.LinearAlgebra;
@ -243,31 +248,14 @@ Let's create a C# file <code>Start.cs</code>:</p>
}
</code></pre></td></tr></table>
<p>Compile and run:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
<span class="l">4: </span>
<span class="l">5: </span>
</pre></td>
<td class="snippet"><pre class="fssnip"><code lang="sh"># single line:
<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 Start.cs -out:Start
# launch:
mono Start
</code></pre></td></tr></table>
<p>Which will print something like the following to the output:</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l"> 1: </span>
<span class="l"> 2: </span>
<span class="l"> 3: </span>
<span class="l"> 4: </span>
<span class="l"> 5: </span>
<span class="l"> 6: </span>
<span class="l"> 7: </span>
<span class="l"> 8: </span>
<span class="l"> 9: </span>
<span class="l">10: </span>
</pre></td>
<td class="snippet"><pre class="fssnip"><code lang="text">0.520499877813047
<table class="pre"><tr><td class="snippet"><pre class="fssnip"><code lang="text">0.520499877813047
DenseVector 500-Double
-0.181414 -1.25024 -0.607136 1.12975 -3.31201 0.344146
0.934095 -2.96364 1.84499 1.20752 0.753055 1.56942
@ -280,91 +268,27 @@ DenseVector 500-Double
</code></pre></td></tr></table>
<p>See <a href="MKL.html">Intel MKL</a> for details how to use native providers on Linux.</p>
<div class="tip" id="fs1">val m : obj<br /><br />Full name: index.m</div>
<div class="tip" id="fs2">val m&#39; : obj<br /><br />Full name: index.m&#39;</div>
<div class="tip" id="fs3">Multiple items<br />val float : value:&#39;T -&gt; float (requires member op_Explicit)<br /><br />Full name: Microsoft.FSharp.Core.Operators.float<br /><br />--------------------<br />type float = System.Double<br /><br />Full name: Microsoft.FSharp.Core.float<br /><br />--------------------<br />type float&lt;&#39;Measure&gt; = float<br /><br />Full name: Microsoft.FSharp.Core.float&lt;_&gt;</div>
<div class="fsdocs-tip" id="fs1">val m : obj</div>
<div class="fsdocs-tip" id="fs2">val m&#39; : obj</div>
<div class="fsdocs-tip" id="fs3">Multiple items<br />val float : value:&#39;T -&gt; float (requires member op_Explicit)<br /><em>&lt;summary&gt;Converts the argument to 64-bit float. This is a direct conversion for all
primitive numeric types. For strings, the input is converted using &lt;c&gt;Double.Parse()&lt;/c&gt;
with InvariantCulture settings. Otherwise the operation requires an appropriate
static conversion method on the input type.&lt;/summary&gt;<br />&lt;param name=&quot;value&quot;&gt;The input value.&lt;/param&gt;<br />&lt;returns&gt;The converted float&lt;/returns&gt;</em><br /><br />--------------------<br />[&lt;Struct&gt;]
type float = System.Double<br /><em>&lt;summary&gt;An abbreviation for the CLI type &lt;see cref=&quot;T:System.Double&quot; /&gt;.&lt;/summary&gt;<br />&lt;category&gt;Basic Types&lt;/category&gt;</em><br /><br />--------------------<br />type float&lt;&#39;Measure&gt; =
float<br /><em>&lt;summary&gt;The type of double-precision floating point numbers, annotated with a unit of measure.
The unit of measure is erased in compiled code and when values of this type
are analyzed using reflection. The type is representationally equivalent to
&lt;see cref=&quot;T:System.Double&quot; /&gt;.&lt;/summary&gt;<br />&lt;category index=&quot;6&quot;&gt;Basic Types with Units of Measure&lt;/category&gt;</em></div>
</div>
<div class="span3">
<ul class="nav nav-list" id="menu">
<li class="nav-header">Math.NET Numerics</li>
<li><a href="https://numerics.mathdotnet.com/Packages.html">NuGet & Binaries</a></li>
<li><a href="https://numerics.mathdotnet.com/ReleaseNotes.html">Release Notes</a></li>
<li><a href="https://numerics.mathdotnet.com/License.html">MIT License</a></li>
<li><a href="https://numerics.mathdotnet.com/Compatibility.html">Platform Support</a></li>
<li><a href="https://numerics.mathdotnet.com/api/">Class Reference</a></li>
<li><a href="https://github.com/mathnet/mathnet-numerics/issues">Issues & Bugs</a></li>
<li><a href="https://numerics.mathdotnet.com/Users.html">Who is using Math.NET?</a></li>
<li class="nav-header">Contributing</li>
<li><a href="https://numerics.mathdotnet.com/Contributors.html">Contributors</a></li>
<li><a href="https://numerics.mathdotnet.com/Contributing.html">Contributing</a></li>
<li><a href="https://numerics.mathdotnet.com/Build.html">Build & Tools</a></li>
<li><a href="http://feedback.mathdotnet.com/forums/2060-math-net-numerics">Your Ideas</a></li>
<li class="nav-header">Getting Help</li>
<li><a href="https://discuss.mathdotnet.com/c/numerics">Discuss</a></li>
<li><a href="https://stackoverflow.com/questions/tagged/mathdotnet">Stack Overflow</a></li>
<li class="nav-header">Getting Started</li>
<li><a href="https://numerics.mathdotnet.com/">Getting started</a></li>
<li><a href="https://numerics.mathdotnet.com/Constants.html">Constants</a></li>
<li>Floating-Point Numbers</li>
<li>Arbitrary Precision Numbers</li>
<li>Complex Numbers</li>
<li><a href="https://numerics.mathdotnet.com/Matrix.html">Matrices and Vectors</a></li>
<li><a href="https://numerics.mathdotnet.com/Euclid.html">Euclid & Number Theory</a></li>
<li>Combinatorics</li>
<li class="nav-header">Evaluation</li>
<li><a href="https://numerics.mathdotnet.com/Functions.html">Special Functions</a></li>
<li>Differentiation</li>
<li><a href="https://numerics.mathdotnet.com/Integration.html">Integration</a></li>
<li class="nav-header">Statistics/Probability</li>
<li><a href="https://numerics.mathdotnet.com/DescriptiveStatistics.html">Descriptive Statistics</a></li>
<li><a href="https://numerics.mathdotnet.com/Probability.html">Probability Distributions</a></li>
<li class="nav-header">Generation</li>
<li><a href="https://numerics.mathdotnet.com/Generate.html">Generating Data</a></li>
<li><a href="https://numerics.mathdotnet.com/Random.html">Random Numbers</a></li>
<li class="nav-header">Transformation</li>
<li>Fourier Transform (FFT)</li>
<li>Filtering & DSP</li>
<li>Window Functions</li>
<li class="nav-header">Solving Equations</li>
<li><a href="https://numerics.mathdotnet.com/LinearEquations.html">Linear Equation Systems</a></li>
<li>Nonlinear Root Finding</li>
<li class="nav-header">Optimization</li>
<li>Linear Least Squares</li>
<li>Nonlinear Optimization</li>
<li><a href="https://numerics.mathdotnet.com/Distance.html">Distance Metrics</a></li>
<li class="nav-header">Curve Fitting</li>
<li><a href="https://numerics.mathdotnet.com/Regression.html">Regression</a></li>
<li>Interpolation</li>
<li>Fourier Approximation</li>
<li class="nav-header">Native Providers</li>
<li><a href="https://numerics.mathdotnet.com/MKL.html">Intel MKL</a></li>
<li class="nav-header">Working Together</li>
<li><a href="https://numerics.mathdotnet.com/CSV.html">Delimited Text Files (CSV)</a></li>
<li><a href="https://numerics.mathdotnet.com/MatrixMarket.html">NIST MatrixMarket</a></li>
<li><a href="https://numerics.mathdotnet.com/MatlabFiles.html">MATLAB</a></li>
<li><a href="https://numerics.mathdotnet.com/IFSharpNotebook.html">IF# Notebook</a></li>
<li>FsLab & Deedle</li>
<li>Microsoft Excel</li>
<li>numl.net machine learning</li>
<li>R-project</li>
</ul>
</div>
</div>
</div>
</body>
<!-- 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>

1
index.json

File diff suppressed because one or more lines are too long

BIN
logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Loading…
Cancel
Save