Browse Source

Build: simplify compilation symbols

pull/64/merge
Christoph Ruegg 14 years ago
parent
commit
513c33c90b
  1. 12
      src/FSharp/BigIntegerExtensions.fs
  2. 5
      src/FSharp/FSharp.fsproj
  3. 8
      src/FSharpPortable/FSharpPortable.fsproj
  4. 2
      src/Numerics/Complex32.cs
  5. 10
      src/Numerics/Complex64.cs
  6. 2
      src/Numerics/NumberTheory/IntegerTheory.Euclid.Big.cs
  7. 6
      src/Numerics/Numerics.csproj

12
src/FSharpPortable/BigIntegerExtensions.fs → src/FSharp/BigIntegerExtensions.fs

@ -2,8 +2,10 @@
open System
#if PORTABLE
[<AutoOpen>]
module BigIntegerExtensions =
module BigIntegerExtensions =
let private parse str =
let len = String.length str
@ -12,19 +14,21 @@ module BigIntegerExtensions =
acc
else
let c = str.[i]
let d = int c - int '0'
let d = int c - int '0'
if 0 <= d && d <= 9 then
build (10I * acc + (bigint d)) (i+1)
else
raise (new FormatException("The value could not be parsed"))
raise (new FormatException("The value could not be parsed"))
build 0I 0
type BigInteger with
static member Parse(text: string) =
let len = text.Length
let len = text.Length
if len = 0 then raise (new FormatException("The value could not be parsed"))
if text.[0..0] = "-" then
parse text.[1..len-1] |> bigint.Negate
else
parse text
#endif

5
src/FSharp/FSharp.fsproj

@ -19,7 +19,7 @@
<Optimize>false</Optimize>
<Tailcalls>false</Tailcalls>
<OutputPath>..\..\out\debug\Net40\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DefineConstants>TRACE;DEBUG</DefineConstants>
<WarningLevel>3</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
@ -38,7 +38,7 @@
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<Tailcalls>true</Tailcalls>
<DefineConstants>TRACE</DefineConstants>
<DefineConstants>TRACE;STRONGNAME</DefineConstants>
<WarningLevel>3</WarningLevel>
<DocumentationFile>..\..\out\lib\Net40\MathNet.Numerics.FSharp.xml</DocumentationFile>
<OutputPath>bin\Release-Signed\</OutputPath>
@ -59,6 +59,7 @@
<Compile Include="LinearAlgebra.Double.fs" />
<Compile Include="Complex.fsi" />
<Compile Include="Complex.fs" />
<Compile Include="BigIntegerExtensions.fs" />
<Compile Include="BigRational.fsi" />
<Compile Include="BigRational.fs" />
<Compile Include="RandomVariable.fs" />

8
src/FSharpPortable/FSharpPortable.fsproj

@ -19,7 +19,7 @@
<Optimize>false</Optimize>
<Tailcalls>false</Tailcalls>
<OutputPath>..\..\out\debug\Portable\</OutputPath>
<DefineConstants>TRACE;DEBUG;PORTABLE;FX_NO_BIGINT</DefineConstants>
<DefineConstants>TRACE;DEBUG;PORTABLE</DefineConstants>
<WarningLevel>3</WarningLevel>
<DocumentationFile>
</DocumentationFile>
@ -29,7 +29,7 @@
<Optimize>true</Optimize>
<Tailcalls>true</Tailcalls>
<OutputPath>..\..\out\lib\Portable\</OutputPath>
<DefineConstants>TRACE;PORTABLE;FX_NO_BIGINT</DefineConstants>
<DefineConstants>TRACE;PORTABLE</DefineConstants>
<WarningLevel>3</WarningLevel>
<DocumentationFile>..\..\out\lib\Portable\MathNet.Numerics.FSharp.XML</DocumentationFile>
</PropertyGroup>
@ -68,7 +68,9 @@
<Compile Include="..\FSharp\Complex.fs">
<Link>Complex.fs</Link>
</Compile>
<Compile Include="BigIntegerExtensions.fs" />
<Compile Include="..\FSharp\BigIntegerExtensions.fs">
<Link>BigIntegerExtensions.fs</Link>
</Compile>
<Compile Include="..\FSharp\BigRational.fsi">
<Link>BigRational.fsi</Link>
</Compile>

2
src/Numerics/Complex32.cs

@ -1199,7 +1199,7 @@ namespace MathNet.Numerics
return new Complex32(value, 0.0f);
}
#if SYSNUMERICS
#if !PORTABLE
/// <summary>
/// Implicit conversion of a BigInteger int to a <c>Complex32</c>.
/// </summary>

10
src/Numerics/Complex64.cs

@ -28,7 +28,7 @@
// OTHER DEALINGS IN THE SOFTWARE.
// </copyright>
#if !SYSNUMERICS
#if PORTABLE
namespace System.Numerics
{
using System;
@ -38,10 +38,6 @@ namespace System.Numerics
using MathNet.Numerics;
using MathNet.Numerics.Properties;
#if !PORTABLE
using System.Runtime;
#endif
/// <summary>
/// 64-bit double precision complex numbers class.
/// </summary>
@ -722,11 +718,7 @@ namespace System.Numerics
}
}
#if PORTABLE
var value = GlobalizationHelper.ParseSingle(ref token);
#else
var value = GlobalizationHelper.ParseSingle(ref token, format.GetCultureInfo());
#endif
// handle suffix imaginary symbol
if (token != null && (String.Compare(token.Value, "i", StringComparison.OrdinalIgnoreCase) == 0

2
src/Numerics/NumberTheory/IntegerTheory.Euclid.Big.cs

@ -28,7 +28,7 @@
// OTHER DEALINGS IN THE SOFTWARE.
// </copyright>
#if SYSNUMERICS
#if !PORTABLE
namespace MathNet.Numerics.NumberTheory
{
using System;

6
src/Numerics/Numerics.csproj

@ -43,7 +43,7 @@
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<DefineConstants>TRACE;DEBUG;SYSNUMERICS</DefineConstants>
<DefineConstants>TRACE;DEBUG</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>
@ -57,7 +57,7 @@
<SignAssembly>false</SignAssembly>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<DefineConstants>TRACE;SYSNUMERICS</DefineConstants>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
@ -70,7 +70,7 @@
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<Optimize>true</Optimize>
<DefineConstants>TRACE;SYSNUMERICS;STRONGNAME</DefineConstants>
<DefineConstants>TRACE;STRONGNAME</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>

Loading…
Cancel
Save