Browse Source

added x_scale routine and correted style cop errors

pull/36/head
Marcus Cuda 17 years ago
parent
commit
ea6063272f
  1. 2
      src/NativeWrappers/ATLASWrapperTests/ATLASWrapperTests.csproj
  2. 17
      src/NativeWrappers/Common/blas.c
  3. 4
      src/NativeWrappers/MKLWrapper32Tests/MKLWrapper32Tests.csproj
  4. 4
      src/NativeWrappers/MKLWrapper64Tests/MKLWrapper64Tests.csproj
  5. 1086
      src/Numerics/Algorithms/LinearAlgebra/Atlas/AtlasLinearAlgebraProvider.cs
  6. 24
      src/Numerics/Algorithms/LinearAlgebra/Atlas/SafeNativeMethods.cs
  7. 1086
      src/Numerics/Algorithms/LinearAlgebra/Mkl/MklLinearAlgebraProvider.cs
  8. 24
      src/Numerics/Algorithms/LinearAlgebra/Mkl/SafeNativeMethods.cs
  9. 1086
      src/Numerics/Algorithms/LinearAlgebra/NativeAlgebraProvider.include
  10. 22
      src/Numerics/Algorithms/LinearAlgebra/SafeNativeMethods.include

2
src/NativeWrappers/ATLASWrapperTests/ATLASWrapperTests.csproj

@ -73,7 +73,7 @@
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="..\Win32\Debug\MathNET.Numerics.ATLAS.dll">
<Content Include="..\Win32\Release\MathNET.Numerics.ATLAS.dll">
<Link>MathNET.Numerics.ATLAS.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>

17
src/NativeWrappers/Common/blas.c

@ -21,3 +21,20 @@ DLLEXPORT void c_axpy( const int n, const Complex8 alpha, const Complex8 x[], Co
DLLEXPORT void z_axpy( const int n, const Complex16 alpha, const Complex16 x[], Complex16 y[]){
cblas_zaxpy(n, &alpha, x, 1, y, 1);
}
DLLEXPORT void s_scale(const int n, const float alpha, float x[]){
cblas_sscal(n, alpha, x, 1);
}
DLLEXPORT void d_scale(const int n, const double alpha, double x[]){
cblas_dscal(n, alpha, x, 1);
}
DLLEXPORT void c_scale(const int n, const Complex8 alpha, Complex8 x[]){
cblas_cscal(n, &alpha, x, 1);
}
DLLEXPORT void z_scale(const int n, const Complex16 alpha, Complex16 x[]){
cblas_zscal(n, &alpha, x, 1);
}

4
src/NativeWrappers/MKLWrapper32Tests/MKLWrapper32Tests.csproj

@ -73,11 +73,11 @@
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="..\Win32\Debug\libiomp5md.dll">
<Content Include="..\Win32\Release\libiomp5md.dll">
<Link>libiomp5md.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="..\Win32\Debug\MathNET.Numerics.MKL.dll">
<Content Include="..\Win32\Release\MathNET.Numerics.MKL.dll">
<Link>MathNET.Numerics.MKL.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>

4
src/NativeWrappers/MKLWrapper64Tests/MKLWrapper64Tests.csproj

@ -79,11 +79,11 @@
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="..\x64\Debug\libiomp5md.dll">
<Content Include="..\x64\Release\libiomp5md.dll">
<Link>libiomp5md.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="..\x64\Debug\MathNET.Numerics.MKL.dll">
<Content Include="..\x64\Release\MathNET.Numerics.MKL.dll">
<Link>MathNET.Numerics.MKL.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>

1086
src/Numerics/Algorithms/LinearAlgebra/Atlas/AtlasLinearAlgebraProvider.cs

File diff suppressed because it is too large

24
src/Numerics/Algorithms/LinearAlgebra/Atlas/SafeNativeMethods.cs

@ -1,4 +1,4 @@
// <copyright file="Constants.cs" company="Math.NET">
// <copyright file="SafeNativeMethods.cs" company="Math.NET">
// Math.NET Numerics, part of the Math.NET Project
// http://mathnet.opensourcedotnet.info
//
@ -28,7 +28,7 @@
/* This file is automatically generated - do not modify it.
Change SafeNativeMethods.include instead.
Last generated on: 11/4/2009 2:23:36 PM
Last generated on: 11/6/2009 2:44:00 PM
*/
using System.Runtime.InteropServices;
@ -36,9 +36,15 @@ using System.Security;
namespace MathNet.Numerics.Algorithms.LinearAlgebra.Atlas
{
/// <summary>
/// P/Invoke methods to the native math libraries.
/// </summary>
[SuppressUnmanagedCodeSecurity]
internal static class SafeNativeMethods
{
/// <summary>
/// Name of the native DLL.
/// </summary>
private const string DllName = "MathNET.Numerics.ATLAS.dll";
#region BLAS
@ -55,6 +61,18 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra.Atlas
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)]
internal static extern void z_axpy(int n, ref 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, ref Complex32 alpha, [In, Out] Complex32[] x);
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)]
internal static extern void z_scale(int n, ref Complex alpha, [In, Out] Complex[] x);
#endregion BLAS
}
}
}

1086
src/Numerics/Algorithms/LinearAlgebra/Mkl/MklLinearAlgebraProvider.cs

File diff suppressed because it is too large

24
src/Numerics/Algorithms/LinearAlgebra/Mkl/SafeNativeMethods.cs

@ -1,4 +1,4 @@
// <copyright file="Constants.cs" company="Math.NET">
// <copyright file="SafeNativeMethods.cs" company="Math.NET">
// Math.NET Numerics, part of the Math.NET Project
// http://mathnet.opensourcedotnet.info
//
@ -28,7 +28,7 @@
/* This file is automatically generated - do not modify it.
Change SafeNativeMethods.include instead.
Last generated on: 11/4/2009 2:23:40 PM
Last generated on: 11/6/2009 2:44:03 PM
*/
using System.Runtime.InteropServices;
@ -36,9 +36,15 @@ using System.Security;
namespace MathNet.Numerics.Algorithms.LinearAlgebra.Mkl
{
/// <summary>
/// P/Invoke methods to the native math libraries.
/// </summary>
[SuppressUnmanagedCodeSecurity]
internal static class SafeNativeMethods
{
/// <summary>
/// Name of the native DLL.
/// </summary>
private const string DllName = "MathNET.Numerics.MKL.dll";
#region BLAS
@ -55,6 +61,18 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra.Mkl
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)]
internal static extern void z_axpy(int n, ref 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, ref Complex32 alpha, [In, Out] Complex32[] x);
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)]
internal static extern void z_scale(int n, ref Complex alpha, [In, Out] Complex[] x);
#endregion BLAS
}
}
}

1086
src/Numerics/Algorithms/LinearAlgebra/NativeAlgebraProvider.include

File diff suppressed because it is too large

22
src/Numerics/Algorithms/LinearAlgebra/SafeNativeMethods.include

@ -1,4 +1,4 @@
// <copyright file="Constants.cs" company="Math.NET">
// <copyright file="SafeNativeMethods.cs" company="Math.NET">
// Math.NET Numerics, part of the Math.NET Project
// http://mathnet.opensourcedotnet.info
//
@ -36,9 +36,15 @@ using System.Security;
namespace MathNet.Numerics.Algorithms.LinearAlgebra.<#= namespaceSuffix #>
{
/// <summary>
/// P/Invoke methods to the native math libraries.
/// </summary>
[SuppressUnmanagedCodeSecurity]
internal static class SafeNativeMethods
{
/// <summary>
/// Name of the native DLL.
/// </summary>
private const string DllName = "MathNET.Numerics.<#=library#>.dll";
#region BLAS
@ -55,6 +61,18 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra.<#= namespaceSuffix #>
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)]
internal static extern void z_axpy(int n, ref 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, ref Complex32 alpha, [In, Out] Complex32[] x);
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)]
internal static extern void z_scale(int n, ref Complex alpha, [In, Out] Complex[] x);
#endregion BLAS
}
}
}

Loading…
Cancel
Save