Browse Source

added GotoBLAS2 provider class.

la-knuth
Marcus Cuda 16 years ago
parent
commit
1713db411a
  1. 3
      src/MathNet.Numerics.5.1.ReSharper
  2. 2
      src/NativeWrappers/GotoBlas2/blas.c
  3. 16
      src/NativeWrappers/Windows/GotoBLAS2/GotoBLAS2Wrapper.vcxproj
  4. 51
      src/NativeWrappers/Windows/GotoBLAS2WrapperTests/Complex/GotoBlasLinearAlgebraProviderTests.cs
  5. 51
      src/NativeWrappers/Windows/GotoBLAS2WrapperTests/Complex32/GotoBlasLinearAlgebraProviderTests.cs
  6. 51
      src/NativeWrappers/Windows/GotoBLAS2WrapperTests/Double/GotoBlasLinearAlgebraProviderTests.cs
  7. 120
      src/NativeWrappers/Windows/GotoBLAS2WrapperTests/GotoBLAS2WrapperTests.csproj
  8. 36
      src/NativeWrappers/Windows/GotoBLAS2WrapperTests/Properties/AssemblyInfo.cs
  9. 51
      src/NativeWrappers/Windows/GotoBLAS2WrapperTests/Single/GotoBlasLinearAlgebraProviderTests.cs
  10. 21
      src/NativeWrappers/Windows/NativeWrappers.sln
  11. 8
      src/Numerics/Algorithms/LinearAlgebra/GotoBlas/GotoBlasLinearAlgebraProvider.Common.tt
  12. 12
      src/Numerics/Algorithms/LinearAlgebra/GotoBlas/GotoBlasLinearAlgebraProvider.Complex.tt
  13. 12
      src/Numerics/Algorithms/LinearAlgebra/GotoBlas/GotoBlasLinearAlgebraProvider.Complex32.tt
  14. 12
      src/Numerics/Algorithms/LinearAlgebra/GotoBlas/GotoBlasLinearAlgebraProvider.double.tt
  15. 12
      src/Numerics/Algorithms/LinearAlgebra/GotoBlas/GotoBlasLinearAlgebraProvider.float.tt
  16. 8
      src/Numerics/Algorithms/LinearAlgebra/GotoBlas/SafeNativeMethods.tt
  17. 4
      src/Numerics/LinearAlgebra/Generic/Matrix.cs
  18. 54
      src/Numerics/Numerics.csproj

3
src/MathNet.Numerics.5.1.ReSharper

@ -86,7 +86,8 @@ dll
Silverlight
namespace
da
Dont</UserWords>
Dont
Blas</UserWords>
</CustomDictionary>
</Dictionaries>
</CustomDictionaries>

2
src/NativeWrappers/GotoBlas2/blas.c

@ -1,6 +1,6 @@
#include "blas.h"
#include "wrapper_common.h"
#include <stdlib.h>
DLLEXPORT void s_axpy(int n, float alpha, float x[], float y[]){
cblas_saxpy(n, alpha, x, 1, y, 1);
}

16
src/NativeWrappers/Windows/GotoBLAS2/GotoBLAS2Wrapper.vcxproj

@ -86,7 +86,9 @@
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>..\..\..\..\lib\GotoBLAS2;</AdditionalLibraryDirectories>
<AdditionalDependencies>libgoto2_core2p-r1.13_x86.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>libgoto2_core2p-r1.13_x86.lib;libf2c_x86.lib;lapack_x86.lib;libf2c_x86.lib;%(AdditionalDependencies)</AdditionalDependencies>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<OutputFile>$(OutDir)MathNET.Numerics.GotoBLAS2.dll</OutputFile>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
@ -101,7 +103,9 @@
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>..\..\..\..\lib\GotoBLAS2;</AdditionalLibraryDirectories>
<AdditionalDependencies>libgoto2_core2p-r1.13_x86_64.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>libgoto2_core2p-r1.13_x86_64.lib;libf2c_x86_64.lib;lapack_x86_64.lib;%(AdditionalDependencies)</AdditionalDependencies>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<OutputFile>$(OutDir)MathNET.Numerics.GotoBLAS2.dll</OutputFile>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@ -120,7 +124,9 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalLibraryDirectories>..\..\..\..\lib\GotoBLAS2;</AdditionalLibraryDirectories>
<AdditionalDependencies>libgoto2_core2p-r1.13_x86.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>libgoto2_core2p-r1.13_x86.lib;libf2c_x86.lib;lapack_x86.lib;%(AdditionalDependencies)</AdditionalDependencies>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<OutputFile>$(OutDir)MathNET.Numerics.GotoBLAS2.dll</OutputFile>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
@ -139,7 +145,9 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalLibraryDirectories>..\..\..\..\lib\GotoBLAS2;</AdditionalLibraryDirectories>
<AdditionalDependencies>libgoto2_core2p-r1.13_x86_64.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>libgoto2_core2p-r1.13_x86_64.lib;libf2c_x86_64.lib;lapack_x86_64.lib;%(AdditionalDependencies)</AdditionalDependencies>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<OutputFile>$(OutDir)MathNET.Numerics.GotoBLAS2.dll</OutputFile>
</Link>
</ItemDefinitionGroup>
<ItemGroup>

51
src/NativeWrappers/Windows/GotoBLAS2WrapperTests/Complex/GotoBlasLinearAlgebraProviderTests.cs

@ -0,0 +1,51 @@
// <copyright file="MklLinearAlgebraProviderTests.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-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 MathNet.Numerics.UnitTests.LinearAlgebraProviderTests.Complex;
namespace MathNet.Numerics.GotoBlasWrapperTests.LinearAlgebra.Complex
{
using NUnit.Framework;
/// <summary>
/// Unit test container for the GotoBLAS2 linear algebra provider.
/// </summary>
[TestFixture]
public class GotoBlasLinearAlgebraProviderTests : LinearAlgebraProviderTests
{
/// <summary>
/// Initializes a new instance of the <see cref="GotoBlasLinearAlgebraProviderTests"/> class.
/// </summary>
public GotoBlasLinearAlgebraProviderTests()
{
Control.LinearAlgebraProvider = new Algorithms.LinearAlgebra.GotoBlas.GotoBlasLinearAlgebraProvider();
}
}
}

51
src/NativeWrappers/Windows/GotoBLAS2WrapperTests/Complex32/GotoBlasLinearAlgebraProviderTests.cs

@ -0,0 +1,51 @@
// <copyright file="MklLinearAlgebraProviderTests.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-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 MathNet.Numerics.UnitTests.LinearAlgebraProviderTests.Complex32;
namespace MathNet.Numerics.GotoBlasWrapperTests.LinearAlgebra.Complex32
{
using NUnit.Framework;
/// <summary>
/// Unit test container for the GotoBLAS2 linear algebra provider.
/// </summary>
[TestFixture]
public class GotoBlasLinearAlgebraProviderTests : LinearAlgebraProviderTests
{
/// <summary>
/// Initializes a new instance of the <see cref="GotoBlasLinearAlgebraProviderTests"/> class.
/// </summary>
public GotoBlasLinearAlgebraProviderTests()
{
Control.LinearAlgebraProvider = new Algorithms.LinearAlgebra.GotoBlas.GotoBlasLinearAlgebraProvider();
}
}
}

51
src/NativeWrappers/Windows/GotoBLAS2WrapperTests/Double/GotoBlasLinearAlgebraProviderTests.cs

@ -0,0 +1,51 @@
// <copyright file="MklLinearAlgebraProviderTests.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-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 MathNet.Numerics.UnitTests.LinearAlgebraProviderTests.Double;
namespace MathNet.Numerics.GotoBlasWrapperTests.LinearAlgebra.Double
{
using NUnit.Framework;
/// <summary>
/// Unit test container for the GotoBLAS2 linear algebra provider.
/// </summary>
[TestFixture]
public class GotoBlasLinearAlgebraProviderTests : LinearAlgebraProviderTests
{
/// <summary>
/// Initializes a new instance of the <see cref="GotoBlasLinearAlgebraProviderTests"/> class.
/// </summary>
public GotoBlasLinearAlgebraProviderTests()
{
Control.LinearAlgebraProvider = new Algorithms.LinearAlgebra.GotoBlas.GotoBlasLinearAlgebraProvider();
}
}
}

120
src/NativeWrappers/Windows/GotoBLAS2WrapperTests/GotoBLAS2WrapperTests.csproj

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{56FFAB18-CAA6-4913-8123-610872BFD60A}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>GotoBLAS2WrapperTests</RootNamespace>
<AssemblyName>GotoBLAS2WrapperTests</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<CodeAnalysisLogFile>bin\Debug\GotoBLAS2WrapperTests.dll.CodeAnalysisLog.xml</CodeAnalysisLogFile>
<CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
<CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSetDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories>
<CodeAnalysisIgnoreBuiltInRuleSets>false</CodeAnalysisIgnoreBuiltInRuleSets>
<CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
<CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>
<CodeAnalysisFailOnMissingRules>false</CodeAnalysisFailOnMissingRules>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<CodeAnalysisLogFile>bin\Release\GotoBLAS2WrapperTests.dll.CodeAnalysisLog.xml</CodeAnalysisLogFile>
<CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
<CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSetDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories>
<CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets>
<CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
<CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>
</PropertyGroup>
<ItemGroup>
<Reference Include="MathNet.Numerics, Version=2011.3.29.268, Culture=neutral, PublicKeyToken=cd8b63ad3d691a37, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\out\lib\Net40\MathNet.Numerics.dll</HintPath>
</Reference>
<Reference Include="nunit.framework">
<HintPath>..\..\..\..\lib\NUnit.2.5.9\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Numerics" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\..\..\UnitTests\AssertHelpers.cs">
<Link>AssertHelpers.cs</Link>
</Compile>
<Compile Include="..\..\..\unittests\linearalgebraprovidertests\complex32\LinearAlgebraProviderTests.cs">
<Link>Complex32\LinearAlgebraProviderTests.cs</Link>
</Compile>
<Compile Include="..\..\..\unittests\linearalgebraprovidertests\complex\LinearAlgebraProviderTests.cs">
<Link>Complex\LinearAlgebraProviderTests.cs</Link>
</Compile>
<Compile Include="..\..\..\unittests\linearalgebraprovidertests\double\LinearAlgebraProviderTests.cs">
<Link>Double\LinearAlgebraProviderTests.cs</Link>
</Compile>
<Compile Include="..\..\..\unittests\linearalgebraprovidertests\single\LinearAlgebraProviderTests.cs">
<Link>Single\LinearAlgebraProviderTests.cs</Link>
</Compile>
<Compile Include="Complex32\GotoBlasLinearAlgebraProviderTests.cs" />
<Compile Include="Complex\GotoBlasLinearAlgebraProviderTests.cs" />
<Compile Include="Double\GotoBlasLinearAlgebraProviderTests.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Single\GotoBlasLinearAlgebraProviderTests.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="..\x64\Release\MathNET.Numerics.GotoBLAS2.dll">
<Link>MathNET.Numerics.GotoBLAS2.dll</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

36
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")]

51
src/NativeWrappers/Windows/GotoBLAS2WrapperTests/Single/GotoBlasLinearAlgebraProviderTests.cs

@ -0,0 +1,51 @@
// <copyright file="MklLinearAlgebraProviderTests.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-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 MathNet.Numerics.UnitTests.LinearAlgebraProviderTests.Single;
namespace MathNet.Numerics.GotoBlasWrapperTests.LinearAlgebra.Single
{
using NUnit.Framework;
/// <summary>
/// Unit test container for the GotoBLAS2 linear algebra provider.
/// </summary>
[TestFixture]
public class GotoBlasLinearAlgebraProviderTests : LinearAlgebraProviderTests
{
/// <summary>
/// Initializes a new instance of the <see cref="GotoBlasLinearAlgebraProviderTests"/> class.
/// </summary>
public GotoBlasLinearAlgebraProviderTests()
{
Control.LinearAlgebraProvider = new Algorithms.LinearAlgebra.GotoBlas.GotoBlasLinearAlgebraProvider();
}
}
}

21
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

8
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" #>

12
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" #>

12
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" #>

12
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" #>

12
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" #>

8
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" #>
}
}

4
src/Numerics/LinearAlgebra/Generic/Matrix.cs

@ -253,7 +253,7 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
/// </returns>
public override string ToString()
{
return ToString(null, null);
return ToString(null);
}
/// <summary>
@ -1349,7 +1349,7 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
/// <returns>
/// A <see cref="System.String"/> that represents this instance.
/// </returns>
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++)

54
src/Numerics/Numerics.csproj

@ -70,6 +70,30 @@
</Reference>
</ItemGroup>
<ItemGroup>
<None Include="Algorithms\LinearAlgebra\GotoBlas\GotoBlasLinearAlgebraProvider.Common.tt">
<Generator>TextTemplatingFileGenerator</Generator>
<LastGenOutput>GotoBlasLinearAlgebraProvider.Common.cs</LastGenOutput>
</None>
<None Include="Algorithms\LinearAlgebra\GotoBlas\GotoBlasLinearAlgebraProvider.Complex.tt">
<Generator>TextTemplatingFileGenerator</Generator>
<LastGenOutput>GotoBlasLinearAlgebraProvider.Complex.cs</LastGenOutput>
</None>
<None Include="Algorithms\LinearAlgebra\GotoBlas\GotoBlasLinearAlgebraProvider.Complex32.tt">
<Generator>TextTemplatingFileGenerator</Generator>
<LastGenOutput>GotoBlasLinearAlgebraProvider.Complex32.cs</LastGenOutput>
</None>
<None Include="Algorithms\LinearAlgebra\GotoBlas\GotoBlasLinearAlgebraProvider.double.tt">
<Generator>TextTemplatingFileGenerator</Generator>
<LastGenOutput>GotoBlasLinearAlgebraProvider.double.cs</LastGenOutput>
</None>
<None Include="Algorithms\LinearAlgebra\GotoBlas\GotoBlasLinearAlgebraProvider.float.tt">
<Generator>TextTemplatingFileGenerator</Generator>
<LastGenOutput>GotoBlasLinearAlgebraProvider.float.cs</LastGenOutput>
</None>
<None Include="Algorithms\LinearAlgebra\GotoBlas\SafeNativeMethods.tt">
<Generator>TextTemplatingFileGenerator</Generator>
<LastGenOutput>SafeNativeMethods.cs</LastGenOutput>
</None>
<None Include="Algorithms\LinearAlgebra\Mkl\MklLinearAlgebraProvider.Common.tt">
<Generator>TextTemplatingFileGenerator</Generator>
<LastGenOutput>MklLinearAlgebraProvider.Common.cs</LastGenOutput>
@ -101,6 +125,36 @@
<LastGenOutput>SafeNativeMethods.cs</LastGenOutput>
</None>
<None Include="Algorithms\LinearAlgebra\native.vector.include" />
<Compile Include="Algorithms\LinearAlgebra\GotoBlas\GotoBlasLinearAlgebraProvider.Common.cs">
<DependentUpon>GotoBlasLinearAlgebraProvider.Common.tt</DependentUpon>
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
</Compile>
<Compile Include="Algorithms\LinearAlgebra\GotoBlas\GotoBlasLinearAlgebraProvider.Complex.cs">
<DependentUpon>GotoBlasLinearAlgebraProvider.Complex.tt</DependentUpon>
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
</Compile>
<Compile Include="Algorithms\LinearAlgebra\GotoBlas\GotoBlasLinearAlgebraProvider.Complex32.cs">
<DependentUpon>GotoBlasLinearAlgebraProvider.Complex32.tt</DependentUpon>
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
</Compile>
<Compile Include="Algorithms\LinearAlgebra\GotoBlas\GotoBlasLinearAlgebraProvider.double.cs">
<DependentUpon>GotoBlasLinearAlgebraProvider.double.tt</DependentUpon>
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
</Compile>
<Compile Include="Algorithms\LinearAlgebra\GotoBlas\GotoBlasLinearAlgebraProvider.float.cs">
<DependentUpon>GotoBlasLinearAlgebraProvider.float.tt</DependentUpon>
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
</Compile>
<Compile Include="Algorithms\LinearAlgebra\GotoBlas\SafeNativeMethods.cs">
<DependentUpon>SafeNativeMethods.tt</DependentUpon>
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
</Compile>
<Compile Include="Algorithms\LinearAlgebra\ManagedLinearAlgebraProvider.Complex32.cs" />
<Compile Include="Algorithms\LinearAlgebra\ManagedLinearAlgebraProvider.Complex.cs" />
<Compile Include="Algorithms\LinearAlgebra\ManagedLinearAlgebraProvider.Single.cs" />

Loading…
Cancel
Save