forked from tsai/mathnet-numerics
47 changed files with 13609 additions and 901 deletions
@ -1,36 +0,0 @@ |
|||
IF DEFINED CommonProgramFiles(x86) GOTO x64 |
|||
|
|||
:x86 |
|||
SET common=%CommonProgramFiles% |
|||
GOTO prepare |
|||
|
|||
:x64 |
|||
SET common=%CommonProgramFiles(x86)% |
|||
GOTO prepare |
|||
|
|||
:prepare |
|||
"%common%\Microsoft Shared\TextTemplating\10.0\texttransform.exe" -out ..\src\Numerics\Version.cs -P "%ProgramFiles%\Reference Assemblies\Microsoft\Framework\v3.5" ..\src\Numerics\Version.tt |
|||
"%common%\Microsoft Shared\TextTemplating\10.0\texttransform.exe" -out ..\src\Silverlight\Version.cs -P "%ProgramFiles%\Reference Assemblies\Microsoft\Framework\v3.5" ..\src\Silverlight\Version.tt |
|||
|
|||
"%common%\Microsoft Shared\TextTemplating\10.0\texttransform.exe" -out ..\src\Numerics\Algorithms\LinearAlgebra\Mkl\MklLinearAlgebraProvider.Common.cs -P "%ProgramFiles%\Reference Assemblies\Microsoft\Framework\v3.5" ..\src\Numerics\Algorithms\LinearAlgebra\Mkl\MklLinearAlgebraProvider.Common.tt |
|||
"%common%\Microsoft Shared\TextTemplating\10.0\texttransform.exe" -out ..\src\Numerics\Algorithms\LinearAlgebra\Mkl\MklLinearAlgebraProvider.Complex.cs -P "%ProgramFiles%\Reference Assemblies\Microsoft\Framework\v3.5" ..\src\Numerics\Algorithms\LinearAlgebra\Mkl\MklLinearAlgebraProvider.Complex.tt |
|||
"%common%\Microsoft Shared\TextTemplating\10.0\texttransform.exe" -out ..\src\Numerics\Algorithms\LinearAlgebra\Mkl\MklLinearAlgebraProvider.Complex32.cs -P "%ProgramFiles%\Reference Assemblies\Microsoft\Framework\v3.5" ..\src\Numerics\Algorithms\LinearAlgebra\Mkl\MklLinearAlgebraProvider.Complex32.tt |
|||
"%common%\Microsoft Shared\TextTemplating\10.0\texttransform.exe" -out ..\src\Numerics\Algorithms\LinearAlgebra\Mkl\MklLinearAlgebraProvider.double.cs -P "%ProgramFiles%\Reference Assemblies\Microsoft\Framework\v3.5" ..\src\Numerics\Algorithms\LinearAlgebra\Mkl\MklLinearAlgebraProvider.double.tt |
|||
"%common%\Microsoft Shared\TextTemplating\10.0\texttransform.exe" -out ..\src\Numerics\Algorithms\LinearAlgebra\Mkl\MklLinearAlgebraProvider.float.cs -P "%ProgramFiles%\Reference Assemblies\Microsoft\Framework\v3.5" ..\src\Numerics\Algorithms\LinearAlgebra\Mkl\MklLinearAlgebraProvider.float.tt |
|||
"%common%\Microsoft Shared\TextTemplating\10.0\texttransform.exe" -out ..\src\Numerics\Algorithms\LinearAlgebra\Mkl\SafeNativeMethods.cs -P "%ProgramFiles%\Reference Assemblies\Microsoft\Framework\v3.5" ..\src\Numerics\Algorithms\LinearAlgebra\Mkl\SafeNativeMethods.tt |
|||
|
|||
"%common%\Microsoft Shared\TextTemplating\10.0\texttransform.exe" -out ..\src\Numerics\Algorithms\LinearAlgebra\GotoBlas\GotoBlasLinearAlgebraProvider.Common.cs -P "%ProgramFiles%\Reference Assemblies\Microsoft\Framework\v3.5" ..\src\Numerics\Algorithms\LinearAlgebra\GotoBlas\GotoBlasLinearAlgebraProvider.Common.tt |
|||
"%common%\Microsoft Shared\TextTemplating\10.0\texttransform.exe" -out ..\src\Numerics\Algorithms\LinearAlgebra\GotoBlas\GotoBlasLinearAlgebraProvider.Complex.cs -P "%ProgramFiles%\Reference Assemblies\Microsoft\Framework\v3.5" ..\src\Numerics\Algorithms\LinearAlgebra\GotoBlas\GotoBlasLinearAlgebraProvider.Complex.tt |
|||
"%common%\Microsoft Shared\TextTemplating\10.0\texttransform.exe" -out ..\src\Numerics\Algorithms\LinearAlgebra\GotoBlas\GotoBlasLinearAlgebraProvider.Complex32.cs -P "%ProgramFiles%\Reference Assemblies\Microsoft\Framework\v3.5" ..\src\Numerics\Algorithms\LinearAlgebra\GotoBlas\GotoBlasLinearAlgebraProvider.Complex32.tt |
|||
"%common%\Microsoft Shared\TextTemplating\10.0\texttransform.exe" -out ..\src\Numerics\Algorithms\LinearAlgebra\GotoBlas\GotoBlasLinearAlgebraProvider.double.cs -P "%ProgramFiles%\Reference Assemblies\Microsoft\Framework\v3.5" ..\src\Numerics\Algorithms\LinearAlgebra\GotoBlas\GotoBlasLinearAlgebraProvider.double.tt |
|||
"%common%\Microsoft Shared\TextTemplating\10.0\texttransform.exe" -out ..\src\Numerics\Algorithms\LinearAlgebra\GotoBlas\GotoBlasLinearAlgebraProvider.float.cs -P "%ProgramFiles%\Reference Assemblies\Microsoft\Framework\v3.5" ..\src\Numerics\Algorithms\LinearAlgebra\GotoBlas\GotoBlasLinearAlgebraProvider.float.tt |
|||
"%common%\Microsoft Shared\TextTemplating\10.0\texttransform.exe" -out ..\src\Numerics\Algorithms\LinearAlgebra\GotoBlas\SafeNativeMethods.cs -P "%ProgramFiles%\Reference Assemblies\Microsoft\Framework\v3.5" ..\src\Numerics\Algorithms\LinearAlgebra\GotoBlas\SafeNativeMethods.tt |
|||
|
|||
"%common%\Microsoft Shared\TextTemplating\10.0\texttransform.exe" -out ..\src\Numerics\Algorithms\LinearAlgebra\Acml\AcmlLinearAlgebraProvider.Common.cs -P "%ProgramFiles%\Reference Assemblies\Microsoft\Framework\v3.5" ..\src\Numerics\Algorithms\LinearAlgebra\Acml\AcmlLinearAlgebraProvider.Common.tt |
|||
"%common%\Microsoft Shared\TextTemplating\10.0\texttransform.exe" -out ..\src\Numerics\Algorithms\LinearAlgebra\Acml\AcmlLinearAlgebraProvider.Complex.cs -P "%ProgramFiles%\Reference Assemblies\Microsoft\Framework\v3.5" ..\src\Numerics\Algorithms\LinearAlgebra\Acml\AcmlLinearAlgebraProvider.Complex.tt |
|||
"%common%\Microsoft Shared\TextTemplating\10.0\texttransform.exe" -out ..\src\Numerics\Algorithms\LinearAlgebra\Acml\AcmlLinearAlgebraProvider.Complex32.cs -P "%ProgramFiles%\Reference Assemblies\Microsoft\Framework\v3.5" ..\src\Numerics\Algorithms\LinearAlgebra\Acml\AcmlLinearAlgebraProvider.Complex32.tt |
|||
"%common%\Microsoft Shared\TextTemplating\10.0\texttransform.exe" -out ..\src\Numerics\Algorithms\LinearAlgebra\Acml\AcmlLinearAlgebraProvider.double.cs -P "%ProgramFiles%\Reference Assemblies\Microsoft\Framework\v3.5" ..\src\Numerics\Algorithms\LinearAlgebra\Acml\AcmlLinearAlgebraProvider.double.tt |
|||
"%common%\Microsoft Shared\TextTemplating\10.0\texttransform.exe" -out ..\src\Numerics\Algorithms\LinearAlgebra\Acml\AcmlLinearAlgebraProvider.float.cs -P "%ProgramFiles%\Reference Assemblies\Microsoft\Framework\v3.5" ..\src\Numerics\Algorithms\LinearAlgebra\Acml\AcmlLinearAlgebraProvider.float.tt |
|||
"%common%\Microsoft Shared\TextTemplating\10.0\texttransform.exe" -out ..\src\Numerics\Algorithms\LinearAlgebra\Acml\SafeNativeMethods.cs -P "%ProgramFiles%\Reference Assemblies\Microsoft\Framework\v3.5" ..\src\Numerics\Algorithms\LinearAlgebra\Acml\SafeNativeMethods.tt |
|||
|
|||
set common = |
|||
@ -1,55 +0,0 @@ |
|||
// <copyright file="AssemblyInfo.fs" company="Math.NET"> |
|||
// Math.NET Numerics, part of the Math.NET Project |
|||
// http://numerics.mathdotnet.com |
|||
// http://github.com/mathnet/mathnet-numerics |
|||
// http://mathnetnumerics.codeplex.com |
|||
// |
|||
// Copyright (c) 2009 Math.NET |
|||
// |
|||
// Permission is hereby granted, free of charge, to any person |
|||
// obtaining a copy of this software and associated documentation |
|||
// files (the "Software"), to deal in the Software without |
|||
// restriction, including without limitation the rights to use, |
|||
// copy, modify, merge, publish, distribute, sublicense, and/or sell |
|||
// copies of the Software, and to permit persons to whom the |
|||
// Software is furnished to do so, subject to the following |
|||
// conditions: |
|||
// |
|||
// The above copyright notice and this permission notice shall be |
|||
// included in all copies or substantial portions of the Software. |
|||
// |
|||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
|||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
|||
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
|||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
|||
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
|||
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
|||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
|||
// OTHER DEALINGS IN THE SOFTWARE. |
|||
// </copyright> |
|||
|
|||
namespace MathNet.Numerics |
|||
|
|||
open System.Reflection |
|||
open System.Resources; |
|||
open System.Runtime.CompilerServices |
|||
open System.Runtime.InteropServices |
|||
|
|||
[<assembly: AssemblyTitle("Math.NET Numerics F# Modules")>] |
|||
[<assembly: AssemblyDescription("")>] |
|||
[<assembly: AssemblyConfiguration("")>] |
|||
[<assembly: AssemblyCompany("Math.NET Project")>] |
|||
[<assembly: AssemblyProduct("Math.NET Numerics")>] |
|||
[<assembly: AssemblyCopyright("Copyright © Math.NET Project")>] |
|||
[<assembly: AssemblyTrademark("")>] |
|||
[<assembly: AssemblyCulture("")>] |
|||
[<assembly: ComVisible(false)>] |
|||
[<assembly: Guid("048BC4EB-CE2B-4040-9967-4784F5405B0F")>] |
|||
[<assembly: NeutralResourcesLanguage("en")>] |
|||
|
|||
<#@ template Language="C#"#> |
|||
<# DateTime date = DateTime.UtcNow; #> |
|||
[<assembly: AssemblyVersion("<#=date.Year#>.<#=date.Month.ToString("0#")#>.<#=date.Day#>.<#=(int)date.TimeOfDay.TotalMinutes#>")>] |
|||
[<assembly: AssemblyFileVersion("<#=date.Year#>.<#=date.Month.ToString("0#")#>.<#=date.Day#>.<#=(int)date.TimeOfDay.TotalMinutes#>")>] |
|||
|
|||
() |
|||
@ -1,7 +0,0 @@ |
|||
<#@ template language="C#" debug="true" #> |
|||
<#@ output extenstion="cs" #> |
|||
<# string library = "Acml";#> |
|||
<# string title = "AMD Core Math Library (ACML)";#> |
|||
<# string dataType = "Common";#> |
|||
<#@ include file="..\native.header.include" #> |
|||
<#@ include file="..\native.footer.include" #> |
|||
File diff suppressed because it is too large
@ -1,13 +0,0 @@ |
|||
<#@ template language="C#" debug="true" #> |
|||
<#@ output extenstion="cs" #> |
|||
<# string library = "Acml";#> |
|||
<# string title = "AMD Core Math Library (ACML)";#> |
|||
<# string dataType = "Complex";#> |
|||
<# string zero = "Complex.Zero";#> |
|||
<# string one = "Complex.One";#> |
|||
<# string prefix = "z";#> |
|||
<# string svd_work = "2 * Math.Min(rowsA, columnsA) + Math.Max(rowsA, columnsA)";#> |
|||
<#@ include file="..\native.header.include" #> |
|||
<#@ include file="..\native.dotproduct.include" #> |
|||
<#@ include file="..\native.generic.include" #> |
|||
<#@ include file="..\native.footer.include" #> |
|||
File diff suppressed because it is too large
@ -1,13 +0,0 @@ |
|||
<#@ template language="C#" debug="true" #> |
|||
<#@ output extenstion="cs" #> |
|||
<# string library = "Acml";#> |
|||
<# string title = "AMD Core Math Library (ACML)";#> |
|||
<# string dataType = "Complex32";#> |
|||
<# string zero = "Complex32.Zero";#> |
|||
<# string one = "Complex32.One";#> |
|||
<# string prefix = "c";#> |
|||
<# string svd_work = "2 * Math.Min(rowsA, columnsA) + Math.Max(rowsA, columnsA)";#> |
|||
<#@ include file="..\native.header.include" #> |
|||
<#@ include file="..\native.dotproduct.include" #> |
|||
<#@ include file="..\native.generic.include" #> |
|||
<#@ include file="..\native.footer.include" #> |
|||
File diff suppressed because it is too large
@ -1,13 +0,0 @@ |
|||
<#@ template language="C#" debug="true" #> |
|||
<#@ output extenstion="cs" #> |
|||
<# string library = "Acml";#> |
|||
<# string title = "AMD Core Math Library (ACML)";#> |
|||
<# string dataType = "double";#> |
|||
<# string zero = "0.0";#> |
|||
<# string one = "1.0";#> |
|||
<# string prefix = "d";#> |
|||
<# string svd_work = "Math.Max((3 * Math.Min(rowsA, columnsA)) + Math.Max(rowsA, columnsA), 5 * Math.Min(rowsA, columnsA))";#> |
|||
<#@ include file="..\native.header.include" #> |
|||
<#@ include file="..\native.dotproduct.include" #> |
|||
<#@ include file="..\native.generic.include" #> |
|||
<#@ include file="..\native.footer.include" #> |
|||
File diff suppressed because it is too large
@ -1,13 +0,0 @@ |
|||
<#@ template language="C#" debug="true" #> |
|||
<#@ output extenstion="cs" #> |
|||
<# string library = "Acml";#> |
|||
<# string title = "AMD Core Math Library (ACML)";#> |
|||
<# string dataType = "float";#> |
|||
<# string zero = "0.0f";#> |
|||
<# string one = "1.0f";#> |
|||
<# string prefix = "s";#> |
|||
<# string svd_work = "Math.Max((3 * Math.Min(rowsA, columnsA) + Math.Max(rowsA, columnsA)), 5 * Math.Min(rowsA, columnsA))";#> |
|||
<#@ include file="..\native.header.include" #> |
|||
<#@ include file="..\native.dotproduct.include" #> |
|||
<#@ include file="..\native.generic.include" #> |
|||
<#@ include file="..\native.footer.include" #> |
|||
@ -1,8 +0,0 @@ |
|||
<#@ template language="C#" debug="true" #> |
|||
<#@ output extenstion="cs" #> |
|||
<# string namespaceSuffix = "Acml"; |
|||
string library = "ACML"; |
|||
#> |
|||
<#@ include file="..\safe.native.common.include" #> |
|||
} |
|||
} |
|||
@ -1,8 +0,0 @@ |
|||
<#@ template language="C#" debug="true" #> |
|||
<#@ output extenstion="cs" #> |
|||
<# string library = "GotoBlas";#> |
|||
<# string title = "GotoBLAS2";#> |
|||
<# string dataType = "Common";#> |
|||
<#@ include file="..\native.header.include" #> |
|||
<#@ include file="..\native.norm.include" #> |
|||
<#@ include file="..\native.footer.include" #> |
|||
@ -1,12 +0,0 @@ |
|||
<#@ template language="C#" debug="true" #> |
|||
<#@ output extenstion="cs" #> |
|||
<# string library = "GotoBlas";#> |
|||
<# string title = "GotoBLAS2";#> |
|||
<# string dataType = "Complex";#> |
|||
<# string zero = "Complex.Zero";#> |
|||
<# string one = "Complex.One";#> |
|||
<# string prefix = "z";#> |
|||
<# string svd_work = "2 * Math.Min(rowsA, columnsA) + Math.Max(rowsA, columnsA)";#> |
|||
<#@ include file="..\native.header.include" #> |
|||
<#@ include file="..\native.generic.include" #> |
|||
<#@ include file="..\native.footer.include" #> |
|||
File diff suppressed because it is too large
@ -1,12 +0,0 @@ |
|||
<#@ template language="C#" debug="true" #> |
|||
<#@ output extenstion="cs" #> |
|||
<# string library = "GotoBlas";#> |
|||
<# string title = "GotoBLAS2";#> |
|||
<# string dataType = "Complex32";#> |
|||
<# string zero = "Complex32.Zero";#> |
|||
<# string one = "Complex32.One";#> |
|||
<# string prefix = "c";#> |
|||
<# string svd_work = "2 * Math.Min(rowsA, columnsA) + Math.Max(rowsA, columnsA)";#> |
|||
<#@ include file="..\native.header.include" #> |
|||
<#@ include file="..\native.generic.include" #> |
|||
<#@ include file="..\native.footer.include" #> |
|||
File diff suppressed because it is too large
@ -1,12 +0,0 @@ |
|||
<#@ template language="C#" debug="true" #> |
|||
<#@ output extenstion="cs" #> |
|||
<# string library = "GotoBlas";#> |
|||
<# string title = "GotoBLAS2";#> |
|||
<# string dataType = "double";#> |
|||
<# string zero = "0.0";#> |
|||
<# string one = "1.0";#> |
|||
<# string prefix = "d";#> |
|||
<# string svd_work = "Math.Max((3 * Math.Min(rowsA, columnsA)) + Math.Max(rowsA, columnsA), 5 * Math.Min(rowsA, columnsA))";#> |
|||
<#@ include file="..\native.header.include" #> |
|||
<#@ include file="..\native.generic.include" #> |
|||
<#@ include file="..\native.footer.include" #> |
|||
File diff suppressed because it is too large
@ -1,12 +0,0 @@ |
|||
<#@ template language="C#" debug="true" #> |
|||
<#@ output extenstion="cs" #> |
|||
<# string library = "GotoBlas";#> |
|||
<# string title = "GotoBLAS2";#> |
|||
<# string dataType = "float";#> |
|||
<# string zero = "0.0f";#> |
|||
<# string one = "1.0f";#> |
|||
<# string prefix = "s";#> |
|||
<# string svd_work = "Math.Max((3 * Math.Min(rowsA, columnsA) + Math.Max(rowsA, columnsA)), 5 * Math.Min(rowsA, columnsA))";#> |
|||
<#@ include file="..\native.header.include" #> |
|||
<#@ include file="..\native.generic.include" #> |
|||
<#@ include file="..\native.footer.include" #> |
|||
@ -0,0 +1,259 @@ |
|||
// <copyright file="SafeNativeMethods.cs" company="Math.NET">
|
|||
// Math.NET Numerics, part of the Math.NET Project
|
|||
// http://mathnet.opensourcedotnet.info
|
|||
//
|
|||
// Copyright (c) 2009-2010 Math.NET
|
|||
//
|
|||
// Permission is hereby granted, free of charge, to any person
|
|||
// obtaining a copy of this software and associated documentation
|
|||
// files (the "Software"), to deal in the Software without
|
|||
// restriction, including without limitation the rights to use,
|
|||
// copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|||
// copies of the Software, and to permit persons to whom the
|
|||
// Software is furnished to do so, subject to the following
|
|||
// conditions:
|
|||
//
|
|||
// The above copyright notice and this permission notice shall be
|
|||
// included in all copies or substantial portions of the Software.
|
|||
//
|
|||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|||
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|||
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|||
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|||
// OTHER DEALINGS IN THE SOFTWARE.
|
|||
// </copyright>
|
|||
|
|||
using System.Numerics; |
|||
using System.Runtime.InteropServices; |
|||
using System.Security; |
|||
|
|||
namespace MathNet.Numerics.Algorithms.LinearAlgebra.GotoBlas |
|||
{ |
|||
/// <summary>
|
|||
/// P/Invoke methods to the native math libraries.
|
|||
/// </summary>
|
|||
[SuppressUnmanagedCodeSecurity] |
|||
[SecurityCritical] |
|||
internal static class SafeNativeMethods |
|||
{ |
|||
/// <summary>
|
|||
/// Name of the native DLL.
|
|||
/// </summary>
|
|||
private const string DllName = "MathNET.Numerics.GotoBLAS2.dll"; |
|||
|
|||
#region BLAS
|
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern void s_axpy(int n, float alpha, float[] x, [In, Out] float[] y); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern void d_axpy(int n, double alpha, double[] x, [In, Out] double[] y); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern void c_axpy(int n, Complex32 alpha, Complex32[] x, [In, Out] Complex32[] y); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern void z_axpy(int n, Complex alpha, Complex[] x, [In, Out] Complex[] y); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern void s_scale(int n, float alpha, [Out] float[] x); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern void d_scale(int n, double alpha, [Out] double[] x); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern void c_scale(int n, Complex32 alpha, [In, Out] Complex32[] x); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern void z_scale(int n, Complex alpha, [In, Out] Complex[] x); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern float s_dot_product(int n, float[] x, float[] y); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern double d_dot_product(int n, double[] x, double[] y); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern Complex32 c_dot_product(int n, Complex32[] x, Complex32[] y); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern Complex z_dot_product(int n, Complex[] x, Complex[] y); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern void s_matrix_multiply(Transpose transA, Transpose transB, int m, int n, int k, float alpha, float[] x, float[] y, float beta, [In, Out]float[] c); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern void d_matrix_multiply(Transpose transA, Transpose transB, int m, int n, int k, double alpha, double[] x, double[] y, double beta, [In, Out]double[] c); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern void c_matrix_multiply(Transpose transA, Transpose transB, int m, int n, int k, Complex32 alpha, Complex32[] x, Complex32[] y, Complex32 beta, [In, Out]Complex32[] c); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern void z_matrix_multiply(Transpose transA, Transpose transB, int m, int n, int k, Complex alpha, Complex[] x, Complex[] y, Complex beta, [In, Out]Complex[] c); |
|||
|
|||
#endregion BLAS
|
|||
|
|||
#region LAPACK
|
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern float s_matrix_norm(byte norm, int rows, int columns, [In] float[] a, [In, Out] float[] work); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern float d_matrix_norm(byte norm, int rows, int columns, [In] double[] a, [In, Out] double[] work); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern float c_matrix_norm(byte norm, int rows, int columns, [In] Complex32[] a, [In, Out] float[] work); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern double z_matrix_norm(byte norm, int rows, int columns, [In] Complex[] a, [In, Out] double[] work); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int s_cholesky_factor(int n, [In, Out] float[] a); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int d_cholesky_factor(int n, [In, Out] double[] a); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int c_cholesky_factor(int n, [In, Out] Complex32[] a); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int z_cholesky_factor(int n, [In, Out] Complex[] a); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int s_lu_factor(int n, [In, Out] float[] a, [In, Out] int[] ipiv); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int d_lu_factor(int n, [In, Out] double[] a, [In, Out] int[] ipiv); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int c_lu_factor(int n, [In, Out] Complex32[] a, [In, Out] int[] ipiv); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int z_lu_factor(int n, [In, Out] Complex[] a, [In, Out] int[] ipiv); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int s_lu_inverse(int n, [In, Out] float[] a, [In, Out] float[] work, int lwork); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int d_lu_inverse(int n, [In, Out] double[] a, [In, Out] double[] work, int lwork); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int c_lu_inverse(int n, [In, Out] Complex32[] a, [In, Out] Complex32[] work, int lwork); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int z_lu_inverse(int n, [In, Out] Complex[] a, [In, Out] Complex[] work, int lwork); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int s_lu_inverse_factored(int n, [In, Out] float[] a, [In, Out] int[] ipiv, [In, Out] float[] work, int lwork); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int d_lu_inverse_factored(int n, [In, Out] double[] a, [In, Out] int[] ipiv, [In, Out] double[] work, int lwork); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int c_lu_inverse_factored(int n, [In, Out] Complex32[] a, [In, Out] int[] ipiv, [In, Out] Complex32[] work, int lwork); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int z_lu_inverse_factored(int n, [In, Out] Complex[] a, [In, Out] int[] ipiv, [In, Out] Complex[] work, int lwork); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int s_lu_solve_factored(int n, int nrhs, float[] a, [In, Out]int[] ipiv, [In, Out] float[] b); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int d_lu_solve_factored(int n, int nrhs, double[] a, [In, Out] int[] ipiv, [In, Out] double[] b); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int c_lu_solve_factored(int n, int nrhs, Complex32[] a, [In, Out] int[] ipiv, [In, Out] Complex32[] b); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int z_lu_solve_factored(int n, int nrhs, Complex[] a, [In, Out]int[] ipiv, [In, Out] Complex[] b); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int s_lu_solve(int n, int nrhs, float[] a, [In, Out] float[] b); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int d_lu_solve(int n, int nrhs, double[] a, [In, Out] double[] b); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int c_lu_solve(int n, int nrhs, Complex32[] a, [In, Out] Complex32[] b); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int z_lu_solve(int n, int nrhs, Complex[] a, [In, Out] Complex[] b); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int s_cholesky_solve(int n, int nrhs, float[] a, [In, Out] float[] b); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int d_cholesky_solve(int n, int nrhs, double[] a, [In, Out] double[] b); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int c_cholesky_solve(int n, int nrhs, Complex32[] a, [In, Out] Complex32[] b); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int z_cholesky_solve(int n, int nrhs, Complex[] a, [In, Out] Complex[] b); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int s_cholesky_solve_factored(int n, int nrhs, float[] a, [In, Out] float[] b); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int d_cholesky_solve_factored(int n, int nrhs, double[] a, [In, Out] double[] b); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int c_cholesky_solve_factored(int n, int nrhs, Complex32[] a, [In, Out] Complex32[] b); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int z_cholesky_solve_factored(int n, int nrhs, Complex[] a, [In, Out] Complex[] b); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int s_qr_factor(int m, int n, [In, Out] float[] r, [In, Out] float[] tau, [In, Out] float[] q, [In, Out] float[] work, int len); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int d_qr_factor(int m, int n, [In, Out] double[] r, [In, Out] double[] tau, [In, Out] double[] q, [In, Out] double[] work, int len); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int c_qr_factor(int m, int n, [In, Out] Complex32[] r, [In, Out] Complex32[] tau, [In, Out] Complex32[] q, [In, Out] Complex32[] work, int len); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int z_qr_factor(int m, int n, [In, Out] Complex[] r, [In, Out] Complex[] tau, [In, Out] Complex[] q, [In, Out] Complex[] work, int len); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int s_qr_solve(int m, int n, int bn, float[] r, float[] b, [In, Out] float[] x, [In, Out] float[] work, int len); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int d_qr_solve(int m, int n, int bn, double[] r, double[] b, [In, Out] double[] x, [In, Out] double[] work, int len); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int c_qr_solve(int m, int n, int bn, Complex32[] r, Complex32[] b, [In, Out] Complex32[] x, [In, Out] Complex32[] work, int len); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int z_qr_solve(int m, int n, int bn, Complex[] r, Complex[] b, [In, Out] Complex[] x, [In, Out] Complex[] work, int len); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int s_qr_solve_factored(int m, int n, int bn, float[] r, float[] b, float[] tau, [In, Out] float[] x, [In, Out] float[] work, int len); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int d_qr_solve_factored(int m, int n, int bn, double[] r, double[] b, double[] tau, [In, Out] double[] x, [In, Out] double[] work, int len); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int c_qr_solve_factored(int m, int n, int bn, Complex32[] r, Complex32[] b, Complex32[] tau, [In, Out] Complex32[] x, [In, Out] Complex32[] work, int len); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int z_qr_solve_factored(int m, int n, int bn, Complex[] r, Complex[] b, Complex[] tau, [In, Out] Complex[] x, [In, Out] Complex[] work, int len); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int s_svd_factor(bool computeVectors, int m, int n, [In, Out] float[] a, [In, Out] float[] s, [In, Out] float[] u, [In, Out] float[] v, [In, Out] float[] work, int len); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int d_svd_factor(bool computeVectors, int m, int n, [In, Out] double[] a, [In, Out] double[] s, [In, Out] double[] u, [In, Out] double[] v, [In, Out] double[] work, int len); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int c_svd_factor(bool computeVectors, int m, int n, [In, Out] Complex32[] a, [In, Out] Complex32[] s, [In, Out] Complex32[] u, [In, Out] Complex32[] v, [In, Out] Complex32[] work, int len); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int z_svd_factor(bool computeVectors, int m, int n, [In, Out] Complex[] a, [In, Out] Complex[] s, [In, Out] Complex[] u, [In, Out] Complex[] v, [In, Out] Complex[] work, int len); |
|||
|
|||
#endregion LAPACK
|
|||
} |
|||
} |
|||
@ -1,8 +0,0 @@ |
|||
<#@ template language="C#" debug="true" #> |
|||
<#@ output extenstion="cs" #> |
|||
<# string namespaceSuffix = "GotoBlas"; |
|||
string library = "GotoBLAS2"; |
|||
#> |
|||
<#@ include file="..\safe.native.common.include" #> |
|||
} |
|||
} |
|||
@ -0,0 +1,363 @@ |
|||
// <copyright file="MklLinearAlgebraProvider.Common.cs" company="Math.NET">
|
|||
// Math.NET Numerics, part of the Math.NET Project
|
|||
// http://numerics.mathdotnet.com
|
|||
// http://github.com/mathnet/mathnet-numerics
|
|||
// http://mathnetnumerics.codeplex.com
|
|||
//
|
|||
// Copyright (c) 2009-2011 Math.NET
|
|||
//
|
|||
// Permission is hereby granted, free of charge, to any person
|
|||
// obtaining a copy of this software and associated documentation
|
|||
// files (the "Software"), to deal in the Software without
|
|||
// restriction, including without limitation the rights to use,
|
|||
// copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|||
// copies of the Software, and to permit persons to whom the
|
|||
// Software is furnished to do so, subject to the following
|
|||
// conditions:
|
|||
//
|
|||
// The above copyright notice and this permission notice shall be
|
|||
// included in all copies or substantial portions of the Software.
|
|||
//
|
|||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|||
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|||
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|||
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|||
// OTHER DEALINGS IN THE SOFTWARE.
|
|||
// </copyright>
|
|||
|
|||
namespace MathNet.Numerics.Algorithms.LinearAlgebra.Mkl |
|||
{ |
|||
using System; |
|||
using System.Numerics; |
|||
using System.Security; |
|||
using Properties; |
|||
|
|||
/// <summary>
|
|||
/// Intel's Math Kernel Library (MKL) linear algebra provider.
|
|||
/// </summary>
|
|||
public partial class MklLinearAlgebraProvider : ManagedLinearAlgebraProvider |
|||
{ |
|||
/// <summary>
|
|||
/// Computes the requested <see cref="Norm"/> of the matrix.
|
|||
/// </summary>
|
|||
/// <param name="norm">The type of norm to compute.</param>
|
|||
/// <param name="rows">The number of rows in the matrix.</param>
|
|||
/// <param name="columns">The number of columns in the matrix.</param>
|
|||
/// <param name="matrix">The matrix to compute the norm from.</param>
|
|||
/// <returns>
|
|||
/// The requested <see cref="Norm"/> of the matrix.
|
|||
/// </returns>
|
|||
[SecuritySafeCritical] |
|||
public override float MatrixNorm(Norm norm, int rows, int columns, float[] matrix) |
|||
{ |
|||
if (matrix == null) |
|||
{ |
|||
throw new ArgumentNullException("matrix"); |
|||
} |
|||
|
|||
if (rows <= 0) |
|||
{ |
|||
throw new ArgumentException(Resources.ArgumentMustBePositive, "rows"); |
|||
} |
|||
|
|||
if (columns <= 0) |
|||
{ |
|||
throw new ArgumentException(Resources.ArgumentMustBePositive, "columns"); |
|||
} |
|||
|
|||
if (matrix.Length < rows * columns) |
|||
{ |
|||
throw new ArgumentException(string.Format(Resources.ArrayTooSmall, rows * columns), "matrix"); |
|||
} |
|||
|
|||
var work = new float[rows]; |
|||
return MatrixNorm(norm, rows, columns, matrix, work); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Computes the requested <see cref="Norm"/> of the matrix.
|
|||
/// </summary>
|
|||
/// <param name="norm">The type of norm to compute.</param>
|
|||
/// <param name="rows">The number of rows in the matrix.</param>
|
|||
/// <param name="columns">The number of columns in the matrix.</param>
|
|||
/// <param name="matrix">The matrix to compute the norm from.</param>
|
|||
/// <param name="work">The work array. Only used when <see cref="Norm.InfinityNorm"/>
|
|||
/// and needs to be have a length of at least M (number of rows of <paramref name="matrix"/>.</param>
|
|||
/// <returns>
|
|||
/// The requested <see cref="Norm"/> of the matrix.
|
|||
/// </returns>
|
|||
[SecuritySafeCritical] |
|||
public override float MatrixNorm(Norm norm, int rows, int columns, float[] matrix, float[] work) |
|||
{ |
|||
if (matrix == null) |
|||
{ |
|||
throw new ArgumentNullException("matrix"); |
|||
} |
|||
|
|||
if (rows <= 0) |
|||
{ |
|||
throw new ArgumentException(Resources.ArgumentMustBePositive, "rows"); |
|||
} |
|||
|
|||
if (columns <= 0) |
|||
{ |
|||
throw new ArgumentException(Resources.ArgumentMustBePositive, "columns"); |
|||
} |
|||
|
|||
if (matrix.Length < rows * columns) |
|||
{ |
|||
throw new ArgumentException(string.Format(Resources.ArrayTooSmall, rows * columns), "matrix"); |
|||
} |
|||
|
|||
if (work.Length < rows) |
|||
{ |
|||
throw new ArgumentException(string.Format(Resources.ArrayTooSmall, rows), "work"); |
|||
} |
|||
|
|||
return SafeNativeMethods.s_matrix_norm((byte)norm, rows, columns, matrix, work); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Computes the requested <see cref="Norm"/> of the matrix.
|
|||
/// </summary>
|
|||
/// <param name="norm">The type of norm to compute.</param>
|
|||
/// <param name="rows">The number of rows in the matrix.</param>
|
|||
/// <param name="columns">The number of columns in the matrix.</param>
|
|||
/// <param name="matrix">The matrix to compute the norm from.</param>
|
|||
/// <returns>
|
|||
/// The requested <see cref="Norm"/> of the matrix.
|
|||
/// </returns>
|
|||
[SecuritySafeCritical] |
|||
public override double MatrixNorm(Norm norm, int rows, int columns, double[] matrix) |
|||
{ |
|||
if (matrix == null) |
|||
{ |
|||
throw new ArgumentNullException("matrix"); |
|||
} |
|||
|
|||
if (rows <= 0) |
|||
{ |
|||
throw new ArgumentException(Resources.ArgumentMustBePositive, "rows"); |
|||
} |
|||
|
|||
if (columns <= 0) |
|||
{ |
|||
throw new ArgumentException(Resources.ArgumentMustBePositive, "columns"); |
|||
} |
|||
|
|||
if (matrix.Length < rows * columns) |
|||
{ |
|||
throw new ArgumentException(string.Format(Resources.ArrayTooSmall, rows * columns), "matrix"); |
|||
} |
|||
|
|||
var work = new double[rows]; |
|||
return MatrixNorm(norm, rows, columns, matrix, work); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Computes the requested <see cref="Norm"/> of the matrix.
|
|||
/// </summary>
|
|||
/// <param name="norm">The type of norm to compute.</param>
|
|||
/// <param name="rows">The number of rows in the matrix.</param>
|
|||
/// <param name="columns">The number of columns in the matrix.</param>
|
|||
/// <param name="matrix">The matrix to compute the norm from.</param>
|
|||
/// <param name="work">The work array. Only used when <see cref="Norm.InfinityNorm"/>
|
|||
/// and needs to be have a length of at least M (number of rows of <paramref name="matrix"/>.</param>
|
|||
/// <returns>
|
|||
/// The requested <see cref="Norm"/> of the matrix.
|
|||
/// </returns>
|
|||
[SecuritySafeCritical] |
|||
public override double MatrixNorm(Norm norm, int rows, int columns, double[] matrix, double[] work) |
|||
{ |
|||
if (matrix == null) |
|||
{ |
|||
throw new ArgumentNullException("matrix"); |
|||
} |
|||
|
|||
if (rows <= 0) |
|||
{ |
|||
throw new ArgumentException(Resources.ArgumentMustBePositive, "rows"); |
|||
} |
|||
|
|||
if (columns <= 0) |
|||
{ |
|||
throw new ArgumentException(Resources.ArgumentMustBePositive, "columns"); |
|||
} |
|||
|
|||
if (matrix.Length < rows * columns) |
|||
{ |
|||
throw new ArgumentException(string.Format(Resources.ArrayTooSmall, rows * columns), "matrix"); |
|||
} |
|||
|
|||
if (work.Length < rows) |
|||
{ |
|||
throw new ArgumentException(string.Format(Resources.ArrayTooSmall, rows), "work"); |
|||
} |
|||
|
|||
return SafeNativeMethods.d_matrix_norm((byte)norm, rows, columns, matrix, work); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Computes the requested <see cref="Norm"/> of the matrix.
|
|||
/// </summary>
|
|||
/// <param name="norm">The type of norm to compute.</param>
|
|||
/// <param name="rows">The number of rows in the matrix.</param>
|
|||
/// <param name="columns">The number of columns in the matrix.</param>
|
|||
/// <param name="matrix">The matrix to compute the norm from.</param>
|
|||
/// <returns>
|
|||
/// The requested <see cref="Norm"/> of the matrix.
|
|||
/// </returns>
|
|||
[SecuritySafeCritical] |
|||
public override Complex32 MatrixNorm(Norm norm, int rows, int columns, Complex32[] matrix) |
|||
{ |
|||
if (matrix == null) |
|||
{ |
|||
throw new ArgumentNullException("matrix"); |
|||
} |
|||
|
|||
if (rows <= 0) |
|||
{ |
|||
throw new ArgumentException(Resources.ArgumentMustBePositive, "rows"); |
|||
} |
|||
|
|||
if (columns <= 0) |
|||
{ |
|||
throw new ArgumentException(Resources.ArgumentMustBePositive, "columns"); |
|||
} |
|||
|
|||
if (matrix.Length < rows * columns) |
|||
{ |
|||
throw new ArgumentException(string.Format(Resources.ArrayTooSmall, rows * columns), "matrix"); |
|||
} |
|||
|
|||
var work = new float[rows]; |
|||
return MatrixNorm(norm, rows, columns, matrix, work); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Computes the requested <see cref="Norm"/> of the matrix.
|
|||
/// </summary>
|
|||
/// <param name="norm">The type of norm to compute.</param>
|
|||
/// <param name="rows">The number of rows in the matrix.</param>
|
|||
/// <param name="columns">The number of columns in the matrix.</param>
|
|||
/// <param name="matrix">The matrix to compute the norm from.</param>
|
|||
/// <param name="work">The work array. Only used when <see cref="Norm.InfinityNorm"/>
|
|||
/// and needs to be have a length of at least M (number of rows of <paramref name="matrix"/>.</param>
|
|||
/// <returns>
|
|||
/// The requested <see cref="Norm"/> of the matrix.
|
|||
/// </returns>
|
|||
[SecuritySafeCritical] |
|||
public override Complex32 MatrixNorm(Norm norm, int rows, int columns, Complex32[] matrix, float[] work) |
|||
{ |
|||
if (matrix == null) |
|||
{ |
|||
throw new ArgumentNullException("matrix"); |
|||
} |
|||
|
|||
if (rows <= 0) |
|||
{ |
|||
throw new ArgumentException(Resources.ArgumentMustBePositive, "rows"); |
|||
} |
|||
|
|||
if (columns <= 0) |
|||
{ |
|||
throw new ArgumentException(Resources.ArgumentMustBePositive, "columns"); |
|||
} |
|||
|
|||
if (matrix.Length < rows * columns) |
|||
{ |
|||
throw new ArgumentException(string.Format(Resources.ArrayTooSmall, rows * columns), "matrix"); |
|||
} |
|||
|
|||
if (work.Length < rows) |
|||
{ |
|||
throw new ArgumentException(string.Format(Resources.ArrayTooSmall, rows), "work"); |
|||
} |
|||
|
|||
return SafeNativeMethods.c_matrix_norm((byte)norm, rows, columns, matrix, work); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Computes the requested <see cref="Norm"/> of the matrix.
|
|||
/// </summary>
|
|||
/// <param name="norm">The type of norm to compute.</param>
|
|||
/// <param name="rows">The number of rows in the matrix.</param>
|
|||
/// <param name="columns">The number of columns in the matrix.</param>
|
|||
/// <param name="matrix">The matrix to compute the norm from.</param>
|
|||
/// <returns>
|
|||
/// The requested <see cref="Norm"/> of the matrix.
|
|||
/// </returns>
|
|||
[SecuritySafeCritical] |
|||
public override Complex MatrixNorm(Norm norm, int rows, int columns, Complex[] matrix) |
|||
{ |
|||
if (matrix == null) |
|||
{ |
|||
throw new ArgumentNullException("matrix"); |
|||
} |
|||
|
|||
if (rows <= 0) |
|||
{ |
|||
throw new ArgumentException(Resources.ArgumentMustBePositive, "rows"); |
|||
} |
|||
|
|||
if (columns <= 0) |
|||
{ |
|||
throw new ArgumentException(Resources.ArgumentMustBePositive, "columns"); |
|||
} |
|||
|
|||
if (matrix.Length < rows * columns) |
|||
{ |
|||
throw new ArgumentException(string.Format(Resources.ArrayTooSmall, rows * columns), "matrix"); |
|||
} |
|||
|
|||
var work = new double[rows]; |
|||
return MatrixNorm(norm, rows, columns, matrix, work); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Computes the requested <see cref="Norm"/> of the matrix.
|
|||
/// </summary>
|
|||
/// <param name="norm">The type of norm to compute.</param>
|
|||
/// <param name="rows">The number of rows in the matrix.</param>
|
|||
/// <param name="columns">The number of columns in the matrix.</param>
|
|||
/// <param name="matrix">The matrix to compute the norm from.</param>
|
|||
/// <param name="work">The work array. Only used when <see cref="Norm.InfinityNorm"/>
|
|||
/// and needs to be have a length of at least M (number of rows of <paramref name="matrix"/>.</param>
|
|||
/// <returns>
|
|||
/// The requested <see cref="Norm"/> of the matrix.
|
|||
/// </returns>
|
|||
[SecuritySafeCritical] |
|||
public override Complex MatrixNorm(Norm norm, int rows, int columns, Complex[] matrix, double[] work) |
|||
{ |
|||
if (matrix == null) |
|||
{ |
|||
throw new ArgumentNullException("matrix"); |
|||
} |
|||
|
|||
if (rows <= 0) |
|||
{ |
|||
throw new ArgumentException(Resources.ArgumentMustBePositive, "rows"); |
|||
} |
|||
|
|||
if (columns <= 0) |
|||
{ |
|||
throw new ArgumentException(Resources.ArgumentMustBePositive, "columns"); |
|||
} |
|||
|
|||
if (matrix.Length < rows * columns) |
|||
{ |
|||
throw new ArgumentException(string.Format(Resources.ArrayTooSmall, rows * columns), "matrix"); |
|||
} |
|||
|
|||
if (work.Length < rows) |
|||
{ |
|||
throw new ArgumentException(string.Format(Resources.ArrayTooSmall, rows), "work"); |
|||
} |
|||
|
|||
return SafeNativeMethods.z_matrix_norm((byte)norm, rows, columns, matrix, work); |
|||
} |
|||
} |
|||
} |
|||
@ -1,8 +0,0 @@ |
|||
<#@ template language="C#" debug="true" #> |
|||
<#@ output extenstion="cs" #> |
|||
<# string library = "Mkl";#> |
|||
<# string title = "Intel's Math Kernel Library (MKL)";#> |
|||
<# string dataType = "Common";#> |
|||
<#@ include file="..\native.header.include" #> |
|||
<#@ include file="..\native.norm.include" #> |
|||
<#@ include file="..\native.footer.include" #> |
|||
File diff suppressed because it is too large
@ -1,14 +0,0 @@ |
|||
<#@ template language="C#" debug="true" #> |
|||
<#@ output extenstion="cs" #> |
|||
<# string library = "Mkl";#> |
|||
<# string title = "Intel's Math Kernel Library (MKL)";#> |
|||
<# string dataType = "Complex";#> |
|||
<# string zero = "Complex.Zero";#> |
|||
<# string one = "Complex.One";#> |
|||
<# string prefix = "z";#> |
|||
<# string svd_work = "2 * Math.Min(rowsA, columnsA) + Math.Max(rowsA, columnsA)";#> |
|||
<#@ include file="..\native.header.include" #> |
|||
<#@ include file="..\native.dotproduct.include" #> |
|||
<#@ include file="..\native.generic.include" #> |
|||
<#@ include file="..\native.vector.include" #> |
|||
<#@ include file="..\native.footer.include" #> |
|||
File diff suppressed because it is too large
@ -1,14 +0,0 @@ |
|||
<#@ template language="C#" debug="true" #> |
|||
<#@ output extenstion="cs" #> |
|||
<# string library = "Mkl";#> |
|||
<# string title = "Intel's Math Kernel Library (MKL)";#> |
|||
<# string dataType = "Complex32";#> |
|||
<# string zero = "Complex32.Zero";#> |
|||
<# string one = "Complex32.One";#> |
|||
<# string prefix = "c";#> |
|||
<# string svd_work = "2 * Math.Min(rowsA, columnsA) + Math.Max(rowsA, columnsA)";#> |
|||
<#@ include file="..\native.header.include" #> |
|||
<#@ include file="..\native.dotproduct.include" #> |
|||
<#@ include file="..\native.generic.include" #> |
|||
<#@ include file="..\native.vector.include" #> |
|||
<#@ include file="..\native.footer.include" #> |
|||
File diff suppressed because it is too large
@ -1,14 +0,0 @@ |
|||
<#@ template language="C#" debug="true" #> |
|||
<#@ output extenstion="cs" #> |
|||
<# string library = "Mkl";#> |
|||
<# string title = "Intel's Math Kernel Library (MKL)";#> |
|||
<# string dataType = "double";#> |
|||
<# string zero = "0.0";#> |
|||
<# string one = "1.0";#> |
|||
<# string prefix = "d";#> |
|||
<# string svd_work = "Math.Max((3 * Math.Min(rowsA, columnsA)) + Math.Max(rowsA, columnsA), 5 * Math.Min(rowsA, columnsA))";#> |
|||
<#@ include file="..\native.header.include" #> |
|||
<#@ include file="..\native.dotproduct.include" #> |
|||
<#@ include file="..\native.generic.include" #> |
|||
<#@ include file="..\native.vector.include" #> |
|||
<#@ include file="..\native.footer.include" #> |
|||
File diff suppressed because it is too large
@ -1,14 +0,0 @@ |
|||
<#@ template language="C#" debug="true" #> |
|||
<#@ output extenstion="cs" #> |
|||
<# string library = "Mkl";#> |
|||
<# string title = "Intel's Math Kernel Library (MKL)";#> |
|||
<# string dataType = "float";#> |
|||
<# string zero = "0.0f";#> |
|||
<# string one = "1.0f";#> |
|||
<# string prefix = "s";#> |
|||
<# string svd_work = "Math.Max((3 * Math.Min(rowsA, columnsA) + Math.Max(rowsA, columnsA)), 5 * Math.Min(rowsA, columnsA))";#> |
|||
<#@ include file="..\native.header.include" #> |
|||
<#@ include file="..\native.dotproduct.include" #> |
|||
<#@ include file="..\native.generic.include" #> |
|||
<#@ include file="..\native.vector.include" #> |
|||
<#@ include file="..\native.footer.include" #> |
|||
@ -0,0 +1,311 @@ |
|||
// <copyright file="SafeNativeMethods.cs" company="Math.NET">
|
|||
// Math.NET Numerics, part of the Math.NET Project
|
|||
// http://mathnet.opensourcedotnet.info
|
|||
//
|
|||
// Copyright (c) 2009-2010 Math.NET
|
|||
//
|
|||
// Permission is hereby granted, free of charge, to any person
|
|||
// obtaining a copy of this software and associated documentation
|
|||
// files (the "Software"), to deal in the Software without
|
|||
// restriction, including without limitation the rights to use,
|
|||
// copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|||
// copies of the Software, and to permit persons to whom the
|
|||
// Software is furnished to do so, subject to the following
|
|||
// conditions:
|
|||
//
|
|||
// The above copyright notice and this permission notice shall be
|
|||
// included in all copies or substantial portions of the Software.
|
|||
//
|
|||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|||
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|||
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|||
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|||
// OTHER DEALINGS IN THE SOFTWARE.
|
|||
// </copyright>
|
|||
|
|||
using System.Numerics; |
|||
using System.Runtime.InteropServices; |
|||
using System.Security; |
|||
|
|||
namespace MathNet.Numerics.Algorithms.LinearAlgebra.Mkl |
|||
{ |
|||
/// <summary>
|
|||
/// P/Invoke methods to the native math libraries.
|
|||
/// </summary>
|
|||
[SuppressUnmanagedCodeSecurity] |
|||
[SecurityCritical] |
|||
internal static class SafeNativeMethods |
|||
{ |
|||
/// <summary>
|
|||
/// Name of the native DLL.
|
|||
/// </summary>
|
|||
private const string DllName = "MathNET.Numerics.MKL.dll"; |
|||
|
|||
#region BLAS
|
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern void s_axpy(int n, float alpha, float[] x, [In, Out] float[] y); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern void d_axpy(int n, double alpha, double[] x, [In, Out] double[] y); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern void c_axpy(int n, Complex32 alpha, Complex32[] x, [In, Out] Complex32[] y); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern void z_axpy(int n, Complex alpha, Complex[] x, [In, Out] Complex[] y); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern void s_scale(int n, float alpha, [Out] float[] x); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern void d_scale(int n, double alpha, [Out] double[] x); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern void c_scale(int n, Complex32 alpha, [In, Out] Complex32[] x); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern void z_scale(int n, Complex alpha, [In, Out] Complex[] x); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern float s_dot_product(int n, float[] x, float[] y); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern double d_dot_product(int n, double[] x, double[] y); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern Complex32 c_dot_product(int n, Complex32[] x, Complex32[] y); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern Complex z_dot_product(int n, Complex[] x, Complex[] y); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern void s_matrix_multiply(Transpose transA, Transpose transB, int m, int n, int k, float alpha, float[] x, float[] y, float beta, [In, Out]float[] c); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern void d_matrix_multiply(Transpose transA, Transpose transB, int m, int n, int k, double alpha, double[] x, double[] y, double beta, [In, Out]double[] c); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern void c_matrix_multiply(Transpose transA, Transpose transB, int m, int n, int k, Complex32 alpha, Complex32[] x, Complex32[] y, Complex32 beta, [In, Out]Complex32[] c); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern void z_matrix_multiply(Transpose transA, Transpose transB, int m, int n, int k, Complex alpha, Complex[] x, Complex[] y, Complex beta, [In, Out]Complex[] c); |
|||
|
|||
#endregion BLAS
|
|||
|
|||
#region LAPACK
|
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern float s_matrix_norm(byte norm, int rows, int columns, [In] float[] a, [In, Out] float[] work); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern float d_matrix_norm(byte norm, int rows, int columns, [In] double[] a, [In, Out] double[] work); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern float c_matrix_norm(byte norm, int rows, int columns, [In] Complex32[] a, [In, Out] float[] work); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern double z_matrix_norm(byte norm, int rows, int columns, [In] Complex[] a, [In, Out] double[] work); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int s_cholesky_factor(int n, [In, Out] float[] a); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int d_cholesky_factor(int n, [In, Out] double[] a); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int c_cholesky_factor(int n, [In, Out] Complex32[] a); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int z_cholesky_factor(int n, [In, Out] Complex[] a); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int s_lu_factor(int n, [In, Out] float[] a, [In, Out] int[] ipiv); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int d_lu_factor(int n, [In, Out] double[] a, [In, Out] int[] ipiv); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int c_lu_factor(int n, [In, Out] Complex32[] a, [In, Out] int[] ipiv); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int z_lu_factor(int n, [In, Out] Complex[] a, [In, Out] int[] ipiv); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int s_lu_inverse(int n, [In, Out] float[] a, [In, Out] float[] work, int lwork); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int d_lu_inverse(int n, [In, Out] double[] a, [In, Out] double[] work, int lwork); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int c_lu_inverse(int n, [In, Out] Complex32[] a, [In, Out] Complex32[] work, int lwork); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int z_lu_inverse(int n, [In, Out] Complex[] a, [In, Out] Complex[] work, int lwork); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int s_lu_inverse_factored(int n, [In, Out] float[] a, [In, Out] int[] ipiv, [In, Out] float[] work, int lwork); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int d_lu_inverse_factored(int n, [In, Out] double[] a, [In, Out] int[] ipiv, [In, Out] double[] work, int lwork); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int c_lu_inverse_factored(int n, [In, Out] Complex32[] a, [In, Out] int[] ipiv, [In, Out] Complex32[] work, int lwork); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int z_lu_inverse_factored(int n, [In, Out] Complex[] a, [In, Out] int[] ipiv, [In, Out] Complex[] work, int lwork); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int s_lu_solve_factored(int n, int nrhs, float[] a, [In, Out]int[] ipiv, [In, Out] float[] b); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int d_lu_solve_factored(int n, int nrhs, double[] a, [In, Out] int[] ipiv, [In, Out] double[] b); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int c_lu_solve_factored(int n, int nrhs, Complex32[] a, [In, Out] int[] ipiv, [In, Out] Complex32[] b); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int z_lu_solve_factored(int n, int nrhs, Complex[] a, [In, Out]int[] ipiv, [In, Out] Complex[] b); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int s_lu_solve(int n, int nrhs, float[] a, [In, Out] float[] b); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int d_lu_solve(int n, int nrhs, double[] a, [In, Out] double[] b); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int c_lu_solve(int n, int nrhs, Complex32[] a, [In, Out] Complex32[] b); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int z_lu_solve(int n, int nrhs, Complex[] a, [In, Out] Complex[] b); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int s_cholesky_solve(int n, int nrhs, float[] a, [In, Out] float[] b); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int d_cholesky_solve(int n, int nrhs, double[] a, [In, Out] double[] b); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int c_cholesky_solve(int n, int nrhs, Complex32[] a, [In, Out] Complex32[] b); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int z_cholesky_solve(int n, int nrhs, Complex[] a, [In, Out] Complex[] b); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int s_cholesky_solve_factored(int n, int nrhs, float[] a, [In, Out] float[] b); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int d_cholesky_solve_factored(int n, int nrhs, double[] a, [In, Out] double[] b); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int c_cholesky_solve_factored(int n, int nrhs, Complex32[] a, [In, Out] Complex32[] b); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int z_cholesky_solve_factored(int n, int nrhs, Complex[] a, [In, Out] Complex[] b); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int s_qr_factor(int m, int n, [In, Out] float[] r, [In, Out] float[] tau, [In, Out] float[] q, [In, Out] float[] work, int len); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int d_qr_factor(int m, int n, [In, Out] double[] r, [In, Out] double[] tau, [In, Out] double[] q, [In, Out] double[] work, int len); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int c_qr_factor(int m, int n, [In, Out] Complex32[] r, [In, Out] Complex32[] tau, [In, Out] Complex32[] q, [In, Out] Complex32[] work, int len); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int z_qr_factor(int m, int n, [In, Out] Complex[] r, [In, Out] Complex[] tau, [In, Out] Complex[] q, [In, Out] Complex[] work, int len); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int s_qr_solve(int m, int n, int bn, float[] r, float[] b, [In, Out] float[] x, [In, Out] float[] work, int len); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int d_qr_solve(int m, int n, int bn, double[] r, double[] b, [In, Out] double[] x, [In, Out] double[] work, int len); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int c_qr_solve(int m, int n, int bn, Complex32[] r, Complex32[] b, [In, Out] Complex32[] x, [In, Out] Complex32[] work, int len); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int z_qr_solve(int m, int n, int bn, Complex[] r, Complex[] b, [In, Out] Complex[] x, [In, Out] Complex[] work, int len); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int s_qr_solve_factored(int m, int n, int bn, float[] r, float[] b, float[] tau, [In, Out] float[] x, [In, Out] float[] work, int len); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int d_qr_solve_factored(int m, int n, int bn, double[] r, double[] b, double[] tau, [In, Out] double[] x, [In, Out] double[] work, int len); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int c_qr_solve_factored(int m, int n, int bn, Complex32[] r, Complex32[] b, Complex32[] tau, [In, Out] Complex32[] x, [In, Out] Complex32[] work, int len); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int z_qr_solve_factored(int m, int n, int bn, Complex[] r, Complex[] b, Complex[] tau, [In, Out] Complex[] x, [In, Out] Complex[] work, int len); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int s_svd_factor(bool computeVectors, int m, int n, [In, Out] float[] a, [In, Out] float[] s, [In, Out] float[] u, [In, Out] float[] v, [In, Out] float[] work, int len); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int d_svd_factor(bool computeVectors, int m, int n, [In, Out] double[] a, [In, Out] double[] s, [In, Out] double[] u, [In, Out] double[] v, [In, Out] double[] work, int len); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int c_svd_factor(bool computeVectors, int m, int n, [In, Out] Complex32[] a, [In, Out] Complex32[] s, [In, Out] Complex32[] u, [In, Out] Complex32[] v, [In, Out] Complex32[] work, int len); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern int z_svd_factor(bool computeVectors, int m, int n, [In, Out] Complex[] a, [In, Out] Complex[] s, [In, Out] Complex[] u, [In, Out] Complex[] v, [In, Out] Complex[] work, int len); |
|||
|
|||
#endregion LAPACK
|
|||
|
|||
#region Vector Functions
|
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern void s_vector_add(int n, float[] x, float[] y, [In, Out] float[] result); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern void s_vector_subtract(int n, float[] x, float[] y, [In, Out] float[] result); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern void s_vector_multiply(int n, float[] x, float[] y, [In, Out] float[] result); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern void s_vector_divide(int n, float[] x, float[] y, [In, Out] float[] result); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern void d_vector_add(int n, double[] x, double[] y, [In, Out] double[] result); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern void d_vector_subtract(int n, double[] x, double[] y, [In, Out] double[] result); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern void d_vector_multiply(int n, double[] x, double[] y, [In, Out] double[] result); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern void d_vector_divide(int n, double[] x, double[] y, [In, Out] double[] result); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern void c_vector_add(int n, Complex32[] x, Complex32[] y, [In, Out] Complex32[] result); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern void c_vector_subtract(int n, Complex32[] x, Complex32[] y, [In, Out] Complex32[] result); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern void c_vector_multiply(int n, Complex32[] x, Complex32[] y, [In, Out] Complex32[] result); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern void c_vector_divide(int n, Complex32[] x, Complex32[] y, [In, Out] Complex32[] result); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern void z_vector_add(int n, Complex[] x, Complex[] y, [In, Out] Complex[] result); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern void z_vector_subtract(int n, Complex[] x, Complex[] y, [In, Out] Complex[] result); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern void z_vector_multiply(int n, Complex[] x, Complex[] y, [In, Out] Complex[] result); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern void z_vector_divide(int n, Complex[] x, Complex[] y, [In, Out] Complex[] result); |
|||
|
|||
#endregion Vector Functions
|
|||
} |
|||
} |
|||
@ -1,9 +0,0 @@ |
|||
<#@ template language="C#" debug="true" #> |
|||
<#@ output extenstion="cs" #> |
|||
<# string namespaceSuffix = "Mkl"; |
|||
string library = "MKL"; |
|||
#> |
|||
<#@ include file="..\safe.native.common.include" #> |
|||
<#@ include file="..\safe.native.vector.include" #> |
|||
} |
|||
} |
|||
@ -1,27 +0,0 @@ |
|||
/// <summary> |
|||
/// Computes the dot product of x and y. |
|||
/// </summary> |
|||
/// <param name="x">The vector x.</param> |
|||
/// <param name="y">The vector y.</param> |
|||
/// <returns>The dot product of x and y.</returns> |
|||
/// <remarks>This is equivalent to the DOT BLAS routine.</remarks> |
|||
[SecuritySafeCritical] |
|||
public override <#=dataType#> DotProduct(<#=dataType#>[] x, <#=dataType#>[] y) |
|||
{ |
|||
if (y == null) |
|||
{ |
|||
throw new ArgumentNullException("y"); |
|||
} |
|||
|
|||
if (x == null) |
|||
{ |
|||
throw new ArgumentNullException("x"); |
|||
} |
|||
|
|||
if (x.Length != y.Length) |
|||
{ |
|||
throw new ArgumentException(Resources.ArgumentArraysSameLength); |
|||
} |
|||
|
|||
return SafeNativeMethods.<#=prefix#>_dot_product(x.Length, x, y); |
|||
} |
|||
@ -1,2 +0,0 @@ |
|||
} |
|||
} |
|||
@ -1,46 +0,0 @@ |
|||
// <copyright file="<#=library#>LinearAlgebraProvider.<#=dataType#>.cs" company="Math.NET"> |
|||
// Math.NET Numerics, part of the Math.NET Project |
|||
// http://numerics.mathdotnet.com |
|||
// http://github.com/mathnet/mathnet-numerics |
|||
// http://mathnetnumerics.codeplex.com |
|||
// |
|||
// Copyright (c) 2009-2011 Math.NET |
|||
// |
|||
// Permission is hereby granted, free of charge, to any person |
|||
// obtaining a copy of this software and associated documentation |
|||
// files (the "Software"), to deal in the Software without |
|||
// restriction, including without limitation the rights to use, |
|||
// copy, modify, merge, publish, distribute, sublicense, and/or sell |
|||
// copies of the Software, and to permit persons to whom the |
|||
// Software is furnished to do so, subject to the following |
|||
// conditions: |
|||
// |
|||
// The above copyright notice and this permission notice shall be |
|||
// included in all copies or substantial portions of the Software. |
|||
// |
|||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
|||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
|||
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
|||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
|||
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
|||
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
|||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
|||
// OTHER DEALINGS IN THE SOFTWARE. |
|||
// </copyright> |
|||
|
|||
/* This file is automatically generated - do not modify it. |
|||
Last generated on UTC <#=DateTime.UtcNow.ToString("u")#> |
|||
*/ |
|||
|
|||
namespace MathNet.Numerics.Algorithms.LinearAlgebra.<#=library#> |
|||
{ |
|||
using System; |
|||
using System.Numerics; |
|||
using System.Security; |
|||
using Properties; |
|||
|
|||
/// <summary> |
|||
/// <#=title#> linear algebra provider. |
|||
/// </summary> |
|||
public partial class <#=library#>LinearAlgebraProvider : ManagedLinearAlgebraProvider |
|||
{ |
|||
@ -1,139 +0,0 @@ |
|||
/// <summary> |
|||
/// Does a point wise add of two arrays <c>z = x + y</c>. This can be used |
|||
/// to add vectors or matrices. |
|||
/// </summary> |
|||
/// <param name="x">The array x.</param> |
|||
/// <param name="y">The array y.</param> |
|||
/// <param name="result">The result of the addition.</param> |
|||
/// <remarks>There is no equivalent BLAS routine, but many libraries |
|||
/// provide optimized (parallel and/or vectorized) versions of this |
|||
/// routine.</remarks> |
|||
public override void AddArrays(<#=dataType#>[] x, <#=dataType#>[] y, <#=dataType#>[] result) |
|||
{ |
|||
if (y == null) |
|||
{ |
|||
throw new ArgumentNullException("y"); |
|||
} |
|||
|
|||
if (x == null) |
|||
{ |
|||
throw new ArgumentNullException("x"); |
|||
} |
|||
|
|||
if (x.Length != y.Length) |
|||
{ |
|||
throw new ArgumentException(Resources.ArgumentArraysSameLength); |
|||
} |
|||
|
|||
if (x.Length != result.Length) |
|||
{ |
|||
throw new ArgumentException(Resources.ArgumentArraysSameLength); |
|||
} |
|||
|
|||
SafeNativeMethods.<#=prefix#>_vector_add(x.Length, x, y, result); |
|||
} |
|||
|
|||
/// <summary> |
|||
/// Does a point wise subtraction of two arrays <c>z = x - y</c>. This can be used |
|||
/// to subtract vectors or matrices. |
|||
/// </summary> |
|||
/// <param name="x">The array x.</param> |
|||
/// <param name="y">The array y.</param> |
|||
/// <param name="result">The result of the subtraction.</param> |
|||
/// <remarks>There is no equivalent BLAS routine, but many libraries |
|||
/// provide optimized (parallel and/or vectorized) versions of this |
|||
/// routine.</remarks> |
|||
public override void SubtractArrays(<#=dataType#>[] x, <#=dataType#>[] y, <#=dataType#>[] result) |
|||
{ |
|||
if (y == null) |
|||
{ |
|||
throw new ArgumentNullException("y"); |
|||
} |
|||
|
|||
if (x == null) |
|||
{ |
|||
throw new ArgumentNullException("x"); |
|||
} |
|||
|
|||
if (x.Length != y.Length) |
|||
{ |
|||
throw new ArgumentException(Resources.ArgumentArraysSameLength); |
|||
} |
|||
|
|||
if (x.Length != result.Length) |
|||
{ |
|||
throw new ArgumentException(Resources.ArgumentArraysSameLength); |
|||
} |
|||
|
|||
SafeNativeMethods.<#=prefix#>_vector_subtract(x.Length, x, y, result); |
|||
} |
|||
|
|||
/// <summary> |
|||
/// Does a point wise multiplication of two arrays <c>z = x * y</c>. This can be used |
|||
/// to multiple elements of vectors or matrices. |
|||
/// </summary> |
|||
/// <param name="x">The array x.</param> |
|||
/// <param name="y">The array y.</param> |
|||
/// <param name="result">The result of the point wise multiplication.</param> |
|||
/// <remarks>There is no equivalent BLAS routine, but many libraries |
|||
/// provide optimized (parallel and/or vectorized) versions of this |
|||
/// routine.</remarks> |
|||
public override void PointWiseMultiplyArrays(<#=dataType#>[] x, <#=dataType#>[] y, <#=dataType#>[] result) |
|||
{ |
|||
if (y == null) |
|||
{ |
|||
throw new ArgumentNullException("y"); |
|||
} |
|||
|
|||
if (x == null) |
|||
{ |
|||
throw new ArgumentNullException("x"); |
|||
} |
|||
|
|||
if (x.Length != y.Length) |
|||
{ |
|||
throw new ArgumentException(Resources.ArgumentArraysSameLength); |
|||
} |
|||
|
|||
if (x.Length != result.Length) |
|||
{ |
|||
throw new ArgumentException(Resources.ArgumentArraysSameLength); |
|||
} |
|||
|
|||
SafeNativeMethods.<#=prefix#>_vector_multiply(x.Length, x, y, result); |
|||
} |
|||
|
|||
/// <summary> |
|||
/// Does a point wise division of two arrays <c>z = x / y</c>. This can be used |
|||
/// to divide elements of vectors or matrices. |
|||
/// </summary> |
|||
/// <param name="x">The array x.</param> |
|||
/// <param name="y">The array y.</param> |
|||
/// <param name="result">The result of the point wise division.</param> |
|||
/// <remarks>There is no equivalent BLAS routine, but many libraries |
|||
/// provide optimized (parallel and/or vectorized) versions of this |
|||
/// routine.</remarks> |
|||
public override void PointWiseDivideArrays(<#=dataType#>[] x, <#=dataType#>[] y, <#=dataType#>[] result) |
|||
{ |
|||
if (y == null) |
|||
{ |
|||
throw new ArgumentNullException("y"); |
|||
} |
|||
|
|||
if (x == null) |
|||
{ |
|||
throw new ArgumentNullException("x"); |
|||
} |
|||
|
|||
if (x.Length != y.Length) |
|||
{ |
|||
throw new ArgumentException(Resources.ArgumentArraysSameLength); |
|||
} |
|||
|
|||
if (x.Length != result.Length) |
|||
{ |
|||
throw new ArgumentException(Resources.ArgumentArraysSameLength); |
|||
} |
|||
|
|||
SafeNativeMethods.<#=prefix#>_vector_divide(x.Length, x, y, result); |
|||
} |
|||
@ -1,52 +0,0 @@ |
|||
|
|||
#region Vector Functions |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern void s_vector_add(int n, float[] x, float[] y, [In, Out] float[] result); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern void s_vector_subtract(int n, float[] x, float[] y, [In, Out] float[] result); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern void s_vector_multiply(int n, float[] x, float[] y, [In, Out] float[] result); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern void s_vector_divide(int n, float[] x, float[] y, [In, Out] float[] result); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern void d_vector_add(int n, double[] x, double[] y, [In, Out] double[] result); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern void d_vector_subtract(int n, double[] x, double[] y, [In, Out] double[] result); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern void d_vector_multiply(int n, double[] x, double[] y, [In, Out] double[] result); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern void d_vector_divide(int n, double[] x, double[] y, [In, Out] double[] result); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern void c_vector_add(int n, Complex32[] x, Complex32[] y, [In, Out] Complex32[] result); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern void c_vector_subtract(int n, Complex32[] x, Complex32[] y, [In, Out] Complex32[] result); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern void c_vector_multiply(int n, Complex32[] x, Complex32[] y, [In, Out] Complex32[] result); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern void c_vector_divide(int n, Complex32[] x, Complex32[] y, [In, Out] Complex32[] result); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern void z_vector_add(int n, Complex[] x, Complex[] y, [In, Out] Complex[] result); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern void z_vector_subtract(int n, Complex[] x, Complex[] y, [In, Out] Complex[] result); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern void z_vector_multiply(int n, Complex[] x, Complex[] y, [In, Out] Complex[] result); |
|||
|
|||
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] |
|||
internal static extern void z_vector_divide(int n, Complex[] x, Complex[] y, [In, Out] Complex[] result); |
|||
|
|||
#endregion Vector Functions |
|||
@ -1,38 +0,0 @@ |
|||
// <copyright file="Version.cs" company="Math.NET"> |
|||
// Math.NET Numerics, part of the Math.NET Project |
|||
// http://mathnet.opensourcedotnet.info |
|||
// |
|||
// Copyright (c) 2009 Math.NET |
|||
// |
|||
// Permission is hereby granted, free of charge, to any person |
|||
// obtaining a copy of this software and associated documentation |
|||
// files (the "Software"), to deal in the Software without |
|||
// restriction, including without limitation the rights to use, |
|||
// copy, modify, merge, publish, distribute, sublicense, and/or sell |
|||
// copies of the Software, and to permit persons to whom the |
|||
// Software is furnished to do so, subject to the following |
|||
// conditions: |
|||
// |
|||
// The above copyright notice and this permission notice shall be |
|||
// included in all copies or substantial portions of the Software. |
|||
// |
|||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
|||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
|||
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
|||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
|||
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
|||
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
|||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
|||
// OTHER DEALINGS IN THE SOFTWARE. |
|||
// </copyright> |
|||
|
|||
/* This file is automatically generated - do not modify it. Change Version.tt instead. |
|||
Last generated on UTC <#=DateTime.UtcNow.ToString("u")#> |
|||
*/ |
|||
|
|||
<#@ template Language="C#"#> |
|||
using System.Reflection; |
|||
|
|||
<# DateTime date = DateTime.UtcNow; #> |
|||
[assembly: AssemblyVersion("<#=date.Year#>.<#=date.Month.ToString("0#")#>.<#=date.Day#>.<#=(int)date.TimeOfDay.TotalMinutes#>")] |
|||
[assembly: AssemblyFileVersion("<#=date.Year#>.<#=date.Month.ToString("0#")#>.<#=date.Day#>.<#=(int)date.TimeOfDay.TotalMinutes#>")] |
|||
Loading…
Reference in new issue