From 8ba423a8a6f011bb079f736497526ad44c88aad3 Mon Sep 17 00:00:00 2001 From: Christoph Ruegg Date: Wed, 24 Jan 2018 23:06:41 +0100 Subject: [PATCH] Build: rework and simplify compiler constants, bring native provider tests back --- MathNet.Numerics.sln | 24 + src/FSharp/AssemblyInfo.fs | 3 - src/FSharp/BigIntegerExtensions.fs | 7 - src/FSharp/BigRational.fs | 5 - src/FSharp/BigRational.fsi | 5 - src/FSharp/Compatibility.fs | 59 - src/FSharp/Complex.fs | 6 +- src/FSharp/FSharp.fsproj | 9 +- src/FSharp/Fit.fs | 2 +- src/FSharp/LinearAlgebra.Matrix.fs | 16 +- src/FSharp/LinearAlgebra.Vector.fs | 12 +- src/FSharp/Random.fs | 3 - src/FSharp/RandomVariable.fs | 5 - src/FSharpUnitTests/AssemblyInfo.fs | 3 - src/FSharpUnitTests/BigRationalTests.fs | 5 - src/FSharpUnitTests/FSharpUnitTests.fsproj | 3 - src/FSharpUnitTests/RandomVariableTests.fs | 5 - src/FSharpUnitTests/VectorTests.fs | 4 - src/Numerics/ArrayExtensions.cs | 6 +- src/Numerics/Compatibility.cs | 182 +-- src/Numerics/Complex32.cs | 19 +- src/Numerics/Complex64.cs | 1275 ----------------- src/Numerics/ComplexExtensions.cs | 19 +- .../FiniteDifferenceCoefficients.cs | 8 +- src/Numerics/Euclid.cs | 11 +- src/Numerics/ExcelFunctions.cs | 2 +- src/Numerics/Exceptions.cs | 12 +- src/Numerics/FindRoots.cs | 5 +- src/Numerics/Generate.cs | 9 +- src/Numerics/GlobalizationHelper.cs | 2 +- .../IntegralTransforms/Fourier.Bluestein.cs | 5 +- .../IntegralTransforms/Fourier.Naive.cs | 5 +- .../IntegralTransforms/Fourier.RadixN.cs | 5 +- src/Numerics/IntegralTransforms/Fourier.cs | 17 +- src/Numerics/LinearAlgebra/Builder.cs | 18 +- .../LinearAlgebra/Complex/DenseMatrix.cs | 5 - .../LinearAlgebra/Complex/DenseVector.cs | 7 +- .../LinearAlgebra/Complex/DiagonalMatrix.cs | 7 +- .../Complex/Factorization/Cholesky.cs | 5 - .../Complex/Factorization/DenseCholesky.cs | 7 +- .../Complex/Factorization/DenseEvd.cs | 7 +- .../Complex/Factorization/DenseGramSchmidt.cs | 7 +- .../Complex/Factorization/DenseLU.cs | 7 +- .../Complex/Factorization/DenseQR.cs | 7 +- .../Complex/Factorization/DenseSvd.cs | 7 +- .../Complex/Factorization/Evd.cs | 5 - .../Complex/Factorization/GramSchmidt.cs | 5 - .../LinearAlgebra/Complex/Factorization/LU.cs | 5 - .../LinearAlgebra/Complex/Factorization/QR.cs | 5 - .../Complex/Factorization/Svd.cs | 7 +- .../Complex/Factorization/UserCholesky.cs | 7 +- .../Complex/Factorization/UserEvd.cs | 7 +- .../Complex/Factorization/UserGramSchmidt.cs | 7 +- .../Complex/Factorization/UserLU.cs | 7 +- .../Complex/Factorization/UserQR.cs | 7 +- .../Complex/Factorization/UserSvd.cs | 7 +- src/Numerics/LinearAlgebra/Complex/Matrix.cs | 5 - .../LinearAlgebra/Complex/Solvers/BiCgStab.cs | 5 - .../Complex/Solvers/CompositeSolver.cs | 7 +- .../Complex/Solvers/DiagonalPreconditioner.cs | 5 - .../LinearAlgebra/Complex/Solvers/GpBiCg.cs | 5 - .../Complex/Solvers/ILU0Preconditioner.cs | 5 - .../Complex/Solvers/ILUTPPreconditioner.cs | 5 - .../Complex/Solvers/MILU0Preconditioner.cs | 5 - .../Complex/Solvers/MlkBiCgStab.cs | 5 - .../LinearAlgebra/Complex/Solvers/TFQMR.cs | 6 - .../LinearAlgebra/Complex/SparseMatrix.cs | 7 +- .../LinearAlgebra/Complex/SparseVector.cs | 7 +- src/Numerics/LinearAlgebra/Complex/Vector.cs | 5 - .../Complex32/Factorization/DenseEvd.cs | 5 - .../Complex32/Factorization/Evd.cs | 5 - .../Complex32/Factorization/UserEvd.cs | 5 +- .../Double/Factorization/DenseEvd.cs | 7 +- .../LinearAlgebra/Double/Factorization/Evd.cs | 5 - .../Double/Factorization/UserEvd.cs | 7 +- .../LinearAlgebra/Factorization/Evd.cs | 5 +- src/Numerics/LinearAlgebra/Matrix.BCL.cs | 4 +- src/Numerics/LinearAlgebra/Matrix.cs | 2 +- .../LinearAlgebra/MatrixExtensions.cs | 4 - .../Single/Factorization/DenseEvd.cs | 7 +- .../LinearAlgebra/Single/Factorization/Evd.cs | 7 +- .../Single/Factorization/UserEvd.cs | 5 +- .../LinearAlgebra/Solvers/SolverSetup.cs | 8 +- .../Storage/DenseColumnMajorMatrixStorage.cs | 2 +- .../LinearAlgebra/Storage/MatrixStorage.cs | 2 +- src/Numerics/LinearAlgebra/Vector.BCL.cs | 2 +- src/Numerics/LinearAlgebra/Vector.cs | 2 +- .../LinearAlgebra/VectorExtensions.cs | 4 - src/Numerics/Numerics.csproj | 104 +- src/Numerics/Permutation.cs | 14 +- src/Numerics/Precision.Equality.cs | 52 +- src/Numerics/Precision.cs | 4 - src/Numerics/Properties/AssemblyInfo.cs | 30 +- src/Numerics/Properties/Resources.Designer.cs | 236 +-- .../Common/Cuda/SafeNativeMethods.cs | 5 +- .../Providers/Common/Mkl/SafeNativeMethods.cs | 5 +- .../Providers/Common/NativeProviderLoader.cs | 5 +- .../Common/OpenBlas/SafeNativeMethods.cs | 5 +- .../IFourierTransformProvider.cs | 11 +- .../ManagedFourierTransformProvider.cs | 5 +- .../Mkl/MklFourierTransformProvider.cs | 5 +- .../Cuda/CudaLinearAlgebraProvider.Complex.cs | 5 +- .../LinearAlgebra/ILinearAlgebraProvider.cs | 6 +- .../ManagedLinearAlgebraProvider.Complex.cs | 6 +- .../ManagedLinearAlgebraProvider.Complex32.cs | 6 +- .../ManagedLinearAlgebraProvider.Double.cs | 6 +- .../ManagedLinearAlgebraProvider.Single.cs | 6 +- .../Mkl/MklLinearAlgebraProvider.Complex.cs | 5 +- .../Mkl/MklLinearAlgebraProvider.Complex32.cs | 5 +- .../Mkl/MklLinearAlgebraProvider.Double.cs | 5 +- .../Mkl/MklLinearAlgebraProvider.Single.cs | 5 +- .../OpenBlasLinearAlgebraProvider.Complex.cs | 5 +- ...OpenBlasLinearAlgebraProvider.Complex32.cs | 5 +- .../OpenBlasLinearAlgebraProvider.Double.cs | 5 +- .../OpenBlasLinearAlgebraProvider.Single.cs | 5 +- src/Numerics/Random/CryptoRandomSource.cs | 16 +- src/Numerics/Random/Mcg31m1.cs | 4 +- src/Numerics/Random/Mcg59.cs | 4 +- src/Numerics/Random/MersenneTwister.cs | 27 +- src/Numerics/Random/Mrg32k3a.cs | 6 +- src/Numerics/Random/Palf.cs | 2 +- src/Numerics/Random/RandomSeed.cs | 9 - src/Numerics/Random/SystemRandomSource.cs | 26 +- src/Numerics/Random/WH1982.cs | 4 +- src/Numerics/Random/WH2006.cs | 4 +- src/Numerics/Random/Xorshift.cs | 2 +- src/Numerics/RootFinding/Cubic.cs | 5 +- src/Numerics/Sorting.cs | 4 - src/Numerics/SpecialFunctions/Evaluate.cs | 3 - src/Numerics/SpecialFunctions/Factorial.cs | 7 +- src/Numerics/SpecialFunctions/Stability.cs | 3 - .../Statistics/ArrayStatistics.Complex.cs | 24 +- .../Statistics/ArrayStatistics.Single.cs | 4 - src/Numerics/Statistics/ArrayStatistics.cs | 4 - src/Numerics/Statistics/Histogram.cs | 2 +- .../SortedArrayStatistics.Single.cs | 4 - .../Statistics/SortedArrayStatistics.cs | 4 - src/Numerics/Statistics/Statistics.cs | 15 +- .../Statistics/StreamingStatistics.cs | 23 +- src/Numerics/Threading/CommonParallel.cs | 14 +- src/Numerics/Trigonometry.cs | 25 +- src/TestData/Data.cs | 2 +- src/TestData/Properties/AssemblyInfo.cs | 17 - src/TestData/TestData.csproj | 5 +- src/UnitTests/ArrayHelpers.cs | 8 +- src/UnitTests/AssertHelpers.cs | 7 +- .../Complex32Test.TextHandling.cs | 4 - src/UnitTests/ComplexTests/Complex32Test.cs | 7 +- .../ComplexTests/ComplexTest.TextHandling.cs | 9 +- src/UnitTests/ComplexTests/ComplexTest.cs | 7 +- .../EuclidTests/GcdRelatedTestBigInteger.cs | 10 - src/UnitTests/GenerateTests.cs | 10 +- src/UnitTests/GenericMath.cs | 4 +- .../IntegralTransformsTests/FourierTest.cs | 6 +- .../IntegralTransformsTests/HartleyTest.cs | 6 +- .../InverseTransformTest.cs | 6 +- .../MatchingNaiveTransformTest.cs | 6 +- .../ParsevalTheoremTest.cs | 6 +- .../InterpolationTests/CubicSplineTest.cs | 3 - .../Complex/DenseMatrixTests.cs | 4 - .../Complex/DenseVectorTests.cs | 4 - .../Complex/DiagonalMatrixTests.cs | 4 - .../Complex/Factorization/CholeskyTests.cs | 6 +- .../Complex/Factorization/EvdTests.cs | 4 - .../Complex/Factorization/GramSchmidtTests.cs | 4 - .../Complex/Factorization/LUTests.cs | 4 - .../Complex/Factorization/QRTests.cs | 4 - .../Complex/Factorization/SvdTests.cs | 4 - .../Factorization/UserCholeskyTests.cs | 4 - .../Complex/Factorization/UserEvdTests.cs | 4 - .../Factorization/UserGramSchmidtTests.cs | 4 - .../Complex/Factorization/UserLUTests.cs | 4 - .../Complex/Factorization/UserQRTests.cs | 4 - .../Complex/Factorization/UserSvdTests.cs | 4 - .../Complex/MatrixLoader.cs | 4 - .../Complex/MatrixStructureTheory.cs | 4 - .../Complex/MatrixTests.Arithmetic.cs | 4 - .../Complex/ReturnTypeTests.cs | 4 - .../Complex/Solvers/Iterative/BiCgStabTest.cs | 5 - .../Complex/Solvers/Iterative/GpBiCgTest.cs | 5 - .../Solvers/Iterative/MlkBiCgStabTest.cs | 5 - .../Complex/Solvers/Iterative/TFQMRTest.cs | 5 - .../Complex/Solvers/IteratorTest.cs | 5 - .../Solvers/Preconditioners/DiagonalTest.cs | 5 - .../Preconditioners/IluptElementSorterTest.cs | 4 - .../Solvers/Preconditioners/IlutpTest.cs | 7 +- .../Preconditioners/IncompleteLUTest.cs | 7 +- .../Preconditioners/PreConditionerTest.cs | 5 - .../Preconditioners/UnitPreconditionerTest.cs | 5 - .../DivergenceStopCriteriumTest.cs | 5 - .../StopCriterion/FailureStopCriteriumTest.cs | 5 - .../IterationCountStopCriteriumTest.cs | 5 - .../ResidualStopCriteriumTest.cs | 5 - .../Complex/SparseMatrixTests.cs | 4 - .../Complex/SparseVectorTest.cs | 4 - .../LinearAlgebraTests/Complex/TestData.cs | 4 - .../Complex/UserDefinedMatrix.cs | 6 +- .../Complex/UserDefinedMatrixTests.cs | 4 - .../Complex/UserDefinedVector.cs | 4 - .../Complex/UserDefinedVectorTests.cs | 4 - .../Complex/VectorArithmeticTheory.cs | 4 - .../Complex/VectorTests.Arithmetic.cs | 4 - .../Complex/VectorTests.Norm.cs | 4 - .../LinearAlgebraTests/Complex/VectorTests.cs | 6 +- .../Complex32/Factorization/EvdTests.cs | 5 - .../Complex32/Factorization/UserEvdTests.cs | 5 - .../Solvers/Preconditioners/IlutpTest.cs | 2 +- .../Preconditioners/IncompleteLUTest.cs | 2 +- .../Complex32/VectorTests.cs | 2 +- .../Double/Factorization/EvdTests.cs | 4 - .../Double/Factorization/UserEvdTests.cs | 4 - .../Solvers/Preconditioners/IlutpTest.cs | 2 +- .../Preconditioners/IncompleteLUTest.cs | 2 +- .../LinearAlgebraTests/Double/VectorTests.cs | 2 +- .../LinearAlgebraTests/MatrixHelpers.cs | 4 - .../MatrixStorageSerializationTests.cs | 4 - .../MatrixStructureTheory.cs | 2 +- .../Single/Factorization/EvdTests.cs | 4 - .../Single/Factorization/UserEvdTests.cs | 4 - .../Solvers/Preconditioners/IlutpTest.cs | 2 +- .../Preconditioners/IncompleteLUTest.cs | 2 +- .../LinearAlgebraTests/Single/VectorTests.cs | 2 +- .../VectorStorageSerializationTests.cs | 4 - .../OptimizationTests/NewtonMinimizerTests.cs | 2 - .../FourierTransformProviderTests.cs | 7 +- .../Complex/LinearAlgebraProviderTests.cs | 6 +- .../Complex32/LinearAlgebraProviderTests.cs | 2 +- .../Double/LinearAlgebraProviderTests.cs | 2 +- .../Single/LinearAlgebraProviderTests.cs | 2 +- .../Random/CryptoRandomSourceTests.cs | 4 - .../Random/RandomSerializationTests.cs | 11 +- src/UnitTests/Random/RandomTests.cs | 4 +- .../RootFindingTests/FindRootsTest.cs | 8 +- .../StatisticsTests/CorrelationTests.cs | 2 - .../DescriptiveStatisticsTests.cs | 2 - src/UnitTests/TrigonometryTest.cs | 7 +- src/UnitTests/UnitTests-CUDA.csproj | 99 +- .../UnitTests-CUDA.csproj.paket.references | 1 - src/UnitTests/UnitTests-MKL.csproj | 99 +- .../UnitTests-MKL.csproj.paket.references | 1 - src/UnitTests/UnitTests-OpenBLAS.csproj | 99 +- ...UnitTests-OpenBLAS.csproj.paket.references | 1 - ...tTests-Portable259.csproj.paket.references | 1 - ...tTests-Portable328.csproj.paket.references | 1 - ...itTests-Portable47.csproj.paket.references | 1 - ...nitTests-Portable7.csproj.paket.references | 1 - ...itTests-Portable78.csproj.paket.references | 1 - src/UnitTests/UnitTests.csproj | 5 +- src/UnitTests/UseLinearAlgebraProvider.cs | 4 +- ...proj.paket.references => paket.references} | 0 250 files changed, 502 insertions(+), 3128 deletions(-) delete mode 100644 src/FSharp/Compatibility.fs delete mode 100644 src/Numerics/Complex64.cs delete mode 100644 src/UnitTests/UnitTests-CUDA.csproj.paket.references delete mode 100644 src/UnitTests/UnitTests-MKL.csproj.paket.references delete mode 100644 src/UnitTests/UnitTests-OpenBLAS.csproj.paket.references delete mode 100644 src/UnitTests/UnitTests-Portable259.csproj.paket.references delete mode 100644 src/UnitTests/UnitTests-Portable328.csproj.paket.references delete mode 100644 src/UnitTests/UnitTests-Portable47.csproj.paket.references delete mode 100644 src/UnitTests/UnitTests-Portable7.csproj.paket.references delete mode 100644 src/UnitTests/UnitTests-Portable78.csproj.paket.references rename src/UnitTests/{UnitTests.csproj.paket.references => paket.references} (100%) diff --git a/MathNet.Numerics.sln b/MathNet.Numerics.sln index 92cfb47f..8350ee7f 100644 --- a/MathNet.Numerics.sln +++ b/MathNet.Numerics.sln @@ -35,6 +35,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{B54A0B40 EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestData", "src/TestData/TestData.csproj", "{AF3253C9-4DB5-45A0-98CF-C105FDA9DA47}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTests-MKL", "src/UnitTests/UnitTests-MKL.csproj", "{0F171596-CDE9-4197-A8B2-07C406814CE3}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTests-OpenBLAS", "src/UnitTests/UnitTests-OpenBLAS.csproj", "{9C4A3651-3C4D-405A-8D25-503E04A1B459}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTests-CUDA", "src/UnitTests/UnitTests-CUDA.csproj", "{E184F219-F9F9-4396-AE0A-B431375CF06F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -72,6 +78,24 @@ Global {AF3253C9-4DB5-45A0-98CF-C105FDA9DA47}.Release|Any CPU.Build.0 = Release|Any CPU {AF3253C9-4DB5-45A0-98CF-C105FDA9DA47}.Release-Signed|Any CPU.ActiveCfg = Release|Any CPU {AF3253C9-4DB5-45A0-98CF-C105FDA9DA47}.Release-Signed|Any CPU.Build.0 = Release|Any CPU + {0F171596-CDE9-4197-A8B2-07C406814CE3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0F171596-CDE9-4197-A8B2-07C406814CE3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0F171596-CDE9-4197-A8B2-07C406814CE3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0F171596-CDE9-4197-A8B2-07C406814CE3}.Release|Any CPU.Build.0 = Release|Any CPU + {0F171596-CDE9-4197-A8B2-07C406814CE3}.Release-Signed|Any CPU.ActiveCfg = Debug|Any CPU + {0F171596-CDE9-4197-A8B2-07C406814CE3}.Release-Signed|Any CPU.Build.0 = Debug|Any CPU + {9C4A3651-3C4D-405A-8D25-503E04A1B459}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9C4A3651-3C4D-405A-8D25-503E04A1B459}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9C4A3651-3C4D-405A-8D25-503E04A1B459}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9C4A3651-3C4D-405A-8D25-503E04A1B459}.Release|Any CPU.Build.0 = Release|Any CPU + {9C4A3651-3C4D-405A-8D25-503E04A1B459}.Release-Signed|Any CPU.ActiveCfg = Debug|Any CPU + {9C4A3651-3C4D-405A-8D25-503E04A1B459}.Release-Signed|Any CPU.Build.0 = Debug|Any CPU + {E184F219-F9F9-4396-AE0A-B431375CF06F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E184F219-F9F9-4396-AE0A-B431375CF06F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E184F219-F9F9-4396-AE0A-B431375CF06F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E184F219-F9F9-4396-AE0A-B431375CF06F}.Release|Any CPU.Build.0 = Release|Any CPU + {E184F219-F9F9-4396-AE0A-B431375CF06F}.Release-Signed|Any CPU.ActiveCfg = Debug|Any CPU + {E184F219-F9F9-4396-AE0A-B431375CF06F}.Release-Signed|Any CPU.Build.0 = Debug|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/FSharp/AssemblyInfo.fs b/src/FSharp/AssemblyInfo.fs index f2c4743d..4cd360ee 100644 --- a/src/FSharp/AssemblyInfo.fs +++ b/src/FSharp/AssemblyInfo.fs @@ -48,10 +48,7 @@ open System.Runtime.InteropServices [] [] -#if PORTABLE || NETSTANDARD -#else [] [] -#endif () diff --git a/src/FSharp/BigIntegerExtensions.fs b/src/FSharp/BigIntegerExtensions.fs index 70a04705..fc2df821 100644 --- a/src/FSharp/BigIntegerExtensions.fs +++ b/src/FSharp/BigIntegerExtensions.fs @@ -1,9 +1,5 @@ namespace System.Numerics -#if PORTABLE || NETSTANDARD -#if NOSYSNUMERICS -#else - open System [] @@ -30,6 +26,3 @@ module BigIntegerExtensions = -(parseImpl str len 0I 1) else parseImpl str len 0I 0 - -#endif -#endif diff --git a/src/FSharp/BigRational.fs b/src/FSharp/BigRational.fs index 725e2e0b..b0b71645 100644 --- a/src/FSharp/BigRational.fs +++ b/src/FSharp/BigRational.fs @@ -7,9 +7,6 @@ namespace MathNet.Numerics -#if NOSYSNUMERICS -#else - open System open System.Numerics open System.Globalization @@ -499,5 +496,3 @@ module NumericLiteralN = type BigNum = BigRational // type bignum = BigRational - -#endif diff --git a/src/FSharp/BigRational.fsi b/src/FSharp/BigRational.fsi index d22711b2..19eba6e2 100644 --- a/src/FSharp/BigRational.fsi +++ b/src/FSharp/BigRational.fsi @@ -6,9 +6,6 @@ namespace MathNet.Numerics -#if NOSYSNUMERICS -#else - open System open System.Numerics @@ -79,5 +76,3 @@ module NumericLiteralN = type BigNum = BigRational type bignum = BigRational - -#endif diff --git a/src/FSharp/Compatibility.fs b/src/FSharp/Compatibility.fs deleted file mode 100644 index 8de8f9aa..00000000 --- a/src/FSharp/Compatibility.fs +++ /dev/null @@ -1,59 +0,0 @@ -// -// Math.NET Numerics, part of the Math.NET Project -// http://numerics.mathdotnet.com -// http://github.com/mathnet/mathnet-numerics -// -// Copyright (c) 2009-2014 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. -// - -namespace MathNet.Numerics - -[] -module internal Compatibility = - -#if NET35 - - let inline internal properTuple2 (tuple: MathNet.Numerics.Tuple<'a,'b>) = tuple.Item1, tuple.Item2 - let inline internal properTuple3 (tuple: MathNet.Numerics.Tuple<'a,'b,'c>) = tuple.Item1, tuple.Item2, tuple.Item3 - let inline internal internalTuple2 ((a,b): ('a * 'b)) = MathNet.Numerics.Tuple<'a,'b>(a, b) - let inline internal internalTuple3 ((a,b,c): ('a * 'b * 'c)) = MathNet.Numerics.Tuple<'a,'b,'c>(a, b, c) - - let inline internal properTuple2Seq x = x |> Seq.map properTuple2 - let inline internal properTuple3Seq x = x |> Seq.map properTuple3 - let inline internal internalTuple2Seq x = x |> Seq.map internalTuple2 - let inline internal internalTuple3Seq x = x |> Seq.map internalTuple3 - -#else - - let inline internal properTuple2 x = x - let inline internal properTuple3 x = x - let inline internal internalTuple2 x = x - let inline internal internalTuple3 x = x - - let inline internal properTuple2Seq x = x - let inline internal properTuple3Seq x = x - let inline internal internalTuple2Seq x = x - let inline internal internalTuple3Seq x = x - -#endif diff --git a/src/FSharp/Complex.fs b/src/FSharp/Complex.fs index 1581a970..fab8b2e4 100644 --- a/src/FSharp/Complex.fs +++ b/src/FSharp/Complex.fs @@ -6,12 +6,8 @@ namespace MathNet.Numerics open Microsoft.FSharp.Math open System -open System.Globalization - -#if NOSYSNUMERICS -#else open System.Numerics -#endif +open System.Globalization // type complex = Complex diff --git a/src/FSharp/FSharp.fsproj b/src/FSharp/FSharp.fsproj index bbe6fcd7..9bc26046 100644 --- a/src/FSharp/FSharp.fsproj +++ b/src/FSharp/FSharp.fsproj @@ -40,18 +40,11 @@ All: code quality fixes ~Jonas Nyrup false 2003 - - NETSTANDARD - - - NETSTANDARD - - @@ -71,4 +64,4 @@ All: code quality fixes ~Jonas Nyrup - + \ No newline at end of file diff --git a/src/FSharp/Fit.fs b/src/FSharp/Fit.fs index b18baf2b..9aec4a93 100644 --- a/src/FSharp/Fit.fs +++ b/src/FSharp/Fit.fs @@ -41,7 +41,7 @@ module Fit = /// Least-Squares fitting the points (x,y) to a line y : x -> a+b*x, /// returning its best fitting parameters as (a, b) tuple. - let line x y = Fit.Line(x,y) |> properTuple2 + let line x y = Fit.Line(x,y) /// Least-Squares fitting the points (x,y) to a line y : x -> a+b*x, /// returning a function y' for the best fitting line. diff --git a/src/FSharp/LinearAlgebra.Matrix.fs b/src/FSharp/LinearAlgebra.Matrix.fs index 822640db..3c343b3c 100644 --- a/src/FSharp/LinearAlgebra.Matrix.fs +++ b/src/FSharp/LinearAlgebra.Matrix.fs @@ -52,25 +52,25 @@ module Matrix = let inline toSeq (m: #Matrix<_>) = m.Enumerate(Zeros.Include) /// Transform a matrix into an indexed sequence. - let inline toSeqi (m: #Matrix<_>) = m.EnumerateIndexed(Zeros.Include) |> properTuple3Seq + let inline toSeqi (m: #Matrix<_>) = m.EnumerateIndexed(Zeros.Include) /// Transform a matrix into a sequence where zero-values are skipped. Skipping zeros is efficient on sparse data. let inline toSeqSkipZeros (m: #Matrix<_>) = m.Enumerate(Zeros.AllowSkip) /// Transform a matrix into an indexed sequence where zero-values are skipped. Skipping zeros is efficient on sparse data. - let inline toSeqiSkipZeros (m: #Matrix<_>) = m.EnumerateIndexed(Zeros.AllowSkip) |> properTuple3Seq + let inline toSeqiSkipZeros (m: #Matrix<_>) = m.EnumerateIndexed(Zeros.AllowSkip) /// Transform a matrix into a column sequence. let inline toColSeq (m: #Matrix<_>) = m.EnumerateColumns() /// Transform a matrix into an indexed column sequence. - let inline toColSeqi (m: #Matrix<_>) = m.EnumerateColumnsIndexed() |> properTuple2Seq + let inline toColSeqi (m: #Matrix<_>) = m.EnumerateColumnsIndexed() /// Transform a matrix into a row sequence. let inline toRowSeq (m: #Matrix<_>) = m.EnumerateRows() /// Transform a matrix into an indexed row sequence. - let inline toRowSeqi (m: #Matrix<_>) = m.EnumerateRowsIndexed() |> properTuple2Seq + let inline toRowSeqi (m: #Matrix<_>) = m.EnumerateRowsIndexed() /// Applies a function to all elements of the matrix. @@ -475,10 +475,10 @@ module DenseMatrix = let inline ofColumnSeq2 (rows: int) (cols: int) (seqOfCols: #seq>) = Matrix<'T>.Build.DenseOfColumns(rows, cols, seqOfCols) /// Create a matrix with a given dimension from an indexed list of row, column, value tuples. - let inline ofListi (rows: int) (cols: int) (indexed: list) = Matrix<'T>.Build.DenseOfIndexed(rows, cols, Seq.ofList indexed |> internalTuple3Seq) + let inline ofListi (rows: int) (cols: int) (indexed: list) = Matrix<'T>.Build.DenseOfIndexed(rows, cols, Seq.ofList indexed) /// Create a matrix with a given dimension from an indexed sequences of row, column, value tuples. - let inline ofSeqi (rows: int) (cols: int) (indexed: #seq) = Matrix<'T>.Build.DenseOfIndexed(rows, cols, indexed |> internalTuple3Seq) + let inline ofSeqi (rows: int) (cols: int) (indexed: #seq) = Matrix<'T>.Build.DenseOfIndexed(rows, cols, indexed) /// Create a square matrix with the vector elements on the diagonal. let inline ofDiag (v: Vector<'T>) = Matrix<'T>.Build.DenseOfDiagonalVector(v) @@ -579,10 +579,10 @@ module SparseMatrix = let inline ofColumnSeq2 (rows: int) (cols: int) (seqOfCols: #seq>) = Matrix<'T>.Build.SparseOfColumns(rows, cols, seqOfCols) /// Create a matrix with a given dimension from an indexed list of row, column, value tuples. - let inline ofListi (rows: int) (cols: int) (indexed: list) = Matrix<'T>.Build.SparseOfIndexed(rows, cols, Seq.ofList indexed |> internalTuple3Seq) + let inline ofListi (rows: int) (cols: int) (indexed: list) = Matrix<'T>.Build.SparseOfIndexed(rows, cols, Seq.ofList indexed) /// Create a matrix with a given dimension from an indexed sequences of row, column, value tuples. - let inline ofSeqi (rows: int) (cols: int) (indexed: #seq) = Matrix<'T>.Build.SparseOfIndexed(rows, cols, indexed |> internalTuple3Seq) + let inline ofSeqi (rows: int) (cols: int) (indexed: #seq) = Matrix<'T>.Build.SparseOfIndexed(rows, cols, indexed) /// Create a square matrix with the vector elements on the diagonal. let inline ofDiag (v: Vector<'T>) = Matrix<'T>.Build.SparseOfDiagonalVector(v) diff --git a/src/FSharp/LinearAlgebra.Vector.fs b/src/FSharp/LinearAlgebra.Vector.fs index 90951e00..353884fd 100644 --- a/src/FSharp/LinearAlgebra.Vector.fs +++ b/src/FSharp/LinearAlgebra.Vector.fs @@ -49,13 +49,13 @@ module Vector = let inline toSeq (v: #Vector<_>) = v.Enumerate(Zeros.Include) /// Transform a vector into an indexed sequence. - let inline toSeqi (v: #Vector<_>) = v.EnumerateIndexed(Zeros.Include) |> properTuple2Seq + let inline toSeqi (v: #Vector<_>) = v.EnumerateIndexed(Zeros.Include) /// Transform a vector into a sequence where zero-values are skipped. Skipping zeros is efficient on sparse data. let inline toSeqSkipZeros (v: #Vector<_>) = v.Enumerate(Zeros.AllowSkip) /// Transform a vector into an indexed sequence where zero-values are skipped. Skipping zeros is efficient on sparse data. - let inline toSeqiSkipZeros (v: #Vector<_>) = v.EnumerateIndexed(Zeros.AllowSkip) |> properTuple2Seq + let inline toSeqiSkipZeros (v: #Vector<_>) = v.EnumerateIndexed(Zeros.AllowSkip) /// Applies a function to all elements of the vector. @@ -279,10 +279,10 @@ module DenseVector = let inline ofSeq (fs: #seq<'T>) = Vector<'T>.Build.DenseOfEnumerable(fs) /// Create a vector with a given dimension from an indexed list of index, value pairs. - let inline ofListi (n: int) (fl: list) = Vector<'T>.Build.DenseOfIndexed(n, Seq.ofList fl |> internalTuple2Seq) + let inline ofListi (n: int) (fl: list) = Vector<'T>.Build.DenseOfIndexed(n, Seq.ofList fl) /// Create a vector with a given dimension from an indexed sequences of index, value pairs. - let inline ofSeqi (n: int) (fs: #seq) = Vector<'T>.Build.DenseOfIndexed(n, fs |> internalTuple2Seq) + let inline ofSeqi (n: int) (fs: #seq) = Vector<'T>.Build.DenseOfIndexed(n, fs) /// Create a vector with integer entries in the given range. let inline range (start: int) (step: int) (stop: int) = raw [| for i in start..step..stop -> float i |] @@ -318,10 +318,10 @@ module SparseVector = let inline ofSeq (fs: #seq<'T>) = Vector<'T>.Build.SparseOfEnumerable(fs) /// Create a sparse vector with a given dimension from an indexed list of index, value pairs. - let inline ofListi (n: int) (fl: list) = Vector<'T>.Build.SparseOfIndexed(n, Seq.ofList fl |> internalTuple2Seq) + let inline ofListi (n: int) (fl: list) = Vector<'T>.Build.SparseOfIndexed(n, Seq.ofList fl) /// Create a sparse vector with a given dimension from an indexed sequence of index, value pairs. - let inline ofSeqi (n: int) (fs: #seq) = Vector<'T>.Build.SparseOfIndexed(n, fs |> internalTuple2Seq) + let inline ofSeqi (n: int) (fs: #seq) = Vector<'T>.Build.SparseOfIndexed(n, fs) /// Module that contains implementation of useful F#-specific extension members for generic vectors diff --git a/src/FSharp/Random.fs b/src/FSharp/Random.fs index ebd5a6c4..5998baee 100644 --- a/src/FSharp/Random.fs +++ b/src/FSharp/Random.fs @@ -49,14 +49,11 @@ module Random = let inline system () = SystemRandomSource() :> System.Random let inline systemSeed (seed:int) = SystemRandomSource(seed) :> System.Random -#if PORTABLE || NETSTANDARD -#else /// Creates a default .Net cryptographic system pRNG let inline crypto () = new CryptoRandomSource() :> System.Random let inline cryptoWith (threadSafe:bool) = new CryptoRandomSource(threadSafe) :> System.Random let inline cryptoDoubles (length:int) = CryptoRandomSource.Doubles(length) let inline cryptoDoubleSeq () = CryptoRandomSource.DoubleSequence() -#endif /// Creates a Mersenne Twister 19937 pRNG with a robust seed let mersenneTwisterShared = MersenneTwister.Default :> System.Random diff --git a/src/FSharp/RandomVariable.fs b/src/FSharp/RandomVariable.fs index a0113850..352b7ff4 100644 --- a/src/FSharp/RandomVariable.fs +++ b/src/FSharp/RandomVariable.fs @@ -2,9 +2,6 @@ #nowarn "40" -#if NOSYSNUMERICS -#else - open System open System.Collections open System.Collections.Generic @@ -96,5 +93,3 @@ module RandomVariable = |> map (fst >> List.rev) let remove items = Seq.filter (fun v -> Seq.forall ((<>) v) items) - -#endif diff --git a/src/FSharpUnitTests/AssemblyInfo.fs b/src/FSharpUnitTests/AssemblyInfo.fs index 68e2d7a8..0add45c2 100644 --- a/src/FSharpUnitTests/AssemblyInfo.fs +++ b/src/FSharpUnitTests/AssemblyInfo.fs @@ -14,10 +14,7 @@ open System.Runtime.InteropServices [] [] -#if PORTABLE || NETSTANDARD -#else [] [] -#endif () diff --git a/src/FSharpUnitTests/BigRationalTests.fs b/src/FSharpUnitTests/BigRationalTests.fs index 50141c3c..1c278958 100644 --- a/src/FSharpUnitTests/BigRationalTests.fs +++ b/src/FSharpUnitTests/BigRationalTests.fs @@ -3,9 +3,6 @@ namespace MathNet.Numerics.Tests -#if NOSYSNUMERICS -#else - open MathNet.Numerics open NUnit.Framework open System @@ -648,5 +645,3 @@ type BigNumType() = Assert.AreEqual(g_positive1.Numerator, g_bigintpositive) Assert.AreEqual(g_negative1.Numerator, g_bigintnegative) Assert.AreEqual(0N.Numerator, 0I) - -#endif diff --git a/src/FSharpUnitTests/FSharpUnitTests.fsproj b/src/FSharpUnitTests/FSharpUnitTests.fsproj index a2085f65..1be53fc3 100644 --- a/src/FSharpUnitTests/FSharpUnitTests.fsproj +++ b/src/FSharpUnitTests/FSharpUnitTests.fsproj @@ -9,9 +9,6 @@ false 44;2003 - - NETSTANDARD - diff --git a/src/FSharpUnitTests/RandomVariableTests.fs b/src/FSharpUnitTests/RandomVariableTests.fs index 84707eb5..8d220743 100644 --- a/src/FSharpUnitTests/RandomVariableTests.fs +++ b/src/FSharpUnitTests/RandomVariableTests.fs @@ -1,8 +1,5 @@ module MathNet.Numerics.Tests.RandomVariableTests -#if NOSYSNUMERICS -#else - open NUnit.Framework open FsUnitTyped @@ -81,5 +78,3 @@ let ``When switching in a MontyHall situation, the chances to win should be 2/3` |> RandomVariable.filter ((=) Car) |> RandomVariable.probability |> shouldEqual (2N/3N) - -#endif diff --git a/src/FSharpUnitTests/VectorTests.fs b/src/FSharpUnitTests/VectorTests.fs index 6c55127b..5fd3de5e 100644 --- a/src/FSharpUnitTests/VectorTests.fs +++ b/src/FSharpUnitTests/VectorTests.fs @@ -28,9 +28,6 @@ module VectorTests = largev.[97..] |> shouldEqual (DenseVector.raw [|0.97;0.98;0.99|]) largev.[..4] |> shouldEqual (DenseVector.raw [|0.00;0.01;0.02;0.03;0.04|]) -#if NOFSSLICESET1D -#else -// Vector SetSlice does not work properly in VisualStudio 2013 RTM [] let ``Vector.SetSlice`` () = let v = smallv.Clone() in @@ -48,7 +45,6 @@ module VectorTests = let v = smallv.Clone() in v.[..2] <- vector [7.0;8.0;9.0]; v |> shouldEqual (DenseVector.raw [|7.0;8.0;9.0;0.3;0.3|]) -#endif [] let ``Vector.toArray`` () = diff --git a/src/Numerics/ArrayExtensions.cs b/src/Numerics/ArrayExtensions.cs index 11a9e190..5284b653 100644 --- a/src/Numerics/ArrayExtensions.cs +++ b/src/Numerics/ArrayExtensions.cs @@ -28,14 +28,10 @@ // using System; +using System.Numerics; namespace MathNet.Numerics { - -#if !NOSYSNUMERICS - using Complex = System.Numerics.Complex; -#endif - /// /// Useful extension methods for Arrays. /// diff --git a/src/Numerics/Compatibility.cs b/src/Numerics/Compatibility.cs index a0135350..3ad83d17 100644 --- a/src/Numerics/Compatibility.cs +++ b/src/Numerics/Compatibility.cs @@ -1,4 +1,4 @@ -#if PORTABLE || NETSTANDARD +#if NETSTANDARD1_3 namespace MathNet.Numerics { using System; @@ -139,7 +139,7 @@ namespace MathNet.Numerics } #endif -#if (PORTABLE || NET35 || NETSTANDARD) +#if NETSTANDARD1_3 namespace MathNet.Numerics { using System; @@ -156,181 +156,3 @@ namespace MathNet.Numerics } } #endif - -#if NET35 -namespace MathNet.Numerics -{ - using System; - using System.Collections.Concurrent; - using System.Collections.Generic; - - internal static class ObjectComparer - { - internal static int Compare(T a, T b) - { - if (ReferenceEquals(a, null)) return -1; - if (ReferenceEquals(b, null)) return 1; - if (Equals(a, b)) return 0; - return Comparer.Default.Compare(a, b); - } - } - - public class Tuple : IComparable, IComparable> - { - public T1 Item1 { get; set; } - public T2 Item2 { get; set; } - - public Tuple(T1 item1, T2 item2) - { - Item1 = item1; - Item2 = item2; - } - - public int CompareTo(object obj) - { - if (obj == null) return 1; - var other = obj as Tuple; - if (other == null) throw new ArgumentException(); - return CompareTo(other); - } - - public int CompareTo(Tuple other) - { - if (other == null) return 1; - int a = ObjectComparer.Compare(Item1, other.Item1); - return a != 0 ? a : ObjectComparer.Compare(Item2, other.Item2); - } - } - - public class Tuple : IComparable, IComparable> - { - public T1 Item1 { get; set; } - public T2 Item2 { get; set; } - public T3 Item3 { get; set; } - - public Tuple(T1 item1, T2 item2, T3 item3) - { - Item1 = item1; - Item2 = item2; - Item3 = item3; - } - - public int CompareTo(object obj) - { - if (obj == null) return 1; - var other = obj as Tuple; - if (other == null) throw new ArgumentException(); - return CompareTo(other); - } - - public int CompareTo(Tuple other) - { - if (other == null) return 1; - int a = ObjectComparer.Compare(Item1, other.Item1); - if (a != 0) return a; - int b = ObjectComparer.Compare(Item2, other.Item2); - return b != 0 ? b : ObjectComparer.Compare(Item3, other.Item3); - } - } - - public class Tuple : IComparable, IComparable> - { - public T1 Item1 { get; set; } - public T2 Item2 { get; set; } - public T3 Item3 { get; set; } - public T4 Item4 { get; set; } - - public Tuple(T1 item1, T2 item2, T3 item3, T4 item4) - { - Item1 = item1; - Item2 = item2; - Item3 = item3; - Item4 = item4; - } - - public int CompareTo(object obj) - { - if (obj == null) return 1; - var other = obj as Tuple; - if (other == null) throw new ArgumentException(); - return CompareTo(other); - } - - public int CompareTo(Tuple other) - { - if (other == null) return 1; - int a = ObjectComparer.Compare(Item1, other.Item1); - if (a != 0) return a; - int b = ObjectComparer.Compare(Item2, other.Item2); - if (b != 0) return b; - int c = ObjectComparer.Compare(Item3, other.Item3); - return c != 0 ? c : ObjectComparer.Compare(Item4, other.Item4); - } - } - - public static class EnumerableExtensions - { - public static IEnumerable Zip(this IEnumerable seqA, IEnumerable seqB, Func func) - { - if (seqA == null) throw new ArgumentNullException("seqA"); - if (seqB == null) throw new ArgumentNullException("seqB"); - - return Zip35Deferred(seqA, seqB, func); - } - - private static IEnumerable Zip35Deferred(IEnumerable seqA, IEnumerable seqB, Func func) - { - using (var iteratorA = seqA.GetEnumerator()) - using (var iteratorB = seqB.GetEnumerator()) - { - while (iteratorA.MoveNext() && iteratorB.MoveNext()) - { - yield return func(iteratorA.Current, iteratorB.Current); - } - } - } - } - - internal static class Partitioner - { - public static OrderablePartitioner> Create(int fromInclusive, int toExclusive) - { - var rangeSize = Math.Max(1, (toExclusive - fromInclusive) / Control.MaxDegreeOfParallelism); - return Create(fromInclusive, toExclusive, rangeSize); - } - - public static OrderablePartitioner> Create(int fromInclusive, int toExclusive, int rangeSize) - { - if (toExclusive <= fromInclusive) throw new ArgumentOutOfRangeException("toExclusive"); - if (rangeSize <= 0) throw new ArgumentOutOfRangeException("rangeSize"); - return System.Collections.Concurrent.Partitioner.Create(CreateRanges(fromInclusive, toExclusive, rangeSize)); - } - - private static IEnumerable> CreateRanges(int fromInclusive, int toExclusive, int rangeSize) - { - bool flag = false; - int num = fromInclusive; - while (num < toExclusive && !flag) - { - int item = num; - int num2; - try - { - num2 = checked(num + rangeSize); - } - catch (OverflowException) - { - num2 = toExclusive; - flag = true; - } - if (num2 > toExclusive) - { - num2 = toExclusive; - } - yield return new Tuple(item, num2); - num += rangeSize; - } - } - } -} -#endif diff --git a/src/Numerics/Complex32.cs b/src/Numerics/Complex32.cs index 50e3417c..449b5426 100644 --- a/src/Numerics/Complex32.cs +++ b/src/Numerics/Complex32.cs @@ -32,17 +32,14 @@ using System.Collections.Generic; using System.Globalization; using System.Runtime.InteropServices; using System.Runtime.Serialization; +using System.Numerics; -namespace MathNet.Numerics -{ -#if !PORTABLE - using System.Runtime; -#endif -#if !NOSYSNUMERICS - using Complex = System.Numerics.Complex; - using BigInteger = System.Numerics.BigInteger; +#if !NETSTANDARD1_3 +using System.Runtime; #endif +namespace MathNet.Numerics +{ /// /// 32-bit single precision complex numbers class. /// @@ -698,7 +695,7 @@ namespace MathNet.Numerics /// Division operator. Divides a float value by a complex number. /// Algorithm based on Smith's algorithm - /// + /// /// The result of the division. /// The dividend. /// The divisor. @@ -1030,7 +1027,7 @@ namespace MathNet.Numerics } } -#if PORTABLE || NETSTANDARD +#if NETSTANDARD1_3 var value = GlobalizationHelper.ParseSingle(ref token); #else var value = GlobalizationHelper.ParseSingle(ref token, format.GetCultureInfo()); @@ -1187,7 +1184,6 @@ namespace MathNet.Numerics return new Complex32(value, 0.0f); } -#if !NOSYSNUMERICS /// /// Implicit conversion of a BigInteger int to a Complex32. /// @@ -1197,7 +1193,6 @@ namespace MathNet.Numerics { return new Complex32((long)value, 0.0f); } -#endif /// /// Implicit conversion of a real long to a Complex32. diff --git a/src/Numerics/Complex64.cs b/src/Numerics/Complex64.cs deleted file mode 100644 index 63cf10a2..00000000 --- a/src/Numerics/Complex64.cs +++ /dev/null @@ -1,1275 +0,0 @@ -// -// Math.NET Numerics, part of the Math.NET Project -// http://numerics.mathdotnet.com -// http://github.com/mathnet/mathnet-numerics -// -// 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. -// - -#if NOSYSNUMERICS - -using System; -using System.Collections.Generic; -using System.Runtime.InteropServices; -using System.Runtime.Serialization; -using System.Text; - -namespace MathNet.Numerics -{ - /// - /// 64-bit double precision complex numbers class. - /// - /// - /// - /// The class Complex provides all elementary operations - /// on complex numbers. All the operators +, -, - /// *, /, ==, != are defined in the - /// canonical way. Additional complex trigonometric functions - /// are also provided. Note that the Complex structures - /// has two special constant values and - /// . - /// - /// - /// - /// Complex x = new Complex(1d, 2d); - /// Complex y = Complex.FromPolarCoordinates(1d, Math.Pi); - /// Complex z = (x + y) / (x - y); - /// - /// - /// - /// For mathematical details about complex numbers, please - /// have a look at the - /// Wikipedia - /// - /// - [Serializable] - [DataContract(Namespace = "urn:MathNet/Numerics")] - [StructLayout(LayoutKind.Sequential)] - public struct Complex : IFormattable, IEquatable, IPrecisionSupport - { - /// - /// The real component of the complex number. - /// - [DataMember(Order = 1)] - private readonly double _real; - - /// - /// The imaginary component of the complex number. - /// - [DataMember(Order = 2)] - private readonly double _imag; - - /// - /// Initializes a new instance of the Complex structure with the given real - /// and imaginary parts. - /// - /// The value for the real component. - /// The value for the imaginary component. - [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")] - public Complex(double real, double imaginary) - { - _real = real; - _imag = imaginary; - } - - /// - /// Creates a complex number from a point's polar coordinates. - /// - /// A complex number. - /// The magnitude, which is the distance from the origin (the intersection of the x-axis and the y-axis) to the number. - /// The phase, which is the angle from the line to the horizontal axis, measured in radians. - public static Complex FromPolarCoordinates(double magnitude, double phase) - { - return new Complex(magnitude * Math.Cos(phase), magnitude * Math.Sin(phase)); - } - - /// - /// Returns a new Complex instance - /// with a real number equal to zero and an imaginary number equal to zero. - /// - public static readonly Complex Zero = new Complex(0.0f, 0.0f); - - /// - /// Returns a new Complex instance - /// with a real number equal to one and an imaginary number equal to zero. - /// - public static readonly Complex One = new Complex(1.0f, 0.0f); - - /// - /// Returns a new Complex instance - /// with a real number equal to zero and an imaginary number equal to one. - /// - public static readonly Complex ImaginaryOne = new Complex(0, 1); - - /// - /// Returns a new Complex instance - /// with real and imaginary numbers positive infinite. - /// - public static readonly Complex PositiveInfinity = new Complex(float.PositiveInfinity, float.PositiveInfinity); - - /// - /// Returns a new Complex instance - /// with real and imaginary numbers not a number. - /// - public static readonly Complex NaN = new Complex(float.NaN, float.NaN); - - /// - /// Gets the real component of the complex number. - /// - /// The real component of the complex number. - public double Real - { - [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")] - get { return _real; } - } - - /// - /// Gets the real imaginary component of the complex number. - /// - /// The real imaginary component of the complex number. - public double Imaginary - { - [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")] - get { return _imag; } - } - - /// - /// Gets the phase or argument of this Complex. - /// - /// - /// Phase always returns a value bigger than negative Pi and - /// smaller or equal to Pi. If this Complex is zero, the Complex - /// is assumed to be positive real with an argument of zero. - /// - /// The phase or argument of this Complex - public double Phase - { - // NOTE: the special case for negative real numbers fixes negative-zero value behavior. Do not remove. - [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")] - get { return _imag == 0d && _real < 0d ? Constants.Pi : Math.Atan2(_imag, _real); } - } - - /// - /// Gets the magnitude (or absolute value) of a complex number. - /// - /// The magnitude of the current instance. - public double Magnitude - { - [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")] - get { return Math.Sqrt((_real * _real) + (_imag * _imag)); } - } - - /// - /// Equality test. - /// - /// One of complex numbers to compare. - /// The other complex numbers to compare. - /// true if the real and imaginary components of the two complex numbers are equal; false otherwise. - public static bool operator ==(Complex complex1, Complex complex2) - { - return complex1.Equals(complex2); - } - - /// - /// Inequality test. - /// - /// One of complex numbers to compare. - /// The other complex numbers to compare. - /// true if the real or imaginary components of the two complex numbers are not equal; false otherwise. - public static bool operator !=(Complex complex1, Complex complex2) - { - return !complex1.Equals(complex2); - } - - /// - /// Unary addition. - /// - /// The complex number to operate on. - /// Returns the same complex number. - public static Complex operator +(Complex summand) - { - return summand; - } - - /// - /// Unary minus. - /// - /// The complex number to operate on. - /// The negated value of the . - public static Complex operator -(Complex subtrahend) - { - return new Complex(-subtrahend._real, -subtrahend._imag); - } - - /// Addition operator. Adds two complex numbers together. - /// The result of the addition. - /// One of the complex numbers to add. - /// The other complex numbers to add. - public static Complex operator +(Complex summand1, Complex summand2) - { - return new Complex(summand1._real + summand2._real, summand1._imag + summand2._imag); - } - - /// Subtraction operator. Subtracts two complex numbers. - /// The result of the subtraction. - /// The complex number to subtract from. - /// The complex number to subtract. - public static Complex operator -(Complex minuend, Complex subtrahend) - { - return new Complex(minuend._real - subtrahend._real, minuend._imag - subtrahend._imag); - } - - /// Addition operator. Adds a complex number and double together. - /// The result of the addition. - /// The complex numbers to add. - /// The double value to add. - public static Complex operator +(Complex summand1, double summand2) - { - return new Complex(summand1._real + summand2, summand1._imag); - } - - /// Subtraction operator. Subtracts double value from a complex value. - /// The result of the subtraction. - /// The complex number to subtract from. - /// The double value to subtract. - public static Complex operator -(Complex minuend, double subtrahend) - { - return new Complex(minuend._real - subtrahend, minuend._imag); - } - - /// Addition operator. Adds a complex number and double together. - /// The result of the addition. - /// The double value to add. - /// The complex numbers to add. - public static Complex operator +(double summand1, Complex summand2) - { - return new Complex(summand2._real + summand1, summand2._imag); - } - - /// Subtraction operator. Subtracts complex value from a double value. - /// The result of the subtraction. - /// The double vale to subtract from. - /// The complex value to subtract. - public static Complex operator -(double minuend, Complex subtrahend) - { - return new Complex(minuend - subtrahend._real, -subtrahend._imag); - } - - /// Multiplication operator. Multiplies two complex numbers. - /// The result of the multiplication. - /// One of the complex numbers to multiply. - /// The other complex number to multiply. - public static Complex operator *(Complex multiplicand, Complex multiplier) - { - return new Complex( - (multiplicand._real * multiplier._real) - (multiplicand._imag * multiplier._imag), - (multiplicand._real * multiplier._imag) + (multiplicand._imag * multiplier._real)); - } - - /// Multiplication operator. Multiplies a complex number with a double value. - /// The result of the multiplication. - /// The double value to multiply. - /// The complex number to multiply. - public static Complex operator *(double multiplicand, Complex multiplier) - { - return new Complex(multiplier._real * multiplicand, multiplier._imag * multiplicand); - } - - /// Multiplication operator. Multiplies a complex number with a double value. - /// The result of the multiplication. - /// The complex number to multiply. - /// The double value to multiply. - public static Complex operator *(Complex multiplicand, double multiplier) - { - return new Complex(multiplicand._real * multiplier, multiplicand._imag * multiplier); - } - - /// Division operator. Divides a complex number by another. - /// The result of the division. - /// The dividend. - /// The divisor. - public static Complex operator /(Complex dividend, Complex divisor) - { - if (dividend.IsZero() && divisor.IsZero()) - { - return NaN; - } - - if (divisor.IsZero()) - { - return PositiveInfinity; - } - - var modSquared = divisor.MagnitudeSquared(); - return new Complex( - ((dividend._real * divisor._real) + (dividend._imag * divisor._imag)) / modSquared, - ((dividend._imag * divisor._real) - (dividend._real * divisor._imag)) / modSquared); - } - - /// Division operator. Divides a double value by a complex number. - /// The result of the division. - /// The dividend. - /// The divisor. - public static Complex operator /(double dividend, Complex divisor) - { - if (dividend == 0.0d && divisor.IsZero()) - { - return NaN; - } - - if (divisor.IsZero()) - { - return PositiveInfinity; - } - - var zmod = divisor.MagnitudeSquared(); - return new Complex(dividend * divisor._real / zmod, -dividend * divisor._imag / zmod); - } - - /// Division operator. Divides a complex number by a double value. - /// The result of the division. - /// The dividend. - /// The divisor. - public static Complex operator /(Complex dividend, double divisor) - { - if (dividend.IsZero() && divisor == 0.0d) - { - return NaN; - } - - if (divisor == 0.0d) - { - return PositiveInfinity; - } - - return new Complex(dividend._real / divisor, dividend._imag / divisor); - } - -#region IFormattable Members - - /// - /// A string representation of this complex number. - /// - /// - /// The string representation of this complex number. - /// - public override string ToString() - { - return ToString(null, null); - } - - /// - /// A string representation of this complex number. - /// - /// - /// The string representation of this complex number formatted as specified by the - /// format string. - /// - /// - /// A format specification. - /// - public string ToString(string format) - { - return ToString(format, null); - } - - /// - /// A string representation of this complex number. - /// - /// - /// The string representation of this complex number formatted as specified by the - /// format provider. - /// - /// - /// An that supplies culture-specific formatting information. - /// - public string ToString(IFormatProvider formatProvider) - { - return ToString(null, formatProvider); - } - - /// - /// A string representation of this complex number. - /// - /// - /// The string representation of this complex number formatted as specified by the - /// format string and format provider. - /// - /// - /// if the n, is not a number. - /// - /// - /// if s, is . - /// - /// - /// A format specification. - /// - /// - /// An that supplies culture-specific formatting information. - /// - public string ToString(string format, IFormatProvider formatProvider) - { - var ret = new StringBuilder(); - ret.Append("(").Append(_real.ToString(format, formatProvider)).Append(", ").Append(_imag.ToString(format, formatProvider)).Append(")"); - return ret.ToString(); - } - -#endregion - -#region IEquatable Members - - /// - /// Checks if two complex numbers are equal. Two complex numbers are equal if their - /// corresponding real and imaginary components are equal. - /// - /// - /// Returns true if the two objects are the same object, or if their corresponding - /// real and imaginary components are equal, false otherwise. - /// - /// - /// The complex number to compare to with. - /// - public bool Equals(Complex other) - { - if (this.IsNaN() || other.IsNaN()) - { - return false; - } - - if (this.IsInfinity() && other.IsInfinity()) - { - return true; - } - - return _real.AlmostEqual(other._real) && _imag.AlmostEqual(other._imag); - } - - /// - /// The hash code for the complex number. - /// - /// - /// The hash code of the complex number. - /// - /// - /// The hash code is calculated as - /// System.Math.Exp(ComplexMath.Absolute(complexNumber)). - /// - public override int GetHashCode() - { - int hash = 27; - hash = (13 * hash) + _real.GetHashCode(); - hash = (13 * hash) + _imag.GetHashCode(); - return hash; - } - - /// - /// Checks if two complex numbers are equal. Two complex numbers are equal if their - /// corresponding real and imaginary components are equal. - /// - /// - /// Returns true if the two objects are the same object, or if their corresponding - /// real and imaginary components are equal, false otherwise. - /// - /// - /// The complex number to compare to with. - /// - public override bool Equals(object obj) - { - return (obj is Complex) && Equals((Complex)obj); - } - -#endregion - -#region IPrecisionSupport - - /// - /// Returns a Norm of a value of this type, which is appropriate for measuring how - /// close this value is to zero. - /// - /// - /// A norm of this value. - /// - double IPrecisionSupport.Norm() - { - return this.MagnitudeSquared(); - } - - /// - /// Returns a Norm of the difference of two values of this type, which is - /// appropriate for measuring how close together these two values are. - /// - /// - /// The value to compare with. - /// - /// - /// A norm of the difference between this and the other value. - /// - double IPrecisionSupport.NormOfDifference(Complex otherValue) - { - return (this - otherValue).MagnitudeSquared(); - } - -#endregion - -#region Parse Functions - - /// - /// Creates a complex number based on a string. The string can be in the - /// following formats (without the quotes): 'n', 'ni', 'n +/- ni', - /// 'ni +/- n', 'n,n', 'n,ni,' '(n,n)', or '(n,ni)', where n is a double. - /// - /// - /// A complex number containing the value specified by the given string. - /// - /// - /// The string to parse. - /// - public static Complex Parse(string value) - { - return Parse(value, null); - } - - /// - /// Creates a complex number based on a string. The string can be in the - /// following formats (without the quotes): 'n', 'ni', 'n +/- ni', - /// 'ni +/- n', 'n,n', 'n,ni,' '(n,n)', or '(n,ni)', where n is a double. - /// - /// - /// A complex number containing the value specified by the given string. - /// - /// - /// the string to parse. - /// - /// - /// An that supplies culture-specific - /// formatting information. - /// - public static Complex Parse(string value, IFormatProvider formatProvider) - { - if (value == null) - { - throw new ArgumentNullException(value); - } - - value = value.Trim(); - if (value.Length == 0) - { - throw new FormatException(); - } - - // strip out parens - if (value.StartsWith("(", StringComparison.Ordinal)) - { - if (!value.EndsWith(")", StringComparison.Ordinal)) - { - throw new FormatException(); - } - - value = value.Substring(1, value.Length - 2).Trim(); - } - - // keywords - var numberFormatInfo = formatProvider.GetNumberFormatInfo(); - var textInfo = formatProvider.GetTextInfo(); - var keywords = - new[] - { - textInfo.ListSeparator, numberFormatInfo.NaNSymbol, - numberFormatInfo.NegativeInfinitySymbol, numberFormatInfo.PositiveInfinitySymbol, - "+", "-", "i", "j" - }; - - // lexing - var tokens = new LinkedList(); - GlobalizationHelper.Tokenize(tokens.AddFirst(value), keywords, 0); - var token = tokens.First; - - // parse the left part - bool isLeftPartImaginary; - var leftPart = ParsePart(ref token, out isLeftPartImaginary, formatProvider); - if (token == null) - { - return isLeftPartImaginary ? new Complex(0, leftPart) : new Complex(leftPart, 0); - } - - // parse the right part - if (token.Value == textInfo.ListSeparator) - { - // format: real,imag - token = token.Next; - - if (isLeftPartImaginary) - { - // left must not contain 'i', right doesn't matter. - throw new FormatException(); - } - - bool isRightPartImaginary; - var rightPart = ParsePart(ref token, out isRightPartImaginary, formatProvider); - - return new Complex(leftPart, rightPart); - } - else - { - // format: real + imag - bool isRightPartImaginary; - var rightPart = ParsePart(ref token, out isRightPartImaginary, formatProvider); - - if (!(isLeftPartImaginary ^ isRightPartImaginary)) - { - // either left or right part must contain 'i', but not both. - throw new FormatException(); - } - - return isLeftPartImaginary ? new Complex(rightPart, leftPart) : new Complex(leftPart, rightPart); - } - } - - /// - /// Parse a part (real or complex) from a complex number. - /// - /// Start Token. - /// Is set to true if the part identified itself as being imaginary. - /// - /// An that supplies culture-specific - /// formatting information. - /// - /// Resulting part as double. - /// - private static double ParsePart(ref LinkedListNode token, out bool imaginary, IFormatProvider format) - { - imaginary = false; - if (token == null) - { - throw new FormatException(); - } - - // handle prefix modifiers - if (token.Value == "+") - { - token = token.Next; - - if (token == null) - { - throw new FormatException(); - } - } - - var negative = false; - if (token.Value == "-") - { - negative = true; - token = token.Next; - - if (token == null) - { - throw new FormatException(); - } - } - - // handle prefix imaginary symbol - if (String.Compare(token.Value, "i", StringComparison.OrdinalIgnoreCase) == 0 - || String.Compare(token.Value, "j", StringComparison.OrdinalIgnoreCase) == 0) - { - imaginary = true; - token = token.Next; - - if (token == null) - { - return negative ? -1 : 1; - } - } - -#if PORTABLE || NETSTANDARD - 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 - || String.Compare(token.Value, "j", StringComparison.OrdinalIgnoreCase) == 0)) - { - if (imaginary) - { - // only one time allowed: either prefix or suffix, or neither. - throw new FormatException(); - } - - imaginary = true; - token = token.Next; - } - - return negative ? -value : value; - } - - /// - /// Converts the string representation of a complex number to a single-precision complex number equivalent. - /// A return value indicates whether the conversion succeeded or failed. - /// - /// - /// A string containing a complex number to convert. - /// - /// - /// The parsed value. - /// - /// - /// If the conversion succeeds, the result will contain a complex number equivalent to value. - /// Otherwise the result will contain complex32.Zero. This parameter is passed uninitialized - /// - public static bool TryParse(string value, out Complex result) - { - return TryParse(value, null, out result); - } - - /// - /// Converts the string representation of a complex number to single-precision complex number equivalent. - /// A return value indicates whether the conversion succeeded or failed. - /// - /// - /// A string containing a complex number to convert. - /// - /// - /// An that supplies culture-specific formatting information about value. - /// - /// - /// The parsed value. - /// - /// - /// If the conversion succeeds, the result will contain a complex number equivalent to value. - /// Otherwise the result will contain complex32.Zero. This parameter is passed uninitialized - /// - public static bool TryParse(string value, IFormatProvider formatProvider, out Complex result) - { - bool ret; - try - { - result = Parse(value, formatProvider); - ret = true; - } - catch (ArgumentNullException) - { - result = Zero; - ret = false; - } - catch (FormatException) - { - result = Zero; - ret = false; - } - - return ret; - } - -#endregion - -#region Conversion - - /// - /// Explicit conversion of a real decimal to a Complex. - /// - /// The decimal value to convert. - /// The result of the conversion. - public static explicit operator Complex(decimal value) - { - return new Complex((double)value, 0.0d); - } - - /// - /// Explicit conversion of a Complex to a Complex. - /// - /// The decimal value to convert. - /// The result of the conversion. - public static explicit operator Complex(Complex32 value) - { - return new Complex((double)value.Real, (double)value.Imaginary); - } - - /// - /// Implicit conversion of a real byte to a Complex. - /// - /// The byte value to convert. - /// The result of the conversion. - public static implicit operator Complex(byte value) - { - return new Complex(value, 0.0d); - } - - /// - /// Implicit conversion of a real short to a Complex. - /// - /// The short value to convert. - /// The result of the conversion. - public static implicit operator Complex(short value) - { - return new Complex(value, 0.0d); - } - - /// - /// Implicit conversion of a signed byte to a Complex. - /// - /// The signed byte value to convert. - /// The result of the conversion. - [CLSCompliant(false)] - public static implicit operator Complex(sbyte value) - { - return new Complex(value, 0.0d); - } - - /// - /// Implicit conversion of a unsigned real short to a Complex. - /// - /// The unsigned short value to convert. - /// The result of the conversion. - [CLSCompliant(false)] - public static implicit operator Complex(ushort value) - { - return new Complex(value, 0.0d); - } - - /// - /// Implicit conversion of a real int to a Complex. - /// - /// The int value to convert. - /// The result of the conversion. - public static implicit operator Complex(int value) - { - return new Complex(value, 0.0d); - } - - /// - /// Implicit conversion of a real long to a Complex. - /// - /// The long value to convert. - /// The result of the conversion. - public static implicit operator Complex(long value) - { - return new Complex(value, 0.0d); - } - - /// - /// Implicit conversion of a real uint to a Complex. - /// - /// The uint value to convert. - /// The result of the conversion. - [CLSCompliant(false)] - public static implicit operator Complex(uint value) - { - return new Complex(value, 0.0d); - } - - /// - /// Implicit conversion of a real ulong to a Complex. - /// - /// The ulong value to convert. - /// The result of the conversion. - [CLSCompliant(false)] - public static implicit operator Complex(ulong value) - { - return new Complex(value, 0.0d); - } - - /// - /// Implicit conversion of a real double to a Complex. - /// - /// The double value to convert. - /// The result of the conversion. - public static implicit operator Complex(double value) - { - return new Complex(value, 0.0d); - } - - /// - /// Implicit conversion of a real float to a Complex. - /// - /// The double value to convert. - /// The result of the conversion. - public static explicit operator Complex(float value) - { - return new Complex((double)value, 0.0d); - } - - /// - /// Converts this Complex to a . - /// - /// A with the same values as this Complex. - public Complex ToComplex() - { - return new Complex(_real, _imag); - } - -#endregion - - /// - /// Returns the additive inverse of a specified complex number. - /// - /// The result of the and components of the parameter multiplied by -1. - /// A complex number. - [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")] - public static Complex Negate(Complex value) - { - return -value; - } - - /// - /// Computes the conjugate of a complex number and returns the result. - /// - /// The conjugate of . - /// A complex number. - [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")] - public static Complex Conjugate(Complex value) - { - return new Complex(value._real, -value._imag); - } - - /// - /// Adds two complex numbers and returns the result. - /// - /// The sum of and . - /// The first complex number to add. - /// The second complex number to add. - [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")] - public static Complex Add(Complex left, Complex right) - { - return left + right; - } - - /// - /// Subtracts one complex number from another and returns the result. - /// - /// The result of subtracting from . - /// The value to subtract from (the minuend). - /// The value to subtract (the subtrahend). - [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")] - public static Complex Subtract(Complex left, Complex right) - { - return left - right; - } - - /// - /// Returns the product of two complex numbers. - /// - /// The product of the and parameters. - /// The first complex number to multiply. - /// The second complex number to multiply. - [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")] - public static Complex Multiply(Complex left, Complex right) - { - return left * right; - } - - /// - /// Divides one complex number by another and returns the result. - /// - /// The quotient of the division. - /// The complex number to be divided. - /// The complex number to divide by. - [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")] - public static Complex Divide(Complex dividend, Complex divisor) - { - return dividend / divisor; - } - - /// - /// Returns the multiplicative inverse of a complex number. - /// - /// The reciprocal of . - /// A complex number. - public static Complex Reciprocal(Complex value) - { - if (value.IsZero()) - { - return Zero; - } - - return 1.0d / value; - } - - /// - /// Returns the square root of a specified complex number. - /// - /// The square root of . - /// A complex number. - public static Complex Sqrt(Complex value) - { - if (value.IsRealNonNegative()) - { - return new Complex(Math.Sqrt(value.Real), 0.0); - } - - Complex result; - - var absReal = Math.Abs(value.Real); - var absImag = Math.Abs(value.Imaginary); - double w; - if (absReal >= absImag) - { - var ratio = value.Imaginary / value.Real; - w = Math.Sqrt(absReal) * Math.Sqrt(0.5 * (1.0 + Math.Sqrt(1.0 + (ratio * ratio)))); - } - else - { - var ratio = value.Real / value.Imaginary; - w = Math.Sqrt(absImag) * Math.Sqrt(0.5 * (Math.Abs(ratio) + Math.Sqrt(1.0 + (ratio * ratio)))); - } - - if (value.Real >= 0.0) - { - result = new Complex(w, value.Imaginary / (2.0 * w)); - } - else if (value.Imaginary >= 0.0) - { - result = new Complex(absImag / (2.0 * w), w); - } - else - { - result = new Complex(absImag / (2.0 * w), -w); - } - - return result; - } - - /// - /// Gets the absolute value (or magnitude) of a complex number. - /// - /// A complex number. - /// The absolute value (or magnitude) of a complex number. - [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")] - public static double Abs(Complex value) - { - return value.Magnitude; - } - - /// - /// Returns e raised to the power specified by a complex number. - /// - /// The number e raised to the power . - /// A complex number that specifies a power. - public static Complex Exp(Complex value) - { - var exp = Math.Exp(value.Real); - if (value.IsReal()) - { - return new Complex(exp, 0.0); - } - - return new Complex(exp * Trig.Cos(value.Imaginary), exp * Trig.Sin(value.Imaginary)); - } - - /// - /// Returns a specified complex number raised to a power specified by a complex number. - /// - /// The complex number raised to the power . - /// A complex number to be raised to a power. - /// A complex number that specifies a power. - public static Complex Pow(Complex value, Complex power) - { - if (value.IsZero()) - { - if (power.IsZero()) - { - return One; - } - - if (power.Real > 0.0) - { - return Zero; - } - - if (power.Real < 0) - { - if (power.Imaginary == 0.0) - { - return new Complex(double.PositiveInfinity, 0.0); - } - - return new Complex(double.PositiveInfinity, double.PositiveInfinity); - } - - return double.NaN; - } - - return Exp(power * Log(value)); - } - - /// - /// Returns a specified complex number raised to a power specified by a double-precision floating-point number. - /// - /// The complex number raised to the power . - /// A complex number to be raised to a power. - /// A double-precision floating-point number that specifies a power. - public static Complex Pow(Complex value, double power) - { - if (value.IsZero()) - { - if (power == 0d) - { - return One; - } - - return power > 0d - ? Zero - : new Complex(double.PositiveInfinity, 0.0); - } - - return Exp(power * Log(value)); - } - - /// - /// Returns the natural (base e) logarithm of a specified complex number. - /// - /// The natural (base e) logarithm of . - /// A complex number. - public static Complex Log(Complex value) - { - if (value.IsRealNonNegative()) - { - return new Complex(Math.Log(value.Real), 0.0); - } - - return new Complex(0.5 * Math.Log(value.MagnitudeSquared()), value.Phase); - } - - /// - /// Returns the logarithm of a specified complex number in a specified base. - /// - /// The logarithm of in base . - /// A complex number. - /// The base of the logarithm. - public static Complex Log(Complex value, double baseValue) - { - return Log(value) / Math.Log(baseValue); - } - - /// - /// Returns the base-10 logarithm of a specified complex number. - /// - /// The base-10 logarithm of . - /// A complex number. - public static Complex Log10(Complex value) - { - return Log(value) / Constants.Ln10; - } - - /// - /// Returns the sine of the specified complex number. - /// - /// The sine of . - /// A complex number. - [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")] - public static Complex Sin(Complex value) - { - return Trig.Sin(value); - } - - /// - /// Returns the cosine of the specified complex number. - /// - /// The cosine of . - /// A complex number. - [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")] - public static Complex Cos(Complex value) - { - return Trig.Cos(value); - } - - /// - /// Returns the tangent of the specified complex number. - /// - /// The tangent of . - /// A complex number. - [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")] - public static Complex Tan(Complex value) - { - return Trig.Tan(value); - } - - /// - /// Returns the angle that is the arc sine of the specified complex number. - /// - /// The angle which is the arc sine of . - /// A complex number. - [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")] - public static Complex Asin(Complex value) - { - return Trig.Asin(value); - } - - /// - /// Returns the angle that is the arc cosine of the specified complex number. - /// - /// The angle, measured in radians, which is the arc cosine of . - /// A complex number that represents a cosine. - [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")] - public static Complex Acos(Complex value) - { - return Trig.Acos(value); - } - - /// - /// Returns the angle that is the arc tangent of the specified complex number. - /// - /// The angle that is the arc tangent of . - /// A complex number. - [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")] - public static Complex Atan(Complex value) - { - return Trig.Atan(value); - } - - /// - /// Returns the hyperbolic sine of the specified complex number. - /// - /// The hyperbolic sine of . - /// A complex number. - [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")] - public static Complex Sinh(Complex value) - { - return Trig.Sinh(value); - } - - /// - /// Returns the hyperbolic cosine of the specified complex number. - /// - /// The hyperbolic cosine of . - /// A complex number. - [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")] - public static Complex Cosh(Complex value) - { - return Trig.Cosh(value); - } - - /// - /// Returns the hyperbolic tangent of the specified complex number. - /// - /// The hyperbolic tangent of . - /// A complex number. - [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")] - public static Complex Tanh(Complex value) - { - return Trig.Tanh(value); - } - } -} -#endif diff --git a/src/Numerics/ComplexExtensions.cs b/src/Numerics/ComplexExtensions.cs index 1d0a11fd..188db737 100644 --- a/src/Numerics/ComplexExtensions.cs +++ b/src/Numerics/ComplexExtensions.cs @@ -27,19 +27,16 @@ // OTHER DEALINGS IN THE SOFTWARE. // -namespace MathNet.Numerics -{ - using System; - using System.Collections.Generic; - -#if !PORTABLE && !NETSTANDARD - using System.Runtime; -#endif +using System; +using System.Collections.Generic; +using System.Numerics; -#if !NOSYSNUMERICS - using Complex = System.Numerics.Complex; +#if !NETSTANDARD1_3 +using System.Runtime; #endif +namespace MathNet.Numerics +{ /// /// Extension methods for the Complex type provided by System.Numerics /// @@ -607,7 +604,7 @@ namespace MathNet.Numerics } } -#if PORTABLE || NETSTANDARD +#if NETSTANDARD1_3 var value = GlobalizationHelper.ParseDouble(ref token); #else var value = GlobalizationHelper.ParseDouble(ref token, format.GetCultureInfo()); diff --git a/src/Numerics/Differentiation/FiniteDifferenceCoefficients.cs b/src/Numerics/Differentiation/FiniteDifferenceCoefficients.cs index eab541ba..73a17d63 100644 --- a/src/Numerics/Differentiation/FiniteDifferenceCoefficients.cs +++ b/src/Numerics/Differentiation/FiniteDifferenceCoefficients.cs @@ -129,12 +129,12 @@ namespace MathNet.Numerics.Differentiation // "Polish" results by rounding. var fac = SpecialFunctions.Factorial(points); for (int j = 0; j < points; j++) + { for (int k = 0; k < points; k++) -#if PORTABLE - c[center][j, k] = (Math.Round(c[center][j, k] * fac)) / fac; -#else + { c[center][j, k] = (Math.Round(c[center][j, k] * fac, MidpointRounding.AwayFromZero)) / fac; -#endif + } + } } _coefficients = c; diff --git a/src/Numerics/Euclid.cs b/src/Numerics/Euclid.cs index 1abe4676..0d9c16d0 100644 --- a/src/Numerics/Euclid.cs +++ b/src/Numerics/Euclid.cs @@ -29,10 +29,7 @@ using System; using System.Collections.Generic; - -#if !NOSYSNUMERICS using System.Numerics; -#endif namespace MathNet.Numerics { @@ -73,7 +70,6 @@ namespace MathNet.Numerics return ((dividend%divisor) + divisor)%divisor; } -#if !NOSYSNUMERICS /// /// Canonical Modulus. The result has the sign of the divisor. /// @@ -81,7 +77,6 @@ namespace MathNet.Numerics { return ((dividend%divisor) + divisor)%divisor; } -#endif /// /// Remainder (% operator). The result has the sign of the dividend. @@ -115,7 +110,6 @@ namespace MathNet.Numerics return dividend%divisor; } -#if !NOSYSNUMERICS /// /// Remainder (% operator). The result has the sign of the dividend. /// @@ -123,7 +117,6 @@ namespace MathNet.Numerics { return dividend%divisor; } -#endif /// /// Find out whether the provided 32 bit integer is an even number. @@ -430,7 +423,7 @@ namespace MathNet.Numerics while (b != 0) { long rem; -#if PORTABLE || NETSTANDARD +#if NETSTANDARD1_3 rem = a % b; var quot = a / b; #else @@ -513,7 +506,6 @@ namespace MathNet.Numerics return LeastCommonMultiple((IList)integers); } -#if !NOSYSNUMERICS /// /// Returns the greatest common divisor (gcd) of two big integers. /// @@ -662,6 +654,5 @@ namespace MathNet.Numerics { return LeastCommonMultiple((IList)integers); } -#endif } } diff --git a/src/Numerics/ExcelFunctions.cs b/src/Numerics/ExcelFunctions.cs index 63941ff2..28282e13 100644 --- a/src/Numerics/ExcelFunctions.cs +++ b/src/Numerics/ExcelFunctions.cs @@ -31,7 +31,7 @@ using System; using MathNet.Numerics.Distributions; using MathNet.Numerics.Statistics; -#if !PORTABLE +#if !NETSTANDARD1_3 using System.Runtime; #endif diff --git a/src/Numerics/Exceptions.cs b/src/Numerics/Exceptions.cs index 00d02d95..2cc6c10e 100644 --- a/src/Numerics/Exceptions.cs +++ b/src/Numerics/Exceptions.cs @@ -20,7 +20,7 @@ namespace MathNet.Numerics public NonConvergenceException(string message, Exception innerException) : base(message, innerException) { } -#if !PORTABLE && !NETSTANDARD +#if !NETSTANDARD1_3 protected NonConvergenceException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : base(info, context) { @@ -48,7 +48,7 @@ namespace MathNet.Numerics : base(message, innerException) { } -#if !PORTABLE && !NETSTANDARD +#if !NETSTANDARD1_3 protected NumericalBreakdownException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : base(info, context) { @@ -75,7 +75,7 @@ namespace MathNet.Numerics : base(message, innerException) { } -#if !PORTABLE && !NETSTANDARD +#if !NETSTANDARD1_3 protected NativeInterfaceException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : base(info, context) { @@ -103,7 +103,7 @@ namespace MathNet.Numerics : base(string.Format(Resources.InvalidParameterWithNumber, parameter), innerException) { } -#if !PORTABLE && !NETSTANDARD +#if !NETSTANDARD1_3 protected InvalidParameterException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : base(info, context) { @@ -126,7 +126,7 @@ namespace MathNet.Numerics : base(Resources.MemoryAllocation, innerException) { } -#if !PORTABLE && !NETSTANDARD +#if !NETSTANDARD1_3 protected MemoryAllocationException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : base(info, context) { @@ -154,7 +154,7 @@ namespace MathNet.Numerics : base(string.Format(Resources.SingularUMatrixWithElement, element), innerException) { } -#if !PORTABLE && !NETSTANDARD +#if !NETSTANDARD1_3 protected SingularUMatrixException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : base(info, context) { diff --git a/src/Numerics/FindRoots.cs b/src/Numerics/FindRoots.cs index f07a43b9..3e8af9a7 100644 --- a/src/Numerics/FindRoots.cs +++ b/src/Numerics/FindRoots.cs @@ -28,13 +28,10 @@ // using System; +using System.Numerics; using MathNet.Numerics.Properties; using MathNet.Numerics.RootFinding; -#if !NOSYSNUMERICS - using Complex = System.Numerics.Complex; -#endif - namespace MathNet.Numerics { public static class FindRoots diff --git a/src/Numerics/Generate.cs b/src/Numerics/Generate.cs index a72fa5d9..260de796 100644 --- a/src/Numerics/Generate.cs +++ b/src/Numerics/Generate.cs @@ -28,6 +28,7 @@ // using System; +using System.Numerics; using System.Collections.Generic; using System.Linq; using MathNet.Numerics.Distributions; @@ -37,10 +38,6 @@ using MathNet.Numerics.Threading; namespace MathNet.Numerics { -#if !NOSYSNUMERICS - using System.Numerics; -#endif - public static class Generate { /// @@ -797,8 +794,6 @@ namespace MathNet.Numerics } } -#if !NOSYSNUMERICS - /// /// Generate a Fibonacci sequence, including zero as first value. /// @@ -846,8 +841,6 @@ namespace MathNet.Numerics } } -#endif - /// /// Create random samples, uniform between 0 and 1. /// Faster than other methods but with reduced guarantees on randomness. diff --git a/src/Numerics/GlobalizationHelper.cs b/src/Numerics/GlobalizationHelper.cs index a7a32e45..a966c0a9 100644 --- a/src/Numerics/GlobalizationHelper.cs +++ b/src/Numerics/GlobalizationHelper.cs @@ -131,7 +131,7 @@ namespace MathNet.Numerics } } -#if PORTABLE || NETSTANDARD +#if NETSTANDARD1_3 /// /// Globalized Parsing: Parse a double number /// diff --git a/src/Numerics/IntegralTransforms/Fourier.Bluestein.cs b/src/Numerics/IntegralTransforms/Fourier.Bluestein.cs index 46c38d30..49517daf 100644 --- a/src/Numerics/IntegralTransforms/Fourier.Bluestein.cs +++ b/src/Numerics/IntegralTransforms/Fourier.Bluestein.cs @@ -28,14 +28,11 @@ // using System; +using System.Numerics; using MathNet.Numerics.Threading; namespace MathNet.Numerics.IntegralTransforms { -#if !NOSYSNUMERICS - using System.Numerics; -#endif - /// /// Complex Fast (FFT) Implementation of the Discrete Fourier Transform (DFT). /// diff --git a/src/Numerics/IntegralTransforms/Fourier.Naive.cs b/src/Numerics/IntegralTransforms/Fourier.Naive.cs index b03ebca7..28490d7a 100644 --- a/src/Numerics/IntegralTransforms/Fourier.Naive.cs +++ b/src/Numerics/IntegralTransforms/Fourier.Naive.cs @@ -28,14 +28,11 @@ // using System; +using System.Numerics; using MathNet.Numerics.Threading; namespace MathNet.Numerics.IntegralTransforms { -#if !NOSYSNUMERICS - using Complex = System.Numerics.Complex; -#endif - /// /// Complex Fast (FFT) Implementation of the Discrete Fourier Transform (DFT). /// diff --git a/src/Numerics/IntegralTransforms/Fourier.RadixN.cs b/src/Numerics/IntegralTransforms/Fourier.RadixN.cs index 0d029bff..e8c9358d 100644 --- a/src/Numerics/IntegralTransforms/Fourier.RadixN.cs +++ b/src/Numerics/IntegralTransforms/Fourier.RadixN.cs @@ -28,15 +28,12 @@ // using System; +using System.Numerics; using MathNet.Numerics.Properties; using MathNet.Numerics.Threading; namespace MathNet.Numerics.IntegralTransforms { -#if !NOSYSNUMERICS - using System.Numerics; -#endif - /// /// Complex Fast (FFT) Implementation of the Discrete Fourier Transform (DFT). /// diff --git a/src/Numerics/IntegralTransforms/Fourier.cs b/src/Numerics/IntegralTransforms/Fourier.cs index 52943aa4..972f6531 100644 --- a/src/Numerics/IntegralTransforms/Fourier.cs +++ b/src/Numerics/IntegralTransforms/Fourier.cs @@ -28,6 +28,7 @@ // using System; +using System.Numerics; using MathNet.Numerics.LinearAlgebra; using MathNet.Numerics.LinearAlgebra.Storage; using MathNet.Numerics.Properties; @@ -35,10 +36,6 @@ using MathNet.Numerics.Providers.FourierTransform; namespace MathNet.Numerics.IntegralTransforms { -#if !NOSYSNUMERICS - using System.Numerics; -#endif - /// /// Complex Fast (FFT) Implementation of the Discrete Fourier Transform (DFT). /// @@ -61,7 +58,7 @@ namespace MathNet.Numerics.IntegralTransforms { Control.FourierTransformProvider.Forward(samples, FourierTransformScaling.SymmetricScaling); } - + /// /// Applies the forward Fast Fourier Transform (FFT) to arbitrary-length sample vectors. /// @@ -113,7 +110,7 @@ namespace MathNet.Numerics.IntegralTransforms break; } } - + /// /// Applies the forward Fast Fourier Transform (FFT) to arbitrary-length sample vectors. /// @@ -175,7 +172,7 @@ namespace MathNet.Numerics.IntegralTransforms imaginary[i] = data[i].Imaginary; } } - + /// /// Packed Real-Complex forward Fast Fourier Transform (FFT) to arbitrary-length sample vectors. /// Since for real-valued time samples the complex spectrum is conjugate-even (symmetry), @@ -303,7 +300,7 @@ namespace MathNet.Numerics.IntegralTransforms break; } } - + /// /// Applies the forward Fast Fourier Transform (FFT) to two dimensional sample data. /// @@ -329,7 +326,7 @@ namespace MathNet.Numerics.IntegralTransforms { ForwardMultiDim(samplesRowWise, new[] { rows, columns }, options); } - + /// /// Applies the forward Fast Fourier Transform (FFT) to a two dimensional data in form of a matrix. /// @@ -494,7 +491,7 @@ namespace MathNet.Numerics.IntegralTransforms imaginary[i] = data[i].Imaginary; } } - + /// /// Applies the inverse Fast Fourier Transform (iFFT) to arbitrary-length sample vectors. /// diff --git a/src/Numerics/LinearAlgebra/Builder.cs b/src/Numerics/LinearAlgebra/Builder.cs index 0c0b3033..6270c51d 100644 --- a/src/Numerics/LinearAlgebra/Builder.cs +++ b/src/Numerics/LinearAlgebra/Builder.cs @@ -187,11 +187,7 @@ namespace MathNet.Numerics.LinearAlgebra.Single namespace MathNet.Numerics.LinearAlgebra.Complex { -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else using Complex = System.Numerics.Complex; -#endif internal class MatrixBuilder : MatrixBuilder { @@ -343,14 +339,6 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32 namespace MathNet.Numerics.LinearAlgebra { - -#if NOSYSNUMERICS - using Complex64 = Numerics.Complex; -#else - using Complex64 = System.Numerics.Complex; - -#endif - /// /// Generic linear algebra type builder, for situations where a matrix or vector /// must be created in a generic way. Usage of generic builders should not be @@ -1587,11 +1575,11 @@ namespace MathNet.Numerics.LinearAlgebra static Tuple, VectorBuilder> Create() { - if (typeof (T) == typeof (Complex64)) + if (typeof (T) == typeof (System.Numerics.Complex)) { return new Tuple, VectorBuilder>( - (MatrixBuilder)(object)new Complex.MatrixBuilder(), - (VectorBuilder)(object)new Complex.VectorBuilder()); + (MatrixBuilder)(object)new LinearAlgebra.Complex.MatrixBuilder(), + (VectorBuilder)(object)new LinearAlgebra.Complex.VectorBuilder()); } if (typeof (T) == typeof (Numerics.Complex32)) diff --git a/src/Numerics/LinearAlgebra/Complex/DenseMatrix.cs b/src/Numerics/LinearAlgebra/Complex/DenseMatrix.cs index 310f5536..cd293209 100644 --- a/src/Numerics/LinearAlgebra/Complex/DenseMatrix.cs +++ b/src/Numerics/LinearAlgebra/Complex/DenseMatrix.cs @@ -41,12 +41,7 @@ using MathNet.Numerics.Threading; namespace MathNet.Numerics.LinearAlgebra.Complex { - -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else using Complex = System.Numerics.Complex; -#endif /// /// A Matrix class with dense storage. The underlying storage is a one dimensional array in column-major order (column by column). diff --git a/src/Numerics/LinearAlgebra/Complex/DenseVector.cs b/src/Numerics/LinearAlgebra/Complex/DenseVector.cs index 02fe3dfe..2c876268 100644 --- a/src/Numerics/LinearAlgebra/Complex/DenseVector.cs +++ b/src/Numerics/LinearAlgebra/Complex/DenseVector.cs @@ -37,12 +37,7 @@ using System.Linq; namespace MathNet.Numerics.LinearAlgebra.Complex { - -#if NOSYSNUMERICS - using Numerics; -#else - using System.Numerics; -#endif + using Complex = System.Numerics.Complex; /// /// A vector using dense storage. diff --git a/src/Numerics/LinearAlgebra/Complex/DiagonalMatrix.cs b/src/Numerics/LinearAlgebra/Complex/DiagonalMatrix.cs index 6ad63e2d..e09f0070 100644 --- a/src/Numerics/LinearAlgebra/Complex/DiagonalMatrix.cs +++ b/src/Numerics/LinearAlgebra/Complex/DiagonalMatrix.cs @@ -38,12 +38,7 @@ using MathNet.Numerics.Threading; namespace MathNet.Numerics.LinearAlgebra.Complex { - -#if NOSYSNUMERICS - using Numerics; -#else - using System.Numerics; -#endif + using Complex = System.Numerics.Complex; /// /// A matrix type for diagonal matrices. diff --git a/src/Numerics/LinearAlgebra/Complex/Factorization/Cholesky.cs b/src/Numerics/LinearAlgebra/Complex/Factorization/Cholesky.cs index 5d52591e..163e7e18 100644 --- a/src/Numerics/LinearAlgebra/Complex/Factorization/Cholesky.cs +++ b/src/Numerics/LinearAlgebra/Complex/Factorization/Cholesky.cs @@ -31,12 +31,7 @@ using MathNet.Numerics.LinearAlgebra.Factorization; namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization { - -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else using Complex = System.Numerics.Complex; -#endif /// /// A class which encapsulates the functionality of a Cholesky factorization. diff --git a/src/Numerics/LinearAlgebra/Complex/Factorization/DenseCholesky.cs b/src/Numerics/LinearAlgebra/Complex/Factorization/DenseCholesky.cs index da788e9e..c0c0898d 100644 --- a/src/Numerics/LinearAlgebra/Complex/Factorization/DenseCholesky.cs +++ b/src/Numerics/LinearAlgebra/Complex/Factorization/DenseCholesky.cs @@ -32,12 +32,7 @@ using System; namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization { - -#if NOSYSNUMERICS - using Numerics; -#else - using System.Numerics; -#endif + using Complex = System.Numerics.Complex; /// /// A class which encapsulates the functionality of a Cholesky factorization for dense matrices. diff --git a/src/Numerics/LinearAlgebra/Complex/Factorization/DenseEvd.cs b/src/Numerics/LinearAlgebra/Complex/Factorization/DenseEvd.cs index eac98bb9..074a41d2 100644 --- a/src/Numerics/LinearAlgebra/Complex/Factorization/DenseEvd.cs +++ b/src/Numerics/LinearAlgebra/Complex/Factorization/DenseEvd.cs @@ -32,12 +32,7 @@ using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization { - -#if NOSYSNUMERICS - using Numerics; -#else - using System.Numerics; -#endif + using Complex = System.Numerics.Complex; /// /// Eigenvalues and eigenvectors of a complex matrix. diff --git a/src/Numerics/LinearAlgebra/Complex/Factorization/DenseGramSchmidt.cs b/src/Numerics/LinearAlgebra/Complex/Factorization/DenseGramSchmidt.cs index cf894d35..b4961b5e 100644 --- a/src/Numerics/LinearAlgebra/Complex/Factorization/DenseGramSchmidt.cs +++ b/src/Numerics/LinearAlgebra/Complex/Factorization/DenseGramSchmidt.cs @@ -33,12 +33,7 @@ using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization { - -#if NOSYSNUMERICS - using Numerics; -#else - using System.Numerics; -#endif + using Complex = System.Numerics.Complex; /// /// A class which encapsulates the functionality of the QR decomposition Modified Gram-Schmidt Orthogonalization. diff --git a/src/Numerics/LinearAlgebra/Complex/Factorization/DenseLU.cs b/src/Numerics/LinearAlgebra/Complex/Factorization/DenseLU.cs index 2dc7a525..17a81c6a 100644 --- a/src/Numerics/LinearAlgebra/Complex/Factorization/DenseLU.cs +++ b/src/Numerics/LinearAlgebra/Complex/Factorization/DenseLU.cs @@ -32,12 +32,7 @@ using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization { - -#if NOSYSNUMERICS - using Numerics; -#else - using System.Numerics; -#endif + using Complex = System.Numerics.Complex; /// /// A class which encapsulates the functionality of an LU factorization. diff --git a/src/Numerics/LinearAlgebra/Complex/Factorization/DenseQR.cs b/src/Numerics/LinearAlgebra/Complex/Factorization/DenseQR.cs index 48716a5b..c0bc7726 100644 --- a/src/Numerics/LinearAlgebra/Complex/Factorization/DenseQR.cs +++ b/src/Numerics/LinearAlgebra/Complex/Factorization/DenseQR.cs @@ -33,12 +33,7 @@ using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization { - -#if NOSYSNUMERICS - using Numerics; -#else - using System.Numerics; -#endif + using Complex = System.Numerics.Complex; /// /// A class which encapsulates the functionality of the QR decomposition. diff --git a/src/Numerics/LinearAlgebra/Complex/Factorization/DenseSvd.cs b/src/Numerics/LinearAlgebra/Complex/Factorization/DenseSvd.cs index 44333efd..d0ac9b2f 100644 --- a/src/Numerics/LinearAlgebra/Complex/Factorization/DenseSvd.cs +++ b/src/Numerics/LinearAlgebra/Complex/Factorization/DenseSvd.cs @@ -32,12 +32,7 @@ using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization { - -#if NOSYSNUMERICS - using Numerics; -#else - using System.Numerics; -#endif + using Complex = System.Numerics.Complex; /// /// A class which encapsulates the functionality of the singular value decomposition (SVD) for . diff --git a/src/Numerics/LinearAlgebra/Complex/Factorization/Evd.cs b/src/Numerics/LinearAlgebra/Complex/Factorization/Evd.cs index 2ea4b104..f12bcefc 100644 --- a/src/Numerics/LinearAlgebra/Complex/Factorization/Evd.cs +++ b/src/Numerics/LinearAlgebra/Complex/Factorization/Evd.cs @@ -31,12 +31,7 @@ using MathNet.Numerics.LinearAlgebra.Factorization; namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization { - -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else using Complex = System.Numerics.Complex; -#endif /// /// Eigenvalues and eigenvectors of a real matrix. diff --git a/src/Numerics/LinearAlgebra/Complex/Factorization/GramSchmidt.cs b/src/Numerics/LinearAlgebra/Complex/Factorization/GramSchmidt.cs index 4ca52436..b805aaa0 100644 --- a/src/Numerics/LinearAlgebra/Complex/Factorization/GramSchmidt.cs +++ b/src/Numerics/LinearAlgebra/Complex/Factorization/GramSchmidt.cs @@ -33,12 +33,7 @@ using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization { - -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else using Complex = System.Numerics.Complex; -#endif /// /// A class which encapsulates the functionality of the QR decomposition Modified Gram-Schmidt Orthogonalization. diff --git a/src/Numerics/LinearAlgebra/Complex/Factorization/LU.cs b/src/Numerics/LinearAlgebra/Complex/Factorization/LU.cs index 6ef4e2b2..d684416a 100644 --- a/src/Numerics/LinearAlgebra/Complex/Factorization/LU.cs +++ b/src/Numerics/LinearAlgebra/Complex/Factorization/LU.cs @@ -31,12 +31,7 @@ using MathNet.Numerics.LinearAlgebra.Factorization; namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization { - -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else using Complex = System.Numerics.Complex; -#endif /// /// A class which encapsulates the functionality of an LU factorization. diff --git a/src/Numerics/LinearAlgebra/Complex/Factorization/QR.cs b/src/Numerics/LinearAlgebra/Complex/Factorization/QR.cs index 64e4bd1a..3b685f5c 100644 --- a/src/Numerics/LinearAlgebra/Complex/Factorization/QR.cs +++ b/src/Numerics/LinearAlgebra/Complex/Factorization/QR.cs @@ -33,12 +33,7 @@ using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization { - -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else using Complex = System.Numerics.Complex; -#endif /// /// A class which encapsulates the functionality of the QR decomposition. diff --git a/src/Numerics/LinearAlgebra/Complex/Factorization/Svd.cs b/src/Numerics/LinearAlgebra/Complex/Factorization/Svd.cs index bd3c0eaf..8ba7ea13 100644 --- a/src/Numerics/LinearAlgebra/Complex/Factorization/Svd.cs +++ b/src/Numerics/LinearAlgebra/Complex/Factorization/Svd.cs @@ -34,12 +34,7 @@ using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization { - -#if NOSYSNUMERICS - using Numerics; -#else - using System.Numerics; -#endif + using Complex = System.Numerics.Complex; /// /// A class which encapsulates the functionality of the singular value decomposition (SVD). diff --git a/src/Numerics/LinearAlgebra/Complex/Factorization/UserCholesky.cs b/src/Numerics/LinearAlgebra/Complex/Factorization/UserCholesky.cs index 487ff885..d423eac3 100644 --- a/src/Numerics/LinearAlgebra/Complex/Factorization/UserCholesky.cs +++ b/src/Numerics/LinearAlgebra/Complex/Factorization/UserCholesky.cs @@ -33,12 +33,7 @@ using System; namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization { - -#if NOSYSNUMERICS - using Numerics; -#else - using System.Numerics; -#endif + using Complex = System.Numerics.Complex; /// /// A class which encapsulates the functionality of a Cholesky factorization for user matrices. diff --git a/src/Numerics/LinearAlgebra/Complex/Factorization/UserEvd.cs b/src/Numerics/LinearAlgebra/Complex/Factorization/UserEvd.cs index add638a3..c42697e0 100644 --- a/src/Numerics/LinearAlgebra/Complex/Factorization/UserEvd.cs +++ b/src/Numerics/LinearAlgebra/Complex/Factorization/UserEvd.cs @@ -32,12 +32,7 @@ using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization { - -#if NOSYSNUMERICS - using Numerics; -#else - using System.Numerics; -#endif + using Complex = System.Numerics.Complex; /// /// Eigenvalues and eigenvectors of a complex matrix. diff --git a/src/Numerics/LinearAlgebra/Complex/Factorization/UserGramSchmidt.cs b/src/Numerics/LinearAlgebra/Complex/Factorization/UserGramSchmidt.cs index eb280ac9..eab07099 100644 --- a/src/Numerics/LinearAlgebra/Complex/Factorization/UserGramSchmidt.cs +++ b/src/Numerics/LinearAlgebra/Complex/Factorization/UserGramSchmidt.cs @@ -32,12 +32,7 @@ using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization { - -#if NOSYSNUMERICS - using Numerics; -#else - using System.Numerics; -#endif + using Complex = System.Numerics.Complex; /// /// A class which encapsulates the functionality of the QR decomposition Modified Gram-Schmidt Orthogonalization. diff --git a/src/Numerics/LinearAlgebra/Complex/Factorization/UserLU.cs b/src/Numerics/LinearAlgebra/Complex/Factorization/UserLU.cs index 72243183..1ee4f788 100644 --- a/src/Numerics/LinearAlgebra/Complex/Factorization/UserLU.cs +++ b/src/Numerics/LinearAlgebra/Complex/Factorization/UserLU.cs @@ -32,12 +32,7 @@ using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization { - -#if NOSYSNUMERICS - using Numerics; -#else - using System.Numerics; -#endif + using Complex = System.Numerics.Complex; /// /// A class which encapsulates the functionality of an LU factorization. diff --git a/src/Numerics/LinearAlgebra/Complex/Factorization/UserQR.cs b/src/Numerics/LinearAlgebra/Complex/Factorization/UserQR.cs index dea5cb1a..307944ee 100644 --- a/src/Numerics/LinearAlgebra/Complex/Factorization/UserQR.cs +++ b/src/Numerics/LinearAlgebra/Complex/Factorization/UserQR.cs @@ -35,12 +35,7 @@ using MathNet.Numerics.Threading; namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization { - -#if NOSYSNUMERICS - using Numerics; -#else - using System.Numerics; -#endif + using Complex = System.Numerics.Complex; /// /// A class which encapsulates the functionality of the QR decomposition. diff --git a/src/Numerics/LinearAlgebra/Complex/Factorization/UserSvd.cs b/src/Numerics/LinearAlgebra/Complex/Factorization/UserSvd.cs index 48f0d529..a68c9785 100644 --- a/src/Numerics/LinearAlgebra/Complex/Factorization/UserSvd.cs +++ b/src/Numerics/LinearAlgebra/Complex/Factorization/UserSvd.cs @@ -32,12 +32,7 @@ using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization { - -#if NOSYSNUMERICS - using Numerics; -#else - using System.Numerics; -#endif + using Complex = System.Numerics.Complex; /// /// A class which encapsulates the functionality of the singular value decomposition (SVD) for . diff --git a/src/Numerics/LinearAlgebra/Complex/Matrix.cs b/src/Numerics/LinearAlgebra/Complex/Matrix.cs index 9842d874..e3faf813 100644 --- a/src/Numerics/LinearAlgebra/Complex/Matrix.cs +++ b/src/Numerics/LinearAlgebra/Complex/Matrix.cs @@ -35,12 +35,7 @@ using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Complex { - -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else using Complex = System.Numerics.Complex; -#endif /// /// Complex version of the class. diff --git a/src/Numerics/LinearAlgebra/Complex/Solvers/BiCgStab.cs b/src/Numerics/LinearAlgebra/Complex/Solvers/BiCgStab.cs index 544fb22c..e71f4cf2 100644 --- a/src/Numerics/LinearAlgebra/Complex/Solvers/BiCgStab.cs +++ b/src/Numerics/LinearAlgebra/Complex/Solvers/BiCgStab.cs @@ -33,12 +33,7 @@ using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Complex.Solvers { - -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else using Complex = System.Numerics.Complex; -#endif /// /// A Bi-Conjugate Gradient stabilized iterative matrix solver. diff --git a/src/Numerics/LinearAlgebra/Complex/Solvers/CompositeSolver.cs b/src/Numerics/LinearAlgebra/Complex/Solvers/CompositeSolver.cs index de30342f..fc66e48c 100644 --- a/src/Numerics/LinearAlgebra/Complex/Solvers/CompositeSolver.cs +++ b/src/Numerics/LinearAlgebra/Complex/Solvers/CompositeSolver.cs @@ -35,12 +35,7 @@ using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Complex.Solvers { - -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else using Complex = System.Numerics.Complex; -#endif /// /// A composite matrix solver. The actual solver is made by a sequence of @@ -51,7 +46,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Solvers /// Solver based on:
/// Faster PDE-based simulations using robust composite linear solvers
/// S. Bhowmicka, P. Raghavan a,*, L. McInnes b, B. Norris
- /// Future Generation Computer Systems, Vol 20, 2004, pp 373–387
+ /// Future Generation Computer Systems, Vol 20, 2004, pp 373�387
/// /// /// Note that if an iterator is passed to this solver it will be used for all the sub-solvers. diff --git a/src/Numerics/LinearAlgebra/Complex/Solvers/DiagonalPreconditioner.cs b/src/Numerics/LinearAlgebra/Complex/Solvers/DiagonalPreconditioner.cs index d2b008ba..94481c86 100644 --- a/src/Numerics/LinearAlgebra/Complex/Solvers/DiagonalPreconditioner.cs +++ b/src/Numerics/LinearAlgebra/Complex/Solvers/DiagonalPreconditioner.cs @@ -33,12 +33,7 @@ using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Complex.Solvers { - -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else using Complex = System.Numerics.Complex; -#endif /// /// A diagonal preconditioner. The preconditioner uses the inverse diff --git a/src/Numerics/LinearAlgebra/Complex/Solvers/GpBiCg.cs b/src/Numerics/LinearAlgebra/Complex/Solvers/GpBiCg.cs index 73bc5621..3fc29e8f 100644 --- a/src/Numerics/LinearAlgebra/Complex/Solvers/GpBiCg.cs +++ b/src/Numerics/LinearAlgebra/Complex/Solvers/GpBiCg.cs @@ -33,12 +33,7 @@ using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Complex.Solvers { - -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else using Complex = System.Numerics.Complex; -#endif /// /// A Generalized Product Bi-Conjugate Gradient iterative matrix solver. diff --git a/src/Numerics/LinearAlgebra/Complex/Solvers/ILU0Preconditioner.cs b/src/Numerics/LinearAlgebra/Complex/Solvers/ILU0Preconditioner.cs index 553863d6..cda5ee03 100644 --- a/src/Numerics/LinearAlgebra/Complex/Solvers/ILU0Preconditioner.cs +++ b/src/Numerics/LinearAlgebra/Complex/Solvers/ILU0Preconditioner.cs @@ -33,12 +33,7 @@ using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Complex.Solvers { - -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else using Complex = System.Numerics.Complex; -#endif /// /// An incomplete, level 0, LU factorization preconditioner. diff --git a/src/Numerics/LinearAlgebra/Complex/Solvers/ILUTPPreconditioner.cs b/src/Numerics/LinearAlgebra/Complex/Solvers/ILUTPPreconditioner.cs index 2e452963..df753632 100644 --- a/src/Numerics/LinearAlgebra/Complex/Solvers/ILUTPPreconditioner.cs +++ b/src/Numerics/LinearAlgebra/Complex/Solvers/ILUTPPreconditioner.cs @@ -34,12 +34,7 @@ using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Complex.Solvers { - -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else using Complex = System.Numerics.Complex; -#endif /// /// This class performs an Incomplete LU factorization with drop tolerance diff --git a/src/Numerics/LinearAlgebra/Complex/Solvers/MILU0Preconditioner.cs b/src/Numerics/LinearAlgebra/Complex/Solvers/MILU0Preconditioner.cs index c8594b13..148bb524 100644 --- a/src/Numerics/LinearAlgebra/Complex/Solvers/MILU0Preconditioner.cs +++ b/src/Numerics/LinearAlgebra/Complex/Solvers/MILU0Preconditioner.cs @@ -34,12 +34,7 @@ using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Complex.Solvers { - -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else using Complex = System.Numerics.Complex; -#endif /// /// A simple milu(0) preconditioner. diff --git a/src/Numerics/LinearAlgebra/Complex/Solvers/MlkBiCgStab.cs b/src/Numerics/LinearAlgebra/Complex/Solvers/MlkBiCgStab.cs index 388e3aef..54f9044f 100644 --- a/src/Numerics/LinearAlgebra/Complex/Solvers/MlkBiCgStab.cs +++ b/src/Numerics/LinearAlgebra/Complex/Solvers/MlkBiCgStab.cs @@ -37,12 +37,7 @@ using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Complex.Solvers { - -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else using Complex = System.Numerics.Complex; -#endif /// /// A Multiple-Lanczos Bi-Conjugate Gradient stabilized iterative matrix solver. diff --git a/src/Numerics/LinearAlgebra/Complex/Solvers/TFQMR.cs b/src/Numerics/LinearAlgebra/Complex/Solvers/TFQMR.cs index f47d77c4..5bf61bb8 100644 --- a/src/Numerics/LinearAlgebra/Complex/Solvers/TFQMR.cs +++ b/src/Numerics/LinearAlgebra/Complex/Solvers/TFQMR.cs @@ -33,14 +33,8 @@ using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Complex.Solvers { - -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else using Complex = System.Numerics.Complex; -#endif - /// /// A Transpose Free Quasi-Minimal Residual (TFQMR) iterative matrix solver. /// diff --git a/src/Numerics/LinearAlgebra/Complex/SparseMatrix.cs b/src/Numerics/LinearAlgebra/Complex/SparseMatrix.cs index a8f94bda..96f0836b 100644 --- a/src/Numerics/LinearAlgebra/Complex/SparseMatrix.cs +++ b/src/Numerics/LinearAlgebra/Complex/SparseMatrix.cs @@ -35,12 +35,7 @@ using MathNet.Numerics.LinearAlgebra.Storage; namespace MathNet.Numerics.LinearAlgebra.Complex { - -#if NOSYSNUMERICS - using Numerics; -#else - using System.Numerics; -#endif + using Complex = System.Numerics.Complex; /// /// A Matrix with sparse storage, intended for very large matrices where most of the cells are zero. diff --git a/src/Numerics/LinearAlgebra/Complex/SparseVector.cs b/src/Numerics/LinearAlgebra/Complex/SparseVector.cs index 7c422c93..2bc8b8f6 100644 --- a/src/Numerics/LinearAlgebra/Complex/SparseVector.cs +++ b/src/Numerics/LinearAlgebra/Complex/SparseVector.cs @@ -35,12 +35,7 @@ using System.Diagnostics; namespace MathNet.Numerics.LinearAlgebra.Complex { - -#if NOSYSNUMERICS - using Numerics; -#else - using System.Numerics; -#endif + using Complex = System.Numerics.Complex; /// /// A vector with sparse storage, intended for very large vectors where most of the cells are zero. diff --git a/src/Numerics/LinearAlgebra/Complex/Vector.cs b/src/Numerics/LinearAlgebra/Complex/Vector.cs index afcf0674..fbed2954 100644 --- a/src/Numerics/LinearAlgebra/Complex/Vector.cs +++ b/src/Numerics/LinearAlgebra/Complex/Vector.cs @@ -33,12 +33,7 @@ using System; namespace MathNet.Numerics.LinearAlgebra.Complex { - -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else using Complex = System.Numerics.Complex; -#endif /// /// Complex version of the class. diff --git a/src/Numerics/LinearAlgebra/Complex32/Factorization/DenseEvd.cs b/src/Numerics/LinearAlgebra/Complex32/Factorization/DenseEvd.cs index 892b890d..69e434ce 100644 --- a/src/Numerics/LinearAlgebra/Complex32/Factorization/DenseEvd.cs +++ b/src/Numerics/LinearAlgebra/Complex32/Factorization/DenseEvd.cs @@ -33,12 +33,7 @@ using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization { using Numerics; - -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else using Complex = System.Numerics.Complex; -#endif /// /// Eigenvalues and eigenvectors of a complex matrix. diff --git a/src/Numerics/LinearAlgebra/Complex32/Factorization/Evd.cs b/src/Numerics/LinearAlgebra/Complex32/Factorization/Evd.cs index bb607edc..9676902d 100644 --- a/src/Numerics/LinearAlgebra/Complex32/Factorization/Evd.cs +++ b/src/Numerics/LinearAlgebra/Complex32/Factorization/Evd.cs @@ -33,12 +33,7 @@ using MathNet.Numerics.LinearAlgebra.Factorization; namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization { using Numerics; - -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else using Complex = System.Numerics.Complex; -#endif /// /// Eigenvalues and eigenvectors of a real matrix. diff --git a/src/Numerics/LinearAlgebra/Complex32/Factorization/UserEvd.cs b/src/Numerics/LinearAlgebra/Complex32/Factorization/UserEvd.cs index fd5a2264..a9192442 100644 --- a/src/Numerics/LinearAlgebra/Complex32/Factorization/UserEvd.cs +++ b/src/Numerics/LinearAlgebra/Complex32/Factorization/UserEvd.cs @@ -33,10 +33,7 @@ using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization { using Numerics; - -#if !NOSYSNUMERICS - using System.Numerics; -#endif + using Complex = System.Numerics.Complex; /// /// Eigenvalues and eigenvectors of a complex matrix. diff --git a/src/Numerics/LinearAlgebra/Double/Factorization/DenseEvd.cs b/src/Numerics/LinearAlgebra/Double/Factorization/DenseEvd.cs index 12d4ab41..3552b656 100644 --- a/src/Numerics/LinearAlgebra/Double/Factorization/DenseEvd.cs +++ b/src/Numerics/LinearAlgebra/Double/Factorization/DenseEvd.cs @@ -32,12 +32,7 @@ using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Double.Factorization { - -#if NOSYSNUMERICS - using Numerics; -#else - using System.Numerics; -#endif + using Complex = System.Numerics.Complex; /// /// Eigenvalues and eigenvectors of a real matrix. diff --git a/src/Numerics/LinearAlgebra/Double/Factorization/Evd.cs b/src/Numerics/LinearAlgebra/Double/Factorization/Evd.cs index f5a65102..76031a3a 100644 --- a/src/Numerics/LinearAlgebra/Double/Factorization/Evd.cs +++ b/src/Numerics/LinearAlgebra/Double/Factorization/Evd.cs @@ -31,12 +31,7 @@ using MathNet.Numerics.LinearAlgebra.Factorization; namespace MathNet.Numerics.LinearAlgebra.Double.Factorization { - -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else using Complex = System.Numerics.Complex; -#endif /// /// Eigenvalues and eigenvectors of a real matrix. diff --git a/src/Numerics/LinearAlgebra/Double/Factorization/UserEvd.cs b/src/Numerics/LinearAlgebra/Double/Factorization/UserEvd.cs index 71c32907..9942b434 100644 --- a/src/Numerics/LinearAlgebra/Double/Factorization/UserEvd.cs +++ b/src/Numerics/LinearAlgebra/Double/Factorization/UserEvd.cs @@ -32,12 +32,7 @@ using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Double.Factorization { - -#if NOSYSNUMERICS - using Numerics; -#else - using System.Numerics; -#endif + using Complex = System.Numerics.Complex; /// /// Eigenvalues and eigenvectors of a real matrix. diff --git a/src/Numerics/LinearAlgebra/Factorization/Evd.cs b/src/Numerics/LinearAlgebra/Factorization/Evd.cs index 1820dbe0..7a2c373b 100644 --- a/src/Numerics/LinearAlgebra/Factorization/Evd.cs +++ b/src/Numerics/LinearAlgebra/Factorization/Evd.cs @@ -32,10 +32,7 @@ using System; namespace MathNet.Numerics.LinearAlgebra.Factorization { using Numerics; - -#if !NOSYSNUMERICS - using System.Numerics; -#endif + using Complex = System.Numerics.Complex; /// /// Eigenvalues and eigenvectors of a real matrix. diff --git a/src/Numerics/LinearAlgebra/Matrix.BCL.cs b/src/Numerics/LinearAlgebra/Matrix.BCL.cs index 2490512f..7ff14089 100644 --- a/src/Numerics/LinearAlgebra/Matrix.BCL.cs +++ b/src/Numerics/LinearAlgebra/Matrix.BCL.cs @@ -77,14 +77,14 @@ namespace MathNet.Numerics.LinearAlgebra return Storage.GetHashCode(); } -#if !PORTABLE && !NETSTANDARD +#if !NETSTANDARD1_3 /// /// Creates a new object that is a copy of the current instance. /// /// /// A new object that is a copy of this instance. - /// + /// object ICloneable.Clone() { return Clone(); diff --git a/src/Numerics/LinearAlgebra/Matrix.cs b/src/Numerics/LinearAlgebra/Matrix.cs index 6a9849c3..f5f0a412 100644 --- a/src/Numerics/LinearAlgebra/Matrix.cs +++ b/src/Numerics/LinearAlgebra/Matrix.cs @@ -44,7 +44,7 @@ namespace MathNet.Numerics.LinearAlgebra [Serializable] public abstract partial class Matrix : IFormattable, IEquatable> -#if !PORTABLE && !NETSTANDARD +#if !NETSTANDARD1_3 , ICloneable #endif where T : struct, IEquatable, IFormattable diff --git a/src/Numerics/LinearAlgebra/MatrixExtensions.cs b/src/Numerics/LinearAlgebra/MatrixExtensions.cs index 8dc58cad..07d1c1e4 100644 --- a/src/Numerics/LinearAlgebra/MatrixExtensions.cs +++ b/src/Numerics/LinearAlgebra/MatrixExtensions.cs @@ -29,11 +29,7 @@ namespace MathNet.Numerics.LinearAlgebra { -#if NOSYSNUMERICS - using Complex64 = Numerics.Complex; -#else using Complex64 = System.Numerics.Complex; -#endif public static class MatrixExtensions { diff --git a/src/Numerics/LinearAlgebra/Single/Factorization/DenseEvd.cs b/src/Numerics/LinearAlgebra/Single/Factorization/DenseEvd.cs index 29378a87..18b65004 100644 --- a/src/Numerics/LinearAlgebra/Single/Factorization/DenseEvd.cs +++ b/src/Numerics/LinearAlgebra/Single/Factorization/DenseEvd.cs @@ -32,12 +32,7 @@ using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Single.Factorization { - -#if NOSYSNUMERICS - using Numerics; -#else - using System.Numerics; -#endif + using Complex = System.Numerics.Complex; /// /// Eigenvalues and eigenvectors of a real matrix. diff --git a/src/Numerics/LinearAlgebra/Single/Factorization/Evd.cs b/src/Numerics/LinearAlgebra/Single/Factorization/Evd.cs index a28c8802..d8034fde 100644 --- a/src/Numerics/LinearAlgebra/Single/Factorization/Evd.cs +++ b/src/Numerics/LinearAlgebra/Single/Factorization/Evd.cs @@ -27,17 +27,12 @@ // OTHER DEALINGS IN THE SOFTWARE. // +using System; using MathNet.Numerics.LinearAlgebra.Factorization; namespace MathNet.Numerics.LinearAlgebra.Single.Factorization { - using System; - -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else using Complex = System.Numerics.Complex; -#endif /// /// Eigenvalues and eigenvectors of a real matrix. diff --git a/src/Numerics/LinearAlgebra/Single/Factorization/UserEvd.cs b/src/Numerics/LinearAlgebra/Single/Factorization/UserEvd.cs index 6a7b49ed..b65235fa 100644 --- a/src/Numerics/LinearAlgebra/Single/Factorization/UserEvd.cs +++ b/src/Numerics/LinearAlgebra/Single/Factorization/UserEvd.cs @@ -33,10 +33,7 @@ using MathNet.Numerics.Properties; namespace MathNet.Numerics.LinearAlgebra.Single.Factorization { using Numerics; - -#if !NOSYSNUMERICS - using System.Numerics; -#endif + using Complex = System.Numerics.Complex; /// /// Eigenvalues and eigenvectors of a real matrix. diff --git a/src/Numerics/LinearAlgebra/Solvers/SolverSetup.cs b/src/Numerics/LinearAlgebra/Solvers/SolverSetup.cs index a094040d..f294c821 100644 --- a/src/Numerics/LinearAlgebra/Solvers/SolverSetup.cs +++ b/src/Numerics/LinearAlgebra/Solvers/SolverSetup.cs @@ -44,7 +44,7 @@ namespace MathNet.Numerics.LinearAlgebra.Solvers /// The types that should not be loaded. public static IEnumerable> LoadFromAssembly(Assembly assembly, bool ignoreFailed = true, params Type[] typesToExclude) { -#if NET45REFLECTION || NETSTANDARD +#if NETSTANDARD1_3 TypeInfo setupInterfaceType = typeof(IIterativeSolverSetup).GetTypeInfo(); IEnumerable candidates = assembly.DefinedTypes .Where(typeInfo => !typeInfo.IsAbstract && !typeInfo.IsEnum && !typeInfo.IsInterface && typeInfo.IsVisible) @@ -73,7 +73,7 @@ namespace MathNet.Numerics.LinearAlgebra.Solvers } } -#if NET45REFLECTION || NETSTANDARD +#if NETSTANDARD1_3 var excludedTypes = new List(typesToExclude.Select(type => type.GetTypeInfo())); return setups .Where(s => !excludedTypes.Any(t => t.IsAssignableFrom(s.SolverType.GetTypeInfo()) || t.IsAssignableFrom(s.PreconditionerType.GetTypeInfo()))) @@ -94,7 +94,7 @@ namespace MathNet.Numerics.LinearAlgebra.Solvers /// The types that should not be loaded. public static IEnumerable> LoadFromAssembly(Type typeInAssembly, bool ignoreFailed = true, params Type[] typesToExclude) { -#if NET45REFLECTION || NETSTANDARD +#if NETSTANDARD1_3 return LoadFromAssembly(typeInAssembly.GetTypeInfo().Assembly, ignoreFailed, typesToExclude); #else return LoadFromAssembly(typeInAssembly.Assembly, ignoreFailed, typesToExclude); @@ -109,7 +109,7 @@ namespace MathNet.Numerics.LinearAlgebra.Solvers /// The types that should not be loaded. public static IEnumerable> LoadFromAssembly(AssemblyName assemblyName, bool ignoreFailed = true, params Type[] typesToExclude) { -#if NET45REFLECTION || NETSTANDARD +#if NETSTANDARD1_3 return LoadFromAssembly(Assembly.Load(assemblyName), ignoreFailed, typesToExclude); #else return LoadFromAssembly(Assembly.Load(assemblyName.FullName), ignoreFailed, typesToExclude); diff --git a/src/Numerics/LinearAlgebra/Storage/DenseColumnMajorMatrixStorage.cs b/src/Numerics/LinearAlgebra/Storage/DenseColumnMajorMatrixStorage.cs index 02cab1ae..97b06fba 100644 --- a/src/Numerics/LinearAlgebra/Storage/DenseColumnMajorMatrixStorage.cs +++ b/src/Numerics/LinearAlgebra/Storage/DenseColumnMajorMatrixStorage.cs @@ -115,7 +115,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage /// void RowColumnAtIndex(int index, out int row, out int column) { -#if PORTABLE || NETSTANDARD +#if NETSTANDARD1_3 row = index % RowCount; column = index / RowCount; #else diff --git a/src/Numerics/LinearAlgebra/Storage/MatrixStorage.cs b/src/Numerics/LinearAlgebra/Storage/MatrixStorage.cs index c725c7bb..b95dc93f 100644 --- a/src/Numerics/LinearAlgebra/Storage/MatrixStorage.cs +++ b/src/Numerics/LinearAlgebra/Storage/MatrixStorage.cs @@ -190,7 +190,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage { for (var i = 0; i < hashNum; i++) { -#if PORTABLE || NETSTANDARD +#if NETSTANDARD1_3 int col = i%ColumnCount; int row = i/ColumnCount; #else diff --git a/src/Numerics/LinearAlgebra/Vector.BCL.cs b/src/Numerics/LinearAlgebra/Vector.BCL.cs index de5c8a08..d15cf95e 100644 --- a/src/Numerics/LinearAlgebra/Vector.BCL.cs +++ b/src/Numerics/LinearAlgebra/Vector.BCL.cs @@ -77,7 +77,7 @@ namespace MathNet.Numerics.LinearAlgebra return Storage.GetHashCode(); } -#if !PORTABLE && !NETSTANDARD +#if !NETSTANDARD1_3 /// /// Creates a new object that is a copy of the current instance. diff --git a/src/Numerics/LinearAlgebra/Vector.cs b/src/Numerics/LinearAlgebra/Vector.cs index 73e436b2..d92a5210 100644 --- a/src/Numerics/LinearAlgebra/Vector.cs +++ b/src/Numerics/LinearAlgebra/Vector.cs @@ -43,7 +43,7 @@ namespace MathNet.Numerics.LinearAlgebra [Serializable] public abstract partial class Vector : IFormattable, IEquatable>, IList, IList -#if !PORTABLE && !NETSTANDARD +#if !NETSTANDARD1_3 , ICloneable #endif where T : struct, IEquatable, IFormattable diff --git a/src/Numerics/LinearAlgebra/VectorExtensions.cs b/src/Numerics/LinearAlgebra/VectorExtensions.cs index 190893d1..3358274a 100644 --- a/src/Numerics/LinearAlgebra/VectorExtensions.cs +++ b/src/Numerics/LinearAlgebra/VectorExtensions.cs @@ -29,11 +29,7 @@ namespace MathNet.Numerics.LinearAlgebra { -#if NOSYSNUMERICS - using Complex64 = Numerics.Complex; -#else using Complex64 = System.Numerics.Complex; -#endif public static class VectorExtensions { diff --git a/src/Numerics/Numerics.csproj b/src/Numerics/Numerics.csproj index afa33eb4..20a71e14 100644 --- a/src/Numerics/Numerics.csproj +++ b/src/Numerics/Numerics.csproj @@ -1,59 +1,53 @@ - - Library - net40;netstandard1.3;netstandard2.0 - 2.0.1 - MathNet.Numerics - MathNet.Numerics - true - MathNet.Numerics - 4.0.0 - beta05 - 4.0.0-beta05 - 4.0.0-beta05 - 4.0.0.0 - 4.0.0.0 - Math.NET Numerics - Christoph Ruegg, Marcus Cuda, Jurgen Van Gael - Math.NET Project - Math.NET Numerics - Math.NET Numerics is the numerical foundation of the Math.NET project, aiming to provide methods and algorithms for numerical computations in science, engineering and every day use. Supports .Net Framework 4.0 or higher and .Net Standard 1.3 or higher, on Windows, Linux and Mac. - Copyright Math.NET Project - false - https://numerics.mathdotnet.com/License.html - https://numerics.mathdotnet.com/ - https://www.mathdotnet.com/images/MathNet128.png - BUG: Distributions: BetaScaled no longer ignores optional random source parameter + + Library + net40;netstandard1.3;netstandard2.0 + 2.0.1 + MathNet.Numerics + MathNet.Numerics + true + MathNet.Numerics + 4.0.0 + beta05 + 4.0.0-beta05 + 4.0.0-beta05 + 4.0.0.0 + 4.0.0.0 + Math.NET Numerics + Christoph Ruegg, Marcus Cuda, Jurgen Van Gael + Math.NET Project + Math.NET Numerics + Math.NET Numerics is the numerical foundation of the Math.NET project, aiming to provide methods and algorithms for numerical computations in science, engineering and every day use. Supports .Net Framework 4.0 or higher and .Net Standard 1.3 or higher, on Windows, Linux and Mac. + Copyright Math.NET Project + false + https://numerics.mathdotnet.com/License.html + https://numerics.mathdotnet.com/ + https://www.mathdotnet.com/images/MathNet128.png + BUG: Distributions: BetaScaled no longer ignores optional random source parameter BUG: Trigonometry: Complex trigonometric functions behave on large imput ~diluculo All: code quality fixes ~Jonas Nyrup - math numeric statistics probability integration interpolation regression solve fit linear algebra matrix fft - false - https://github.com/mathnet/mathnet-numerics - git - en - false - true - false - true - false - true - true - 1701;1702;1705;1591;1573 - - - NETSTANDARD - - - NETSTANDARD;NATIVE - - - NATIVE - - - - - - - - + math numeric statistics probability integration interpolation regression solve fit linear algebra matrix fft + false + https://github.com/mathnet/mathnet-numerics + git + en + false + true + false + true + false + true + true + 1701;1702;1705;1591;1573 + + + NATIVE + + + + + + + + diff --git a/src/Numerics/Permutation.cs b/src/Numerics/Permutation.cs index 86ec2fb0..3adb0dea 100644 --- a/src/Numerics/Permutation.cs +++ b/src/Numerics/Permutation.cs @@ -148,19 +148,7 @@ namespace MathNet.Numerics { if (idx[i] != i) { -#if !PORTABLE int q = Array.FindIndex(idx, i + 1, x => x == i); -#else - int q = -1; - for(int j = i+1; j < Dimension; j++) - { - if(idx[j] == i) - { - q = j; - break; - } - } -#endif var t = idx[i]; idx[i] = q; idx[q] = t; @@ -201,4 +189,4 @@ namespace MathNet.Numerics return true; } } -} \ No newline at end of file +} diff --git a/src/Numerics/Precision.Equality.cs b/src/Numerics/Precision.Equality.cs index 48e8754e..62c4d30e 100644 --- a/src/Numerics/Precision.Equality.cs +++ b/src/Numerics/Precision.Equality.cs @@ -28,16 +28,12 @@ // using System; +using System.Numerics; using System.Collections.Generic; using MathNet.Numerics.LinearAlgebra; namespace MathNet.Numerics { - -#if !NOSYSNUMERICS - using Complex = System.Numerics.Complex; -#endif - // TODO PERF: Cache/Precompute 10^x terms public static partial class Precision @@ -324,13 +320,13 @@ namespace MathNet.Numerics } /// - /// Compares two doubles and determines if they are equal to within the specified number of decimal places or not, using the + /// Compares two doubles and determines if they are equal to within the specified number of decimal places or not, using the /// number of decimal places as an absolute measure. /// /// /// - /// The values are equal if the difference between the two numbers is smaller than 0.5e-decimalPlaces. We divide by - /// two so that we have half the range on each side of the numbers, e.g. if == 2, then 0.01 will equal between + /// The values are equal if the difference between the two numbers is smaller than 0.5e-decimalPlaces. We divide by + /// two so that we have half the range on each side of the numbers, e.g. if == 2, then 0.01 will equal between /// 0.005 and 0.015, but not 0.02 and not 0.00 /// /// @@ -357,19 +353,19 @@ namespace MathNet.Numerics // The values are equal if the difference between the two numbers is smaller than // 10^(-numberOfDecimalPlaces). We divide by two so that we have half the range - // on each side of the numbers, e.g. if decimalPlaces == 2, + // on each side of the numbers, e.g. if decimalPlaces == 2, // then 0.01 will equal between 0.005 and 0.015, but not 0.02 and not 0.00 return Math.Abs(diff) < Math.Pow(10, -decimalPlaces) / 2d; } /// - /// Compares two doubles and determines if they are equal to within the specified number of decimal places or not, using the + /// Compares two doubles and determines if they are equal to within the specified number of decimal places or not, using the /// number of decimal places as an absolute measure. /// /// /// - /// The values are equal if the difference between the two numbers is smaller than 0.5e-decimalPlaces. We divide by - /// two so that we have half the range on each side of the numbers, e.g. if == 2, then 0.01 will equal between + /// The values are equal if the difference between the two numbers is smaller than 0.5e-decimalPlaces. We divide by + /// two so that we have half the range on each side of the numbers, e.g. if == 2, then 0.01 will equal between /// 0.005 and 0.015, but not 0.02 and not 0.00 /// /// @@ -388,8 +384,8 @@ namespace MathNet.Numerics /// /// /// - /// The values are equal if the difference between the two numbers is smaller than 10^(-numberOfDecimalPlaces). We divide by - /// two so that we have half the range on each side of the numbers, e.g. if == 2, then 0.01 will equal between + /// The values are equal if the difference between the two numbers is smaller than 10^(-numberOfDecimalPlaces). We divide by + /// two so that we have half the range on each side of the numbers, e.g. if == 2, then 0.01 will equal between /// 0.005 and 0.015, but not 0.02 and not 0.00 /// /// @@ -433,7 +429,7 @@ namespace MathNet.Numerics { // The values are equal if the difference between the two numbers is smaller than // 10^(-numberOfDecimalPlaces). We divide by two so that we have half the range - // on each side of the numbers, e.g. if decimalPlaces == 2, + // on each side of the numbers, e.g. if decimalPlaces == 2, // then 0.01 will equal between 0.005 and 0.015, but not 0.02 and not 0.00 return Math.Abs(diff) < Math.Pow(10, -decimalPlaces) / 2d; } @@ -449,7 +445,7 @@ namespace MathNet.Numerics // The values are equal if the difference between the two numbers is smaller than // 10^(-numberOfDecimalPlaces). We divide by two so that we have half the range - // on each side of the numbers, e.g. if decimalPlaces == 2, + // on each side of the numbers, e.g. if decimalPlaces == 2, // then 0.01 will equal between 0.00995 and 0.01005, but not 0.0015 and not 0.0095 return Math.Abs(diff) < Math.Pow(10, magnitudeOfMax - decimalPlaces) / 2d; } @@ -460,8 +456,8 @@ namespace MathNet.Numerics /// /// /// - /// The values are equal if the difference between the two numbers is smaller than 10^(-numberOfDecimalPlaces). We divide by - /// two so that we have half the range on each side of the numbers, e.g. if == 2, then 0.01 will equal between + /// The values are equal if the difference between the two numbers is smaller than 10^(-numberOfDecimalPlaces). We divide by + /// two so that we have half the range on each side of the numbers, e.g. if == 2, then 0.01 will equal between /// 0.005 and 0.015, but not 0.02 and not 0.00 /// /// @@ -475,7 +471,7 @@ namespace MathNet.Numerics } /// - /// Compares two doubles and determines if they are equal to within the specified number of decimal places or not, using the + /// Compares two doubles and determines if they are equal to within the specified number of decimal places or not, using the /// number of decimal places as an absolute measure. /// /// The first value. @@ -487,7 +483,7 @@ namespace MathNet.Numerics } /// - /// Compares two doubles and determines if they are equal to within the specified number of decimal places or not, using the + /// Compares two doubles and determines if they are equal to within the specified number of decimal places or not, using the /// number of decimal places as an absolute measure. /// /// The first value. @@ -499,7 +495,7 @@ namespace MathNet.Numerics } /// - /// Compares two doubles and determines if they are equal to within the specified number of decimal places or not, using the + /// Compares two doubles and determines if they are equal to within the specified number of decimal places or not, using the /// number of decimal places as an absolute measure. /// /// The first value. @@ -511,7 +507,7 @@ namespace MathNet.Numerics } /// - /// Compares two doubles and determines if they are equal to within the specified number of decimal places or not, using the + /// Compares two doubles and determines if they are equal to within the specified number of decimal places or not, using the /// number of decimal places as an absolute measure. /// /// The first value. @@ -575,14 +571,14 @@ namespace MathNet.Numerics /// /// /// - /// Determines the 'number' of floating point numbers between two values (i.e. the number of discrete steps - /// between the two numbers) and then checks if that is within the specified tolerance. So if a tolerance - /// of 1 is passed then the result will be true only if the two numbers have the same binary representation + /// Determines the 'number' of floating point numbers between two values (i.e. the number of discrete steps + /// between the two numbers) and then checks if that is within the specified tolerance. So if a tolerance + /// of 1 is passed then the result will be true only if the two numbers have the same binary representation /// OR if they are two adjacent numbers that only differ by one step. /// /// /// The comparison method used is explained in http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm . The article - /// at http://www.extremeoptimization.com/resources/Articles/FPDotNetConceptsAndFormats.aspx explains how to transform the C code to + /// at http://www.extremeoptimization.com/resources/Articles/FPDotNetConceptsAndFormats.aspx explains how to transform the C code to /// .NET enabled code without using pointers and unsafe code. /// /// @@ -620,7 +616,7 @@ namespace MathNet.Numerics // Get the second double and convert it to an integer value (by using the binary representation) long secondUlong = AsDirectionalInt64(b); - // Now compare the values. + // Now compare the values. // Note that this comparison can overflow so we'll approach this differently // Do note that we could overflow this way too. We should probably check that we don't. return (a > b) ? (secondUlong + maxNumbersBetween >= firstUlong) : (firstUlong + maxNumbersBetween >= secondUlong); @@ -663,7 +659,7 @@ namespace MathNet.Numerics // Get the second float and convert it to an integer value (by using the binary representation) int secondUlong = AsDirectionalInt32(b); - // Now compare the values. + // Now compare the values. // Note that this comparison can overflow so we'll approach this differently // Do note that we could overflow this way too. We should probably check that we don't. return (a > b) ? (secondUlong + maxNumbersBetween >= firstUlong) : (firstUlong + maxNumbersBetween >= secondUlong); diff --git a/src/Numerics/Precision.cs b/src/Numerics/Precision.cs index 1c1255ef..d6e49468 100644 --- a/src/Numerics/Precision.cs +++ b/src/Numerics/Precision.cs @@ -762,11 +762,7 @@ namespace MathNet.Numerics [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")] static double Truncate(double value) { -#if PORTABLE - return value >= 0.0 ? Math.Floor(value) : Math.Ceiling(value); -#else return Math.Truncate(value); -#endif } static int SingleToInt32Bits(float value) diff --git a/src/Numerics/Properties/AssemblyInfo.cs b/src/Numerics/Properties/AssemblyInfo.cs index da1a1a3a..925e7d82 100644 --- a/src/Numerics/Properties/AssemblyInfo.cs +++ b/src/Numerics/Properties/AssemblyInfo.cs @@ -27,33 +27,11 @@ // using System; -using System.Reflection; -using System.Resources; using System.Runtime.CompilerServices; - -#if !PORTABLE using System.Runtime.InteropServices; -#endif [assembly: CLSCompliant(true)] - -#if PORTABLE || NETSTANDARD - -[assembly: InternalsVisibleTo("MathNet.Numerics.UnitTests")] -[assembly: InternalsVisibleTo("MathNet.Numerics.UnitTests7")] -[assembly: InternalsVisibleTo("MathNet.Numerics.UnitTests47")] -[assembly: InternalsVisibleTo("MathNet.Numerics.UnitTests78")] -[assembly: InternalsVisibleTo("MathNet.Numerics.UnitTests259")] -[assembly: InternalsVisibleTo("MathNet.Numerics.UnitTests328")] - -#elif NET35 - -[assembly: InternalsVisibleTo("MathNet.Numerics.UnitTests")] -[assembly: InternalsVisibleTo("MathNet.Numerics.UnitTestsNet35")] - -#else - [assembly: ComVisible(false)] [assembly: Guid("7b66646f-f0ee-425d-9065-910d1937a2df")] @@ -61,10 +39,8 @@ using System.Runtime.InteropServices; [assembly: InternalsVisibleTo("MathNet.Numerics.UnitTests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100ed2314a577643d859571b8b9307c6ff2670525c4598fbb307e57ea65ebf5d4417284cb3da9181636480b623f4db8cc3c1947244ba069df0df86e2431621f51a488f9929519a1c5d0ae595f6e2d0e4094685f0c1229ff658360acbb9f63f1a0258e984dda00dc7ad4fd16dbb550ec1ef8a11df138402b7c1998ee224e652c839b")] #else [assembly: InternalsVisibleTo("MathNet.Numerics.UnitTests")] -[assembly: InternalsVisibleTo("MathNet.Numerics.UnitTestsMKL")] -[assembly: InternalsVisibleTo("MathNet.Numerics.UnitTestsCUDA")] -[assembly: InternalsVisibleTo("MathNet.Numerics.UnitTestsOpenBLAS")] +[assembly: InternalsVisibleTo("MathNet.Numerics.UnitTests.MKL")] +[assembly: InternalsVisibleTo("MathNet.Numerics.UnitTests.CUDA")] +[assembly: InternalsVisibleTo("MathNet.Numerics.UnitTests.OpenBLAS")] [assembly: InternalsVisibleTo("Benchmark")] #endif - -#endif diff --git a/src/Numerics/Properties/Resources.Designer.cs b/src/Numerics/Properties/Resources.Designer.cs index a31c5ef1..112add65 100644 --- a/src/Numerics/Properties/Resources.Designer.cs +++ b/src/Numerics/Properties/Resources.Designer.cs @@ -12,8 +12,8 @@ using System.Reflection; namespace MathNet.Numerics.Properties { using System; - - + + /// /// A strongly-typed resource class, for looking up localized strings, etc. /// @@ -25,22 +25,22 @@ namespace MathNet.Numerics.Properties { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] public class Resources { - + private static global::System.Resources.ResourceManager resourceMan; - + private static global::System.Globalization.CultureInfo resourceCulture; - + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal Resources() { } - + /// /// Returns the cached ResourceManager instance used by this class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] public static global::System.Resources.ResourceManager ResourceManager { get { -#if NET45REFLECTION || NETSTANDARD +#if NETSTANDARD1_3 if (object.ReferenceEquals(resourceMan, null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MathNet.Numerics.Properties.Resources", typeof(Resources).GetTypeInfo().Assembly); @@ -56,7 +56,7 @@ namespace MathNet.Numerics.Properties { return resourceMan; } } - + /// /// Overrides the current thread's CurrentUICulture property for all /// resource lookups using this strongly typed resource class. @@ -70,7 +70,7 @@ namespace MathNet.Numerics.Properties { resourceCulture = value; } } - + /// /// Looks up a localized string similar to The accuracy couldn't be reached with the specified number of iterations.. /// @@ -79,7 +79,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("AccuracyNotReached", resourceCulture); } } - + /// /// Looks up a localized string similar to The array arguments must have the same length.. /// @@ -88,7 +88,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("ArgumentArraysSameLength", resourceCulture); } } - + /// /// Looks up a localized string similar to The given array has the wrong length. Should be {0}.. /// @@ -97,7 +97,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("ArgumentArrayWrongLength", resourceCulture); } } - + /// /// Looks up a localized string similar to The argument must be between 0 and 1.. /// @@ -106,7 +106,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("ArgumentBetween0And1", resourceCulture); } } - + /// /// Looks up a localized string similar to Value cannot be in the range -1 < x < 1.. /// @@ -115,7 +115,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("ArgumentCannotBeBetweenOneAndNegativeOne", resourceCulture); } } - + /// /// Looks up a localized string similar to Value must be even.. /// @@ -124,7 +124,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("ArgumentEven", resourceCulture); } } - + /// /// Looks up a localized string similar to The histogram does not contain the value.. /// @@ -133,7 +133,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("ArgumentHistogramContainsNot", resourceCulture); } } - + /// /// Looks up a localized string similar to Value is expected to be between {0} and {1} (including {0} and {1}).. /// @@ -142,7 +142,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("ArgumentInIntervalXYInclusive", resourceCulture); } } - + /// /// Looks up a localized string similar to At least one item of {0} is a null reference (Nothing in Visual Basic).. /// @@ -151,7 +151,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("ArgumentItemNull", resourceCulture); } } - + /// /// Looks up a localized string similar to Value must be greater than or equal to one.. /// @@ -160,7 +160,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("ArgumentLessThanOne", resourceCulture); } } - + /// /// Looks up a localized string similar to Matrix dimensions must agree.. /// @@ -169,7 +169,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("ArgumentMatrixDimensions", resourceCulture); } } - + /// /// Looks up a localized string similar to Matrix dimensions must agree: {0}.. /// @@ -178,7 +178,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("ArgumentMatrixDimensions1", resourceCulture); } } - + /// /// Looks up a localized string similar to Matrix dimensions must agree: op1 is {0}, op2 is {1}.. /// @@ -187,7 +187,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("ArgumentMatrixDimensions2", resourceCulture); } } - + /// /// Looks up a localized string similar to Matrix dimensions must agree: op1 is {0}, op2 is {1}, op3 is {2}.. /// @@ -196,7 +196,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("ArgumentMatrixDimensions3", resourceCulture); } } - + /// /// Looks up a localized string similar to The requested matrix does not exist.. /// @@ -205,7 +205,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("ArgumentMatrixDoesNotExist", resourceCulture); } } - + /// /// Looks up a localized string similar to The matrix indices must not be out of range of the given matrix.. /// @@ -214,7 +214,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("ArgumentMatrixIndexOutOfRange", resourceCulture); } } - + /// /// Looks up a localized string similar to Matrix must not be rank deficient.. /// @@ -223,7 +223,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("ArgumentMatrixNotRankDeficient", resourceCulture); } } - + /// /// Looks up a localized string similar to Matrix must not be singular.. /// @@ -232,7 +232,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("ArgumentMatrixNotSingular", resourceCulture); } } - + /// /// Looks up a localized string similar to Matrix must be positive definite.. /// @@ -241,7 +241,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("ArgumentMatrixPositiveDefinite", resourceCulture); } } - + /// /// Looks up a localized string similar to Matrix column dimensions must agree.. /// @@ -250,7 +250,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("ArgumentMatrixSameColumnDimension", resourceCulture); } } - + /// /// Looks up a localized string similar to Matrix row dimensions must agree.. /// @@ -259,7 +259,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("ArgumentMatrixSameRowDimension", resourceCulture); } } - + /// /// Looks up a localized string similar to Matrix must have exactly one column.. /// @@ -268,7 +268,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("ArgumentMatrixSingleColumn", resourceCulture); } } - + /// /// Looks up a localized string similar to Matrix must have exactly one column and row, thus have only one cell.. /// @@ -277,7 +277,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("ArgumentMatrixSingleColumnRow", resourceCulture); } } - + /// /// Looks up a localized string similar to Matrix must have exactly one row.. /// @@ -286,7 +286,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("ArgumentMatrixSingleRow", resourceCulture); } } - + /// /// Looks up a localized string similar to Matrix must be square.. /// @@ -295,7 +295,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("ArgumentMatrixSquare", resourceCulture); } } - + /// /// Looks up a localized string similar to Matrix must be symmetric.. /// @@ -304,7 +304,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("ArgumentMatrixSymmetric", resourceCulture); } } - + /// /// Looks up a localized string similar to Matrix must be symmetric positive definite.. /// @@ -313,7 +313,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("ArgumentMatrixSymmetricPositiveDefinite", resourceCulture); } } - + /// /// Looks up a localized string similar to In the specified range, the exclusive maximum must be greater than the inclusive minimum.. /// @@ -322,7 +322,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("ArgumentMaxExclusiveMustBeLargerThanMinInclusive", resourceCulture); } } - + /// /// Looks up a localized string similar to In the specified range, the minimum is greater than maximum.. /// @@ -331,7 +331,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("ArgumentMinValueGreaterThanMaxValue", resourceCulture); } } - + /// /// Looks up a localized string similar to Value must be positive.. /// @@ -340,7 +340,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("ArgumentMustBePositive", resourceCulture); } } - + /// /// Looks up a localized string similar to Value must neither be infinite nor NaN.. /// @@ -349,7 +349,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("ArgumentNotInfinityNaN", resourceCulture); } } - + /// /// Looks up a localized string similar to Value must not be negative (zero is ok).. /// @@ -358,7 +358,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("ArgumentNotNegative", resourceCulture); } } - + /// /// Looks up a localized string similar to {0} is a null reference (Nothing in Visual Basic).. /// @@ -367,7 +367,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("ArgumentNull", resourceCulture); } } - + /// /// Looks up a localized string similar to Value must be odd.. /// @@ -376,7 +376,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("ArgumentOdd", resourceCulture); } } - + /// /// Looks up a localized string similar to {0} must be greater than {1}.. /// @@ -385,7 +385,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("ArgumentOutOfRangeGreater", resourceCulture); } } - + /// /// Looks up a localized string similar to {0} must be greater than or equal to {1}.. /// @@ -394,7 +394,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("ArgumentOutOfRangeGreaterEqual", resourceCulture); } } - + /// /// Looks up a localized string similar to {0} must be smaller than {1}.. /// @@ -403,7 +403,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("ArgumentOutOfRangeSmaller", resourceCulture); } } - + /// /// Looks up a localized string similar to {0} must be smaller than or equal to {1}.. /// @@ -412,7 +412,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("ArgumentOutOfRangeSmallerEqual", resourceCulture); } } - + /// /// Looks up a localized string similar to The chosen parameter set is invalid (probably some value is out of range).. /// @@ -421,7 +421,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("ArgumentParameterSetInvalid", resourceCulture); } } - + /// /// Looks up a localized string similar to The given expression does not represent a complex number.. /// @@ -430,7 +430,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("ArgumentParseComplexNumber", resourceCulture); } } - + /// /// Looks up a localized string similar to Value must be positive (and not zero).. /// @@ -439,7 +439,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("ArgumentPositive", resourceCulture); } } - + /// /// Looks up a localized string similar to Size must be a Power of Two.. /// @@ -448,7 +448,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("ArgumentPowerOfTwo", resourceCulture); } } - + /// /// Looks up a localized string similar to Size must be a Power of Two in every dimension.. /// @@ -457,7 +457,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("ArgumentPowerOfTwoEveryDimension", resourceCulture); } } - + /// /// Looks up a localized string similar to The range between {0} and {1} must be less than or equal to {2}.. /// @@ -466,7 +466,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("ArgumentRangeLessEqual", resourceCulture); } } - + /// /// Looks up a localized string similar to Arguments must be different objects.. /// @@ -475,7 +475,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("ArgumentReferenceDifferent", resourceCulture); } } - + /// /// Looks up a localized string similar to Array must have exactly one dimension (and not be null).. /// @@ -484,7 +484,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("ArgumentSingleDimensionArray", resourceCulture); } } - + /// /// Looks up a localized string similar to Value is too large.. /// @@ -493,7 +493,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("ArgumentTooLarge", resourceCulture); } } - + /// /// Looks up a localized string similar to Value is too large for the current iteration limit.. /// @@ -502,7 +502,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("ArgumentTooLargeForIterationLimit", resourceCulture); } } - + /// /// Looks up a localized string similar to Type mismatch.. /// @@ -511,7 +511,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("ArgumentTypeMismatch", resourceCulture); } } - + /// /// Looks up a localized string similar to The upper bound must be strictly larger than the lower bound.. /// @@ -520,7 +520,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("ArgumentUpperBoundMustBeLargerThanLowerBound", resourceCulture); } } - + /// /// Looks up a localized string similar to The upper bound must be at least as large as the lower bound.. /// @@ -529,7 +529,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("ArgumentUpperBoundMustBeLargerThanOrEqualToLowerBound", resourceCulture); } } - + /// /// Looks up a localized string similar to Array length must be a multiple of {0}.. /// @@ -538,7 +538,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("ArgumentVectorLengthsMultipleOf", resourceCulture); } } - + /// /// Looks up a localized string similar to All vectors must have the same dimensionality.. /// @@ -547,7 +547,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("ArgumentVectorsSameLength", resourceCulture); } } - + /// /// Looks up a localized string similar to The vector must have 3 dimensions.. /// @@ -556,7 +556,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("ArgumentVectorThreeDimensional", resourceCulture); } } - + /// /// Looks up a localized string similar to The given array is too small. It must be at least {0} long.. /// @@ -565,7 +565,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("ArrayTooSmall", resourceCulture); } } - + /// /// Looks up a localized string similar to Big endian files are not supported.. /// @@ -574,7 +574,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("BigEndianNotSupported", resourceCulture); } } - + /// /// Looks up a localized string similar to The supplied collection is empty.. /// @@ -583,7 +583,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("CollectionEmpty", resourceCulture); } } - + /// /// Looks up a localized string similar to Complex matrices are not supported.. /// @@ -592,7 +592,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("ComplexMatricesNotSupported", resourceCulture); } } - + /// /// Looks up a localized string similar to An algorithm failed to converge.. /// @@ -601,7 +601,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("ConvergenceFailed", resourceCulture); } } - + /// /// Looks up a localized string similar to The sample size must be larger than the given degrees of freedom.. /// @@ -610,7 +610,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("DegreesOfFreedomMustBeLessThanSampleSize", resourceCulture); } } - + /// /// Looks up a localized string similar to This feature is not implemented yet (but is planned).. /// @@ -619,7 +619,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("FeaturePlannedButNotImplementedYet", resourceCulture); } } - + /// /// Looks up a localized string similar to The given file doesn't exist.. /// @@ -628,7 +628,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("FileDoesNotExist", resourceCulture); } } - + /// /// Looks up a localized string similar to Sample points should be sorted in strictly ascending order. /// @@ -637,7 +637,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("Interpolation_Initialize_SamplePointsNotStrictlyAscendingOrder", resourceCulture); } } - + /// /// Looks up a localized string similar to All sample points should be unique.. /// @@ -646,7 +646,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("Interpolation_Initialize_SamplePointsNotUnique", resourceCulture); } } - + /// /// Looks up a localized string similar to Invalid parameterization for the distribution.. /// @@ -655,7 +655,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("InvalidDistributionParameters", resourceCulture); } } - + /// /// Looks up a localized string similar to Invalid Left Boundary Condition.. /// @@ -664,7 +664,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("InvalidLeftBoundaryCondition", resourceCulture); } } - + /// /// Looks up a localized string similar to The operation could not be performed because the accumulator is empty.. /// @@ -673,7 +673,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("InvalidOperationAccumulatorEmpty", resourceCulture); } } - + /// /// Looks up a localized string similar to The operation could not be performed because the histogram is empty.. /// @@ -682,7 +682,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("InvalidOperationHistogramEmpty", resourceCulture); } } - + /// /// Looks up a localized string similar to Not enough points in the distribution.. /// @@ -691,7 +691,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("InvalidOperationHistogramNotEnoughPoints", resourceCulture); } } - + /// /// Looks up a localized string similar to No Samples Provided. Preparation Required.. /// @@ -700,7 +700,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("InvalidOperationNoSamplesProvided", resourceCulture); } } - + /// /// Looks up a localized string similar to An invalid parameter was passed to a native method.. /// @@ -709,7 +709,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("InvalidParameter", resourceCulture); } } - + /// /// Looks up a localized string similar to An invalid parameter was passed to a native method, parameter number : {0}. /// @@ -718,7 +718,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("InvalidParameterWithNumber", resourceCulture); } } - + /// /// Looks up a localized string similar to Invalid Right Boundary Condition.. /// @@ -727,7 +727,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("InvalidRightBoundaryCondition", resourceCulture); } } - + /// /// Looks up a localized string similar to Lag must be positive. /// @@ -736,7 +736,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("LagMustBePositive", resourceCulture); } } - + /// /// Looks up a localized string similar to Lag must be smaller than the sample size. /// @@ -745,7 +745,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("LagMustBeSmallerThanTheSampleSize", resourceCulture); } } - + /// /// Looks up a localized string similar to ddd MMM dd HH:mm:ss yyyy. /// @@ -754,7 +754,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("MatlabDateHeaderFormat", resourceCulture); } } - + /// /// Looks up a localized string similar to Matrices can not be empty and must have at least one row and column.. /// @@ -763,7 +763,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("MatrixCanNotBeEmpty", resourceCulture); } } - + /// /// Looks up a localized string similar to The number of columns of a matrix must be positive.. /// @@ -772,7 +772,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("MatrixColumnsMustBePositive", resourceCulture); } } - + /// /// Looks up a localized string similar to Matrix must be in sparse storage format. /// @@ -781,7 +781,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("MatrixMustBeSparse", resourceCulture); } } - + /// /// Looks up a localized string similar to The number of rows of a matrix must be positive.. /// @@ -790,7 +790,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("MatrixRowsMustBePositive", resourceCulture); } } - + /// /// Looks up a localized string similar to The number of rows or columns of a matrix must be positive.. /// @@ -799,7 +799,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("MatrixRowsOrColumnsMustBePositive", resourceCulture); } } - + /// /// Looks up a localized string similar to Unable to allocate native memory.. /// @@ -808,7 +808,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("MemoryAllocation", resourceCulture); } } - + /// /// Looks up a localized string similar to Only 1 and 2 dimensional arrays are supported.. /// @@ -817,7 +817,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("MoreThan2D", resourceCulture); } } - + /// /// Looks up a localized string similar to Data must contain at least {0} values.. /// @@ -826,7 +826,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("MustContainAtLeast", resourceCulture); } } - + /// /// Looks up a localized string similar to Name cannot contain a space. name: {0}. /// @@ -835,7 +835,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("NameCannotContainASpace", resourceCulture); } } - + /// /// Looks up a localized string similar to {0} is not a supported type.. /// @@ -844,7 +844,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("NotSupportedType", resourceCulture); } } - + /// /// Looks up a localized string similar to Algorithm experience a numerical break down ///. @@ -854,7 +854,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("NumericalBreakdown", resourceCulture); } } - + /// /// Looks up a localized string similar to The two arguments can't be compared (maybe they are part of a partial ordering?). /// @@ -863,7 +863,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("PartialOrderException", resourceCulture); } } - + /// /// Looks up a localized string similar to The integer array does not represent a valid permutation.. /// @@ -872,7 +872,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("PermutationAsIntArrayInvalid", resourceCulture); } } - + /// /// Looks up a localized string similar to The sampler's proposal distribution is not upper bounding the target density.. /// @@ -881,7 +881,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("ProposalDistributionNoUpperBound", resourceCulture); } } - + /// /// Looks up a localized string similar to A regression of the requested order requires at least {0} samples. Only {1} samples have been provided. . /// @@ -890,7 +890,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("RegressionNotEnoughSamples", resourceCulture); } } - + /// /// Looks up a localized string similar to The algorithm has failed, exceeded the number of iterations allowed or there is no root within the provided bounds.. /// @@ -899,7 +899,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("RootFindingFailed", resourceCulture); } } - + /// /// Looks up a localized string similar to The algorithm has failed, exceeded the number of iterations allowed or there is no root within the provided bounds. Consider to use RobustNewtonRaphson instead.. /// @@ -908,7 +908,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("RootFindingFailedRecommendRobustNewtonRaphson", resourceCulture); } } - + /// /// Looks up a localized string similar to The lower and upper bounds must bracket a single root.. /// @@ -917,7 +917,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("RootMustBeBracketedByBounds", resourceCulture); } } - + /// /// Looks up a localized string similar to The algorithm ended without root in the range.. /// @@ -926,7 +926,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("RootNotFound", resourceCulture); } } - + /// /// Looks up a localized string similar to The number of rows must greater than or equal to the number of columns.. /// @@ -935,7 +935,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("RowsLessThanColumns", resourceCulture); } } - + /// /// Looks up a localized string similar to All sample vectors must have the same length. However, vectors with disagreeing length {0} and {1} have been provided. A sample with index i is given by the value at index i of each provided vector.. /// @@ -944,7 +944,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("SampleVectorsSameLength", resourceCulture); } } - + /// /// Looks up a localized string similar to U is singular, and the inversion could not be completed.. /// @@ -953,7 +953,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("SingularUMatrix", resourceCulture); } } - + /// /// Looks up a localized string similar to U is singular, and the inversion could not be completed. The {0}-th diagonal element of the factor U is zero.. /// @@ -962,7 +962,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("SingularUMatrixWithElement", resourceCulture); } } - + /// /// Looks up a localized string similar to The singular vectors were not computed.. /// @@ -971,7 +971,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("SingularVectorsNotComputed", resourceCulture); } } - + /// /// Looks up a localized string similar to This special case is not supported yet (but is planned).. /// @@ -980,7 +980,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("SpecialCasePlannedButNotImplementedYet", resourceCulture); } } - + /// /// Looks up a localized string similar to The given stop criterion already exist in the collection.. /// @@ -989,7 +989,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("StopCriterionDuplicate", resourceCulture); } } - + /// /// Looks up a localized string similar to There is no stop criterion in the collection.. /// @@ -998,7 +998,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("StopCriterionMissing", resourceCulture); } } - + /// /// Looks up a localized string similar to String parameter cannot be empty or null.. /// @@ -1007,7 +1007,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("StringNullOrEmpty", resourceCulture); } } - + /// /// Looks up a localized string similar to We only support sparse matrix with less than int.MaxValue elements.. /// @@ -1016,7 +1016,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("TooManyElements", resourceCulture); } } - + /// /// Looks up a localized string similar to The moment of the distribution is undefined.. /// @@ -1025,7 +1025,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("UndefinedMoment", resourceCulture); } } - + /// /// Looks up a localized string similar to A user defined provider has not been specified.. /// @@ -1034,7 +1034,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("UserDefinedProviderNotSpecified", resourceCulture); } } - + /// /// Looks up a localized string similar to User work buffers are not supported by this provider.. /// @@ -1043,7 +1043,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("UserWorkBufferNotSupported", resourceCulture); } } - + /// /// Looks up a localized string similar to Vectors can not be empty and must have at least one element.. /// @@ -1052,7 +1052,7 @@ namespace MathNet.Numerics.Properties { return ResourceManager.GetString("VectorCanNotBeEmpty", resourceCulture); } } - + /// /// Looks up a localized string similar to The given work array is too small. Check work[0] for the corret size.. /// diff --git a/src/Numerics/Providers/Common/Cuda/SafeNativeMethods.cs b/src/Numerics/Providers/Common/Cuda/SafeNativeMethods.cs index f2a0fa66..59c553de 100644 --- a/src/Numerics/Providers/Common/Cuda/SafeNativeMethods.cs +++ b/src/Numerics/Providers/Common/Cuda/SafeNativeMethods.cs @@ -29,16 +29,13 @@ #if NATIVE using System; +using System.Numerics; using System.Runtime.InteropServices; using System.Security; using MathNet.Numerics.Providers.LinearAlgebra; namespace MathNet.Numerics.Providers.Common.Cuda { -#if !NOSYSNUMERICS - using Complex = System.Numerics.Complex; -#endif - /// /// P/Invoke methods to the native math libraries. /// diff --git a/src/Numerics/Providers/Common/Mkl/SafeNativeMethods.cs b/src/Numerics/Providers/Common/Mkl/SafeNativeMethods.cs index bf883400..f6c51c2b 100644 --- a/src/Numerics/Providers/Common/Mkl/SafeNativeMethods.cs +++ b/src/Numerics/Providers/Common/Mkl/SafeNativeMethods.cs @@ -29,16 +29,13 @@ #if NATIVE using System; +using System.Numerics; using System.Runtime.InteropServices; using System.Security; using MathNet.Numerics.Providers.LinearAlgebra; namespace MathNet.Numerics.Providers.Common.Mkl { -#if !NOSYSNUMERICS - using Complex = System.Numerics.Complex; -#endif - /// /// P/Invoke methods to the native math libraries. /// diff --git a/src/Numerics/Providers/Common/NativeProviderLoader.cs b/src/Numerics/Providers/Common/NativeProviderLoader.cs index 42bcb50f..0f04bc22 100644 --- a/src/Numerics/Providers/Common/NativeProviderLoader.cs +++ b/src/Numerics/Providers/Common/NativeProviderLoader.cs @@ -79,9 +79,7 @@ namespace MathNet.Numerics.Providers.Common static string EvaluateArchitectureKey() { -#if NET35 - return (IntPtr.Size == 8) ? X64 : X86; -#else + //return (IntPtr.Size == 8) ? X64 : X86; if (IsUnix) { @@ -115,7 +113,6 @@ namespace MathNet.Numerics.Providers.Common // Fallback if unknown return architecture; -#endif } /// diff --git a/src/Numerics/Providers/Common/OpenBlas/SafeNativeMethods.cs b/src/Numerics/Providers/Common/OpenBlas/SafeNativeMethods.cs index 8aea6173..c8952151 100644 --- a/src/Numerics/Providers/Common/OpenBlas/SafeNativeMethods.cs +++ b/src/Numerics/Providers/Common/OpenBlas/SafeNativeMethods.cs @@ -28,6 +28,7 @@ #if NATIVE +using System.Numerics; using System.Runtime.InteropServices; using System.Security; using MathNet.Numerics.Providers.LinearAlgebra; @@ -35,10 +36,6 @@ using MathNet.Numerics.Providers.LinearAlgebra.OpenBlas; namespace MathNet.Numerics.Providers.Common.OpenBlas { -#if !NOSYSNUMERICS - using Complex = System.Numerics.Complex; -#endif - /// /// P/Invoke methods to the native math libraries. /// diff --git a/src/Numerics/Providers/FourierTransform/IFourierTransformProvider.cs b/src/Numerics/Providers/FourierTransform/IFourierTransformProvider.cs index 86cc9a79..e9e46ef0 100644 --- a/src/Numerics/Providers/FourierTransform/IFourierTransformProvider.cs +++ b/src/Numerics/Providers/FourierTransform/IFourierTransformProvider.cs @@ -27,13 +27,10 @@ // OTHER DEALINGS IN THE SOFTWARE. // +using System.Numerics; + namespace MathNet.Numerics.Providers.FourierTransform { - -#if !NOSYSNUMERICS - using Complex = System.Numerics.Complex; -#endif - public enum FourierTransformScaling : int { NoScaling = 0, @@ -59,12 +56,12 @@ namespace MathNet.Numerics.Providers.FourierTransform void Forward(Complex[] samples, FourierTransformScaling scaling); void Backward(Complex32[] spectrum, FourierTransformScaling scaling); void Backward(Complex[] spectrum, FourierTransformScaling scaling); - + void ForwardReal(float[] samples, int n, FourierTransformScaling scaling); void ForwardReal(double[] samples, int n, FourierTransformScaling scaling); void BackwardReal(float[] spectrum, int n, FourierTransformScaling scaling); void BackwardReal(double[] spectrum, int n, FourierTransformScaling scaling); - + void ForwardMultidim(Complex32[] samples, int[] dimensions, FourierTransformScaling scaling); void ForwardMultidim(Complex[] samples, int[] dimensions, FourierTransformScaling scaling); void BackwardMultidim(Complex32[] spectrum, int[] dimensions, FourierTransformScaling scaling); diff --git a/src/Numerics/Providers/FourierTransform/ManagedFourierTransformProvider.cs b/src/Numerics/Providers/FourierTransform/ManagedFourierTransformProvider.cs index 463e138c..18be089d 100644 --- a/src/Numerics/Providers/FourierTransform/ManagedFourierTransformProvider.cs +++ b/src/Numerics/Providers/FourierTransform/ManagedFourierTransformProvider.cs @@ -27,14 +27,11 @@ // using System; +using System.Numerics; using MathNet.Numerics.IntegralTransforms; namespace MathNet.Numerics.Providers.FourierTransform { -#if !NOSYSNUMERICS - using Complex = System.Numerics.Complex; -#endif - public class ManagedFourierTransformProvider : IFourierTransformProvider { /// diff --git a/src/Numerics/Providers/FourierTransform/Mkl/MklFourierTransformProvider.cs b/src/Numerics/Providers/FourierTransform/Mkl/MklFourierTransformProvider.cs index 219eb218..34437a8c 100644 --- a/src/Numerics/Providers/FourierTransform/Mkl/MklFourierTransformProvider.cs +++ b/src/Numerics/Providers/FourierTransform/Mkl/MklFourierTransformProvider.cs @@ -29,15 +29,12 @@ #if NATIVE using System; +using System.Numerics; using System.Threading; using MathNet.Numerics.Providers.Common.Mkl; namespace MathNet.Numerics.Providers.FourierTransform.Mkl { -#if !NOSYSNUMERICS - using Complex = System.Numerics.Complex; -#endif - public class MklFourierTransformProvider : IFourierTransformProvider, IDisposable { class Kernel diff --git a/src/Numerics/Providers/LinearAlgebra/Cuda/CudaLinearAlgebraProvider.Complex.cs b/src/Numerics/Providers/LinearAlgebra/Cuda/CudaLinearAlgebraProvider.Complex.cs index 8191a13c..28ae3741 100644 --- a/src/Numerics/Providers/LinearAlgebra/Cuda/CudaLinearAlgebraProvider.Complex.cs +++ b/src/Numerics/Providers/LinearAlgebra/Cuda/CudaLinearAlgebraProvider.Complex.cs @@ -30,16 +30,13 @@ #if NATIVE using System; +using System.Numerics; using System.Security; using MathNet.Numerics.Properties; using MathNet.Numerics.Providers.Common.Cuda; namespace MathNet.Numerics.Providers.LinearAlgebra.Cuda { -#if !NOSYSNUMERICS - using Complex = System.Numerics.Complex; -#endif - /// /// NVidia's CUDA Toolkit linear algebra provider. /// diff --git a/src/Numerics/Providers/LinearAlgebra/ILinearAlgebraProvider.cs b/src/Numerics/Providers/LinearAlgebra/ILinearAlgebraProvider.cs index 0565f3db..e196ef86 100644 --- a/src/Numerics/Providers/LinearAlgebra/ILinearAlgebraProvider.cs +++ b/src/Numerics/Providers/LinearAlgebra/ILinearAlgebraProvider.cs @@ -27,15 +27,11 @@ // OTHER DEALINGS IN THE SOFTWARE. // +using System.Numerics; using MathNet.Numerics.LinearAlgebra.Factorization; namespace MathNet.Numerics.Providers.LinearAlgebra { - -#if !NOSYSNUMERICS - using Complex = System.Numerics.Complex; -#endif - /// /// How to transpose a matrix. /// diff --git a/src/Numerics/Providers/LinearAlgebra/ManagedLinearAlgebraProvider.Complex.cs b/src/Numerics/Providers/LinearAlgebra/ManagedLinearAlgebraProvider.Complex.cs index 48657a4f..cb8dc14a 100644 --- a/src/Numerics/Providers/LinearAlgebra/ManagedLinearAlgebraProvider.Complex.cs +++ b/src/Numerics/Providers/LinearAlgebra/ManagedLinearAlgebraProvider.Complex.cs @@ -28,6 +28,7 @@ // using System; +using System.Numerics; using MathNet.Numerics.LinearAlgebra.Complex.Factorization; using MathNet.Numerics.LinearAlgebra.Factorization; using MathNet.Numerics.Properties; @@ -35,11 +36,6 @@ using MathNet.Numerics.Threading; namespace MathNet.Numerics.Providers.LinearAlgebra { - -#if !NOSYSNUMERICS - using Complex = System.Numerics.Complex; -#endif - /// /// The managed linear algebra provider. /// diff --git a/src/Numerics/Providers/LinearAlgebra/ManagedLinearAlgebraProvider.Complex32.cs b/src/Numerics/Providers/LinearAlgebra/ManagedLinearAlgebraProvider.Complex32.cs index 0d9cd9bb..890d0c82 100644 --- a/src/Numerics/Providers/LinearAlgebra/ManagedLinearAlgebraProvider.Complex32.cs +++ b/src/Numerics/Providers/LinearAlgebra/ManagedLinearAlgebraProvider.Complex32.cs @@ -28,6 +28,7 @@ // using System; +using System.Numerics; using MathNet.Numerics.LinearAlgebra.Complex32; using MathNet.Numerics.LinearAlgebra.Complex32.Factorization; using MathNet.Numerics.LinearAlgebra.Factorization; @@ -36,11 +37,6 @@ using MathNet.Numerics.Threading; namespace MathNet.Numerics.Providers.LinearAlgebra { - -#if !NOSYSNUMERICS - using Complex = System.Numerics.Complex; -#endif - /// /// The managed linear algebra provider. /// diff --git a/src/Numerics/Providers/LinearAlgebra/ManagedLinearAlgebraProvider.Double.cs b/src/Numerics/Providers/LinearAlgebra/ManagedLinearAlgebraProvider.Double.cs index 3dc2e890..e6216584 100644 --- a/src/Numerics/Providers/LinearAlgebra/ManagedLinearAlgebraProvider.Double.cs +++ b/src/Numerics/Providers/LinearAlgebra/ManagedLinearAlgebraProvider.Double.cs @@ -28,17 +28,13 @@ // using System; +using System.Numerics; using MathNet.Numerics.LinearAlgebra.Factorization; using MathNet.Numerics.Properties; using MathNet.Numerics.Threading; namespace MathNet.Numerics.Providers.LinearAlgebra { - -#if !NOSYSNUMERICS - using Complex = System.Numerics.Complex; -#endif - /// /// The managed linear algebra provider. /// diff --git a/src/Numerics/Providers/LinearAlgebra/ManagedLinearAlgebraProvider.Single.cs b/src/Numerics/Providers/LinearAlgebra/ManagedLinearAlgebraProvider.Single.cs index c8b0b9fc..8f14d872 100644 --- a/src/Numerics/Providers/LinearAlgebra/ManagedLinearAlgebraProvider.Single.cs +++ b/src/Numerics/Providers/LinearAlgebra/ManagedLinearAlgebraProvider.Single.cs @@ -28,17 +28,13 @@ // using System; +using System.Numerics; using MathNet.Numerics.LinearAlgebra.Factorization; using MathNet.Numerics.Properties; using MathNet.Numerics.Threading; namespace MathNet.Numerics.Providers.LinearAlgebra { - -#if !NOSYSNUMERICS - using Complex = System.Numerics.Complex; -#endif - /// /// The managed linear algebra provider. /// diff --git a/src/Numerics/Providers/LinearAlgebra/Mkl/MklLinearAlgebraProvider.Complex.cs b/src/Numerics/Providers/LinearAlgebra/Mkl/MklLinearAlgebraProvider.Complex.cs index 82f79d6b..6bf17f17 100644 --- a/src/Numerics/Providers/LinearAlgebra/Mkl/MklLinearAlgebraProvider.Complex.cs +++ b/src/Numerics/Providers/LinearAlgebra/Mkl/MklLinearAlgebraProvider.Complex.cs @@ -30,6 +30,7 @@ #if NATIVE using System; +using System.Numerics; using System.Security; using MathNet.Numerics.LinearAlgebra.Factorization; using MathNet.Numerics.Properties; @@ -37,10 +38,6 @@ using MathNet.Numerics.Providers.Common.Mkl; namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl { -#if !NOSYSNUMERICS - using Complex = System.Numerics.Complex; -#endif - /// /// Intel's Math Kernel Library (MKL) linear algebra provider. /// diff --git a/src/Numerics/Providers/LinearAlgebra/Mkl/MklLinearAlgebraProvider.Complex32.cs b/src/Numerics/Providers/LinearAlgebra/Mkl/MklLinearAlgebraProvider.Complex32.cs index 0c30f208..e8b19df6 100644 --- a/src/Numerics/Providers/LinearAlgebra/Mkl/MklLinearAlgebraProvider.Complex32.cs +++ b/src/Numerics/Providers/LinearAlgebra/Mkl/MklLinearAlgebraProvider.Complex32.cs @@ -30,6 +30,7 @@ #if NATIVE using System; +using System.Numerics; using System.Security; using MathNet.Numerics.LinearAlgebra.Factorization; using MathNet.Numerics.Properties; @@ -37,10 +38,6 @@ using MathNet.Numerics.Providers.Common.Mkl; namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl { -#if !NOSYSNUMERICS - using Complex = System.Numerics.Complex; -#endif - /// /// Intel's Math Kernel Library (MKL) linear algebra provider. /// diff --git a/src/Numerics/Providers/LinearAlgebra/Mkl/MklLinearAlgebraProvider.Double.cs b/src/Numerics/Providers/LinearAlgebra/Mkl/MklLinearAlgebraProvider.Double.cs index c6d37d80..881a84ce 100644 --- a/src/Numerics/Providers/LinearAlgebra/Mkl/MklLinearAlgebraProvider.Double.cs +++ b/src/Numerics/Providers/LinearAlgebra/Mkl/MklLinearAlgebraProvider.Double.cs @@ -30,6 +30,7 @@ #if NATIVE using System; +using System.Numerics; using System.Security; using MathNet.Numerics.LinearAlgebra.Factorization; using MathNet.Numerics.Properties; @@ -37,10 +38,6 @@ using MathNet.Numerics.Providers.Common.Mkl; namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl { -#if !NOSYSNUMERICS - using Complex = System.Numerics.Complex; -#endif - /// /// Intel's Math Kernel Library (MKL) linear algebra provider. /// diff --git a/src/Numerics/Providers/LinearAlgebra/Mkl/MklLinearAlgebraProvider.Single.cs b/src/Numerics/Providers/LinearAlgebra/Mkl/MklLinearAlgebraProvider.Single.cs index 84d3b828..2e4bce90 100644 --- a/src/Numerics/Providers/LinearAlgebra/Mkl/MklLinearAlgebraProvider.Single.cs +++ b/src/Numerics/Providers/LinearAlgebra/Mkl/MklLinearAlgebraProvider.Single.cs @@ -30,6 +30,7 @@ #if NATIVE using System; +using System.Numerics; using System.Security; using MathNet.Numerics.LinearAlgebra.Factorization; using MathNet.Numerics.Properties; @@ -37,10 +38,6 @@ using MathNet.Numerics.Providers.Common.Mkl; namespace MathNet.Numerics.Providers.LinearAlgebra.Mkl { -#if !NOSYSNUMERICS - using Complex = System.Numerics.Complex; -#endif - /// /// Intel's Math Kernel Library (MKL) linear algebra provider. /// diff --git a/src/Numerics/Providers/LinearAlgebra/OpenBlas/OpenBlasLinearAlgebraProvider.Complex.cs b/src/Numerics/Providers/LinearAlgebra/OpenBlas/OpenBlasLinearAlgebraProvider.Complex.cs index fbaa1283..d8eb20c5 100644 --- a/src/Numerics/Providers/LinearAlgebra/OpenBlas/OpenBlasLinearAlgebraProvider.Complex.cs +++ b/src/Numerics/Providers/LinearAlgebra/OpenBlas/OpenBlasLinearAlgebraProvider.Complex.cs @@ -32,15 +32,12 @@ using MathNet.Numerics.LinearAlgebra.Factorization; using MathNet.Numerics.Properties; using System; +using System.Numerics; using System.Security; using MathNet.Numerics.Providers.Common.OpenBlas; namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas { -#if !NOSYSNUMERICS - using Complex = System.Numerics.Complex; -#endif - /// /// OpenBLAS linear algebra provider. /// diff --git a/src/Numerics/Providers/LinearAlgebra/OpenBlas/OpenBlasLinearAlgebraProvider.Complex32.cs b/src/Numerics/Providers/LinearAlgebra/OpenBlas/OpenBlasLinearAlgebraProvider.Complex32.cs index 0e44fdfa..fe33a573 100644 --- a/src/Numerics/Providers/LinearAlgebra/OpenBlas/OpenBlasLinearAlgebraProvider.Complex32.cs +++ b/src/Numerics/Providers/LinearAlgebra/OpenBlas/OpenBlasLinearAlgebraProvider.Complex32.cs @@ -32,15 +32,12 @@ using MathNet.Numerics.LinearAlgebra.Factorization; using MathNet.Numerics.Properties; using System; +using System.Numerics; using System.Security; using MathNet.Numerics.Providers.Common.OpenBlas; namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas { -#if !NOSYSNUMERICS - using Complex = System.Numerics.Complex; -#endif - /// /// OpenBLAS linear algebra provider. /// diff --git a/src/Numerics/Providers/LinearAlgebra/OpenBlas/OpenBlasLinearAlgebraProvider.Double.cs b/src/Numerics/Providers/LinearAlgebra/OpenBlas/OpenBlasLinearAlgebraProvider.Double.cs index c36d0857..f3be61ac 100644 --- a/src/Numerics/Providers/LinearAlgebra/OpenBlas/OpenBlasLinearAlgebraProvider.Double.cs +++ b/src/Numerics/Providers/LinearAlgebra/OpenBlas/OpenBlasLinearAlgebraProvider.Double.cs @@ -32,15 +32,12 @@ using MathNet.Numerics.LinearAlgebra.Factorization; using MathNet.Numerics.Properties; using System; +using System.Numerics; using System.Security; using MathNet.Numerics.Providers.Common.OpenBlas; namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas { -#if !NOSYSNUMERICS - using Complex = System.Numerics.Complex; -#endif - /// /// OpenBLAS linear algebra provider. /// diff --git a/src/Numerics/Providers/LinearAlgebra/OpenBlas/OpenBlasLinearAlgebraProvider.Single.cs b/src/Numerics/Providers/LinearAlgebra/OpenBlas/OpenBlasLinearAlgebraProvider.Single.cs index ed05ee94..1ea96429 100644 --- a/src/Numerics/Providers/LinearAlgebra/OpenBlas/OpenBlasLinearAlgebraProvider.Single.cs +++ b/src/Numerics/Providers/LinearAlgebra/OpenBlas/OpenBlasLinearAlgebraProvider.Single.cs @@ -32,15 +32,12 @@ using MathNet.Numerics.LinearAlgebra.Factorization; using MathNet.Numerics.Properties; using System; +using System.Numerics; using System.Security; using MathNet.Numerics.Providers.Common.OpenBlas; namespace MathNet.Numerics.Providers.LinearAlgebra.OpenBlas { -#if !NOSYSNUMERICS - using Complex = System.Numerics.Complex; -#endif - /// /// OpenBLAS linear algebra provider. /// diff --git a/src/Numerics/Random/CryptoRandomSource.cs b/src/Numerics/Random/CryptoRandomSource.cs index fc893434..d8a898da 100644 --- a/src/Numerics/Random/CryptoRandomSource.cs +++ b/src/Numerics/Random/CryptoRandomSource.cs @@ -27,13 +27,14 @@ // OTHER DEALINGS IN THE SOFTWARE. // -#if !PORTABLE - using System; using System.Collections.Generic; -using System.Runtime; using System.Security.Cryptography; +#if !NETSTANDARD1_3 +using System.Runtime; +#endif + namespace MathNet.Numerics.Random { /// @@ -121,9 +122,7 @@ namespace MathNet.Numerics.Random public void Dispose() { -#if !NET35 _crypto.Dispose(); -#endif } /// @@ -134,15 +133,10 @@ namespace MathNet.Numerics.Random { var bytes = new byte[values.Length*4]; -#if !NET35 using (var rnd = RandomNumberGenerator.Create()) { rnd.GetBytes(bytes); } -#else - var rnd = RandomNumberGenerator.Create(); - rnd.GetBytes(bytes); -#endif for (int i = 0; i < values.Length; i++) { @@ -182,5 +176,3 @@ namespace MathNet.Numerics.Random } } } - -#endif diff --git a/src/Numerics/Random/Mcg31m1.cs b/src/Numerics/Random/Mcg31m1.cs index 6e8de9e8..f31a9905 100644 --- a/src/Numerics/Random/Mcg31m1.cs +++ b/src/Numerics/Random/Mcg31m1.cs @@ -27,11 +27,11 @@ // OTHER DEALINGS IN THE SOFTWARE. // -using System; using System.Collections.Generic; using System.Runtime.Serialization; -#if !PORTABLE +#if !NETSTANDARD1_3 +using System; using System.Runtime; #endif diff --git a/src/Numerics/Random/Mcg59.cs b/src/Numerics/Random/Mcg59.cs index 9968c8bc..a1d64977 100644 --- a/src/Numerics/Random/Mcg59.cs +++ b/src/Numerics/Random/Mcg59.cs @@ -27,11 +27,11 @@ // OTHER DEALINGS IN THE SOFTWARE. // -using System; using System.Collections.Generic; using System.Runtime.Serialization; -#if !PORTABLE +#if !NETSTANDARD1_3 +using System; using System.Runtime; #endif diff --git a/src/Numerics/Random/MersenneTwister.cs b/src/Numerics/Random/MersenneTwister.cs index f58ba7cf..742e89de 100644 --- a/src/Numerics/Random/MersenneTwister.cs +++ b/src/Numerics/Random/MersenneTwister.cs @@ -65,16 +65,15 @@ email: m-mat @ math.sci.hiroshima-u.ac.jp (remove space) */ -using System; using System.Collections.Generic; using System.Runtime.Serialization; +using System.Threading; -#if !PORTABLE +#if !NETSTANDARD1_3 +using System; using System.Runtime; -using System.Threading; #endif - namespace MathNet.Numerics.Random { /// @@ -172,25 +171,6 @@ namespace MathNet.Numerics.Random init_genrand((uint)seed); } -#if PORTABLE - [ThreadStatic] - static MersenneTwister DefaultInstance; - - /// - /// Default instance, thread-safe. - /// - public static MersenneTwister Default - { - get - { - if (DefaultInstance == null) - { - DefaultInstance = new MersenneTwister(RandomSeed.Robust(), true); - } - return DefaultInstance; - } - } -#else static readonly ThreadLocal DefaultInstance = new ThreadLocal(() => new MersenneTwister(RandomSeed.Robust(), true)); /// @@ -200,7 +180,6 @@ namespace MathNet.Numerics.Random { get { return DefaultInstance.Value; } } -#endif /*/// /// Initializes a new instance of the class. diff --git a/src/Numerics/Random/Mrg32k3a.cs b/src/Numerics/Random/Mrg32k3a.cs index 5c27c8d8..164e582c 100644 --- a/src/Numerics/Random/Mrg32k3a.cs +++ b/src/Numerics/Random/Mrg32k3a.cs @@ -27,11 +27,11 @@ // OTHER DEALINGS IN THE SOFTWARE. // -using System; using System.Collections.Generic; using System.Runtime.Serialization; -#if !PORTABLE +#if !NETSTANDARD1_3 +using System; using System.Runtime; #endif @@ -41,7 +41,7 @@ namespace MathNet.Numerics.Random /// A 32-bit combined multiple recursive generator with 2 components of order 3. /// /// Based off of P. L'Ecuyer, "Combined Multiple Recursive Random Number Generators," Operations Research, 44, 5 (1996), 816--822. - /// + /// [Serializable] [DataContract(Namespace = "urn:MathNet/Numerics/Random")] public class Mrg32k3a : RandomSource diff --git a/src/Numerics/Random/Palf.cs b/src/Numerics/Random/Palf.cs index d10e2481..ad75c6eb 100644 --- a/src/Numerics/Random/Palf.cs +++ b/src/Numerics/Random/Palf.cs @@ -32,7 +32,7 @@ using System.Collections.Generic; using System.Runtime.Serialization; using MathNet.Numerics.Properties; -#if !PORTABLE +#if !NETSTANDARD1_3 using System.Runtime; #endif diff --git a/src/Numerics/Random/RandomSeed.cs b/src/Numerics/Random/RandomSeed.cs index df2a1df6..fb8b89b8 100644 --- a/src/Numerics/Random/RandomSeed.cs +++ b/src/Numerics/Random/RandomSeed.cs @@ -5,12 +5,7 @@ namespace MathNet.Numerics.Random public static class RandomSeed { static readonly object Lock = new object(); - -#if PORTABLE - static readonly System.Random MasterRng = new System.Random(); -#else static readonly System.Security.Cryptography.RandomNumberGenerator MasterRng = System.Security.Cryptography.RandomNumberGenerator.Create(); -#endif /// /// Provides a time-dependent seed value, matching the default behavior of System.Random. @@ -41,13 +36,9 @@ namespace MathNet.Numerics.Random { lock (Lock) { -#if PORTABLE - return MasterRng.NextFullRangeInt32() ^ Environment.TickCount ^ System.Guid.NewGuid().GetHashCode(); -#else var bytes = new byte[4]; MasterRng.GetBytes(bytes); return BitConverter.ToInt32(bytes, 0); -#endif } } } diff --git a/src/Numerics/Random/SystemRandomSource.cs b/src/Numerics/Random/SystemRandomSource.cs index 8320851f..edda8b8f 100644 --- a/src/Numerics/Random/SystemRandomSource.cs +++ b/src/Numerics/Random/SystemRandomSource.cs @@ -27,14 +27,14 @@ // OTHER DEALINGS IN THE SOFTWARE. // -using System; using System.Collections.Generic; using System.Runtime.Serialization; using MathNet.Numerics.Threading; +using System.Threading; -#if !PORTABLE +#if !NETSTANDARD1_3 +using System; using System.Runtime; -using System.Threading; #endif namespace MathNet.Numerics.Random @@ -83,25 +83,6 @@ namespace MathNet.Numerics.Random _random = new System.Random(seed); } -#if PORTABLE - [ThreadStatic] - static SystemRandomSource DefaultInstance; - - /// - /// Default instance, thread-safe. - /// - public static SystemRandomSource Default - { - get - { - if (DefaultInstance == null) - { - DefaultInstance = new SystemRandomSource(RandomSeed.Robust(), true); - } - return DefaultInstance; - } - } -#else static readonly ThreadLocal DefaultInstance = new ThreadLocal(() => new SystemRandomSource(RandomSeed.Robust(), true)); /// @@ -111,7 +92,6 @@ namespace MathNet.Numerics.Random { get { return DefaultInstance.Value; } } -#endif /// /// Returns a random double-precision floating point number greater than or equal to 0.0, and less than 1.0. diff --git a/src/Numerics/Random/WH1982.cs b/src/Numerics/Random/WH1982.cs index 9dde71e4..89071f9a 100644 --- a/src/Numerics/Random/WH1982.cs +++ b/src/Numerics/Random/WH1982.cs @@ -27,11 +27,11 @@ // OTHER DEALINGS IN THE SOFTWARE. // -using System; using System.Collections.Generic; using System.Runtime.Serialization; -#if !PORTABLE +#if !NETSTANDARD1_3 +using System; using System.Runtime; #endif diff --git a/src/Numerics/Random/WH2006.cs b/src/Numerics/Random/WH2006.cs index a0034748..97a80757 100644 --- a/src/Numerics/Random/WH2006.cs +++ b/src/Numerics/Random/WH2006.cs @@ -27,11 +27,11 @@ // OTHER DEALINGS IN THE SOFTWARE. // -using System; using System.Collections.Generic; using System.Runtime.Serialization; -#if !PORTABLE +#if !NETSTANDARD1_3 +using System; using System.Runtime; #endif diff --git a/src/Numerics/Random/Xorshift.cs b/src/Numerics/Random/Xorshift.cs index 3553ce84..d95eaef0 100644 --- a/src/Numerics/Random/Xorshift.cs +++ b/src/Numerics/Random/Xorshift.cs @@ -32,7 +32,7 @@ using System.Collections.Generic; using System.Runtime.Serialization; using MathNet.Numerics.Properties; -#if !PORTABLE +#if !NETSTANDARD1_3 using System.Runtime; #endif diff --git a/src/Numerics/RootFinding/Cubic.cs b/src/Numerics/RootFinding/Cubic.cs index dc5bdaaa..3052968a 100644 --- a/src/Numerics/RootFinding/Cubic.cs +++ b/src/Numerics/RootFinding/Cubic.cs @@ -28,10 +28,7 @@ // using System; - -#if !NOSYSNUMERICS - using Complex = System.Numerics.Complex; -#endif +using System.Numerics; namespace MathNet.Numerics.RootFinding { diff --git a/src/Numerics/Sorting.cs b/src/Numerics/Sorting.cs index af76c042..42ebdd1b 100644 --- a/src/Numerics/Sorting.cs +++ b/src/Numerics/Sorting.cs @@ -153,7 +153,6 @@ namespace MathNet.Numerics return; } -#if !PORTABLE // array case var keysArray = keys as TKey[]; var itemsArray = items as TItem[]; @@ -162,7 +161,6 @@ namespace MathNet.Numerics Array.Sort(keysArray, itemsArray, comparer); return; } -#endif // local sort implementation QuickSort(keys, items, comparer, 0, count - 1); @@ -369,7 +367,6 @@ namespace MathNet.Numerics return; } -#if !PORTABLE // array case var keysArray = keys as TKey[]; var itemsArray = items as TItem[]; @@ -378,7 +375,6 @@ namespace MathNet.Numerics Array.Sort(keysArray, itemsArray, index, count, comparer); return; } -#endif // fall back: local sort implementation QuickSort(keys, items, comparer, index, count - 1); diff --git a/src/Numerics/SpecialFunctions/Evaluate.cs b/src/Numerics/SpecialFunctions/Evaluate.cs index 1cc1cc19..a1e674f9 100644 --- a/src/Numerics/SpecialFunctions/Evaluate.cs +++ b/src/Numerics/SpecialFunctions/Evaluate.cs @@ -44,10 +44,7 @@ // using System; - -#if !NOSYSNUMERICS using System.Numerics; -#endif // ReSharper disable CheckNamespace namespace MathNet.Numerics diff --git a/src/Numerics/SpecialFunctions/Factorial.cs b/src/Numerics/SpecialFunctions/Factorial.cs index f91fc183..5aea8a51 100644 --- a/src/Numerics/SpecialFunctions/Factorial.cs +++ b/src/Numerics/SpecialFunctions/Factorial.cs @@ -28,11 +28,8 @@ // using System; -using MathNet.Numerics.Properties; - -#if !NOSYSNUMERICS using System.Numerics; -#endif +using MathNet.Numerics.Properties; // ReSharper disable CheckNamespace namespace MathNet.Numerics @@ -88,7 +85,6 @@ namespace MathNet.Numerics return double.PositiveInfinity; } -#if !NOSYSNUMERICS /// /// Computes the factorial of an integer. /// @@ -112,7 +108,6 @@ namespace MathNet.Numerics return r; } -#endif /// /// Computes the logarithmic factorial function x -> ln(x!) of an integer number > 0. diff --git a/src/Numerics/SpecialFunctions/Stability.cs b/src/Numerics/SpecialFunctions/Stability.cs index 2ed927dd..8076d32d 100644 --- a/src/Numerics/SpecialFunctions/Stability.cs +++ b/src/Numerics/SpecialFunctions/Stability.cs @@ -28,10 +28,7 @@ // using System; - -#if !NOSYSNUMERICS using System.Numerics; -#endif // ReSharper disable CheckNamespace namespace MathNet.Numerics diff --git a/src/Numerics/Statistics/ArrayStatistics.Complex.cs b/src/Numerics/Statistics/ArrayStatistics.Complex.cs index b8836316..b8049135 100644 --- a/src/Numerics/Statistics/ArrayStatistics.Complex.cs +++ b/src/Numerics/Statistics/ArrayStatistics.Complex.cs @@ -27,16 +27,10 @@ // OTHER DEALINGS IN THE SOFTWARE. // -using System; +using System.Numerics; namespace MathNet.Numerics.Statistics { -#if NOSYSNUMERICS - using Complex64 = Numerics.Complex; -#else - using Complex64 = System.Numerics.Complex; -#endif - public static partial class ArrayStatistics { /// @@ -44,21 +38,21 @@ namespace MathNet.Numerics.Statistics /// Returns NaN if data is empty or any entry is NaN. /// /// Sample array, no sorting is assumed. - public static Complex64 MinimumMagnitudePhase(Complex64[] data) + public static Complex MinimumMagnitudePhase(Complex[] data) { if (data.Length == 0) { - return new Complex64(double.NaN, double.NaN); + return new Complex(double.NaN, double.NaN); } double minMagnitude = double.PositiveInfinity; - Complex64 min = new Complex64(double.PositiveInfinity, double.PositiveInfinity); + Complex min = new Complex(double.PositiveInfinity, double.PositiveInfinity); for (int i = 0; i < data.Length; i++) { double magnitude = data[i].Magnitude; if (double.IsNaN(magnitude)) { - return new Complex64(double.NaN, double.NaN); + return new Complex(double.NaN, double.NaN); } if (magnitude < minMagnitude || magnitude == minMagnitude && data[i].Phase < min.Phase) { @@ -106,21 +100,21 @@ namespace MathNet.Numerics.Statistics /// Returns NaN if data is empty or any entry is NaN. /// /// Sample array, no sorting is assumed. - public static Complex64 MaximumMagnitudePhase(Complex64[] data) + public static Complex MaximumMagnitudePhase(Complex[] data) { if (data.Length == 0) { - return new Complex64(double.NaN, double.NaN); + return new Complex(double.NaN, double.NaN); } double maxMagnitude = 0.0d; - Complex64 max = Complex64.Zero; + Complex max = Complex.Zero; for (int i = 0; i < data.Length; i++) { double magnitude = data[i].Magnitude; if (double.IsNaN(magnitude)) { - return new Complex64(double.NaN, double.NaN); + return new Complex(double.NaN, double.NaN); } if (magnitude > maxMagnitude || magnitude == maxMagnitude && data[i].Phase > max.Phase) { diff --git a/src/Numerics/Statistics/ArrayStatistics.Single.cs b/src/Numerics/Statistics/ArrayStatistics.Single.cs index 20235466..7614cf12 100644 --- a/src/Numerics/Statistics/ArrayStatistics.Single.cs +++ b/src/Numerics/Statistics/ArrayStatistics.Single.cs @@ -532,11 +532,7 @@ namespace MathNet.Numerics.Statistics } var x = a + (data.Length + b) * tau - 1; -#if PORTABLE - var ip = (int)x; -#else var ip = Math.Truncate(x); -#endif var fp = x - ip; if (Math.Abs(fp) < 1e-9) diff --git a/src/Numerics/Statistics/ArrayStatistics.cs b/src/Numerics/Statistics/ArrayStatistics.cs index d4452db5..cb6d3f6c 100644 --- a/src/Numerics/Statistics/ArrayStatistics.cs +++ b/src/Numerics/Statistics/ArrayStatistics.cs @@ -542,11 +542,7 @@ namespace MathNet.Numerics.Statistics } var x = a + (data.Length + b)*tau - 1; -#if PORTABLE - var ip = (int)x; -#else var ip = Math.Truncate(x); -#endif var fp = x - ip; if (Math.Abs(fp) < 1e-9) diff --git a/src/Numerics/Statistics/Histogram.cs b/src/Numerics/Statistics/Histogram.cs index a7d998d9..fd6ddf83 100644 --- a/src/Numerics/Statistics/Histogram.cs +++ b/src/Numerics/Statistics/Histogram.cs @@ -48,7 +48,7 @@ namespace MathNet.Numerics.Statistics [Serializable] [DataContract(Namespace = "urn:MathNet/Numerics")] public class Bucket : IComparable -#if !(PORTABLE || NETSTANDARD) +#if !NETSTANDARD1_3 , ICloneable #endif { diff --git a/src/Numerics/Statistics/SortedArrayStatistics.Single.cs b/src/Numerics/Statistics/SortedArrayStatistics.Single.cs index ea115a5b..728d35cf 100644 --- a/src/Numerics/Statistics/SortedArrayStatistics.Single.cs +++ b/src/Numerics/Statistics/SortedArrayStatistics.Single.cs @@ -210,11 +210,7 @@ namespace MathNet.Numerics.Statistics } var x = a + (data.Length + b)*tau - 1; -#if PORTABLE - var ip = (int) x; -#else var ip = Math.Truncate(x); -#endif var fp = x - ip; if (Math.Abs(fp) < 1e-9) diff --git a/src/Numerics/Statistics/SortedArrayStatistics.cs b/src/Numerics/Statistics/SortedArrayStatistics.cs index bc50b04b..437cb1ad 100644 --- a/src/Numerics/Statistics/SortedArrayStatistics.cs +++ b/src/Numerics/Statistics/SortedArrayStatistics.cs @@ -214,11 +214,7 @@ namespace MathNet.Numerics.Statistics } var x = a + (data.Length + b)*tau - 1; -#if PORTABLE - var ip = (int) x; -#else var ip = Math.Truncate(x); -#endif var fp = x - ip; if (Math.Abs(fp) < 1e-9) diff --git a/src/Numerics/Statistics/Statistics.cs b/src/Numerics/Statistics/Statistics.cs index ff6de1bd..b1c887f9 100644 --- a/src/Numerics/Statistics/Statistics.cs +++ b/src/Numerics/Statistics/Statistics.cs @@ -28,17 +28,12 @@ // using System; +using System.Numerics; using System.Collections.Generic; using System.Linq; namespace MathNet.Numerics.Statistics { -#if NOSYSNUMERICS - using Complex64 = Numerics.Complex; -#else - using Complex64 = System.Numerics.Complex; -#endif - /// /// Extension methods to return basic statistics on set of data. /// @@ -187,9 +182,9 @@ namespace MathNet.Numerics.Statistics /// /// The sample data. /// The minimum value in the sample data. - public static Complex64 MinimumMagnitudePhase(this IEnumerable data) + public static Complex MinimumMagnitudePhase(this IEnumerable data) { - var array = data as Complex64[]; + var array = data as Complex[]; return array != null ? ArrayStatistics.MinimumMagnitudePhase(array) : StreamingStatistics.MinimumMagnitudePhase(data); @@ -215,9 +210,9 @@ namespace MathNet.Numerics.Statistics /// /// The sample data. /// The minimum value in the sample data. - public static Complex64 MaximumMagnitudePhase(this IEnumerable data) + public static Complex MaximumMagnitudePhase(this IEnumerable data) { - var array = data as Complex64[]; + var array = data as Complex[]; return array != null ? ArrayStatistics.MaximumMagnitudePhase(array) : StreamingStatistics.MaximumMagnitudePhase(data); diff --git a/src/Numerics/Statistics/StreamingStatistics.cs b/src/Numerics/Statistics/StreamingStatistics.cs index 202e6af4..7c88be58 100644 --- a/src/Numerics/Statistics/StreamingStatistics.cs +++ b/src/Numerics/Statistics/StreamingStatistics.cs @@ -28,18 +28,13 @@ // using System; +using System.Numerics; using System.Collections.Generic; using System.Linq; using MathNet.Numerics.Properties; namespace MathNet.Numerics.Statistics { -#if NOSYSNUMERICS - using Complex64 = Numerics.Complex; -#else - using Complex64 = System.Numerics.Complex; -#endif - /// /// Statistics operating on an IEnumerable in a single pass, without keeping the full data in memory. /// Can be used in a streaming way, e.g. on large datasets not fitting into memory. @@ -238,10 +233,10 @@ namespace MathNet.Numerics.Statistics /// Returns NaN if data is empty or any entry is NaN. /// /// Sample stream, no sorting is assumed. - public static Complex64 MinimumMagnitudePhase(IEnumerable stream) + public static Complex MinimumMagnitudePhase(IEnumerable stream) { double minMagnitude = double.PositiveInfinity; - Complex64 min = new Complex64(double.PositiveInfinity, double.PositiveInfinity); + Complex min = new Complex(double.PositiveInfinity, double.PositiveInfinity); bool any = false; foreach (var d in stream) @@ -249,7 +244,7 @@ namespace MathNet.Numerics.Statistics double magnitude = d.Magnitude; if (double.IsNaN(magnitude)) { - return new Complex64(double.NaN, double.NaN); + return new Complex(double.NaN, double.NaN); } if (magnitude < minMagnitude || magnitude == minMagnitude && d.Phase < min.Phase) { @@ -260,7 +255,7 @@ namespace MathNet.Numerics.Statistics any = true; } - return any ? min : new Complex64(double.NaN, double.NaN); + return any ? min : new Complex(double.NaN, double.NaN); } /// @@ -298,10 +293,10 @@ namespace MathNet.Numerics.Statistics /// Returns NaN if data is empty or any entry is NaN. /// /// Sample stream, no sorting is assumed. - public static Complex64 MaximumMagnitudePhase(IEnumerable stream) + public static Complex MaximumMagnitudePhase(IEnumerable stream) { double maxMagnitude = 0.0d; - Complex64 max = Complex64.Zero; + Complex max = Complex.Zero; bool any = false; foreach (var d in stream) @@ -309,7 +304,7 @@ namespace MathNet.Numerics.Statistics double magnitude = d.Magnitude; if (double.IsNaN(magnitude)) { - return new Complex64(double.NaN, double.NaN); + return new Complex(double.NaN, double.NaN); } if (magnitude > maxMagnitude || magnitude == maxMagnitude && d.Phase > max.Phase) { @@ -320,7 +315,7 @@ namespace MathNet.Numerics.Statistics any = true; } - return any ? max : new Complex64(double.NaN, double.NaN); + return any ? max : new Complex(double.NaN, double.NaN); } /// diff --git a/src/Numerics/Threading/CommonParallel.cs b/src/Numerics/Threading/CommonParallel.cs index 83dfd0cc..38e31718 100644 --- a/src/Numerics/Threading/CommonParallel.cs +++ b/src/Numerics/Threading/CommonParallel.cs @@ -29,18 +29,14 @@ using System; using System.Collections.Generic; + +#if !NETSTANDARD1_3 using System.Threading.Tasks; +using System.Collections.Concurrent; +#endif namespace MathNet.Numerics.Threading { -#if NET35 - using Partitioner = MathNet.Numerics.Partitioner; -#endif -#if !PORTABLE && !NETSTANDARD - using System.Collections.Concurrent; - -#endif - /// /// Used to simplify parallel code, particularly between the .NET 4.0 and Silverlight Code. /// @@ -118,7 +114,7 @@ namespace MathNet.Numerics.Threading } /// - /// Executes each of the provided actions inside a discrete, asynchronous task. + /// Executes each of the provided actions inside a discrete, asynchronous task. /// /// An array of actions to execute. /// The actions array contains a null element. diff --git a/src/Numerics/Trigonometry.cs b/src/Numerics/Trigonometry.cs index 0a350594..51b2aedd 100644 --- a/src/Numerics/Trigonometry.cs +++ b/src/Numerics/Trigonometry.cs @@ -27,14 +27,11 @@ // OTHER DEALINGS IN THE SOFTWARE. // +using System; +using System.Numerics; + namespace MathNet.Numerics { - using System; - -#if !NOSYSNUMERICS - using Complex = System.Numerics.Complex; -#endif - /// /// Double-precision trigonometry toolkit. /// @@ -195,7 +192,7 @@ namespace MathNet.Numerics // tan(z) = - j*tanh(j*z) Complex z = Tanh(new Complex(-value.Imaginary, value.Real)); - return new Complex(z.Imaginary, -z.Real); + return new Complex(z.Imaginary, -z.Real); } /// @@ -460,7 +457,7 @@ namespace MathNet.Numerics return new Complex( Sinh(value.Real) * Cos(value.Imaginary), - Cosh(value.Real) * Sin(value.Imaginary)); + Cosh(value.Real) * Sin(value.Imaginary)); } /// @@ -535,13 +532,13 @@ namespace MathNet.Numerics return new Complex(Tanh(value.Real), 0.0); } - // tanh(x + j*y) = (cosh(x)*sinh(x)/cos^2(y) + j*tan(y))/(1 + sinh^2(x)/cos^2(y)) + // tanh(x + j*y) = (cosh(x)*sinh(x)/cos^2(y) + j*tan(y))/(1 + sinh^2(x)/cos^2(y)) // if |x| > huge, tanh(z) = sign(x) + j*4*cos(y)*sin(y)*exp(-2*|x|) // if exp(-|x|) = 0, tanh(z) = sign(x) // if tan(y) = +/- oo or 1/cos^2(y) = 1 + tan^2(y) = oo, tanh(z) = cosh(x)/sinh(x) // // The algorithm is based on Kahan. - + if (Math.Abs(value.Real) >= 22.0) // Taken from the msun library in FreeBSD { double e = Math.Exp(-Math.Abs(value.Real)); @@ -623,7 +620,7 @@ namespace MathNet.Numerics return new Complex(Sech(value.Real), 0.0); } - // sech(x + j*y) = (cosh(x)/cos(y) - j*sinh(x)*tan(y)/cos(y))/(1 + sinh^2(x)/cos^2(y)) + // sech(x + j*y) = (cosh(x)/cos(y) - j*sinh(x)*tan(y)/cos(y))/(1 + sinh^2(x)/cos^2(y)) // if |x| > huge, sech(z) = 4*cosh(x)*cos(y)*exp(-2*|x|) - j*4*sinh(x)*tan(y)*cos(y)*exp(-2*|x|) // if exp(-|x|) = 0, sech(z) = 0 // if tan(y) = +/- oo or 1/cos^2(y) = 1 + tan^2(y) = oo, sech(z) = -j*sign(tan(y))/sinh(x) @@ -635,7 +632,7 @@ namespace MathNet.Numerics double beta = 1.0 + tani * tani; double sinhr = Math.Sinh(value.Real); double coshr = Math.Cosh(value.Real); - + if (Math.Abs(value.Real) >= 22.0) // Taken from the msun library in FreeBSD { double e = Math.Exp(-Math.Abs(value.Real)); @@ -675,7 +672,7 @@ namespace MathNet.Numerics return new Complex(Csch(value.Real), 0.0); } - // csch(x + j*y) = (sinh(x)*cot(y)/sin(y) - j*cosh(x)/sin(y))/(1 + sinh^2(x)/sin^2(y)) + // csch(x + j*y) = (sinh(x)*cot(y)/sin(y) - j*cosh(x)/sin(y))/(1 + sinh^2(x)/sin^2(y)) // if |x| > huge, csch(z) = 4*sinh(x)*cot(y)*sin(y)*exp(-2*|x|) - j*4*cosh(x)*sin(y)*exp(-2*|x|) // if exp(-|x|) = 0, csch(z) = 0 // if cot(y) = +/- oo or 1/sin^2(x) = 1 + cot^2(x) = oo, csch(z) = sign(cot(y))/sinh(x) @@ -687,7 +684,7 @@ namespace MathNet.Numerics double beta = 1 + coti * coti; double sinhr = Sinh(value.Real); double coshr = Cosh(value.Real); - + if (Math.Abs(value.Real) >= 22.0) // Taken from the msun library in FreeBSD { double e = Math.Exp(-Math.Abs(value.Real)); diff --git a/src/TestData/Data.cs b/src/TestData/Data.cs index f4233283..c88573d3 100644 --- a/src/TestData/Data.cs +++ b/src/TestData/Data.cs @@ -6,7 +6,7 @@ namespace MathNet.Numerics.TestData { public static class Data { -#if NETSTANDARD +#if NETSTANDARD1_1 static readonly Assembly DataAssembly = typeof(Data).GetTypeInfo().Assembly; #else static readonly Assembly DataAssembly = typeof (Data).Assembly; diff --git a/src/TestData/Properties/AssemblyInfo.cs b/src/TestData/Properties/AssemblyInfo.cs index 7fd5eba5..569cfb46 100644 --- a/src/TestData/Properties/AssemblyInfo.cs +++ b/src/TestData/Properties/AssemblyInfo.cs @@ -2,9 +2,6 @@ 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("Math.NET Numerics Test Data")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] @@ -14,23 +11,9 @@ using System.Runtime.InteropServices; [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("a4a6a08e-5265-4608-a43d-e4f2e210ba2d")] -// 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/TestData/TestData.csproj b/src/TestData/TestData.csproj index 99f87a46..f88e6f3d 100644 --- a/src/TestData/TestData.csproj +++ b/src/TestData/TestData.csproj @@ -8,10 +8,7 @@ MathNet.Numerics.TestData false - - NETSTANDARD - - + diff --git a/src/UnitTests/ArrayHelpers.cs b/src/UnitTests/ArrayHelpers.cs index 7292e56a..c346e56b 100644 --- a/src/UnitTests/ArrayHelpers.cs +++ b/src/UnitTests/ArrayHelpers.cs @@ -27,7 +27,7 @@ // OTHER DEALINGS IN THE SOFTWARE. // -#if PORTABLE || NETSTANDARD +#if NETCOREAPP1_1 using System.Collections.Generic; using System.Linq; #endif @@ -49,13 +49,13 @@ namespace MathNet.Numerics.UnitTests /// The one-dimensional, zero-based Array to convert to a target type. /// A Converter that converts each element from one type to another type. /// An array of the target type containing the converted elements from the source array. -#if NETSTANDARD +#if NETCOREAPP1_1 public static TOutput[] ConvertAll(TInput[] array, Func converter) #else public static TOutput[] ConvertAll(TInput[] array, Converter converter) #endif { -#if PORTABLE || NETSTANDARD +#if NETCOREAPP1_1 if (array == null) throw new ArgumentException(); @@ -65,7 +65,7 @@ namespace MathNet.Numerics.UnitTests #endif } -#if PORTABLE || NETSTANDARD +#if NETCOREAPP1_1 /// /// Determines whether the specified array contains elements that match the conditions defined by the specified predicate. /// diff --git a/src/UnitTests/AssertHelpers.cs b/src/UnitTests/AssertHelpers.cs index 86fa91bc..b4554e6f 100644 --- a/src/UnitTests/AssertHelpers.cs +++ b/src/UnitTests/AssertHelpers.cs @@ -28,17 +28,12 @@ // using System.Collections.Generic; +using System.Numerics; using MathNet.Numerics.LinearAlgebra; using NUnit.Framework; namespace MathNet.Numerics.UnitTests { -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else - using Complex = System.Numerics.Complex; -#endif - /// /// A class which includes some assertion helper methods particularly for numerical code. /// diff --git a/src/UnitTests/ComplexTests/Complex32Test.TextHandling.cs b/src/UnitTests/ComplexTests/Complex32Test.TextHandling.cs index 69cb5623..c9d261b3 100644 --- a/src/UnitTests/ComplexTests/Complex32Test.TextHandling.cs +++ b/src/UnitTests/ComplexTests/Complex32Test.TextHandling.cs @@ -73,7 +73,6 @@ namespace MathNet.Numerics.UnitTests.ComplexTests a.ToString()); } -#if !PORTABLE /// /// Can format complex to string with culture. /// @@ -99,7 +98,6 @@ namespace MathNet.Numerics.UnitTests.ComplexTests Assert.AreEqual("(0, " + String.Format("{0}", number) + ")", new Complex32(0.0f, 1.1f).ToString(provider)); Assert.AreEqual("(" + String.Format("{0}", number) + ", " + String.Format("{0}", number) + ")", new Complex32(1.1f, 1.1f).ToString(provider)); } -#endif /// /// Can format complex to string with format. @@ -249,7 +247,6 @@ namespace MathNet.Numerics.UnitTests.ComplexTests Assert.AreEqual(float.MinValue, z.Imaginary, "E3"); } -#if !(PORTABLE || NETSTANDARD) /// /// Try parse can handle symbols with a culture. /// @@ -294,7 +291,6 @@ namespace MathNet.Numerics.UnitTests.ComplexTests Assert.AreEqual(float.MaxValue, z.Real, "E2"); Assert.AreEqual(float.MinValue, z.Imaginary, "E3"); } -#endif /// /// Try parse returns false when given bad value with invariant. diff --git a/src/UnitTests/ComplexTests/Complex32Test.cs b/src/UnitTests/ComplexTests/Complex32Test.cs index ec41cd2d..81392037 100644 --- a/src/UnitTests/ComplexTests/Complex32Test.cs +++ b/src/UnitTests/ComplexTests/Complex32Test.cs @@ -28,16 +28,11 @@ // using System; +using System.Numerics; using NUnit.Framework; namespace MathNet.Numerics.UnitTests.ComplexTests { -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else - using Complex = System.Numerics.Complex; -#endif - /// /// Complex32 tests. /// diff --git a/src/UnitTests/ComplexTests/ComplexTest.TextHandling.cs b/src/UnitTests/ComplexTests/ComplexTest.TextHandling.cs index e4c4d17b..ba1c9680 100644 --- a/src/UnitTests/ComplexTests/ComplexTest.TextHandling.cs +++ b/src/UnitTests/ComplexTests/ComplexTest.TextHandling.cs @@ -28,17 +28,12 @@ // using System; +using System.Numerics; using System.Globalization; using NUnit.Framework; namespace MathNet.Numerics.UnitTests.ComplexTests { -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else - using Complex = System.Numerics.Complex; -#endif - /// /// Complex text handling tests /// @@ -155,7 +150,6 @@ namespace MathNet.Numerics.UnitTests.ComplexTests Assert.AreEqual(double.MinValue, z.Imaginary, "E3"); } -#if !(PORTABLE || NETSTANDARD) /// /// Try parse can handle symbols with a culture. /// @@ -202,7 +196,6 @@ namespace MathNet.Numerics.UnitTests.ComplexTests Assert.AreEqual(double.MaxValue, z.Real, "E2"); Assert.AreEqual(double.MinValue, z.Imaginary, "E3"); } -#endif /// /// Try parse returns false when given bad value with invariant. diff --git a/src/UnitTests/ComplexTests/ComplexTest.cs b/src/UnitTests/ComplexTests/ComplexTest.cs index 108cb1bf..ad4c95d2 100644 --- a/src/UnitTests/ComplexTests/ComplexTest.cs +++ b/src/UnitTests/ComplexTests/ComplexTest.cs @@ -27,16 +27,11 @@ // OTHER DEALINGS IN THE SOFTWARE. // +using System.Numerics; using NUnit.Framework; namespace MathNet.Numerics.UnitTests.ComplexTests { -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else - using Complex = System.Numerics.Complex; -#endif - /// /// Complex extension methods tests. /// diff --git a/src/UnitTests/EuclidTests/GcdRelatedTestBigInteger.cs b/src/UnitTests/EuclidTests/GcdRelatedTestBigInteger.cs index 50734061..f7d0fa7b 100644 --- a/src/UnitTests/EuclidTests/GcdRelatedTestBigInteger.cs +++ b/src/UnitTests/EuclidTests/GcdRelatedTestBigInteger.cs @@ -27,8 +27,6 @@ // OTHER DEALINGS IN THE SOFTWARE. // -#if !NOSYSNUMERICS - using System; using System.Numerics; using NUnit.Framework; @@ -78,9 +76,7 @@ namespace MathNet.Numerics.UnitTests.EuclidTests Assert.AreEqual((BigInteger)1, Euclid.GreatestCommonDivisor((BigInteger)Int32.MaxValue, Int64.MaxValue), "Gcd(Int32Max,Int64Max)"); Assert.AreEqual((BigInteger)(1 << 18), Euclid.GreatestCommonDivisor((BigInteger)(1 << 18), 1 << 20), "Gcd(1>>18,1<<20)"); Assert.AreEqual((BigInteger)(1 << 18), Euclid.GreatestCommonDivisor((BigInteger)(1 << 18), 1 << 20), "Gcd(1>>18,1<<20)"); -#if !(PORTABLE || NETSTANDARD) Assert.AreEqual((BigInteger)4569031055798, Euclid.GreatestCommonDivisor(BigInteger.Parse("7305316061155559483748611586449542122662"), BigInteger.Parse("57377277362010117405715236427413896")), "Gcd(large)"); -#endif } /// @@ -100,14 +96,12 @@ namespace MathNet.Numerics.UnitTests.EuclidTests Assert.AreEqual((BigInteger)3, Euclid.ExtendedGreatestCommonDivisor(-6, -15, out x, out y), "Egcd(-6,-15)"); Assert.AreEqual((BigInteger)3, (-6*x) + (-15*y), "Egcd(-6,-15) -> a*x+b*y"); -#if !(PORTABLE || NETSTANDARD) var a = BigInteger.Parse("7305316061155559483748611586449542122662"); var b = BigInteger.Parse("57377277362010117405715236427413896"); Assert.AreEqual((BigInteger)4569031055798, Euclid.ExtendedGreatestCommonDivisor(a, b, out x, out y), "Egcd(large)"); Assert.AreEqual((BigInteger)4569031055798, (a*x) + (b*y), "Egcd(large) -> a*x+b*y"); Assert.AreEqual((BigInteger)4569031055798, Euclid.ExtendedGreatestCommonDivisor(-a, b, out x, out y), "Egcd(-large)"); Assert.AreEqual((BigInteger)4569031055798, (-a*x) + (b*y), "Egcd(-large) -> a*x+b*y"); -#endif } /// @@ -181,9 +175,7 @@ namespace MathNet.Numerics.UnitTests.EuclidTests Assert.AreEqual((BigInteger)Int64.MaxValue, Euclid.LeastCommonMultiple((BigInteger)Int64.MaxValue, Int64.MaxValue), "Lcm(Int64Max,Int64Max)"); Assert.AreEqual((BigInteger)Int64.MaxValue, Euclid.LeastCommonMultiple((BigInteger)(-Int64.MaxValue), -Int64.MaxValue), "Lcm(-Int64Max,-Int64Max)"); Assert.AreEqual((BigInteger)Int64.MaxValue, Euclid.LeastCommonMultiple((BigInteger)(-Int64.MaxValue), Int64.MaxValue), "Lcm(-Int64Max,Int64Max)"); -#if !(PORTABLE || NETSTANDARD) Assert.AreEqual(BigInteger.Parse("91739176367857263082719902034485224119528064014300888465614024"), Euclid.LeastCommonMultiple(BigInteger.Parse("7305316061155559483748611586449542122662"), BigInteger.Parse("57377277362010117405715236427413896")), "Lcm(large)"); -#endif } /// @@ -221,5 +213,3 @@ namespace MathNet.Numerics.UnitTests.EuclidTests } } } - -#endif diff --git a/src/UnitTests/GenerateTests.cs b/src/UnitTests/GenerateTests.cs index 60d47aea..8da0604d 100644 --- a/src/UnitTests/GenerateTests.cs +++ b/src/UnitTests/GenerateTests.cs @@ -28,15 +28,12 @@ // using System; +using System.Numerics; using System.Linq; using NUnit.Framework; namespace MathNet.Numerics.UnitTests { -#if !NOSYSNUMERICS - using System.Numerics; -#endif - [TestFixture] public class GenerateTests { @@ -229,8 +226,6 @@ namespace MathNet.Numerics.UnitTests Is.EqualTo(Generate.Unfold(250, (s => new Tuple(s + 1, s + 1)), 0)).AsCollection); } -#if !NOSYSNUMERICS - [Test] public void FibonacciConsistentWithSequence() { @@ -250,8 +245,5 @@ namespace MathNet.Numerics.UnitTests return new Tuple>(z, new Tuple(s.Item2, z)); }), new Tuple(BigInteger.Zero, BigInteger.One)))).AsCollection); } - -#endif - } } diff --git a/src/UnitTests/GenericMath.cs b/src/UnitTests/GenericMath.cs index ab0c9ded..874afca0 100644 --- a/src/UnitTests/GenericMath.cs +++ b/src/UnitTests/GenericMath.cs @@ -580,7 +580,7 @@ namespace MathNet.Numerics.UnitTests xor = ExpressionUtil.CreateExpression(Expression.ExclusiveOr); Type typeT = typeof (T); -#if NETSTANDARD +#if NETCOREAPP1_1 var typeInfoT = typeT.GetTypeInfo(); if (typeInfoT.IsValueType && typeInfoT.IsGenericType && (typeInfoT.GetGenericTypeDefinition() == typeof (Nullable<>))) #else @@ -596,7 +596,7 @@ namespace MathNet.Numerics.UnitTests else { zero = default(T); -#if NETSTANDARD +#if NETCOREAPP1_1 if (typeT.GetTypeInfo().IsValueType) #else if (typeT.IsValueType) diff --git a/src/UnitTests/IntegralTransformsTests/FourierTest.cs b/src/UnitTests/IntegralTransformsTests/FourierTest.cs index 0c5a8a3d..eac365f6 100644 --- a/src/UnitTests/IntegralTransformsTests/FourierTest.cs +++ b/src/UnitTests/IntegralTransformsTests/FourierTest.cs @@ -28,17 +28,13 @@ // using System; +using System.Numerics; using MathNet.Numerics.Distributions; using MathNet.Numerics.IntegralTransforms; using NUnit.Framework; namespace MathNet.Numerics.UnitTests.IntegralTransformsTests { - -#if !NOSYSNUMERICS - using System.Numerics; -#endif - /// /// Fourier test. /// diff --git a/src/UnitTests/IntegralTransformsTests/HartleyTest.cs b/src/UnitTests/IntegralTransformsTests/HartleyTest.cs index d384d4d5..d59b01b9 100644 --- a/src/UnitTests/IntegralTransformsTests/HartleyTest.cs +++ b/src/UnitTests/IntegralTransformsTests/HartleyTest.cs @@ -28,17 +28,13 @@ // using System; +using System.Numerics; using MathNet.Numerics.Distributions; using MathNet.Numerics.IntegralTransforms; using NUnit.Framework; namespace MathNet.Numerics.UnitTests.IntegralTransformsTests { - -#if !NOSYSNUMERICS - using System.Numerics; -#endif - /// /// Hartley tests. /// diff --git a/src/UnitTests/IntegralTransformsTests/InverseTransformTest.cs b/src/UnitTests/IntegralTransformsTests/InverseTransformTest.cs index f1ce9e62..e1f00b97 100644 --- a/src/UnitTests/IntegralTransformsTests/InverseTransformTest.cs +++ b/src/UnitTests/IntegralTransformsTests/InverseTransformTest.cs @@ -27,17 +27,13 @@ // OTHER DEALINGS IN THE SOFTWARE. // +using System.Numerics; using MathNet.Numerics.Distributions; using MathNet.Numerics.IntegralTransforms; using NUnit.Framework; namespace MathNet.Numerics.UnitTests.IntegralTransformsTests { - -#if !NOSYSNUMERICS - using System.Numerics; -#endif - /// /// Inverse Transform test. /// diff --git a/src/UnitTests/IntegralTransformsTests/MatchingNaiveTransformTest.cs b/src/UnitTests/IntegralTransformsTests/MatchingNaiveTransformTest.cs index 9f40b29a..d42fc070 100644 --- a/src/UnitTests/IntegralTransformsTests/MatchingNaiveTransformTest.cs +++ b/src/UnitTests/IntegralTransformsTests/MatchingNaiveTransformTest.cs @@ -28,6 +28,7 @@ // using System; +using System.Numerics; using MathNet.Numerics.Distributions; using MathNet.Numerics.IntegralTransforms; using MathNet.Numerics.Providers.FourierTransform; @@ -35,11 +36,6 @@ using NUnit.Framework; namespace MathNet.Numerics.UnitTests.IntegralTransformsTests { - -#if !NOSYSNUMERICS - using System.Numerics; -#endif - /// /// Matching Naive transform tests. /// diff --git a/src/UnitTests/IntegralTransformsTests/ParsevalTheoremTest.cs b/src/UnitTests/IntegralTransformsTests/ParsevalTheoremTest.cs index b0f8189e..5c7ab325 100644 --- a/src/UnitTests/IntegralTransformsTests/ParsevalTheoremTest.cs +++ b/src/UnitTests/IntegralTransformsTests/ParsevalTheoremTest.cs @@ -28,6 +28,7 @@ // using System.Linq; +using System.Numerics; using MathNet.Numerics.Distributions; using MathNet.Numerics.IntegralTransforms; using MathNet.Numerics.Statistics; @@ -35,11 +36,6 @@ using NUnit.Framework; namespace MathNet.Numerics.UnitTests.IntegralTransformsTests { - -#if !NOSYSNUMERICS - using System.Numerics; -#endif - /// /// Parseval's theorem verification tests. /// diff --git a/src/UnitTests/InterpolationTests/CubicSplineTest.cs b/src/UnitTests/InterpolationTests/CubicSplineTest.cs index 55c3547e..2ba52584 100644 --- a/src/UnitTests/InterpolationTests/CubicSplineTest.cs +++ b/src/UnitTests/InterpolationTests/CubicSplineTest.cs @@ -183,7 +183,6 @@ namespace MathNet.Numerics.UnitTests.InterpolationTests Assert.That(CubicSpline.InterpolateNatural(new[] { 1.0, 2.0 }, new[] { 2.0, 2.0 }).Interpolate(1.0), Is.EqualTo(2.0)); } -#if !NET35 && !PORTABLE && !NETSTANDARD [Test] public void InterpolateAkimaSorted_MustBeThreadSafe_GitHub219([Values(8, 32, 256, 1024)] int samples) { @@ -203,7 +202,5 @@ namespace MathNet.Numerics.UnitTests.InterpolationTests CollectionAssert.DoesNotContain(yipol, Double.NaN); } -#endif - } } diff --git a/src/UnitTests/LinearAlgebraTests/Complex/DenseMatrixTests.cs b/src/UnitTests/LinearAlgebraTests/Complex/DenseMatrixTests.cs index 2304c3a8..d6a5c0c6 100644 --- a/src/UnitTests/LinearAlgebraTests/Complex/DenseMatrixTests.cs +++ b/src/UnitTests/LinearAlgebraTests/Complex/DenseMatrixTests.cs @@ -35,11 +35,7 @@ using NUnit.Framework; namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex { -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else using Complex = System.Numerics.Complex; -#endif /// /// Dense matrix tests. diff --git a/src/UnitTests/LinearAlgebraTests/Complex/DenseVectorTests.cs b/src/UnitTests/LinearAlgebraTests/Complex/DenseVectorTests.cs index f39b8ea9..efbbdfb9 100644 --- a/src/UnitTests/LinearAlgebraTests/Complex/DenseVectorTests.cs +++ b/src/UnitTests/LinearAlgebraTests/Complex/DenseVectorTests.cs @@ -35,11 +35,7 @@ using System.Collections.Generic; namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex { -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else using Complex = System.Numerics.Complex; -#endif /// /// Dense vector tests. diff --git a/src/UnitTests/LinearAlgebraTests/Complex/DiagonalMatrixTests.cs b/src/UnitTests/LinearAlgebraTests/Complex/DiagonalMatrixTests.cs index bc1514a3..6d50c748 100644 --- a/src/UnitTests/LinearAlgebraTests/Complex/DiagonalMatrixTests.cs +++ b/src/UnitTests/LinearAlgebraTests/Complex/DiagonalMatrixTests.cs @@ -37,11 +37,7 @@ using NUnit.Framework; namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex { -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else using Complex = System.Numerics.Complex; -#endif /// /// Diagonal matrix tests. diff --git a/src/UnitTests/LinearAlgebraTests/Complex/Factorization/CholeskyTests.cs b/src/UnitTests/LinearAlgebraTests/Complex/Factorization/CholeskyTests.cs index b878492d..bb798453 100644 --- a/src/UnitTests/LinearAlgebraTests/Complex/Factorization/CholeskyTests.cs +++ b/src/UnitTests/LinearAlgebraTests/Complex/Factorization/CholeskyTests.cs @@ -33,12 +33,8 @@ using NUnit.Framework; namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex.Factorization { -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else using Complex = System.Numerics.Complex; -#endif - + /// /// Cholesky factorization tests for a dense matrix. /// diff --git a/src/UnitTests/LinearAlgebraTests/Complex/Factorization/EvdTests.cs b/src/UnitTests/LinearAlgebraTests/Complex/Factorization/EvdTests.cs index 6f0d86d8..ef2aaeae 100644 --- a/src/UnitTests/LinearAlgebraTests/Complex/Factorization/EvdTests.cs +++ b/src/UnitTests/LinearAlgebraTests/Complex/Factorization/EvdTests.cs @@ -34,11 +34,7 @@ using NUnit.Framework; namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex.Factorization { -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else using Complex = System.Numerics.Complex; -#endif /// /// Eigenvalues factorization tests for a dense matrix. diff --git a/src/UnitTests/LinearAlgebraTests/Complex/Factorization/GramSchmidtTests.cs b/src/UnitTests/LinearAlgebraTests/Complex/Factorization/GramSchmidtTests.cs index 7841608f..f16ceaa6 100644 --- a/src/UnitTests/LinearAlgebraTests/Complex/Factorization/GramSchmidtTests.cs +++ b/src/UnitTests/LinearAlgebraTests/Complex/Factorization/GramSchmidtTests.cs @@ -34,11 +34,7 @@ using NUnit.Framework; namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex.Factorization { -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else using Complex = System.Numerics.Complex; -#endif /// /// GramSchmidt factorization tests for a dense matrix. diff --git a/src/UnitTests/LinearAlgebraTests/Complex/Factorization/LUTests.cs b/src/UnitTests/LinearAlgebraTests/Complex/Factorization/LUTests.cs index 3a845a23..66e8fb3c 100644 --- a/src/UnitTests/LinearAlgebraTests/Complex/Factorization/LUTests.cs +++ b/src/UnitTests/LinearAlgebraTests/Complex/Factorization/LUTests.cs @@ -33,11 +33,7 @@ using NUnit.Framework; namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex.Factorization { -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else using Complex = System.Numerics.Complex; -#endif /// /// LU factorization tests for a dense matrix. diff --git a/src/UnitTests/LinearAlgebraTests/Complex/Factorization/QRTests.cs b/src/UnitTests/LinearAlgebraTests/Complex/Factorization/QRTests.cs index 0136edd3..12554fbc 100644 --- a/src/UnitTests/LinearAlgebraTests/Complex/Factorization/QRTests.cs +++ b/src/UnitTests/LinearAlgebraTests/Complex/Factorization/QRTests.cs @@ -35,11 +35,7 @@ using NUnit.Framework; namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex.Factorization { -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else using Complex = System.Numerics.Complex; -#endif /// /// QR factorization tests for a dense matrix. diff --git a/src/UnitTests/LinearAlgebraTests/Complex/Factorization/SvdTests.cs b/src/UnitTests/LinearAlgebraTests/Complex/Factorization/SvdTests.cs index fd5f999d..5bbcacee 100644 --- a/src/UnitTests/LinearAlgebraTests/Complex/Factorization/SvdTests.cs +++ b/src/UnitTests/LinearAlgebraTests/Complex/Factorization/SvdTests.cs @@ -34,11 +34,7 @@ using NUnit.Framework; namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex.Factorization { -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else using Complex = System.Numerics.Complex; -#endif /// /// Svd factorization tests for a dense matrix. diff --git a/src/UnitTests/LinearAlgebraTests/Complex/Factorization/UserCholeskyTests.cs b/src/UnitTests/LinearAlgebraTests/Complex/Factorization/UserCholeskyTests.cs index faba4eb3..c24869c3 100644 --- a/src/UnitTests/LinearAlgebraTests/Complex/Factorization/UserCholeskyTests.cs +++ b/src/UnitTests/LinearAlgebraTests/Complex/Factorization/UserCholeskyTests.cs @@ -32,11 +32,7 @@ using NUnit.Framework; namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex.Factorization { -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else using Complex = System.Numerics.Complex; -#endif /// /// Cholesky factorization tests for a user matrix. diff --git a/src/UnitTests/LinearAlgebraTests/Complex/Factorization/UserEvdTests.cs b/src/UnitTests/LinearAlgebraTests/Complex/Factorization/UserEvdTests.cs index 293b013f..d811bbf6 100644 --- a/src/UnitTests/LinearAlgebraTests/Complex/Factorization/UserEvdTests.cs +++ b/src/UnitTests/LinearAlgebraTests/Complex/Factorization/UserEvdTests.cs @@ -32,11 +32,7 @@ using NUnit.Framework; namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex.Factorization { -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else using Complex = System.Numerics.Complex; -#endif /// /// Eigenvalues factorization tests for an user matrix. diff --git a/src/UnitTests/LinearAlgebraTests/Complex/Factorization/UserGramSchmidtTests.cs b/src/UnitTests/LinearAlgebraTests/Complex/Factorization/UserGramSchmidtTests.cs index e1293b05..4f824cf9 100644 --- a/src/UnitTests/LinearAlgebraTests/Complex/Factorization/UserGramSchmidtTests.cs +++ b/src/UnitTests/LinearAlgebraTests/Complex/Factorization/UserGramSchmidtTests.cs @@ -33,11 +33,7 @@ using NUnit.Framework; namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex.Factorization { -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else using Complex = System.Numerics.Complex; -#endif /// /// GramSchmidt factorization tests for a user matrix. diff --git a/src/UnitTests/LinearAlgebraTests/Complex/Factorization/UserLUTests.cs b/src/UnitTests/LinearAlgebraTests/Complex/Factorization/UserLUTests.cs index 712c49f1..4d42151c 100644 --- a/src/UnitTests/LinearAlgebraTests/Complex/Factorization/UserLUTests.cs +++ b/src/UnitTests/LinearAlgebraTests/Complex/Factorization/UserLUTests.cs @@ -32,11 +32,7 @@ using NUnit.Framework; namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex.Factorization { -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else using Complex = System.Numerics.Complex; -#endif /// /// LU factorization tests for a user matrix. diff --git a/src/UnitTests/LinearAlgebraTests/Complex/Factorization/UserQRTests.cs b/src/UnitTests/LinearAlgebraTests/Complex/Factorization/UserQRTests.cs index 3bcbf786..dd50ea61 100644 --- a/src/UnitTests/LinearAlgebraTests/Complex/Factorization/UserQRTests.cs +++ b/src/UnitTests/LinearAlgebraTests/Complex/Factorization/UserQRTests.cs @@ -34,11 +34,7 @@ using NUnit.Framework; namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex.Factorization { -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else using Complex = System.Numerics.Complex; -#endif /// /// QR factorization tests for a user matrix. diff --git a/src/UnitTests/LinearAlgebraTests/Complex/Factorization/UserSvdTests.cs b/src/UnitTests/LinearAlgebraTests/Complex/Factorization/UserSvdTests.cs index f66f7425..6e4d6302 100644 --- a/src/UnitTests/LinearAlgebraTests/Complex/Factorization/UserSvdTests.cs +++ b/src/UnitTests/LinearAlgebraTests/Complex/Factorization/UserSvdTests.cs @@ -33,11 +33,7 @@ using NUnit.Framework; namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex.Factorization { -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else using Complex = System.Numerics.Complex; -#endif /// /// Svd factorization tests for a user matrix. diff --git a/src/UnitTests/LinearAlgebraTests/Complex/MatrixLoader.cs b/src/UnitTests/LinearAlgebraTests/Complex/MatrixLoader.cs index 7303a6e6..b206e7df 100644 --- a/src/UnitTests/LinearAlgebraTests/Complex/MatrixLoader.cs +++ b/src/UnitTests/LinearAlgebraTests/Complex/MatrixLoader.cs @@ -33,11 +33,7 @@ using NUnit.Framework; namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex { -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else using Complex = System.Numerics.Complex; -#endif /// /// Base class for matrix tests. diff --git a/src/UnitTests/LinearAlgebraTests/Complex/MatrixStructureTheory.cs b/src/UnitTests/LinearAlgebraTests/Complex/MatrixStructureTheory.cs index b7acf5e6..2ceff1a6 100644 --- a/src/UnitTests/LinearAlgebraTests/Complex/MatrixStructureTheory.cs +++ b/src/UnitTests/LinearAlgebraTests/Complex/MatrixStructureTheory.cs @@ -32,11 +32,7 @@ using NUnit.Framework; namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex { -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else using Complex = System.Numerics.Complex; -#endif [TestFixture, Category("LA")] public class MatrixStructureTheory : MatrixStructureTheory diff --git a/src/UnitTests/LinearAlgebraTests/Complex/MatrixTests.Arithmetic.cs b/src/UnitTests/LinearAlgebraTests/Complex/MatrixTests.Arithmetic.cs index 61ccbd72..42e76d72 100644 --- a/src/UnitTests/LinearAlgebraTests/Complex/MatrixTests.Arithmetic.cs +++ b/src/UnitTests/LinearAlgebraTests/Complex/MatrixTests.Arithmetic.cs @@ -34,11 +34,7 @@ using NUnit.Framework; namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex { -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else using Complex = System.Numerics.Complex; -#endif /// /// Abstract class with the common set of matrix tests diff --git a/src/UnitTests/LinearAlgebraTests/Complex/ReturnTypeTests.cs b/src/UnitTests/LinearAlgebraTests/Complex/ReturnTypeTests.cs index d4635285..db1b7e4b 100644 --- a/src/UnitTests/LinearAlgebraTests/Complex/ReturnTypeTests.cs +++ b/src/UnitTests/LinearAlgebraTests/Complex/ReturnTypeTests.cs @@ -33,11 +33,7 @@ using NUnit.Framework; namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex { -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else using Complex = System.Numerics.Complex; -#endif [TestFixture, Category("LA")] public class ReturnTypeTests diff --git a/src/UnitTests/LinearAlgebraTests/Complex/Solvers/Iterative/BiCgStabTest.cs b/src/UnitTests/LinearAlgebraTests/Complex/Solvers/Iterative/BiCgStabTest.cs index 1bfe74fc..3bc4bd59 100644 --- a/src/UnitTests/LinearAlgebraTests/Complex/Solvers/Iterative/BiCgStabTest.cs +++ b/src/UnitTests/LinearAlgebraTests/Complex/Solvers/Iterative/BiCgStabTest.cs @@ -36,13 +36,8 @@ using NUnit.Framework; namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex.Solvers.Iterative { -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else using Complex = System.Numerics.Complex; -#endif - /// /// Tests of Bi-Conjugate Gradient stabilized iterative matrix solver. /// diff --git a/src/UnitTests/LinearAlgebraTests/Complex/Solvers/Iterative/GpBiCgTest.cs b/src/UnitTests/LinearAlgebraTests/Complex/Solvers/Iterative/GpBiCgTest.cs index f08eed11..5c75879a 100644 --- a/src/UnitTests/LinearAlgebraTests/Complex/Solvers/Iterative/GpBiCgTest.cs +++ b/src/UnitTests/LinearAlgebraTests/Complex/Solvers/Iterative/GpBiCgTest.cs @@ -36,13 +36,8 @@ using NUnit.Framework; namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex.Solvers.Iterative { -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else using Complex = System.Numerics.Complex; -#endif - /// /// Tests for Generalized Product Bi-Conjugate Gradient iterative matrix solver. /// diff --git a/src/UnitTests/LinearAlgebraTests/Complex/Solvers/Iterative/MlkBiCgStabTest.cs b/src/UnitTests/LinearAlgebraTests/Complex/Solvers/Iterative/MlkBiCgStabTest.cs index b2c5866d..9ee68479 100644 --- a/src/UnitTests/LinearAlgebraTests/Complex/Solvers/Iterative/MlkBiCgStabTest.cs +++ b/src/UnitTests/LinearAlgebraTests/Complex/Solvers/Iterative/MlkBiCgStabTest.cs @@ -36,13 +36,8 @@ using NUnit.Framework; namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex.Solvers.Iterative { -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else using Complex = System.Numerics.Complex; -#endif - /// /// Tests for Multiple-Lanczos Bi-Conjugate Gradient stabilized iterative matrix solver. /// diff --git a/src/UnitTests/LinearAlgebraTests/Complex/Solvers/Iterative/TFQMRTest.cs b/src/UnitTests/LinearAlgebraTests/Complex/Solvers/Iterative/TFQMRTest.cs index a7e1900d..afb7badc 100644 --- a/src/UnitTests/LinearAlgebraTests/Complex/Solvers/Iterative/TFQMRTest.cs +++ b/src/UnitTests/LinearAlgebraTests/Complex/Solvers/Iterative/TFQMRTest.cs @@ -36,13 +36,8 @@ using NUnit.Framework; namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex.Solvers.Iterative { -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else using Complex = System.Numerics.Complex; -#endif - /// /// Tests of Transpose Free Quasi-Minimal Residual iterative matrix solver. /// diff --git a/src/UnitTests/LinearAlgebraTests/Complex/Solvers/IteratorTest.cs b/src/UnitTests/LinearAlgebraTests/Complex/Solvers/IteratorTest.cs index 1a6db013..64b4854b 100644 --- a/src/UnitTests/LinearAlgebraTests/Complex/Solvers/IteratorTest.cs +++ b/src/UnitTests/LinearAlgebraTests/Complex/Solvers/IteratorTest.cs @@ -35,13 +35,8 @@ using NUnit.Framework; namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex.Solvers { -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else using Complex = System.Numerics.Complex; -#endif - /// /// Iterator tests /// diff --git a/src/UnitTests/LinearAlgebraTests/Complex/Solvers/Preconditioners/DiagonalTest.cs b/src/UnitTests/LinearAlgebraTests/Complex/Solvers/Preconditioners/DiagonalTest.cs index 3885cb3c..ee5d2d46 100644 --- a/src/UnitTests/LinearAlgebraTests/Complex/Solvers/Preconditioners/DiagonalTest.cs +++ b/src/UnitTests/LinearAlgebraTests/Complex/Solvers/Preconditioners/DiagonalTest.cs @@ -35,12 +35,7 @@ using NUnit.Framework; namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex.Solvers.Preconditioners { - -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else using Complex = System.Numerics.Complex; -#endif /// /// Diagonal preconditioner test. diff --git a/src/UnitTests/LinearAlgebraTests/Complex/Solvers/Preconditioners/IluptElementSorterTest.cs b/src/UnitTests/LinearAlgebraTests/Complex/Solvers/Preconditioners/IluptElementSorterTest.cs index 82808af0..fa67f3bd 100644 --- a/src/UnitTests/LinearAlgebraTests/Complex/Solvers/Preconditioners/IluptElementSorterTest.cs +++ b/src/UnitTests/LinearAlgebraTests/Complex/Solvers/Preconditioners/IluptElementSorterTest.cs @@ -34,11 +34,7 @@ using NUnit.Framework; namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex.Solvers.Preconditioners { -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else using Complex = System.Numerics.Complex; -#endif /// /// Test for element sort algorithm of Ilupt class. diff --git a/src/UnitTests/LinearAlgebraTests/Complex/Solvers/Preconditioners/IlutpTest.cs b/src/UnitTests/LinearAlgebraTests/Complex/Solvers/Preconditioners/IlutpTest.cs index b69685b0..327d536e 100644 --- a/src/UnitTests/LinearAlgebraTests/Complex/Solvers/Preconditioners/IlutpTest.cs +++ b/src/UnitTests/LinearAlgebraTests/Complex/Solvers/Preconditioners/IlutpTest.cs @@ -37,12 +37,7 @@ using NUnit.Framework; namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex.Solvers.Preconditioners { - -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else using Complex = System.Numerics.Complex; -#endif /// /// Incomplete LU with tpPreconditioner test with drop tolerance and partial pivoting. @@ -86,7 +81,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex.Solvers.Precondi static T GetMethod(ILUTPPreconditioner ilutp, string methodName) { var type = ilutp.GetType(); -#if NETSTANDARD +#if NETCOREAPP1_1 var methodInfo = type.GetMethod( methodName, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static); diff --git a/src/UnitTests/LinearAlgebraTests/Complex/Solvers/Preconditioners/IncompleteLUTest.cs b/src/UnitTests/LinearAlgebraTests/Complex/Solvers/Preconditioners/IncompleteLUTest.cs index 6b233168..114bbc3e 100644 --- a/src/UnitTests/LinearAlgebraTests/Complex/Solvers/Preconditioners/IncompleteLUTest.cs +++ b/src/UnitTests/LinearAlgebraTests/Complex/Solvers/Preconditioners/IncompleteLUTest.cs @@ -37,12 +37,7 @@ using NUnit.Framework; namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex.Solvers.Preconditioners { - -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else using Complex = System.Numerics.Complex; -#endif /// /// Incomplete LU preconditioner test. @@ -60,7 +55,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex.Solvers.Precondi static T GetMethod(ILU0Preconditioner ilu, string methodName) { var type = ilu.GetType(); -#if NETSTANDARD +#if NETCOREAPP1_1 var methodInfo = type.GetMethod( methodName, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static); diff --git a/src/UnitTests/LinearAlgebraTests/Complex/Solvers/Preconditioners/PreConditionerTest.cs b/src/UnitTests/LinearAlgebraTests/Complex/Solvers/Preconditioners/PreConditionerTest.cs index dd9dcba9..76d4daae 100644 --- a/src/UnitTests/LinearAlgebraTests/Complex/Solvers/Preconditioners/PreConditionerTest.cs +++ b/src/UnitTests/LinearAlgebraTests/Complex/Solvers/Preconditioners/PreConditionerTest.cs @@ -34,12 +34,7 @@ using NUnit.Framework; namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex.Solvers.Preconditioners { - -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else using Complex = System.Numerics.Complex; -#endif /// /// Abstract class for preconditioners tests. diff --git a/src/UnitTests/LinearAlgebraTests/Complex/Solvers/Preconditioners/UnitPreconditionerTest.cs b/src/UnitTests/LinearAlgebraTests/Complex/Solvers/Preconditioners/UnitPreconditionerTest.cs index a67879f1..de0e3dbe 100644 --- a/src/UnitTests/LinearAlgebraTests/Complex/Solvers/Preconditioners/UnitPreconditionerTest.cs +++ b/src/UnitTests/LinearAlgebraTests/Complex/Solvers/Preconditioners/UnitPreconditionerTest.cs @@ -34,12 +34,7 @@ using NUnit.Framework; namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex.Solvers.Preconditioners { - -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else using Complex = System.Numerics.Complex; -#endif /// /// Unit precondition tests diff --git a/src/UnitTests/LinearAlgebraTests/Complex/Solvers/StopCriterion/DivergenceStopCriteriumTest.cs b/src/UnitTests/LinearAlgebraTests/Complex/Solvers/StopCriterion/DivergenceStopCriteriumTest.cs index ab5ff05e..ca3616f8 100644 --- a/src/UnitTests/LinearAlgebraTests/Complex/Solvers/StopCriterion/DivergenceStopCriteriumTest.cs +++ b/src/UnitTests/LinearAlgebraTests/Complex/Solvers/StopCriterion/DivergenceStopCriteriumTest.cs @@ -35,13 +35,8 @@ using NUnit.Framework; namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex.Solvers.StopCriterion { -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else using Complex = System.Numerics.Complex; -#endif - /// /// Divergence stop criterion test. /// diff --git a/src/UnitTests/LinearAlgebraTests/Complex/Solvers/StopCriterion/FailureStopCriteriumTest.cs b/src/UnitTests/LinearAlgebraTests/Complex/Solvers/StopCriterion/FailureStopCriteriumTest.cs index cea729b3..375af478 100644 --- a/src/UnitTests/LinearAlgebraTests/Complex/Solvers/StopCriterion/FailureStopCriteriumTest.cs +++ b/src/UnitTests/LinearAlgebraTests/Complex/Solvers/StopCriterion/FailureStopCriteriumTest.cs @@ -35,13 +35,8 @@ using NUnit.Framework; namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex.Solvers.StopCriterion { -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else using Complex = System.Numerics.Complex; -#endif - /// /// Failure stop criterion tests. /// diff --git a/src/UnitTests/LinearAlgebraTests/Complex/Solvers/StopCriterion/IterationCountStopCriteriumTest.cs b/src/UnitTests/LinearAlgebraTests/Complex/Solvers/StopCriterion/IterationCountStopCriteriumTest.cs index df7c365e..370d9ad0 100644 --- a/src/UnitTests/LinearAlgebraTests/Complex/Solvers/StopCriterion/IterationCountStopCriteriumTest.cs +++ b/src/UnitTests/LinearAlgebraTests/Complex/Solvers/StopCriterion/IterationCountStopCriteriumTest.cs @@ -34,13 +34,8 @@ using NUnit.Framework; namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex.Solvers.StopCriterion { -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else using Complex = System.Numerics.Complex; -#endif - /// /// Iteration count stop criterion tests. /// diff --git a/src/UnitTests/LinearAlgebraTests/Complex/Solvers/StopCriterion/ResidualStopCriteriumTest.cs b/src/UnitTests/LinearAlgebraTests/Complex/Solvers/StopCriterion/ResidualStopCriteriumTest.cs index ba4feaa8..93a9ce9c 100644 --- a/src/UnitTests/LinearAlgebraTests/Complex/Solvers/StopCriterion/ResidualStopCriteriumTest.cs +++ b/src/UnitTests/LinearAlgebraTests/Complex/Solvers/StopCriterion/ResidualStopCriteriumTest.cs @@ -35,13 +35,8 @@ using NUnit.Framework; namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex.Solvers.StopCriterion { -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else using Complex = System.Numerics.Complex; -#endif - /// /// Residual stop criterion tests. /// diff --git a/src/UnitTests/LinearAlgebraTests/Complex/SparseMatrixTests.cs b/src/UnitTests/LinearAlgebraTests/Complex/SparseMatrixTests.cs index 77d02300..ba1b7d16 100644 --- a/src/UnitTests/LinearAlgebraTests/Complex/SparseMatrixTests.cs +++ b/src/UnitTests/LinearAlgebraTests/Complex/SparseMatrixTests.cs @@ -35,11 +35,7 @@ using NUnit.Framework; namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex { -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else using Complex = System.Numerics.Complex; -#endif /// /// Sparse matrix tests. diff --git a/src/UnitTests/LinearAlgebraTests/Complex/SparseVectorTest.cs b/src/UnitTests/LinearAlgebraTests/Complex/SparseVectorTest.cs index cbe6d04b..41539478 100644 --- a/src/UnitTests/LinearAlgebraTests/Complex/SparseVectorTest.cs +++ b/src/UnitTests/LinearAlgebraTests/Complex/SparseVectorTest.cs @@ -36,11 +36,7 @@ using System.Collections.Generic; namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex { -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else using Complex = System.Numerics.Complex; -#endif /// /// Sparse vector tests. diff --git a/src/UnitTests/LinearAlgebraTests/Complex/TestData.cs b/src/UnitTests/LinearAlgebraTests/Complex/TestData.cs index a5c3fd45..43da6af4 100644 --- a/src/UnitTests/LinearAlgebraTests/Complex/TestData.cs +++ b/src/UnitTests/LinearAlgebraTests/Complex/TestData.cs @@ -32,11 +32,7 @@ using MathNet.Numerics.LinearAlgebra; namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex { -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else using Complex = System.Numerics.Complex; -#endif public static class TestData { diff --git a/src/UnitTests/LinearAlgebraTests/Complex/UserDefinedMatrix.cs b/src/UnitTests/LinearAlgebraTests/Complex/UserDefinedMatrix.cs index 1480be50..f2170799 100644 --- a/src/UnitTests/LinearAlgebraTests/Complex/UserDefinedMatrix.cs +++ b/src/UnitTests/LinearAlgebraTests/Complex/UserDefinedMatrix.cs @@ -28,11 +28,7 @@ using MathNet.Numerics.LinearAlgebra.Storage; namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex { -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else using Complex = System.Numerics.Complex; -#endif /// /// User-defined matrix implementation (internal class for testing purposes) @@ -106,7 +102,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex } /// - /// Initializes a new instance of the class from a 2D array. + /// Initializes a new instance of the class from a 2D array. /// /// The 2D array to create this matrix from. public UserDefinedMatrix(Complex[,] data) diff --git a/src/UnitTests/LinearAlgebraTests/Complex/UserDefinedMatrixTests.cs b/src/UnitTests/LinearAlgebraTests/Complex/UserDefinedMatrixTests.cs index 19d169d8..839c3a7c 100644 --- a/src/UnitTests/LinearAlgebraTests/Complex/UserDefinedMatrixTests.cs +++ b/src/UnitTests/LinearAlgebraTests/Complex/UserDefinedMatrixTests.cs @@ -27,11 +27,7 @@ using MathNet.Numerics.LinearAlgebra; namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex { -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else using Complex = System.Numerics.Complex; -#endif /// /// Test class for user-defined matrix. diff --git a/src/UnitTests/LinearAlgebraTests/Complex/UserDefinedVector.cs b/src/UnitTests/LinearAlgebraTests/Complex/UserDefinedVector.cs index 391b8265..575bd3af 100644 --- a/src/UnitTests/LinearAlgebraTests/Complex/UserDefinedVector.cs +++ b/src/UnitTests/LinearAlgebraTests/Complex/UserDefinedVector.cs @@ -28,11 +28,7 @@ using MathNet.Numerics.LinearAlgebra.Storage; namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex { -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else using Complex = System.Numerics.Complex; -#endif /// /// User-defined vector implementation (internal class for testing purposes) diff --git a/src/UnitTests/LinearAlgebraTests/Complex/UserDefinedVectorTests.cs b/src/UnitTests/LinearAlgebraTests/Complex/UserDefinedVectorTests.cs index 8a96ffec..af42f4ac 100644 --- a/src/UnitTests/LinearAlgebraTests/Complex/UserDefinedVectorTests.cs +++ b/src/UnitTests/LinearAlgebraTests/Complex/UserDefinedVectorTests.cs @@ -33,11 +33,7 @@ using System.Collections.Generic; namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex { -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else using Complex = System.Numerics.Complex; -#endif /// /// Test class for user-defined vector. diff --git a/src/UnitTests/LinearAlgebraTests/Complex/VectorArithmeticTheory.cs b/src/UnitTests/LinearAlgebraTests/Complex/VectorArithmeticTheory.cs index 2b5fe89f..11ef7dd1 100644 --- a/src/UnitTests/LinearAlgebraTests/Complex/VectorArithmeticTheory.cs +++ b/src/UnitTests/LinearAlgebraTests/Complex/VectorArithmeticTheory.cs @@ -32,11 +32,7 @@ using NUnit.Framework; namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex { -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else using Complex = System.Numerics.Complex; -#endif [TestFixture, Category("LA")] public class VectorArithmeticTheory : VectorArithmeticTheory diff --git a/src/UnitTests/LinearAlgebraTests/Complex/VectorTests.Arithmetic.cs b/src/UnitTests/LinearAlgebraTests/Complex/VectorTests.Arithmetic.cs index 4b0d590a..432cb3db 100644 --- a/src/UnitTests/LinearAlgebraTests/Complex/VectorTests.Arithmetic.cs +++ b/src/UnitTests/LinearAlgebraTests/Complex/VectorTests.Arithmetic.cs @@ -33,11 +33,7 @@ using NUnit.Framework; namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex { -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else using Complex = System.Numerics.Complex; -#endif /// /// Abstract class with the common arithmetic set of vector tests. diff --git a/src/UnitTests/LinearAlgebraTests/Complex/VectorTests.Norm.cs b/src/UnitTests/LinearAlgebraTests/Complex/VectorTests.Norm.cs index e613add1..7ea53fcc 100644 --- a/src/UnitTests/LinearAlgebraTests/Complex/VectorTests.Norm.cs +++ b/src/UnitTests/LinearAlgebraTests/Complex/VectorTests.Norm.cs @@ -31,11 +31,7 @@ using NUnit.Framework; namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex { -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else using Complex = System.Numerics.Complex; -#endif /// /// Abstract class with the norms set of vector tests. diff --git a/src/UnitTests/LinearAlgebraTests/Complex/VectorTests.cs b/src/UnitTests/LinearAlgebraTests/Complex/VectorTests.cs index a1184690..0988fdd1 100644 --- a/src/UnitTests/LinearAlgebraTests/Complex/VectorTests.cs +++ b/src/UnitTests/LinearAlgebraTests/Complex/VectorTests.cs @@ -38,11 +38,7 @@ using NUnit.Framework; namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex { -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else using Complex = System.Numerics.Complex; -#endif /// /// Abstract class with the common set of vector tests. @@ -68,7 +64,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex CollectionAssert.AreEqual(vector, clone); } -#if !PORTABLE && !NETSTANDARD +#if !NETCOREAPP1_1 /// /// Can clone a vector using IClonable interface method. /// diff --git a/src/UnitTests/LinearAlgebraTests/Complex32/Factorization/EvdTests.cs b/src/UnitTests/LinearAlgebraTests/Complex32/Factorization/EvdTests.cs index 44cf00d6..935568cb 100644 --- a/src/UnitTests/LinearAlgebraTests/Complex32/Factorization/EvdTests.cs +++ b/src/UnitTests/LinearAlgebraTests/Complex32/Factorization/EvdTests.cs @@ -34,12 +34,7 @@ using NUnit.Framework; namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex32.Factorization { using Numerics; - -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else using Complex = System.Numerics.Complex; -#endif /// /// Eigenvalues factorization tests for a dense matrix. diff --git a/src/UnitTests/LinearAlgebraTests/Complex32/Factorization/UserEvdTests.cs b/src/UnitTests/LinearAlgebraTests/Complex32/Factorization/UserEvdTests.cs index cad99a19..0ff947a2 100644 --- a/src/UnitTests/LinearAlgebraTests/Complex32/Factorization/UserEvdTests.cs +++ b/src/UnitTests/LinearAlgebraTests/Complex32/Factorization/UserEvdTests.cs @@ -33,12 +33,7 @@ using NUnit.Framework; namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex32.Factorization { using Numerics; - -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else using Complex = System.Numerics.Complex; -#endif /// /// Eigenvalues factorization tests for an user matrix. diff --git a/src/UnitTests/LinearAlgebraTests/Complex32/Solvers/Preconditioners/IlutpTest.cs b/src/UnitTests/LinearAlgebraTests/Complex32/Solvers/Preconditioners/IlutpTest.cs index 0d1b1158..b62d199c 100644 --- a/src/UnitTests/LinearAlgebraTests/Complex32/Solvers/Preconditioners/IlutpTest.cs +++ b/src/UnitTests/LinearAlgebraTests/Complex32/Solvers/Preconditioners/IlutpTest.cs @@ -81,7 +81,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex32.Solvers.Precon static T GetMethod(ILUTPPreconditioner ilutp, string methodName) { var type = ilutp.GetType(); -#if NETSTANDARD +#if NETCOREAPP1_1 var methodInfo = type.GetMethod( methodName, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static); diff --git a/src/UnitTests/LinearAlgebraTests/Complex32/Solvers/Preconditioners/IncompleteLUTest.cs b/src/UnitTests/LinearAlgebraTests/Complex32/Solvers/Preconditioners/IncompleteLUTest.cs index 156781be..e9200899 100644 --- a/src/UnitTests/LinearAlgebraTests/Complex32/Solvers/Preconditioners/IncompleteLUTest.cs +++ b/src/UnitTests/LinearAlgebraTests/Complex32/Solvers/Preconditioners/IncompleteLUTest.cs @@ -55,7 +55,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex32.Solvers.Precon static T GetMethod(ILU0Preconditioner ilu, string methodName) { var type = ilu.GetType(); -#if NETSTANDARD +#if NETCOREAPP1_1 var methodInfo = type.GetMethod( methodName, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static); diff --git a/src/UnitTests/LinearAlgebraTests/Complex32/VectorTests.cs b/src/UnitTests/LinearAlgebraTests/Complex32/VectorTests.cs index ac2b8d45..5b140703 100644 --- a/src/UnitTests/LinearAlgebraTests/Complex32/VectorTests.cs +++ b/src/UnitTests/LinearAlgebraTests/Complex32/VectorTests.cs @@ -64,7 +64,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex32 CollectionAssert.AreEqual(vector, clone); } -#if !PORTABLE && !NETSTANDARD +#if !NETCOREAPP1_1 /// /// Can clone a vector using IClonable interface method. /// diff --git a/src/UnitTests/LinearAlgebraTests/Double/Factorization/EvdTests.cs b/src/UnitTests/LinearAlgebraTests/Double/Factorization/EvdTests.cs index 7f61e564..2e0071a7 100644 --- a/src/UnitTests/LinearAlgebraTests/Double/Factorization/EvdTests.cs +++ b/src/UnitTests/LinearAlgebraTests/Double/Factorization/EvdTests.cs @@ -33,11 +33,7 @@ using NUnit.Framework; namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Double.Factorization { -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else using Complex = System.Numerics.Complex; -#endif /// /// Eigenvalues factorization tests for a dense matrix. diff --git a/src/UnitTests/LinearAlgebraTests/Double/Factorization/UserEvdTests.cs b/src/UnitTests/LinearAlgebraTests/Double/Factorization/UserEvdTests.cs index 1d30a6bb..4cc03b17 100644 --- a/src/UnitTests/LinearAlgebraTests/Double/Factorization/UserEvdTests.cs +++ b/src/UnitTests/LinearAlgebraTests/Double/Factorization/UserEvdTests.cs @@ -32,11 +32,7 @@ using NUnit.Framework; namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Double.Factorization { -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else using Complex = System.Numerics.Complex; -#endif /// /// Eigenvalues factorization tests for an user matrix. diff --git a/src/UnitTests/LinearAlgebraTests/Double/Solvers/Preconditioners/IlutpTest.cs b/src/UnitTests/LinearAlgebraTests/Double/Solvers/Preconditioners/IlutpTest.cs index a9c0da76..0e0a791b 100644 --- a/src/UnitTests/LinearAlgebraTests/Double/Solvers/Preconditioners/IlutpTest.cs +++ b/src/UnitTests/LinearAlgebraTests/Double/Solvers/Preconditioners/IlutpTest.cs @@ -79,7 +79,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Double.Solvers.Precondit static T GetMethod(ILUTPPreconditioner ilutp, string methodName) { var type = ilutp.GetType(); -#if NETSTANDARD +#if NETCOREAPP1_1 var methodInfo = type.GetMethod( methodName, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static); diff --git a/src/UnitTests/LinearAlgebraTests/Double/Solvers/Preconditioners/IncompleteLUTest.cs b/src/UnitTests/LinearAlgebraTests/Double/Solvers/Preconditioners/IncompleteLUTest.cs index 7d881c4f..a8cdc4b9 100644 --- a/src/UnitTests/LinearAlgebraTests/Double/Solvers/Preconditioners/IncompleteLUTest.cs +++ b/src/UnitTests/LinearAlgebraTests/Double/Solvers/Preconditioners/IncompleteLUTest.cs @@ -53,7 +53,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Double.Solvers.Precondit static T GetMethod(ILU0Preconditioner ilu, string methodName) { var type = ilu.GetType(); -#if NETSTANDARD +#if NETCOREAPP1_1 var methodInfo = type.GetMethod( methodName, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static); diff --git a/src/UnitTests/LinearAlgebraTests/Double/VectorTests.cs b/src/UnitTests/LinearAlgebraTests/Double/VectorTests.cs index 3231051d..e9660308 100644 --- a/src/UnitTests/LinearAlgebraTests/Double/VectorTests.cs +++ b/src/UnitTests/LinearAlgebraTests/Double/VectorTests.cs @@ -60,7 +60,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Double CollectionAssert.AreEqual(vector, clone); } -#if !PORTABLE && !NETSTANDARD +#if !NETCOREAPP1_1 /// /// Can clone a vector using IClonable interface method. /// diff --git a/src/UnitTests/LinearAlgebraTests/MatrixHelpers.cs b/src/UnitTests/LinearAlgebraTests/MatrixHelpers.cs index 1c58a272..f1c53a8e 100644 --- a/src/UnitTests/LinearAlgebraTests/MatrixHelpers.cs +++ b/src/UnitTests/LinearAlgebraTests/MatrixHelpers.cs @@ -32,11 +32,7 @@ using MathNet.Numerics.LinearAlgebra; namespace MathNet.Numerics.UnitTests.LinearAlgebraTests { -#if NOSYSNUMERICS - using Complex64 = Numerics.Complex; -#else using Complex64 = System.Numerics.Complex; -#endif /// /// Matrix utility functions to simplify tests. diff --git a/src/UnitTests/LinearAlgebraTests/MatrixStorageSerializationTests.cs b/src/UnitTests/LinearAlgebraTests/MatrixStorageSerializationTests.cs index b02023c6..d22ab6ca 100644 --- a/src/UnitTests/LinearAlgebraTests/MatrixStorageSerializationTests.cs +++ b/src/UnitTests/LinearAlgebraTests/MatrixStorageSerializationTests.cs @@ -36,11 +36,7 @@ using NUnit.Framework; namespace MathNet.Numerics.UnitTests.LinearAlgebraTests { -#if NOSYSNUMERICS - using Complex64 = Numerics.Complex; -#else using Complex64 = System.Numerics.Complex; -#endif [TestFixture] public class MatrixStorageSerializationTests diff --git a/src/UnitTests/LinearAlgebraTests/MatrixStructureTheory.cs b/src/UnitTests/LinearAlgebraTests/MatrixStructureTheory.cs index 0f63a3fb..00e97b6a 100644 --- a/src/UnitTests/LinearAlgebraTests/MatrixStructureTheory.cs +++ b/src/UnitTests/LinearAlgebraTests/MatrixStructureTheory.cs @@ -142,7 +142,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests Assert.That(clone.ColumnCount, Is.EqualTo(matrix.ColumnCount)); } -#if !PORTABLE && !NETSTANDARD +#if !NETCOREAPP1_1 [Theory] public void CanCloneUsingICloneable(TestMatrix testMatrix) { diff --git a/src/UnitTests/LinearAlgebraTests/Single/Factorization/EvdTests.cs b/src/UnitTests/LinearAlgebraTests/Single/Factorization/EvdTests.cs index c6ecfc69..d6021bbb 100644 --- a/src/UnitTests/LinearAlgebraTests/Single/Factorization/EvdTests.cs +++ b/src/UnitTests/LinearAlgebraTests/Single/Factorization/EvdTests.cs @@ -33,11 +33,7 @@ using NUnit.Framework; namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Single.Factorization { -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else using Complex = System.Numerics.Complex; -#endif /// /// Eigenvalues factorization tests for a dense matrix. diff --git a/src/UnitTests/LinearAlgebraTests/Single/Factorization/UserEvdTests.cs b/src/UnitTests/LinearAlgebraTests/Single/Factorization/UserEvdTests.cs index f36a4a4e..08922574 100644 --- a/src/UnitTests/LinearAlgebraTests/Single/Factorization/UserEvdTests.cs +++ b/src/UnitTests/LinearAlgebraTests/Single/Factorization/UserEvdTests.cs @@ -32,11 +32,7 @@ using NUnit.Framework; namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Single.Factorization { -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else using Complex = System.Numerics.Complex; -#endif /// /// Eigenvalues factorization tests for an user matrix. diff --git a/src/UnitTests/LinearAlgebraTests/Single/Solvers/Preconditioners/IlutpTest.cs b/src/UnitTests/LinearAlgebraTests/Single/Solvers/Preconditioners/IlutpTest.cs index 411827dd..2458445b 100644 --- a/src/UnitTests/LinearAlgebraTests/Single/Solvers/Preconditioners/IlutpTest.cs +++ b/src/UnitTests/LinearAlgebraTests/Single/Solvers/Preconditioners/IlutpTest.cs @@ -79,7 +79,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Single.Solvers.Precondit static T GetMethod(ILUTPPreconditioner ilutp, string methodName) { var type = ilutp.GetType(); -#if NETSTANDARD +#if NETCOREAPP1_1 var methodInfo = type.GetMethod( methodName, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static); diff --git a/src/UnitTests/LinearAlgebraTests/Single/Solvers/Preconditioners/IncompleteLUTest.cs b/src/UnitTests/LinearAlgebraTests/Single/Solvers/Preconditioners/IncompleteLUTest.cs index 508376f9..d26b3813 100644 --- a/src/UnitTests/LinearAlgebraTests/Single/Solvers/Preconditioners/IncompleteLUTest.cs +++ b/src/UnitTests/LinearAlgebraTests/Single/Solvers/Preconditioners/IncompleteLUTest.cs @@ -53,7 +53,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Single.Solvers.Precondit static T GetMethod(ILU0Preconditioner ilu, string methodName) { var type = ilu.GetType(); -#if NETSTANDARD +#if NETCOREAPP1_1 var methodInfo = type.GetMethod( methodName, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static); diff --git a/src/UnitTests/LinearAlgebraTests/Single/VectorTests.cs b/src/UnitTests/LinearAlgebraTests/Single/VectorTests.cs index 090fb614..ab60187b 100644 --- a/src/UnitTests/LinearAlgebraTests/Single/VectorTests.cs +++ b/src/UnitTests/LinearAlgebraTests/Single/VectorTests.cs @@ -61,7 +61,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Single CollectionAssert.AreEqual(vector, clone); } -#if !PORTABLE && !NETSTANDARD +#if !NETCOREAPP1_1 /// /// Can clone a vector using IClonable interface method. /// diff --git a/src/UnitTests/LinearAlgebraTests/VectorStorageSerializationTests.cs b/src/UnitTests/LinearAlgebraTests/VectorStorageSerializationTests.cs index 89105403..0bb5a30f 100644 --- a/src/UnitTests/LinearAlgebraTests/VectorStorageSerializationTests.cs +++ b/src/UnitTests/LinearAlgebraTests/VectorStorageSerializationTests.cs @@ -36,11 +36,7 @@ using NUnit.Framework; namespace MathNet.Numerics.UnitTests.LinearAlgebraTests { -#if NOSYSNUMERICS - using Complex64 = Numerics.Complex; -#else using Complex64 = System.Numerics.Complex; -#endif [TestFixture] public class VectorStorageSerializationTests diff --git a/src/UnitTests/OptimizationTests/NewtonMinimizerTests.cs b/src/UnitTests/OptimizationTests/NewtonMinimizerTests.cs index 3366ccd1..17045644 100644 --- a/src/UnitTests/OptimizationTests/NewtonMinimizerTests.cs +++ b/src/UnitTests/OptimizationTests/NewtonMinimizerTests.cs @@ -98,7 +98,6 @@ namespace MathNet.Numerics.UnitTests.OptimizationTests Assert.That(Math.Abs(result.MinimizingPoint[1] - 1.0), Is.LessThan(1e-3)); } -#if !NET35 [Test] public void FindMinimum_Rosenbrock_Hard() { @@ -109,7 +108,6 @@ namespace MathNet.Numerics.UnitTests.OptimizationTests Assert.That(Math.Abs(result.MinimizingPoint[0] - 1.0), Is.LessThan(1e-3)); Assert.That(Math.Abs(result.MinimizingPoint[1] - 1.0), Is.LessThan(1e-3)); } -#endif [Test] public void FindMinimum_Rosenbrock_Overton() diff --git a/src/UnitTests/Providers/FourierTransform/FourierTransformProviderTests.cs b/src/UnitTests/Providers/FourierTransform/FourierTransformProviderTests.cs index 58bf1c2e..dd358eff 100644 --- a/src/UnitTests/Providers/FourierTransform/FourierTransformProviderTests.cs +++ b/src/UnitTests/Providers/FourierTransform/FourierTransformProviderTests.cs @@ -28,6 +28,7 @@ // using System; +using System.Numerics; using MathNet.Numerics.Distributions; using MathNet.Numerics.Providers.FourierTransform; using MathNet.Numerics.Statistics; @@ -35,12 +36,6 @@ using NUnit.Framework; namespace MathNet.Numerics.UnitTests.Providers.FourierTransform { -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else - using Complex = System.Numerics.Complex; -#endif - /// /// Fourier transform provider tests. /// diff --git a/src/UnitTests/Providers/LinearAlgebra/Complex/LinearAlgebraProviderTests.cs b/src/UnitTests/Providers/LinearAlgebra/Complex/LinearAlgebraProviderTests.cs index 017291bf..9567024e 100644 --- a/src/UnitTests/Providers/LinearAlgebra/Complex/LinearAlgebraProviderTests.cs +++ b/src/UnitTests/Providers/LinearAlgebra/Complex/LinearAlgebraProviderTests.cs @@ -38,11 +38,7 @@ using NUnit.Framework; namespace MathNet.Numerics.UnitTests.Providers.LinearAlgebra.Complex { -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else using Complex = System.Numerics.Complex; -#endif /// /// Base class for linear algebra provider tests. @@ -1094,7 +1090,7 @@ namespace MathNet.Numerics.UnitTests.Providers.LinearAlgebra.Complex [TestCase("Wide10x50000", "Tall50000x10")] [TestCase("Square1000x1000", "Square1000x1000")] [Explicit] -#if !NETSTANDARD +#if !NETCOREAPP1_1 && !NETCOREAPP2_0 [Timeout(1000*10)] #endif public void IsMatrixMultiplicationPerformant(string leftMatrixKey, string rightMatrixKey) diff --git a/src/UnitTests/Providers/LinearAlgebra/Complex32/LinearAlgebraProviderTests.cs b/src/UnitTests/Providers/LinearAlgebra/Complex32/LinearAlgebraProviderTests.cs index 1a6949a8..154a72fa 100644 --- a/src/UnitTests/Providers/LinearAlgebra/Complex32/LinearAlgebraProviderTests.cs +++ b/src/UnitTests/Providers/LinearAlgebra/Complex32/LinearAlgebraProviderTests.cs @@ -1129,7 +1129,7 @@ namespace MathNet.Numerics.UnitTests.Providers.LinearAlgebra.Complex32 [TestCase("Wide10x50000", "Tall50000x10")] [TestCase("Square1000x1000", "Square1000x1000")] [Explicit] -#if !NETSTANDARD +#if !NETCOREAPP1_1 && !NETCOREAPP2_0 [Timeout(1000*10)] #endif public void IsMatrixMultiplicationPerformant(string leftMatrixKey, string rightMatrixKey) diff --git a/src/UnitTests/Providers/LinearAlgebra/Double/LinearAlgebraProviderTests.cs b/src/UnitTests/Providers/LinearAlgebra/Double/LinearAlgebraProviderTests.cs index 983febe6..55c81534 100644 --- a/src/UnitTests/Providers/LinearAlgebra/Double/LinearAlgebraProviderTests.cs +++ b/src/UnitTests/Providers/LinearAlgebra/Double/LinearAlgebraProviderTests.cs @@ -1119,7 +1119,7 @@ namespace MathNet.Numerics.UnitTests.Providers.LinearAlgebra.Double [TestCase("Wide10x50000", "Tall50000x10")] [TestCase("Square1000x1000", "Square1000x1000")] [Explicit] -#if !NETSTANDARD +#if !NETCOREAPP1_1 && !NETCOREAPP2_0 [Timeout(1000*5)] #endif public void IsMatrixMultiplicationPerformant(string leftMatrixKey, string rightMatrixKey) diff --git a/src/UnitTests/Providers/LinearAlgebra/Single/LinearAlgebraProviderTests.cs b/src/UnitTests/Providers/LinearAlgebra/Single/LinearAlgebraProviderTests.cs index fc00df9d..4bc13233 100644 --- a/src/UnitTests/Providers/LinearAlgebra/Single/LinearAlgebraProviderTests.cs +++ b/src/UnitTests/Providers/LinearAlgebra/Single/LinearAlgebraProviderTests.cs @@ -1127,7 +1127,7 @@ namespace MathNet.Numerics.UnitTests.Providers.LinearAlgebra.Single [TestCase("Wide10x50000", "Tall50000x10")] [TestCase("Square1000x1000", "Square1000x1000")] [Explicit] -#if !NETSTANDARD +#if !NETCOREAPP1_1 && !NETCOREAPP2_0 [Timeout(1000*5)] #endif public void IsMatrixMultiplicationPerformant(string leftMatrixKey, string rightMatrixKey) diff --git a/src/UnitTests/Random/CryptoRandomSourceTests.cs b/src/UnitTests/Random/CryptoRandomSourceTests.cs index 908c6139..c5de191d 100644 --- a/src/UnitTests/Random/CryptoRandomSourceTests.cs +++ b/src/UnitTests/Random/CryptoRandomSourceTests.cs @@ -27,8 +27,6 @@ // OTHER DEALINGS IN THE SOFTWARE. // -#if !PORTABLE && !NETSTANDARD - using MathNet.Numerics.Random; using NUnit.Framework; @@ -48,5 +46,3 @@ namespace MathNet.Numerics.UnitTests.Random } } } - -#endif diff --git a/src/UnitTests/Random/RandomSerializationTests.cs b/src/UnitTests/Random/RandomSerializationTests.cs index d81241bd..5314c89c 100644 --- a/src/UnitTests/Random/RandomSerializationTests.cs +++ b/src/UnitTests/Random/RandomSerializationTests.cs @@ -31,18 +31,18 @@ using System; using System.IO; using System.Linq; using System.Runtime.Serialization; -#if !PORTABLE && !NETSTANDARD -using System.Runtime.Serialization.Formatters.Binary; -#endif using MathNet.Numerics.Random; using NUnit.Framework; +#if !NETCOREAPP1_1 +using System.Runtime.Serialization.Formatters.Binary; +#endif + namespace MathNet.Numerics.UnitTests.Random { [TestFixture] public class RandomSerializationTests { -#if !NETSTANDARD [Test] [TestCase(typeof(MersenneTwister))] [TestCase(typeof(Mcg59))] @@ -69,9 +69,8 @@ namespace MathNet.Numerics.UnitTests.Random Assert.That(actual.GetType(), Is.EqualTo(randomType)); Assert.That(actual.NextDoubleSequence().Take(10).ToArray(), Is.EqualTo(expected.NextDoubleSequence().Take(10).ToArray()).AsCollection); } -#endif -#if !PORTABLE && !NETSTANDARD +#if !NETCOREAPP1_1 [Test] [TestCase(typeof(MersenneTwister))] [TestCase(typeof(Mcg59))] diff --git a/src/UnitTests/Random/RandomTests.cs b/src/UnitTests/Random/RandomTests.cs index 2e1d5ab5..a95c88d0 100644 --- a/src/UnitTests/Random/RandomTests.cs +++ b/src/UnitTests/Random/RandomTests.cs @@ -84,7 +84,7 @@ namespace MathNet.Numerics.UnitTests.Random disposable.Dispose(); } } - + /// /// Next() result is in boundaries. /// @@ -111,12 +111,10 @@ namespace MathNet.Numerics.UnitTests.Random [Test] public void Reproducible() { -#if !PORTABLE if (_randomType == typeof (CryptoRandomSource)) { Assert.Ignore("CryptoRandomSource does not support seeds and is not reproducible by design."); } -#endif Assert.That( ((RandomSource)Activator.CreateInstance(_randomType, new object[] { 5, false })).NextDoubles(1000), diff --git a/src/UnitTests/RootFindingTests/FindRootsTest.cs b/src/UnitTests/RootFindingTests/FindRootsTest.cs index 04c89dfa..226edb93 100644 --- a/src/UnitTests/RootFindingTests/FindRootsTest.cs +++ b/src/UnitTests/RootFindingTests/FindRootsTest.cs @@ -28,17 +28,11 @@ // using System; +using System.Numerics; using NUnit.Framework; namespace MathNet.Numerics.UnitTests.RootFindingTests { -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else - using Complex = System.Numerics.Complex; - -#endif - [TestFixture, Category("RootFinding")] internal class FindRootsTest { diff --git a/src/UnitTests/StatisticsTests/CorrelationTests.cs b/src/UnitTests/StatisticsTests/CorrelationTests.cs index 7afd9c43..83349627 100644 --- a/src/UnitTests/StatisticsTests/CorrelationTests.cs +++ b/src/UnitTests/StatisticsTests/CorrelationTests.cs @@ -35,7 +35,6 @@ using MathNet.Numerics.Statistics; namespace MathNet.Numerics.UnitTests.StatisticsTests { -#if !PORTABLE /// /// Correlation tests /// @@ -169,5 +168,4 @@ namespace MathNet.Numerics.UnitTests.StatisticsTests Assert.That(() => Correlation.Spearman(dataA, dataB), Throws.TypeOf()); } } -#endif } diff --git a/src/UnitTests/StatisticsTests/DescriptiveStatisticsTests.cs b/src/UnitTests/StatisticsTests/DescriptiveStatisticsTests.cs index 2e02e3c4..1d9b728f 100644 --- a/src/UnitTests/StatisticsTests/DescriptiveStatisticsTests.cs +++ b/src/UnitTests/StatisticsTests/DescriptiveStatisticsTests.cs @@ -34,7 +34,6 @@ using MathNet.Numerics.Statistics; namespace MathNet.Numerics.UnitTests.StatisticsTests { -#if !PORTABLE /// /// Descriptive statistics tests. /// @@ -303,5 +302,4 @@ namespace MathNet.Numerics.UnitTests.StatisticsTests Assert.That(stats.Kurtosis, Is.NaN); } } -#endif } diff --git a/src/UnitTests/TrigonometryTest.cs b/src/UnitTests/TrigonometryTest.cs index f853d401..902476c2 100644 --- a/src/UnitTests/TrigonometryTest.cs +++ b/src/UnitTests/TrigonometryTest.cs @@ -28,16 +28,11 @@ // using System; +using System.Numerics; using NUnit.Framework; namespace MathNet.Numerics.UnitTests { -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else - using Complex = System.Numerics.Complex; -#endif - /// /// Trigonometry tests. /// diff --git a/src/UnitTests/UnitTests-CUDA.csproj b/src/UnitTests/UnitTests-CUDA.csproj index 21e0e293..29f1095c 100644 --- a/src/UnitTests/UnitTests-CUDA.csproj +++ b/src/UnitTests/UnitTests-CUDA.csproj @@ -1,99 +1,30 @@  - + - 10.0 - Debug - AnyCPU - 8.0.30703 - 2.0 - {E79C0395-01DC-4BC9-B86C-ED45790892C5} - {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - UnitTest - Library - Properties + Exe + net45;netcoreapp1.1;netcoreapp2.0 + win7-x64;win-7x86;ubuntu.16.10-x64 + 2.0.0 + false + MathNet.Numerics.UnitTests.CUDA MathNet.Numerics.UnitTests - MathNet.Numerics.UnitTestsCUDA - v4.5 - 512 - 6 - ..\..\ + false + NATIVE;CUDA - - TRACE;NATIVE;CUDA - ..\..\out\CUDA\Windows\ - ..\..\obj\CUDA\Windows\x86\ - ..\..\obj\CUDA\Windows\x86\ - true - pdbonly - prompt - MinimumRecommendedRules.ruleset - 1591 - AnyCPU - - - TRACE;DEBUG;NATIVE;CUDA - ..\..\out\CUDA\Windows\ - ..\..\obj\CUDA\Windows\x86\ - ..\..\obj\CUDA\Windows\x86\ - false - full - true - prompt - 4 - 1591 - AnyCPU - - - + - - - - - {b7cae5f4-a23f-4438-b5be-41226618b695} - Numerics - - - {af3253c9-4db5-45a0-98cf-c105fda9da47} - TestData - - - - - + + - + - - - - - - ..\..\packages\NUnit\lib\net45\nunit.framework.dll - True - True - - - - - - - - - ..\..\packages\System.Runtime.InteropServices.RuntimeInformation\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll - True - True - - - - - - \ No newline at end of file + + diff --git a/src/UnitTests/UnitTests-CUDA.csproj.paket.references b/src/UnitTests/UnitTests-CUDA.csproj.paket.references deleted file mode 100644 index 72ab66bb..00000000 --- a/src/UnitTests/UnitTests-CUDA.csproj.paket.references +++ /dev/null @@ -1 +0,0 @@ -NUnit framework:net45 diff --git a/src/UnitTests/UnitTests-MKL.csproj b/src/UnitTests/UnitTests-MKL.csproj index f78d68e8..24397961 100644 --- a/src/UnitTests/UnitTests-MKL.csproj +++ b/src/UnitTests/UnitTests-MKL.csproj @@ -1,99 +1,30 @@  - + - 10.0 - Debug - AnyCPU - 8.0.30703 - 2.0 - {3515A344-AB5F-41C7-A14C-04A79B3FFAB1} - {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - UnitTest - Library - Properties + Exe + net45;netcoreapp1.1;netcoreapp2.0 + win7-x64;win-7x86;ubuntu.16.10-x64 + 2.0.0 + false + MathNet.Numerics.UnitTests.MKL MathNet.Numerics.UnitTests - MathNet.Numerics.UnitTestsMKL - v4.5 - 512 - 6 - ..\..\ + false + NATIVE;MKL - - TRACE;NATIVE;MKL - ..\..\out\MKL\Windows\ - ..\..\obj\MKL\Windows\x86\ - ..\..\obj\MKL\Windows\x86\ - true - pdbonly - prompt - MinimumRecommendedRules.ruleset - 1591 - AnyCPU - - - TRACE;DEBUG;NATIVE;MKL - ..\..\out\MKL\Windows\ - ..\..\obj\MKL\Windows\x86\ - ..\..\obj\MKL\Windows\x86\ - false - full - true - prompt - 4 - 1591 - AnyCPU - - - + - - - - - {b7cae5f4-a23f-4438-b5be-41226618b695} - Numerics - - - {af3253c9-4db5-45a0-98cf-c105fda9da47} - TestData - - - - - + + - + - - - - - - ..\..\packages\NUnit\lib\net45\nunit.framework.dll - True - True - - - - - - - - - ..\..\packages\System.Runtime.InteropServices.RuntimeInformation\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll - True - True - - - - - - \ No newline at end of file + + diff --git a/src/UnitTests/UnitTests-MKL.csproj.paket.references b/src/UnitTests/UnitTests-MKL.csproj.paket.references deleted file mode 100644 index 72ab66bb..00000000 --- a/src/UnitTests/UnitTests-MKL.csproj.paket.references +++ /dev/null @@ -1 +0,0 @@ -NUnit framework:net45 diff --git a/src/UnitTests/UnitTests-OpenBLAS.csproj b/src/UnitTests/UnitTests-OpenBLAS.csproj index e9cc244e..f848b2ac 100644 --- a/src/UnitTests/UnitTests-OpenBLAS.csproj +++ b/src/UnitTests/UnitTests-OpenBLAS.csproj @@ -1,99 +1,30 @@  - + - 10.0 - Debug - AnyCPU - 8.0.30703 - 2.0 - {96B903EF-3EE1-4569-803C-0482D2F5ED37} - {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - UnitTest - Library - Properties + Exe + net45;netcoreapp1.1;netcoreapp2.0 + win7-x64;win-7x86;ubuntu.16.10-x64 + 2.0.0 + false + MathNet.Numerics.UnitTests.OpenBLAS MathNet.Numerics.UnitTests - MathNet.Numerics.UnitTestsOpenBLAS - v4.5 - 512 - 6 - ..\..\ + false + NATIVE;OPENBLAS - - TRACE;NATIVE;OPENBLAS; - ..\..\out\OpenBLAS\Windows\ - ..\..\obj\OpenBLAS\Windows\AnyCPU\ - ..\..\obj\OpenBLAS\Windows\AnyCPU\ - true - pdbonly - prompt - MinimumRecommendedRules.ruleset - 1591 - AnyCPU - - - TRACE;DEBUG;NATIVE;OPENBLAS; - ..\..\out\OpenBLAS\Windows\ - ..\..\obj\OpenBLAS\Windows\AnyCPU\ - ..\..\obj\OpenBLAS\Windows\AnyCPU\ - false - full - true - prompt - 4 - 1591 - AnyCPU - - - + - - - - - {b7cae5f4-a23f-4438-b5be-41226618b695} - Numerics - - - {af3253c9-4db5-45a0-98cf-c105fda9da47} - TestData - - - - - + + - + - - - - - - ..\..\packages\NUnit\lib\net45\nunit.framework.dll - True - True - - - - - - - - - ..\..\packages\System.Runtime.InteropServices.RuntimeInformation\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll - True - True - - - - - - \ No newline at end of file + + diff --git a/src/UnitTests/UnitTests-OpenBLAS.csproj.paket.references b/src/UnitTests/UnitTests-OpenBLAS.csproj.paket.references deleted file mode 100644 index 72ab66bb..00000000 --- a/src/UnitTests/UnitTests-OpenBLAS.csproj.paket.references +++ /dev/null @@ -1 +0,0 @@ -NUnit framework:net45 diff --git a/src/UnitTests/UnitTests-Portable259.csproj.paket.references b/src/UnitTests/UnitTests-Portable259.csproj.paket.references deleted file mode 100644 index 72ab66bb..00000000 --- a/src/UnitTests/UnitTests-Portable259.csproj.paket.references +++ /dev/null @@ -1 +0,0 @@ -NUnit framework:net45 diff --git a/src/UnitTests/UnitTests-Portable328.csproj.paket.references b/src/UnitTests/UnitTests-Portable328.csproj.paket.references deleted file mode 100644 index 72ab66bb..00000000 --- a/src/UnitTests/UnitTests-Portable328.csproj.paket.references +++ /dev/null @@ -1 +0,0 @@ -NUnit framework:net45 diff --git a/src/UnitTests/UnitTests-Portable47.csproj.paket.references b/src/UnitTests/UnitTests-Portable47.csproj.paket.references deleted file mode 100644 index 551fa416..00000000 --- a/src/UnitTests/UnitTests-Portable47.csproj.paket.references +++ /dev/null @@ -1 +0,0 @@ -NUnit framework:net45 diff --git a/src/UnitTests/UnitTests-Portable7.csproj.paket.references b/src/UnitTests/UnitTests-Portable7.csproj.paket.references deleted file mode 100644 index 72ab66bb..00000000 --- a/src/UnitTests/UnitTests-Portable7.csproj.paket.references +++ /dev/null @@ -1 +0,0 @@ -NUnit framework:net45 diff --git a/src/UnitTests/UnitTests-Portable78.csproj.paket.references b/src/UnitTests/UnitTests-Portable78.csproj.paket.references deleted file mode 100644 index 72ab66bb..00000000 --- a/src/UnitTests/UnitTests-Portable78.csproj.paket.references +++ /dev/null @@ -1 +0,0 @@ -NUnit framework:net45 diff --git a/src/UnitTests/UnitTests.csproj b/src/UnitTests/UnitTests.csproj index ada95604..7a745204 100644 --- a/src/UnitTests/UnitTests.csproj +++ b/src/UnitTests/UnitTests.csproj @@ -10,10 +10,7 @@ MathNet.Numerics.UnitTests false - - NETSTANDARD - - + diff --git a/src/UnitTests/UseLinearAlgebraProvider.cs b/src/UnitTests/UseLinearAlgebraProvider.cs index 19728c3d..693148df 100644 --- a/src/UnitTests/UseLinearAlgebraProvider.cs +++ b/src/UnitTests/UseLinearAlgebraProvider.cs @@ -38,7 +38,7 @@ namespace MathNet.Numerics.UnitTests { public void BeforeTest(ITest testDetails) { -#if !NET35 && NATIVE +#if NATIVE && !NETCOREAPP1_1 #if MKL Control.UseNativeMKL(); #elif CUDA @@ -46,6 +46,8 @@ namespace MathNet.Numerics.UnitTests #elif OPENBLAS Control.UseNativeOpenBLAS(); #endif +#else + Control.UseManaged(); #endif } diff --git a/src/UnitTests/UnitTests.csproj.paket.references b/src/UnitTests/paket.references similarity index 100% rename from src/UnitTests/UnitTests.csproj.paket.references rename to src/UnitTests/paket.references