![]() |
VOOZH | about |
dotnet add package MKL.NET.Matrix --version 1.1.1
NuGet\Install-Package MKL.NET.Matrix -Version 1.1.1
<PackageReference Include="MKL.NET.Matrix" Version="1.1.1" />
<PackageVersion Include="MKL.NET.Matrix" Version="1.1.1" />Directory.Packages.props
<PackageReference Include="MKL.NET.Matrix" />Project file
paket add MKL.NET.Matrix --version 1.1.1
#r "nuget: MKL.NET.Matrix, 1.1.1"
#:package MKL.NET.Matrix@1.1.1
#addin nuget:?package=MKL.NET.Matrix&version=1.1.1Install as a Cake Addin
#tool nuget:?package=MKL.NET.Matrix&version=1.1.1Install as a Cake Tool
A simple cross platform .NET API for Intel MKL.
Exposing functions from MKL keeping the syntax as close to the c developer reference as possible.
Reference the MKL.NET package and required runtime packages and use the static MKL functions. The correct native libraries will be included and loaded at runtime.
If you use your own copy of MKL native libraries please make sure that mkl_rt.dll/libmkl_rt.so/libmkl_rt.dylib is on the path. Newer MKL builds include a version number in the library name, so you will have to create a link or rename it. The names are already adjusted in the MKL.NET packages which work out of the box.
| MKL.NET | 👁 MKL.NET |
|---|---|
| runtimes: | |
| MKL.NET.win-x64 | 👁 MKL.NET |
| MKL.NET.win-x86 | 👁 MKL.NET |
| MKL.NET.linux-x64 | 👁 MKL.NET |
| MKL.NET.linux-x86 | 👁 MKL.NET |
| MKL.NET.osx-x64 | 👁 MKL.NET |
| libraries: | |
| MKL.NET.Matrix | 👁 MKL.NET |
| MKL.NET.Optimization | 👁 MKL.NET |
| MKL.NET.Statistics | 👁 MKL.NET |
The following example only results in one new matrix r (using ArrayPool) without mutating inputs.
public static matrix Example(matrix ma, matrix mb, vector va, vector vb)
{
using matrix r = 0.5 * Matrix.Abs(1.0 - ma) * mb.T + Math.PI * va.T * Vector.Sin(vb);
...
}
Example statistics matrix function:
public static (vector, matrix) MeanAndCovariance(matrix samples, vector weights)
{
if (samples.Rows != weights.Length) ThrowHelper.ThrowIncorrectDimensionsForOperation();
var mean = new vector(samples.Cols);
var cov = new matrix(samples.Cols, samples.Cols);
var task = Vsl.SSNewTask(samples.Cols, samples.Rows, VslStorage.ROWS, samples.Array, weights.Array);
ThrowHelper.Check(Vsl.SSEditCovCor(task, mean.Array, cov.Array, VslFormat.FULL, null, VslFormat.FULL));
ThrowHelper.Check(Vsl.SSCompute(task, VslEstimate.COV, VslMethod.FAST));
ThrowHelper.Check(Vsl.SSDeleteTask(task));
return (mean, cov);
}
Note: arrays need to be pinned across all MKL function calls when there are multiple as above as MKL stores native pointers and the arrays could be moved between calls. MKL.NET handles pinning automatically, unpinning when the task is deleted. This is a common seen bug when using MKL directly from .NET which causes occasional crashes.
Simple and high performance optimization and root finding library loosely based on the scipy.optimize API.
The aim is to include the latest algorithms such as Toms748, robustly tested with CsCheck. Full use of MKL.NET will be made to improve performance. Algorithms will be performance tested and default to the best for given inputs.
Simple and high performance statistics functions.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 is compatible. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 was computed. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 was computed. |
| .NET Framework | net461 net461 was computed. net462 net462 was computed. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
Showing the top 2 NuGet packages that depend on MKL.NET.Matrix:
| Package | Downloads |
|---|---|
|
MKL.NET.Optimization
Optimization and root finding based on cross platform MKL.NET. |
|
|
MKL.NET.Statistics
Statistics functions based on cross platform MKL.NET. |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.1.1 | 42,408 | 6/14/2023 |
| 1.1.0 | 4,126 | 5/7/2023 |
| 1.0.0 | 11,998 | 3/6/2022 |
| 1.0.0-rc1 | 821 | 2/23/2022 |
| 0.7.2 | 1,834 | 9/26/2021 |
| 0.7.0 | 1,361 | 8/26/2021 |
| 0.6.4 | 1,026 | 6/23/2021 |
| 0.6.3 | 1,059 | 2/5/2021 |
| 0.6.2 | 1,014 | 1/30/2021 |
| 0.6.1 | 1,031 | 1/28/2021 |
| 0.6.0 | 1,059 | 1/27/2021 |
| 0.5.0 | 1,058 | 1/18/2021 |
| 0.4.0 | 1,066 | 1/16/2021 |
| 0.3.0 | 1,065 | 11/13/2020 |
| 0.2.0 | 1,081 | 11/9/2020 |
| 0.1.0 | 1,198 | 11/4/2020 |
Fixed MatrixSolve Dispose logic.