Browse Source

Build: simplify compilation symbols

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

5
src/FSharp/FSharp.fsproj

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

8
src/FSharpPortable/FSharpPortable.fsproj

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

2
src/Numerics/Complex32.cs

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

10
src/Numerics/Complex64.cs

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

6
src/Numerics/Numerics.csproj

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

Loading…
Cancel
Save