From 1713db411a4833599f0625b47eb5386f182bffac Mon Sep 17 00:00:00 2001 From: Marcus Cuda Date: Tue, 29 Mar 2011 21:35:42 +0800 Subject: [PATCH] added GotoBLAS2 provider class. --- src/MathNet.Numerics.5.1.ReSharper | 3 +- src/NativeWrappers/GotoBlas2/blas.c | 2 +- .../GotoBLAS2/GotoBLAS2Wrapper.vcxproj | 16 ++- .../GotoBlasLinearAlgebraProviderTests.cs | 51 ++++++++ .../GotoBlasLinearAlgebraProviderTests.cs | 51 ++++++++ .../GotoBlasLinearAlgebraProviderTests.cs | 51 ++++++++ .../GotoBLAS2WrapperTests.csproj | 120 ++++++++++++++++++ .../Properties/AssemblyInfo.cs | 36 ++++++ .../GotoBlasLinearAlgebraProviderTests.cs | 51 ++++++++ src/NativeWrappers/Windows/NativeWrappers.sln | 21 ++- .../GotoBlasLinearAlgebraProvider.Common.tt | 8 ++ .../GotoBlasLinearAlgebraProvider.Complex.tt | 12 ++ ...GotoBlasLinearAlgebraProvider.Complex32.tt | 12 ++ .../GotoBlasLinearAlgebraProvider.double.tt | 12 ++ .../GotoBlasLinearAlgebraProvider.float.tt | 12 ++ .../GotoBlas/SafeNativeMethods.tt | 8 ++ src/Numerics/LinearAlgebra/Generic/Matrix.cs | 4 +- src/Numerics/Numerics.csproj | 54 ++++++++ 18 files changed, 512 insertions(+), 12 deletions(-) create mode 100644 src/NativeWrappers/Windows/GotoBLAS2WrapperTests/Complex/GotoBlasLinearAlgebraProviderTests.cs create mode 100644 src/NativeWrappers/Windows/GotoBLAS2WrapperTests/Complex32/GotoBlasLinearAlgebraProviderTests.cs create mode 100644 src/NativeWrappers/Windows/GotoBLAS2WrapperTests/Double/GotoBlasLinearAlgebraProviderTests.cs create mode 100644 src/NativeWrappers/Windows/GotoBLAS2WrapperTests/GotoBLAS2WrapperTests.csproj create mode 100644 src/NativeWrappers/Windows/GotoBLAS2WrapperTests/Properties/AssemblyInfo.cs create mode 100644 src/NativeWrappers/Windows/GotoBLAS2WrapperTests/Single/GotoBlasLinearAlgebraProviderTests.cs create mode 100644 src/Numerics/Algorithms/LinearAlgebra/GotoBlas/GotoBlasLinearAlgebraProvider.Common.tt create mode 100644 src/Numerics/Algorithms/LinearAlgebra/GotoBlas/GotoBlasLinearAlgebraProvider.Complex.tt create mode 100644 src/Numerics/Algorithms/LinearAlgebra/GotoBlas/GotoBlasLinearAlgebraProvider.Complex32.tt create mode 100644 src/Numerics/Algorithms/LinearAlgebra/GotoBlas/GotoBlasLinearAlgebraProvider.double.tt create mode 100644 src/Numerics/Algorithms/LinearAlgebra/GotoBlas/GotoBlasLinearAlgebraProvider.float.tt create mode 100644 src/Numerics/Algorithms/LinearAlgebra/GotoBlas/SafeNativeMethods.tt diff --git a/src/MathNet.Numerics.5.1.ReSharper b/src/MathNet.Numerics.5.1.ReSharper index 341716e1..c180a3c1 100644 --- a/src/MathNet.Numerics.5.1.ReSharper +++ b/src/MathNet.Numerics.5.1.ReSharper @@ -86,7 +86,8 @@ dll Silverlight namespace da -Dont +Dont +Blas diff --git a/src/NativeWrappers/GotoBlas2/blas.c b/src/NativeWrappers/GotoBlas2/blas.c index a53d93dc..cc5f48c0 100644 --- a/src/NativeWrappers/GotoBlas2/blas.c +++ b/src/NativeWrappers/GotoBlas2/blas.c @@ -1,6 +1,6 @@ #include "blas.h" #include "wrapper_common.h" - +#include DLLEXPORT void s_axpy(int n, float alpha, float x[], float y[]){ cblas_saxpy(n, alpha, x, 1, y, 1); } diff --git a/src/NativeWrappers/Windows/GotoBLAS2/GotoBLAS2Wrapper.vcxproj b/src/NativeWrappers/Windows/GotoBLAS2/GotoBLAS2Wrapper.vcxproj index 62889689..7537f043 100644 --- a/src/NativeWrappers/Windows/GotoBLAS2/GotoBLAS2Wrapper.vcxproj +++ b/src/NativeWrappers/Windows/GotoBLAS2/GotoBLAS2Wrapper.vcxproj @@ -86,7 +86,9 @@ Windows true ..\..\..\..\lib\GotoBLAS2; - libgoto2_core2p-r1.13_x86.lib;%(AdditionalDependencies) + libgoto2_core2p-r1.13_x86.lib;libf2c_x86.lib;lapack_x86.lib;libf2c_x86.lib;%(AdditionalDependencies) + false + $(OutDir)MathNET.Numerics.GotoBLAS2.dll @@ -101,7 +103,9 @@ Windows true ..\..\..\..\lib\GotoBLAS2; - libgoto2_core2p-r1.13_x86_64.lib;%(AdditionalDependencies) + libgoto2_core2p-r1.13_x86_64.lib;libf2c_x86_64.lib;lapack_x86_64.lib;%(AdditionalDependencies) + false + $(OutDir)MathNET.Numerics.GotoBLAS2.dll @@ -120,7 +124,9 @@ true true ..\..\..\..\lib\GotoBLAS2; - libgoto2_core2p-r1.13_x86.lib;%(AdditionalDependencies) + libgoto2_core2p-r1.13_x86.lib;libf2c_x86.lib;lapack_x86.lib;%(AdditionalDependencies) + false + $(OutDir)MathNET.Numerics.GotoBLAS2.dll @@ -139,7 +145,9 @@ true true ..\..\..\..\lib\GotoBLAS2; - libgoto2_core2p-r1.13_x86_64.lib;%(AdditionalDependencies) + libgoto2_core2p-r1.13_x86_64.lib;libf2c_x86_64.lib;lapack_x86_64.lib;%(AdditionalDependencies) + false + $(OutDir)MathNET.Numerics.GotoBLAS2.dll diff --git a/src/NativeWrappers/Windows/GotoBLAS2WrapperTests/Complex/GotoBlasLinearAlgebraProviderTests.cs b/src/NativeWrappers/Windows/GotoBLAS2WrapperTests/Complex/GotoBlasLinearAlgebraProviderTests.cs new file mode 100644 index 00000000..23a90bfb --- /dev/null +++ b/src/NativeWrappers/Windows/GotoBLAS2WrapperTests/Complex/GotoBlasLinearAlgebraProviderTests.cs @@ -0,0 +1,51 @@ +// +// 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-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. +// + +using MathNet.Numerics.UnitTests.LinearAlgebraProviderTests.Complex; + +namespace MathNet.Numerics.GotoBlasWrapperTests.LinearAlgebra.Complex +{ + using NUnit.Framework; + + /// + /// Unit test container for the GotoBLAS2 linear algebra provider. + /// + [TestFixture] + public class GotoBlasLinearAlgebraProviderTests : LinearAlgebraProviderTests + { + /// + /// Initializes a new instance of the class. + /// + public GotoBlasLinearAlgebraProviderTests() + { + Control.LinearAlgebraProvider = new Algorithms.LinearAlgebra.GotoBlas.GotoBlasLinearAlgebraProvider(); + } + } +} diff --git a/src/NativeWrappers/Windows/GotoBLAS2WrapperTests/Complex32/GotoBlasLinearAlgebraProviderTests.cs b/src/NativeWrappers/Windows/GotoBLAS2WrapperTests/Complex32/GotoBlasLinearAlgebraProviderTests.cs new file mode 100644 index 00000000..c08a26d8 --- /dev/null +++ b/src/NativeWrappers/Windows/GotoBLAS2WrapperTests/Complex32/GotoBlasLinearAlgebraProviderTests.cs @@ -0,0 +1,51 @@ +// +// 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-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. +// + +using MathNet.Numerics.UnitTests.LinearAlgebraProviderTests.Complex32; + +namespace MathNet.Numerics.GotoBlasWrapperTests.LinearAlgebra.Complex32 +{ + using NUnit.Framework; + + /// + /// Unit test container for the GotoBLAS2 linear algebra provider. + /// + [TestFixture] + public class GotoBlasLinearAlgebraProviderTests : LinearAlgebraProviderTests + { + /// + /// Initializes a new instance of the class. + /// + public GotoBlasLinearAlgebraProviderTests() + { + Control.LinearAlgebraProvider = new Algorithms.LinearAlgebra.GotoBlas.GotoBlasLinearAlgebraProvider(); + } + } +} diff --git a/src/NativeWrappers/Windows/GotoBLAS2WrapperTests/Double/GotoBlasLinearAlgebraProviderTests.cs b/src/NativeWrappers/Windows/GotoBLAS2WrapperTests/Double/GotoBlasLinearAlgebraProviderTests.cs new file mode 100644 index 00000000..d1206f1f --- /dev/null +++ b/src/NativeWrappers/Windows/GotoBLAS2WrapperTests/Double/GotoBlasLinearAlgebraProviderTests.cs @@ -0,0 +1,51 @@ +// +// 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-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. +// + +using MathNet.Numerics.UnitTests.LinearAlgebraProviderTests.Double; + +namespace MathNet.Numerics.GotoBlasWrapperTests.LinearAlgebra.Double +{ + using NUnit.Framework; + + /// + /// Unit test container for the GotoBLAS2 linear algebra provider. + /// + [TestFixture] + public class GotoBlasLinearAlgebraProviderTests : LinearAlgebraProviderTests + { + /// + /// Initializes a new instance of the class. + /// + public GotoBlasLinearAlgebraProviderTests() + { + Control.LinearAlgebraProvider = new Algorithms.LinearAlgebra.GotoBlas.GotoBlasLinearAlgebraProvider(); + } + } +} diff --git a/src/NativeWrappers/Windows/GotoBLAS2WrapperTests/GotoBLAS2WrapperTests.csproj b/src/NativeWrappers/Windows/GotoBLAS2WrapperTests/GotoBLAS2WrapperTests.csproj new file mode 100644 index 00000000..42d5fecb --- /dev/null +++ b/src/NativeWrappers/Windows/GotoBLAS2WrapperTests/GotoBLAS2WrapperTests.csproj @@ -0,0 +1,120 @@ + + + + Debug + AnyCPU + 8.0.30703 + 2.0 + {56FFAB18-CAA6-4913-8123-610872BFD60A} + Library + Properties + GotoBLAS2WrapperTests + GotoBLAS2WrapperTests + v4.0 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + AnyCPU + + + true + bin\x86\Debug\ + DEBUG;TRACE + full + x86 + bin\Debug\GotoBLAS2WrapperTests.dll.CodeAnalysisLog.xml + true + GlobalSuppressions.cs + prompt + MinimumRecommendedRules.ruleset + ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets + false + ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules + true + false + + + bin\x86\Release\ + TRACE + true + pdbonly + x86 + bin\Release\GotoBLAS2WrapperTests.dll.CodeAnalysisLog.xml + true + GlobalSuppressions.cs + prompt + MinimumRecommendedRules.ruleset + ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets + true + ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules + true + + + + False + ..\..\..\..\out\lib\Net40\MathNet.Numerics.dll + + + ..\..\..\..\lib\NUnit.2.5.9\nunit.framework.dll + + + + + + + + + + + + + AssertHelpers.cs + + + Complex32\LinearAlgebraProviderTests.cs + + + Complex\LinearAlgebraProviderTests.cs + + + Double\LinearAlgebraProviderTests.cs + + + Single\LinearAlgebraProviderTests.cs + + + + + + + + + + MathNET.Numerics.GotoBLAS2.dll + Always + + + + + \ No newline at end of file diff --git a/src/NativeWrappers/Windows/GotoBLAS2WrapperTests/Properties/AssemblyInfo.cs b/src/NativeWrappers/Windows/GotoBLAS2WrapperTests/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..dda7672e --- /dev/null +++ b/src/NativeWrappers/Windows/GotoBLAS2WrapperTests/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("GotoBLAS2WrapperTests")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyProduct("GotoBLAS2WrapperTests")] +[assembly: AssemblyCopyright("Copyright © Microsoft 2011")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("eea98ed9-b5a4-4c81-ac6b-808eecd4bedf")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/NativeWrappers/Windows/GotoBLAS2WrapperTests/Single/GotoBlasLinearAlgebraProviderTests.cs b/src/NativeWrappers/Windows/GotoBLAS2WrapperTests/Single/GotoBlasLinearAlgebraProviderTests.cs new file mode 100644 index 00000000..5cb12d63 --- /dev/null +++ b/src/NativeWrappers/Windows/GotoBLAS2WrapperTests/Single/GotoBlasLinearAlgebraProviderTests.cs @@ -0,0 +1,51 @@ +// +// 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-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. +// + +using MathNet.Numerics.UnitTests.LinearAlgebraProviderTests.Single; + +namespace MathNet.Numerics.GotoBlasWrapperTests.LinearAlgebra.Single +{ + using NUnit.Framework; + + /// + /// Unit test container for the GotoBLAS2 linear algebra provider. + /// + [TestFixture] + public class GotoBlasLinearAlgebraProviderTests : LinearAlgebraProviderTests + { + /// + /// Initializes a new instance of the class. + /// + public GotoBlasLinearAlgebraProviderTests() + { + Control.LinearAlgebraProvider = new Algorithms.LinearAlgebra.GotoBlas.GotoBlasLinearAlgebraProvider(); + } + } +} diff --git a/src/NativeWrappers/Windows/NativeWrappers.sln b/src/NativeWrappers/Windows/NativeWrappers.sln index 5560a0b1..060864f3 100644 --- a/src/NativeWrappers/Windows/NativeWrappers.sln +++ b/src/NativeWrappers/Windows/NativeWrappers.sln @@ -16,6 +16,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MKLWrapperTests", "MKLWrapp EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GotoBLAS2Wrapper", "GotoBLAS2\GotoBLAS2Wrapper.vcxproj", "{507FF69E-32A6-495A-9DE2-20EC10EE8963}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GotoBLAS2WrapperTests", "GotoBLAS2WrapperTests\GotoBLAS2WrapperTests.csproj", "{56FFAB18-CAA6-4913-8123-610872BFD60A}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -36,8 +38,8 @@ Global {C0B0DBA9-7FB0-4C87-BDB1-3EED19DC2B8F}.Debug|x64.ActiveCfg = Debug|x64 {C0B0DBA9-7FB0-4C87-BDB1-3EED19DC2B8F}.Debug|x64.Build.0 = Debug|x64 {C0B0DBA9-7FB0-4C87-BDB1-3EED19DC2B8F}.Release|Any CPU.ActiveCfg = Release|x64 - {C0B0DBA9-7FB0-4C87-BDB1-3EED19DC2B8F}.Release|Mixed Platforms.ActiveCfg = Release|x64 - {C0B0DBA9-7FB0-4C87-BDB1-3EED19DC2B8F}.Release|Mixed Platforms.Build.0 = Release|x64 + {C0B0DBA9-7FB0-4C87-BDB1-3EED19DC2B8F}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {C0B0DBA9-7FB0-4C87-BDB1-3EED19DC2B8F}.Release|Mixed Platforms.Build.0 = Release|Win32 {C0B0DBA9-7FB0-4C87-BDB1-3EED19DC2B8F}.Release|Win32.ActiveCfg = Release|Win32 {C0B0DBA9-7FB0-4C87-BDB1-3EED19DC2B8F}.Release|Win32.Build.0 = Release|Win32 {C0B0DBA9-7FB0-4C87-BDB1-3EED19DC2B8F}.Release|x64.ActiveCfg = Release|Win32 @@ -55,8 +57,8 @@ Global {D0AD591B-0CE6-4A6D-8DEA-01777EE09BC3}.Release|Win32.ActiveCfg = Release|Any CPU {D0AD591B-0CE6-4A6D-8DEA-01777EE09BC3}.Release|x64.ActiveCfg = Release|Any CPU {507FF69E-32A6-495A-9DE2-20EC10EE8963}.Debug|Any CPU.ActiveCfg = Debug|x64 - {507FF69E-32A6-495A-9DE2-20EC10EE8963}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {507FF69E-32A6-495A-9DE2-20EC10EE8963}.Debug|Mixed Platforms.Build.0 = Debug|Win32 + {507FF69E-32A6-495A-9DE2-20EC10EE8963}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 + {507FF69E-32A6-495A-9DE2-20EC10EE8963}.Debug|Mixed Platforms.Build.0 = Debug|x64 {507FF69E-32A6-495A-9DE2-20EC10EE8963}.Debug|Win32.ActiveCfg = Debug|Win32 {507FF69E-32A6-495A-9DE2-20EC10EE8963}.Debug|Win32.Build.0 = Debug|Win32 {507FF69E-32A6-495A-9DE2-20EC10EE8963}.Debug|x64.ActiveCfg = Debug|x64 @@ -68,6 +70,17 @@ Global {507FF69E-32A6-495A-9DE2-20EC10EE8963}.Release|Win32.Build.0 = Release|Win32 {507FF69E-32A6-495A-9DE2-20EC10EE8963}.Release|x64.ActiveCfg = Release|x64 {507FF69E-32A6-495A-9DE2-20EC10EE8963}.Release|x64.Build.0 = Release|x64 + {56FFAB18-CAA6-4913-8123-610872BFD60A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {56FFAB18-CAA6-4913-8123-610872BFD60A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {56FFAB18-CAA6-4913-8123-610872BFD60A}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {56FFAB18-CAA6-4913-8123-610872BFD60A}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {56FFAB18-CAA6-4913-8123-610872BFD60A}.Debug|Win32.ActiveCfg = Debug|Any CPU + {56FFAB18-CAA6-4913-8123-610872BFD60A}.Debug|x64.ActiveCfg = Debug|Any CPU + {56FFAB18-CAA6-4913-8123-610872BFD60A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {56FFAB18-CAA6-4913-8123-610872BFD60A}.Release|Any CPU.Build.0 = Release|Any CPU + {56FFAB18-CAA6-4913-8123-610872BFD60A}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {56FFAB18-CAA6-4913-8123-610872BFD60A}.Release|Win32.ActiveCfg = Release|Any CPU + {56FFAB18-CAA6-4913-8123-610872BFD60A}.Release|x64.ActiveCfg = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/Numerics/Algorithms/LinearAlgebra/GotoBlas/GotoBlasLinearAlgebraProvider.Common.tt b/src/Numerics/Algorithms/LinearAlgebra/GotoBlas/GotoBlasLinearAlgebraProvider.Common.tt new file mode 100644 index 00000000..50d879a5 --- /dev/null +++ b/src/Numerics/Algorithms/LinearAlgebra/GotoBlas/GotoBlasLinearAlgebraProvider.Common.tt @@ -0,0 +1,8 @@ +<#@ 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.common.include" #> +<#@ include file="..\native.footer.include" #> diff --git a/src/Numerics/Algorithms/LinearAlgebra/GotoBlas/GotoBlasLinearAlgebraProvider.Complex.tt b/src/Numerics/Algorithms/LinearAlgebra/GotoBlas/GotoBlasLinearAlgebraProvider.Complex.tt new file mode 100644 index 00000000..48d5a776 --- /dev/null +++ b/src/Numerics/Algorithms/LinearAlgebra/GotoBlas/GotoBlasLinearAlgebraProvider.Complex.tt @@ -0,0 +1,12 @@ +<#@ 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" #> diff --git a/src/Numerics/Algorithms/LinearAlgebra/GotoBlas/GotoBlasLinearAlgebraProvider.Complex32.tt b/src/Numerics/Algorithms/LinearAlgebra/GotoBlas/GotoBlasLinearAlgebraProvider.Complex32.tt new file mode 100644 index 00000000..6f7dd896 --- /dev/null +++ b/src/Numerics/Algorithms/LinearAlgebra/GotoBlas/GotoBlasLinearAlgebraProvider.Complex32.tt @@ -0,0 +1,12 @@ +<#@ 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" #> diff --git a/src/Numerics/Algorithms/LinearAlgebra/GotoBlas/GotoBlasLinearAlgebraProvider.double.tt b/src/Numerics/Algorithms/LinearAlgebra/GotoBlas/GotoBlasLinearAlgebraProvider.double.tt new file mode 100644 index 00000000..a8588b7a --- /dev/null +++ b/src/Numerics/Algorithms/LinearAlgebra/GotoBlas/GotoBlasLinearAlgebraProvider.double.tt @@ -0,0 +1,12 @@ +<#@ 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" #> diff --git a/src/Numerics/Algorithms/LinearAlgebra/GotoBlas/GotoBlasLinearAlgebraProvider.float.tt b/src/Numerics/Algorithms/LinearAlgebra/GotoBlas/GotoBlasLinearAlgebraProvider.float.tt new file mode 100644 index 00000000..542d243e --- /dev/null +++ b/src/Numerics/Algorithms/LinearAlgebra/GotoBlas/GotoBlasLinearAlgebraProvider.float.tt @@ -0,0 +1,12 @@ +<#@ 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" #> diff --git a/src/Numerics/Algorithms/LinearAlgebra/GotoBlas/SafeNativeMethods.tt b/src/Numerics/Algorithms/LinearAlgebra/GotoBlas/SafeNativeMethods.tt new file mode 100644 index 00000000..f9e0aa4a --- /dev/null +++ b/src/Numerics/Algorithms/LinearAlgebra/GotoBlas/SafeNativeMethods.tt @@ -0,0 +1,8 @@ +<#@ template language="C#" debug="true" #> +<#@ output extenstion="cs" #> +<# string namespaceSuffix = "GotoBlas"; + string library = "GotoBLAS2"; +#> +<#@ include file="..\safe.native.common.include" #> + } +} \ No newline at end of file diff --git a/src/Numerics/LinearAlgebra/Generic/Matrix.cs b/src/Numerics/LinearAlgebra/Generic/Matrix.cs index a4136aca..69894a66 100644 --- a/src/Numerics/LinearAlgebra/Generic/Matrix.cs +++ b/src/Numerics/LinearAlgebra/Generic/Matrix.cs @@ -253,7 +253,7 @@ namespace MathNet.Numerics.LinearAlgebra.Generic /// public override string ToString() { - return ToString(null, null); + return ToString(null); } /// @@ -1349,7 +1349,7 @@ namespace MathNet.Numerics.LinearAlgebra.Generic /// /// A that represents this instance. /// - public virtual string ToString(string format, IFormatProvider formatProvider) + public virtual string ToString(string format, IFormatProvider formatProvider = null) { var stringBuilder = new StringBuilder(); for (var row = 0; row < RowCount; row++) diff --git a/src/Numerics/Numerics.csproj b/src/Numerics/Numerics.csproj index cc12f4df..2f779c0d 100644 --- a/src/Numerics/Numerics.csproj +++ b/src/Numerics/Numerics.csproj @@ -70,6 +70,30 @@ + + TextTemplatingFileGenerator + GotoBlasLinearAlgebraProvider.Common.cs + + + TextTemplatingFileGenerator + GotoBlasLinearAlgebraProvider.Complex.cs + + + TextTemplatingFileGenerator + GotoBlasLinearAlgebraProvider.Complex32.cs + + + TextTemplatingFileGenerator + GotoBlasLinearAlgebraProvider.double.cs + + + TextTemplatingFileGenerator + GotoBlasLinearAlgebraProvider.float.cs + + + TextTemplatingFileGenerator + SafeNativeMethods.cs + TextTemplatingFileGenerator MklLinearAlgebraProvider.Common.cs @@ -101,6 +125,36 @@ SafeNativeMethods.cs + + GotoBlasLinearAlgebraProvider.Common.tt + True + True + + + GotoBlasLinearAlgebraProvider.Complex.tt + True + True + + + GotoBlasLinearAlgebraProvider.Complex32.tt + True + True + + + GotoBlasLinearAlgebraProvider.double.tt + True + True + + + GotoBlasLinearAlgebraProvider.float.tt + True + True + + + SafeNativeMethods.tt + True + True +