Browse Source

Build: .Net 3.5 variant of Numerics project in portable solution

optimization-3
Christoph Ruegg 13 years ago
parent
commit
7c6d83464f
  1. 8
      MathNet.Numerics.Portable.sln
  2. 1
      packages/.gitattributes
  3. BIN
      packages/TaskParallelLibrary.1.0.2856.0/TaskParallelLibrary.1.0.2856.0.nupkg
  4. 24
      packages/TaskParallelLibrary.1.0.2856.0/TaskParallelLibrary.1.0.2856.0.nuspec
  5. BIN
      packages/TaskParallelLibrary.1.0.2856.0/lib/Net35/System.Threading.chm
  6. BIN
      packages/TaskParallelLibrary.1.0.2856.0/lib/Net35/System.Threading.dll
  7. 11
      packages/TaskParallelLibrary.1.0.2856.0/lib/Net35/redist.txt
  8. 11
      packages/repositories.config
  9. 91
      src/Numerics/Compatibility.cs
  10. 6
      src/Numerics/Complex64.cs
  11. 111
      src/Numerics/Numerics-Net35.csproj
  12. 2
      src/Numerics/Numerics.csproj
  13. 28
      src/Numerics/PortableAttributes.cs
  14. 2
      src/Numerics/Properties/Resources.Designer.cs
  15. 2
      src/Numerics/Random/SystemCrypto.cs
  16. 16
      src/Numerics/Threading/CommonParallel.cs
  17. 4
      src/Numerics/packages.config

8
MathNet.Numerics.Portable.sln

@ -48,6 +48,8 @@ Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharpUnitTests-Portable47"
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharpUnitTests-Portable136", "src\FSharpUnitTests\FSharpUnitTests-Portable136.fsproj", "{1A8315AC-BCDA-4294-B994-FDC4FED45BEE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Numerics-Net35", "src\Numerics\Numerics-Net35.csproj", "{E54E712D-EB6B-4FBF-B29A-6BB95E719BAC}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -129,6 +131,12 @@ Global
{1A8315AC-BCDA-4294-B994-FDC4FED45BEE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1A8315AC-BCDA-4294-B994-FDC4FED45BEE}.Release|Any CPU.Build.0 = Release|Any CPU
{1A8315AC-BCDA-4294-B994-FDC4FED45BEE}.Release-Signed|Any CPU.ActiveCfg = Release|Any CPU
{E54E712D-EB6B-4FBF-B29A-6BB95E719BAC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E54E712D-EB6B-4FBF-B29A-6BB95E719BAC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E54E712D-EB6B-4FBF-B29A-6BB95E719BAC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E54E712D-EB6B-4FBF-B29A-6BB95E719BAC}.Release|Any CPU.Build.0 = Release|Any CPU
{E54E712D-EB6B-4FBF-B29A-6BB95E719BAC}.Release-Signed|Any CPU.ActiveCfg = Release-Signed|Any CPU
{E54E712D-EB6B-4FBF-B29A-6BB95E719BAC}.Release-Signed|Any CPU.Build.0 = Release-Signed|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

1
packages/.gitattributes

@ -1,3 +1,2 @@
repositories.config text
* -text

BIN
packages/TaskParallelLibrary.1.0.2856.0/TaskParallelLibrary.1.0.2856.0.nupkg

Binary file not shown.

24
packages/TaskParallelLibrary.1.0.2856.0/TaskParallelLibrary.1.0.2856.0.nuspec

@ -0,0 +1,24 @@
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>TaskParallelLibrary</id>
<version>1.0.2856.0</version>
<title>Task Parallel Library for .NET 3.5</title>
<authors>Microsoft Corporation</authors>
<owners>Microsoft Corporation</owners>
<licenseUrl>http://go.microsoft.com/fwlink/?LinkID=186234</licenseUrl>
<projectUrl>http://msdn.microsoft.com/en-us/library/dd460717.aspx</projectUrl>
<iconUrl>http://i.msdn.microsoft.com/ee402630.NET_lg.png</iconUrl>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<description>The package includes:
* Task&lt;T&gt; for executing asynchronous operations.
* Concurrent Collections such as ConcurrentStack, ConcurentQueue ad ConcurrentDictionary.
* PLINQ for writing parallel queries.
* additional Threading operations such as Barrier,SpinLock and SpinWait.</description>
<summary>A complete and official Microsoft backport of the Task Parallel Library (TPL) for .NET 3.5.</summary>
<releaseNotes>This backport was shipped with the Reactive Extensions (Rx) library up until v1.0.2856.0. It can be downloaded from http://www.microsoft.com/download/en/details.aspx?id=24940 .</releaseNotes>
<copyright />
<language />
<tags>tpl plinq pfx task parallel extensions .net35 backport</tags>
</metadata>
</package>

BIN
packages/TaskParallelLibrary.1.0.2856.0/lib/Net35/System.Threading.chm

Binary file not shown.

BIN
packages/TaskParallelLibrary.1.0.2856.0/lib/Net35/System.Threading.dll

Binary file not shown.

11
packages/TaskParallelLibrary.1.0.2856.0/lib/Net35/redist.txt

@ -0,0 +1,11 @@
The files below can be distributed as described in the MICROSOFT REACTIVE EXTENSTIONS FOR JAVASCRIPT AND .NET LIBRARIES License.
System.Observable.dll
System.CoreEx.dll
System.Reactive.dll
System.Interactive.dll
System.Threading.dll
System.Linq.Async.dll
System.Reactive.Testing.dll
System.Reactive.ClientProfile.dll
System.Reactive.ExtendedProfile.dll

11
packages/repositories.config

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<repositories>
<repository path="..\src\FSharpExamples\packages.config" />
<repository path="..\src\FSharpUnitTests\packages.config" />
<repository path="..\src\UnitTests\packages.config" />
<?xml version="1.0" encoding="utf-8"?>
<repositories>
<repository path="..\src\FSharpExamples\packages.config" />
<repository path="..\src\FSharpUnitTests\packages.config" />
<repository path="..\src\Numerics\packages.config" />
<repository path="..\src\UnitTests\packages.config" />
</repositories>

91
src/Numerics/Compatibility.cs

@ -0,0 +1,91 @@
#if PORTABLE
namespace MathNet.Numerics
{
using System;
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct)]
public class SerializableAttribute : Attribute
{
}
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
public class SpecialNameAttribute : Attribute
{
}
}
#endif
#if (PORTABLE || NET35)
namespace MathNet.Numerics
{
using System;
[AttributeUsage(AttributeTargets.Constructor | AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
public class TargetedPatchingOptOutAttribute : Attribute
{
public string Reason { get; private set; }
public TargetedPatchingOptOutAttribute(string reason)
{
Reason = reason;
}
}
}
#endif
#if NET35
namespace MathNet.Numerics
{
using System;
using System.Collections.Generic;
public class Tuple<T1, T2>
{
public T1 Item1 { get; set; }
public T2 Item2 { get; set; }
public Tuple(T1 Item1, T2 Item2)
{
this.Item1 = Item1;
this.Item2 = Item2;
}
}
public class Tuple<T1, T2, T3>
{
public T1 Item1 { get; set; }
public T2 Item2 { get; set; }
public T3 Item3 { get; set; }
public Tuple(T1 Item1, T2 Item2, T3 Item3)
{
this.Item1 = Item1;
this.Item2 = Item2;
this.Item3 = Item3;
}
}
public static class EnumerableExtensions
{
public static IEnumerable<T> Zip<TA, TB, T>(this IEnumerable<TA> seqA, IEnumerable<TB> seqB, Func<TA, TB, T> func)
{
if (seqA == null) throw new ArgumentNullException("seqA");
if (seqB == null) throw new ArgumentNullException("seqB");
return Zip35Deferred(seqA, seqB, func);
}
private static IEnumerable<T> Zip35Deferred<A, B, T>(IEnumerable<A> seqA, IEnumerable<B> seqB, Func<A, B, T> func)
{
using (var iteratorA = seqA.GetEnumerator())
using (var iteratorB = seqB.GetEnumerator())
{
while (iteratorA.MoveNext() && iteratorB.MoveNext())
{
yield return func(iteratorA.Current, iteratorB.Current);
}
}
}
}
}
#endif

6
src/Numerics/Complex64.cs

@ -698,7 +698,11 @@ namespace MathNet.Numerics
}
}
var value = GlobalizationHelper.ParseSingle(ref token);
#if PORTABLE
var value = GlobalizationHelper.ParseDouble(ref token);
#else
var value = GlobalizationHelper.ParseDouble(ref token, format.GetCultureInfo());
#endif
// handle suffix imaginary symbol
if (token != null && (String.Compare(token.Value, "i", StringComparison.OrdinalIgnoreCase) == 0

111
src/Numerics/Numerics-Net35.csproj

@ -0,0 +1,111 @@
<?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>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{E54E712D-EB6B-4FBF-B29A-6BB95E719BAC}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>MathNet.Numerics</RootNamespace>
<AssemblyName>MathNet.Numerics</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<UpgradeBackupLocation />
<IsWebBootstrapper>false</IsWebBootstrapper>
<TargetFrameworkProfile />
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<!-- Conditional Strong Name -->
<AssemblyOriginatorKeyFile>..\MathNet.Numerics.snk</AssemblyOriginatorKeyFile>
<SignAssembly Condition=" '$(SignAssembly)' == '' ">false</SignAssembly>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<OutputPath>..\..\out\lib\Net35\</OutputPath>
<IntermediateOutputPath>..\..\obj\lib\Net35\</IntermediateOutputPath>
<BaseIntermediateOutputPath>..\..\obj\lib\Net35\</BaseIntermediateOutputPath>
<DocumentationFile>..\..\out\lib\Net35\MathNet.Numerics.xml</DocumentationFile>
<!-- Conditional Strong Name: NO -->
<SignAssembly>false</SignAssembly>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<DefineConstants>TRACE;NET35;NOSYSNUMERICS</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<NoWarn>1591</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<OutputPath>..\..\out\lib-debug\Net35\</OutputPath>
<IntermediateOutputPath>..\..\obj\lib-debug\Net35\</IntermediateOutputPath>
<BaseIntermediateOutputPath>..\..\obj\lib-debug\Net35\</BaseIntermediateOutputPath>
<!-- Conditional Strong Name: NO -->
<SignAssembly>false</SignAssembly>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<DefineConstants>TRACE;DEBUG;NET35;NOSYSNUMERICS</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile />
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release-Signed|AnyCPU'">
<OutputPath>..\..\out\lib-signed\Net35\</OutputPath>
<IntermediateOutputPath>..\..\obj\lib-signed\Net35\</IntermediateOutputPath>
<BaseIntermediateOutputPath>..\..\obj\lib-signed\Net35\</BaseIntermediateOutputPath>
<DocumentationFile>..\..\out\lib-signed\Net35\MathNet.Numerics.xml</DocumentationFile>
<!-- Conditional Strong Name: YES -->
<SignAssembly>true</SignAssembly>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<Optimize>true</Optimize>
<DefineConstants>TRACE;NET35;NOSYSNUMERICS;STRONGNAME</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<NoWarn>1591</NoWarn>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Data" />
<Reference Include="System.Threading">
<HintPath>..\..\packages\TaskParallelLibrary.1.0.2856.0\lib\Net35\System.Threading.dll</HintPath>
</Reference>
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<Compile Include="**\*.cs" Exclude="Properties\Resources.Designer.cs">
</Compile>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

2
src/Numerics/Numerics.csproj

@ -406,7 +406,7 @@
<Compile Include="Random\WH1982.cs" />
<Compile Include="Random\WH2006.cs" />
<Compile Include="Random\Xorshift.cs" />
<Compile Include="PortableAttributes.cs" />
<Compile Include="Compatibility.cs" />
<Compile Include="Signals\SignalGenerator.Random.cs" />
<Compile Include="Signals\SignalGenerator.Chebyshev.cs" />
<Compile Include="Signals\SignalGenerator.Equidistant.cs" />

28
src/Numerics/PortableAttributes.cs

@ -1,28 +0,0 @@
#if PORTABLE
using System;
namespace MathNet.Numerics
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct)]
public class SerializableAttribute : Attribute
{
}
[AttributeUsage(AttributeTargets.Constructor | AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
public class TargetedPatchingOptOutAttribute : Attribute
{
public string Reason { get; private set; }
public TargetedPatchingOptOutAttribute(string reason)
{
Reason = reason;
}
}
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
public class SpecialNameAttribute : Attribute
{
}
}
#endif

2
src/Numerics/Properties/Resources.Designer.cs

@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18051
// Runtime Version:4.0.30319.34003
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.

2
src/Numerics/Random/SystemCrypto.cs

@ -101,7 +101,9 @@ namespace MathNet.Numerics.Random
public void Dispose()
{
#if !NET35
_random.Dispose();
#endif
}
}
}

16
src/Numerics/Threading/CommonParallel.cs

@ -33,12 +33,12 @@ namespace MathNet.Numerics.Threading
using System;
using System.Threading.Tasks;
#if !PORTABLE
using System.Collections.Concurrent;
using System.Collections.Generic;
#else
#if (PORTABLE || NET35)
using System.Linq;
using Properties;
#else
using System.Collections.Concurrent;
using System.Collections.Generic;
#endif
/// <summary>
@ -88,7 +88,7 @@ namespace MathNet.Numerics.Threading
return;
}
#if PORTABLE
#if (PORTABLE || NET35)
var tasks = new Task[Math.Min(maxDegreeOfParallelism, length/rangeSize)];
rangeSize = (toExclusive - fromInclusive)/tasks.Length;
@ -146,7 +146,7 @@ namespace MathNet.Numerics.Threading
}
// Common case
#if PORTABLE
#if (PORTABLE || NET35)
var tasks = new Task[actions.Length];
for (var i = 0; i < tasks.Length; i++)
{
@ -211,7 +211,7 @@ namespace MathNet.Numerics.Threading
return reduce(mapped);
}
#if PORTABLE
#if (PORTABLE || NET35)
var tasks = new Task<T>[Control.NumberOfParallelWorkerThreads];
var size = (toExclusive - fromInclusive) / tasks.Length;
@ -317,7 +317,7 @@ namespace MathNet.Numerics.Threading
return reduce(mapped);
}
#if PORTABLE
#if (PORTABLE || NET35)
var tasks = new Task<TOut>[Control.NumberOfParallelWorkerThreads];
var size = array.Length / tasks.Length;

4
src/Numerics/packages.config

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="TaskParallelLibrary" version="1.0.2856.0" targetFramework="net35" />
</packages>
Loading…
Cancel
Save