├── .config └── dotnet-tools.json ├── .editorconfig ├── .gitattributes ├── .github └── dependabot.yml ├── .gitignore ├── .mailmap ├── .paket └── Paket.Restore.targets ├── CONTRIBUTING.md ├── CONTRIBUTORS.md ├── Directory.Build.props ├── LICENSE-MKL.md ├── LICENSE.md ├── MathNet.Numerics.ATLAS.sln ├── MathNet.Numerics.CUDA.sln ├── MathNet.Numerics.MKL.sln ├── MathNet.Numerics.OpenBLAS.sln ├── MathNet.Numerics.sln ├── MathNet.Numerics.sln.DotSettings ├── NuGet.config ├── README.md ├── RELEASENOTES-CUDA.md ├── RELEASENOTES-Data.md ├── RELEASENOTES-MKL.md ├── RELEASENOTES-OpenBLAS.md ├── RELEASENOTES.md ├── Vagrantfile ├── appveyor.yml ├── build.cmd ├── build.sh ├── build ├── .gitignore ├── Building.fs ├── Documentation.fs ├── MathNet.Numerics.CUDA.Win.nuspec ├── MathNet.Numerics.Data.Matlab.nuspec ├── MathNet.Numerics.Data.Text.nuspec ├── MathNet.Numerics.Extension.nuspec ├── MathNet.Numerics.FSharp.Signed.nuspec ├── MathNet.Numerics.FSharp.nuspec ├── MathNet.Numerics.MKL.Linux-x64.nuspec ├── MathNet.Numerics.MKL.Linux-x86.nuspec ├── MathNet.Numerics.MKL.Linux.nuspec ├── MathNet.Numerics.MKL.Win-x64.nuspec ├── MathNet.Numerics.MKL.Win-x86.nuspec ├── MathNet.Numerics.MKL.Win.nuspec ├── MathNet.Numerics.OpenBLAS.Win.nuspec ├── MathNet.Numerics.Signed.nuspec ├── MathNet.Numerics.nuspec ├── MathNet.Numerics.snk ├── Model.fs ├── NativeProvider.targets ├── Packaging.fs ├── Publishing.fs ├── Testing.fs ├── Versioning.fs ├── _._ ├── build.fs ├── build.fsproj ├── build.sln └── icon.png ├── data ├── Codeplex-5667.csv ├── Github-Cureos-1.csv ├── Matlab │ ├── A.mat │ ├── cell-array-nested.mat │ ├── collection-nocompress.mat │ ├── collection.mat │ ├── complex.mat │ ├── matrices.txt │ ├── sparse-large.mat │ ├── sparse-small.mat │ ├── sparse_complex.mat │ ├── struct-nested.mat │ └── v.mat ├── MatrixMarket │ ├── bp___200.mtx │ ├── can24_pattern_symmetric_coordinate_24.mtx │ ├── fidap007.mtx │ ├── gear_integer_general_coordinate_100.mtx │ ├── hilbert_real_symmetric_array_10.mtx │ ├── random_real_general_array_100.mtx │ ├── random_real_general_array_10_20.mtx │ ├── random_real_general_array_20_10.mtx │ ├── random_real_general_coordinate_10_20.mtx │ ├── random_real_general_dense_10_20.comma │ ├── random_real_general_dense_10_20.space │ └── random_real_general_dense_10_20.tab ├── NIST │ ├── AtmWtAgt.dat │ ├── Bennett5.dat │ ├── BoxBOD.dat │ ├── Chwirut1.dat │ ├── Chwirut2.dat │ ├── DanWood.dat │ ├── ENSO.dat │ ├── Eckerle4.dat │ ├── Filip.dat │ ├── Gauss1.dat │ ├── Gauss2.dat │ ├── Gauss3.dat │ ├── Hahn1.dat │ ├── Kirby2.dat │ ├── Lanczos1.dat │ ├── Lanczos2.dat │ ├── Lanczos3.dat │ ├── Lew.dat │ ├── Longley.dat │ ├── Lottery.dat │ ├── MGH09.dat │ ├── MGH10.dat │ ├── MGH17.dat │ ├── Mavro.dat │ ├── Meixner.dat │ ├── Michelso.dat │ ├── Misra1a.dat │ ├── Misra1b.dat │ ├── Misra1c.dat │ ├── Misra1d.dat │ ├── Nelson.dat │ ├── NoInt1.dat │ ├── NoInt2.dat │ ├── Norris.dat │ ├── NumAcc1.dat │ ├── NumAcc2.dat │ ├── NumAcc3.dat │ ├── NumAcc4.dat │ ├── Pontius.dat │ ├── Rat42.dat │ ├── Rat43.dat │ ├── Roszman1.dat │ ├── SiRstvt.dat │ ├── SmLs01t.dat │ ├── SmLs02t.dat │ ├── SmLs03t.dat │ ├── SmLs04t.dat │ ├── SmLs05t.dat │ ├── SmLs06t.dat │ ├── SmLs07t.dat │ ├── SmLs08t.dat │ ├── SmLs09t.dat │ ├── Thurber.dat │ ├── Wampler1.dat │ ├── Wampler2.dat │ ├── Wampler3.dat │ ├── Wampler4.dat │ └── Wampler5.dat ├── coo_torsion_duplicates.csv ├── coo_torsion_no_duplicates.csv └── numpy │ ├── CorrNumpyData_pwm.csv │ ├── CorrNumpyData_rnd.csv │ ├── CorrNumpyData_sin.csv │ └── CorrNumpyData_sqr.csv ├── docs ├── Build.md ├── CSV.md ├── Compatibility.md ├── Constants.md ├── DescriptiveStatistics.md ├── Distance.md ├── DistanceCanberra.png ├── DistanceChebyshev.png ├── DistanceCosine.png ├── DistanceEuclidean.png ├── DistanceMAE.png ├── DistanceMSE.png ├── DistanceManhattan.png ├── DistanceMinkowski3.png ├── DistancePearson.png ├── DistanceSAD.png ├── DistanceSSD.png ├── Euclid.md ├── Functions.md ├── Generate.md ├── IFsharpNotebook.md ├── IfSharp-GenerateIS.png ├── IfSharp-MatrixVector.png ├── IntegralTransforms.md ├── Integration.md ├── Interpolation.md ├── LinearEquations.md ├── MKL.md ├── MatlabFiles.md ├── Matrix.md ├── MatrixMarket.md ├── Packages.md ├── Probability.md ├── Random.md ├── Regression.md ├── Users.md ├── _template.html ├── content │ └── fsdocs-custom.css ├── favicon.ico ├── index.md └── logo.png ├── examples ├── examples-csharp │ ├── ConsoleHelper.cs │ ├── ContinuousDistributions │ │ ├── BetaDistribution.cs │ │ ├── CauchyDistribution.cs │ │ ├── ChiDistribution.cs │ │ ├── ChiSquareDistribution.cs │ │ ├── ContinuousUniformDistribution.cs │ │ ├── ErlangDistribution.cs │ │ ├── ExponentialDistribution.cs │ │ ├── FisherSnedecorDistribution.cs │ │ ├── GammaDistribution.cs │ │ ├── InverseGammaDistribution.cs │ │ ├── LaplaceDistribution.cs │ │ ├── LogNormalDistribution.cs │ │ ├── NormalDistribution.cs │ │ ├── ParetoDistribution.cs │ │ ├── RayleighDistribution.cs │ │ ├── StableDistribution.cs │ │ ├── StudentTDistribution.cs │ │ ├── TriangularDistribution.cs │ │ └── WeibullDistribution.cs │ ├── DiscreteDistributions │ │ ├── BernoulliDistribution.cs │ │ ├── BinomialDistribution.cs │ │ ├── CategoricalDistribution.cs │ │ ├── ConwayMaxwellPoissonDistribution.cs │ │ ├── DiscreteUniformDistribution.cs │ │ ├── GeometricDistribution.cs │ │ ├── HypergeometricDistribution.cs │ │ ├── NegativeBinomialDistribution.cs │ │ ├── PoissonDistribution.cs │ │ └── ZipfDistribution.cs │ ├── IExample.cs │ ├── Integration.cs │ ├── Interpolation │ │ ├── AkimaSpline.cs │ │ ├── LinearBetweenPoints.cs │ │ ├── RationalWithPoles.cs │ │ └── RationalWithoutPoles.cs │ ├── LinearAlgebra │ │ ├── DirectSolvers.cs │ │ ├── Factorization │ │ │ ├── Cholesky.cs │ │ │ ├── Evd.cs │ │ │ ├── LU.cs │ │ │ ├── QR.cs │ │ │ └── Svd.cs │ │ ├── IterativeSolvers │ │ │ ├── BiCgStabSolver.cs │ │ │ ├── CompositeSolverExample.cs │ │ │ ├── GpBiCgSolver.cs │ │ │ ├── MlkBiCgStabSolver.cs │ │ │ └── TFQMRSolver.cs │ │ ├── MatrixArithmeticOperations.cs │ │ ├── MatrixDataAccessor.cs │ │ ├── MatrixInitialization.cs │ │ ├── MatrixNorms.cs │ │ ├── MatrixRowColumnOperations.cs │ │ ├── MatrixSpecialNumbers.cs │ │ ├── MatrixTransposeAndInverse.cs │ │ ├── MatrixTriangular.cs │ │ ├── VectorArithmeticOperations.cs │ │ ├── VectorDataAccessor.cs │ │ └── VectorInitialization.cs │ ├── NumberTheory.cs │ ├── RandomNumberGeneration.cs │ ├── Signals │ │ ├── Chebyshev.cs │ │ ├── Equidistant.cs │ │ └── Random.cs │ ├── SpecialFunctions │ │ ├── Beta.cs │ │ ├── Common.cs │ │ ├── ErrorFunction.cs │ │ ├── Factorial.cs │ │ ├── Gamma.cs │ │ └── Stability.cs │ ├── Statistics.cs │ ├── examples-csharp.csproj │ └── examples-csharp.sln ├── examples-fsharp │ ├── Apply.fs │ ├── Histogram.fs │ ├── LinearRegression.fs │ ├── MCMC.fs │ ├── Matrices.fs │ ├── RandomAndDistributions.fs │ ├── Vectors.fs │ ├── examples-fsharp.fsproj │ └── examples-fsharp.sln ├── net45-console-csharp │ ├── App.config │ ├── Program.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── net45-console-csharp.csproj │ └── net45-console-csharp.sln ├── net45-console-fsharp │ ├── App.config │ ├── AssemblyInfo.fs │ ├── Program.fs │ ├── net45-console-fsharp.fsproj │ ├── net45-console-fsharp.sln │ └── packages.config ├── net471-console-csharp │ ├── App.config │ ├── Program.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── net471-console-csharp.csproj │ └── net471-console-csharp.sln ├── net471-console-fsharp │ ├── App.config │ ├── AssemblyInfo.fs │ ├── Program.fs │ ├── net471-console-fsharp.fsproj │ ├── net471-console-fsharp.sln │ └── packages.config ├── netcore11-console-csharp │ ├── Program.cs │ ├── netcore11-console-csharp.csproj │ └── netcore11-console-csharp.sln ├── netcore11-console-fsharp │ ├── Program.fs │ ├── netcore11-console-fsharp.fsproj │ └── netcore11-console-fsharp.sln ├── netcore20-console-csharp │ ├── Program.cs │ ├── netcore20-console-csharp.csproj │ └── netcore20-console-csharp.sln ├── netcore20-console-fsharp │ ├── Program.fs │ ├── netcore20-console-fsharp.fsproj │ └── netcore20-console-fsharp.sln └── paket.dependencies ├── global.json ├── paket.dependencies ├── paket.lock ├── restore.cmd ├── restore.sh ├── src ├── .gitignore ├── Benchmark │ ├── Benchmark.csproj │ ├── LinearAlgebra │ │ ├── DenseMatrixProduct.cs │ │ └── DenseVector.cs │ ├── Program.cs │ └── Transforms │ │ └── FFT.cs ├── Data.Matlab │ ├── Adler32.cs │ ├── ArrayClass.cs │ ├── ArrayFlags.cs │ ├── Data.Matlab.csproj │ ├── DataType.cs │ ├── Formatter.cs │ ├── MatlabMatrix.cs │ ├── MatlabReader.cs │ ├── MatlabStructure.cs │ ├── MatlabWriter.cs │ ├── Parser.cs │ └── Settings.StyleCop ├── Data.Tests │ ├── AssertHelpers.cs │ ├── Data.Tests.csproj │ ├── Matlab │ │ ├── MatlabReaderTests.cs │ │ └── MatlabWriterTests.cs │ ├── Program.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ └── Text │ │ ├── DelimitedReaderTests.cs │ │ ├── DelimitedWriterTests.cs │ │ ├── MatrixMarketReaderTests.cs │ │ └── MatrixMarketWriterTests.cs ├── Data.Text │ ├── Data.Text.csproj │ ├── DelimitedReader.cs │ ├── DelimitedWriter.cs │ ├── MatrixMarketReader.cs │ ├── MatrixMarketWriter.cs │ ├── Options.cs │ └── Settings.StyleCop ├── FSharp.Tests │ ├── AssemblyInfo.fs │ ├── BigRationalTests.fs │ ├── DenseMatrixTests.fs │ ├── DenseVectorTests.fs │ ├── FSharp.Tests.fsproj │ ├── FindRootsTests.fs │ ├── FitTests.fs │ ├── Main.fs │ ├── MatrixTests.fs │ ├── PokerTests.fs │ ├── QuaternionTests.fs │ ├── RandomVariableTests.fs │ ├── SparseMatrixTests.fs │ ├── SparseVectorTests.fs │ ├── Utilities.fs │ └── VectorTests.fs ├── FSharp │ ├── AssemblyInfo.fs │ ├── BigIntegerExtensions.fs │ ├── BigRational.fs │ ├── BigRational.fsi │ ├── Complex.fs │ ├── Differentiate.fs │ ├── Distributions.fs │ ├── FSharp.fsproj │ ├── FindRoots.fs │ ├── Fit.fs │ ├── Generate.fs │ ├── LinearAlgebra.Matrix.fs │ ├── LinearAlgebra.Vector.fs │ ├── Quaternion.fs │ ├── Random.fs │ ├── RandomVariable.fs │ └── Statistics.fs ├── NativeProviders │ ├── .gitignore │ ├── ATLAS │ │ ├── blas.c │ │ ├── blas.h │ │ ├── lapack.cpp │ │ ├── resource.h │ │ └── resource.rc │ ├── CUDA │ │ ├── blas.cpp │ │ ├── capabilities.cpp │ │ ├── lapack.cpp │ │ ├── memory.c │ │ ├── resource.h │ │ └── resource.rc │ ├── Common │ │ ├── WindowsDLL.cpp │ │ ├── blas.c │ │ ├── lapack.cpp │ │ ├── lapack_common.h │ │ └── wrapper_common.h │ ├── Linux │ │ ├── mkl_build.sh │ │ └── readme.txt │ ├── MKL │ │ ├── blas.h │ │ ├── capabilities.cpp │ │ ├── dss.c │ │ ├── dss.h │ │ ├── fft.cpp │ │ ├── lapack.h │ │ ├── memory.c │ │ ├── resource.h │ │ ├── resource.rc │ │ └── vector_functions.c │ ├── OSX │ │ └── mkl_build.sh │ ├── OpenBLAS │ │ ├── blas.h │ │ ├── capabilities.cpp │ │ ├── lapack.h │ │ ├── resource.h │ │ └── resource.rc │ └── Windows │ │ ├── ATLAS │ │ ├── ATLASWrapper.vcxproj │ │ └── ATLASWrapper.vcxproj.filters │ │ ├── ATLASEx │ │ ├── ATLASWrapper.vcproj │ │ ├── ATLASWrapper.vcxproj │ │ └── ATLASWrapper.vcxproj.filters │ │ ├── CUDA │ │ ├── CUDAWrapper.vcxproj │ │ └── CUDAWrapper.vcxproj.filters │ │ ├── MKL │ │ ├── MKLWrapper.vcxproj │ │ └── MKLWrapper.vcxproj.filters │ │ └── OpenBLAS │ │ ├── OpenBLASWrapper.vcxproj │ │ └── OpenBLASWrapper.vcxproj.filters ├── Numerics.Tests │ ├── ArrayHelpers.cs │ ├── AssertHelpers.cs │ ├── CombinatoricsTests │ │ ├── CombinatoricsCountingTest.cs │ │ └── CombinatoricsGenerationTest.cs │ ├── ComplexTests │ │ ├── Complex32Test.TextHandling.cs │ │ ├── Complex32Test.cs │ │ ├── ComplexTest.TextHandling.cs │ │ └── ComplexTest.cs │ ├── DifferentiationTests │ │ ├── FiniteDifferenceCoefficientsTests.cs │ │ ├── NumericalDerivativeTests.cs │ │ ├── NumericalHessianTests.cs │ │ └── NumericalJacobianTests.cs │ ├── DistanceTests.cs │ ├── DistributionTests │ │ ├── CommonDistributionTests.cs │ │ ├── Continuous │ │ │ ├── BetaScaledTests.cs │ │ │ ├── BetaTests.cs │ │ │ ├── BurrTests.cs │ │ │ ├── CauchyTests.cs │ │ │ ├── ChiSquareTests.cs │ │ │ ├── ChiTests.cs │ │ │ ├── ContinuousUniformTests.cs │ │ │ ├── ErlangTests.cs │ │ │ ├── ExponentialTests.cs │ │ │ ├── FisherSnedecorTests.cs │ │ │ ├── GammaTests.cs │ │ │ ├── InverseGammaTests.cs │ │ │ ├── InverseGaussianTests.cs │ │ │ ├── LaplaceTests.cs │ │ │ ├── LogNormalTests.cs │ │ │ ├── LogisticTests.cs │ │ │ ├── NormalTests.cs │ │ │ ├── ParetoTests.cs │ │ │ ├── RayleighTests.cs │ │ │ ├── SkewGeneralizedTTests.cs │ │ │ ├── StableTests.cs │ │ │ ├── StudentTTests.cs │ │ │ ├── TriangularTests.cs │ │ │ ├── TruncatedParetoTests.cs │ │ │ └── WeibullTests.cs │ │ ├── Discrete │ │ │ ├── BernoulliTests.cs │ │ │ ├── BinomialTests.cs │ │ │ ├── CategoricalTests.cs │ │ │ ├── ConwayMaxwellPoissonTests.cs │ │ │ ├── DiscreteUniformTests.cs │ │ │ ├── GeometricTests.cs │ │ │ ├── HypergeometricTests.cs │ │ │ ├── NegativeBinomialTests.cs │ │ │ ├── PoissonTests.cs │ │ │ └── ZipfTests.cs │ │ └── Multivariate │ │ │ ├── DirichletTests.cs │ │ │ ├── InverseWishartTests.cs │ │ │ ├── MatrixNormalTests.cs │ │ │ ├── MultinomialTests.cs │ │ │ ├── NormalGammaTests.cs │ │ │ └── WishartTests.cs │ ├── EuclidTests │ │ ├── GcdRelatedTest.cs │ │ ├── GcdRelatedTestBigInteger.cs │ │ └── IntegerTheoryTest.cs │ ├── ExcelTests.cs │ ├── FinancialTests │ │ ├── CompoundReturnTests.cs │ │ ├── DownsideDeviationTests.cs │ │ ├── GainLossRatioTests.cs │ │ ├── GainMeanTests.cs │ │ ├── GainStandardDeviationTests.cs │ │ ├── LossMeanTests.cs │ │ ├── LossStandardDeviationTests.cs │ │ └── SemiDeviationTests.cs │ ├── FitTests.cs │ ├── FractionalCalculusTests │ │ └── RiemannLiouvilleTests.cs │ ├── GenerateTests.cs │ ├── GenericMath.cs │ ├── GoodnessOfFit │ │ ├── RSquaredTest.cs │ │ └── StandardErrorTest.cs │ ├── IntegralTransformsTests │ │ ├── FourierTest.cs │ │ ├── HartleyTest.cs │ │ ├── InverseTransformTest.cs │ │ ├── MatchingReferenceTransformTest.cs │ │ ├── ParsevalTheoremTest.cs │ │ └── ReferenceDiscreteFourierTransform.cs │ ├── IntegrationTests │ │ └── IntegrationTest.cs │ ├── InterpolationTests │ │ ├── AkimaSplineTest.cs │ │ ├── BulirschStoerRationalTest.cs │ │ ├── CubicSplineTest.cs │ │ ├── EquidistantPolynomialTest.cs │ │ ├── FloaterHormannRationalTest.cs │ │ ├── LinearInterpolationCase.cs │ │ ├── LinearSplineTest.cs │ │ ├── MakimaSplineTest.cs │ │ ├── NevillePolynomialTest.cs │ │ ├── PchipSplineTest.cs │ │ └── StepInterpolationTest.cs │ ├── LinearAlgebraTests │ │ ├── Complex │ │ │ ├── DenseMatrixTests.cs │ │ │ ├── DenseVectorTests.cs │ │ │ ├── DiagonalMatrixTests.cs │ │ │ ├── Factorization │ │ │ │ ├── CholeskyTests.cs │ │ │ │ ├── EvdTests.cs │ │ │ │ ├── GramSchmidtTests.cs │ │ │ │ ├── LUTests.cs │ │ │ │ ├── QRTests.cs │ │ │ │ ├── SvdTests.cs │ │ │ │ ├── UserCholeskyTests.cs │ │ │ │ ├── UserEvdTests.cs │ │ │ │ ├── UserGramSchmidtTests.cs │ │ │ │ ├── UserLUTests.cs │ │ │ │ ├── UserQRTests.cs │ │ │ │ └── UserSvdTests.cs │ │ │ ├── MatrixLoader.cs │ │ │ ├── MatrixStructureTheory.cs │ │ │ ├── MatrixTests.Arithmetic.cs │ │ │ ├── MatrixTests.cs │ │ │ ├── ReturnTypeTests.cs │ │ │ ├── Solvers │ │ │ │ ├── Iterative │ │ │ │ │ ├── BiCgStabTest.cs │ │ │ │ │ ├── GpBiCgTest.cs │ │ │ │ │ ├── MlkBiCgStabTest.cs │ │ │ │ │ └── TFQMRTest.cs │ │ │ │ ├── IteratorTest.cs │ │ │ │ ├── Preconditioners │ │ │ │ │ ├── DiagonalTest.cs │ │ │ │ │ ├── IluptElementSorterTest.cs │ │ │ │ │ ├── IlutpTest.cs │ │ │ │ │ ├── IncompleteLUTest.cs │ │ │ │ │ ├── PreConditionerTest.cs │ │ │ │ │ └── UnitPreconditionerTest.cs │ │ │ │ └── StopCriterion │ │ │ │ │ ├── DivergenceStopCriteriumTest.cs │ │ │ │ │ ├── FailureStopCriteriumTest.cs │ │ │ │ │ ├── IterationCountStopCriteriumTest.cs │ │ │ │ │ └── ResidualStopCriteriumTest.cs │ │ │ ├── SparseMatrixTests.cs │ │ │ ├── SparseVectorTest.cs │ │ │ ├── TestData.cs │ │ │ ├── UserDefinedMatrix.cs │ │ │ ├── UserDefinedMatrixTests.cs │ │ │ ├── UserDefinedVector.cs │ │ │ ├── UserDefinedVectorTests.cs │ │ │ ├── VectorArithmeticTheory.cs │ │ │ ├── VectorTests.Arithmetic.cs │ │ │ ├── VectorTests.Norm.cs │ │ │ └── VectorTests.cs │ │ ├── Complex32 │ │ │ ├── DenseMatrixTests.cs │ │ │ ├── DenseVectorTests.cs │ │ │ ├── DiagonalMatrixTests.cs │ │ │ ├── Factorization │ │ │ │ ├── CholeskyTests.cs │ │ │ │ ├── EvdTests.cs │ │ │ │ ├── GramSchmidtTests.cs │ │ │ │ ├── LUTests.cs │ │ │ │ ├── QRTests.cs │ │ │ │ ├── SvdTests.cs │ │ │ │ ├── UserCholeskyTests.cs │ │ │ │ ├── UserEvdTests.cs │ │ │ │ ├── UserGramSchmidtTests.cs │ │ │ │ ├── UserLUTests.cs │ │ │ │ ├── UserQRTests.cs │ │ │ │ └── UserSvdTests.cs │ │ │ ├── MatrixLoader.cs │ │ │ ├── MatrixStructureTheory.cs │ │ │ ├── MatrixTests.Arithmetic.cs │ │ │ ├── MatrixTests.cs │ │ │ ├── ReturnTypeTests.cs │ │ │ ├── Solvers │ │ │ │ ├── Iterative │ │ │ │ │ ├── BiCgStabTest.cs │ │ │ │ │ ├── GpBiCgTest.cs │ │ │ │ │ ├── MlkBiCgStabTest.cs │ │ │ │ │ └── TFQMRTest.cs │ │ │ │ ├── IteratorTest.cs │ │ │ │ ├── Preconditioners │ │ │ │ │ ├── DiagonalTest.cs │ │ │ │ │ ├── IluptElementSorterTest.cs │ │ │ │ │ ├── IlutpTest.cs │ │ │ │ │ ├── IncompleteLUTest.cs │ │ │ │ │ ├── PreConditionerTest.cs │ │ │ │ │ └── UnitPreconditionerTest.cs │ │ │ │ └── StopCriterion │ │ │ │ │ ├── DivergenceStopCriteriumTest.cs │ │ │ │ │ ├── FailureStopCriteriumTest.cs │ │ │ │ │ ├── IterationCountStopCriteriumTest.cs │ │ │ │ │ └── ResidualStopCriteriumTest.cs │ │ │ ├── SparseMatrixTests.cs │ │ │ ├── SparseVectorTest.cs │ │ │ ├── TestData.cs │ │ │ ├── UserDefinedMatrix.cs │ │ │ ├── UserDefinedMatrixTests.cs │ │ │ ├── UserDefinedVector.cs │ │ │ ├── UserDefinedVectorTests.cs │ │ │ ├── VectorArithmeticTheory.cs │ │ │ ├── VectorTests.Arithmetic.cs │ │ │ ├── VectorTests.Norm.cs │ │ │ └── VectorTests.cs │ │ ├── Double │ │ │ ├── DenseMatrixTests.cs │ │ │ ├── DenseVectorTests.cs │ │ │ ├── DiagonalMatrixTests.cs │ │ │ ├── Factorization │ │ │ │ ├── CholeskyTests.cs │ │ │ │ ├── EvdTests.cs │ │ │ │ ├── GramSchmidtTests.cs │ │ │ │ ├── LUTests.cs │ │ │ │ ├── QRTests.cs │ │ │ │ ├── SvdTests.cs │ │ │ │ ├── UserCholeskyTests.cs │ │ │ │ ├── UserEvdTests.cs │ │ │ │ ├── UserGramSchmidtTests.cs │ │ │ │ ├── UserLUTests.cs │ │ │ │ ├── UserQRTests.cs │ │ │ │ └── UserSvdTests.cs │ │ │ ├── MatrixLoader.cs │ │ │ ├── MatrixStructureTheory.cs │ │ │ ├── MatrixTests.Arithmetic.cs │ │ │ ├── MatrixTests.cs │ │ │ ├── ReturnTypeTests.cs │ │ │ ├── Solvers │ │ │ │ ├── Iterative │ │ │ │ │ ├── BiCgStabTest.cs │ │ │ │ │ ├── GpBiCgTest.cs │ │ │ │ │ ├── MlkBiCgStabTest.cs │ │ │ │ │ └── TFQMRTest.cs │ │ │ │ ├── IteratorTest.cs │ │ │ │ ├── Preconditioners │ │ │ │ │ ├── DiagonalTest.cs │ │ │ │ │ ├── IluptElementSorterTest.cs │ │ │ │ │ ├── IlutpTest.cs │ │ │ │ │ ├── IncompleteLUTest.cs │ │ │ │ │ ├── PreConditionerTest.cs │ │ │ │ │ └── UnitPreconditionerTest.cs │ │ │ │ └── StopCriterion │ │ │ │ │ ├── DivergenceStopCriteriumTest.cs │ │ │ │ │ ├── FailureStopCriteriumTest.cs │ │ │ │ │ ├── IterationCountStopCriteriumTest.cs │ │ │ │ │ └── ResidualStopCriteriumTest.cs │ │ │ ├── SparseMatrixTests.cs │ │ │ ├── SparseVectorTest.cs │ │ │ ├── TestData.cs │ │ │ ├── UserDefinedMatrix.cs │ │ │ ├── UserDefinedMatrixTests.cs │ │ │ ├── UserDefinedVector.cs │ │ │ ├── UserDefinedVectorTests.cs │ │ │ ├── VectorArithmeticTheory.cs │ │ │ ├── VectorTests.Arithmetic.cs │ │ │ ├── VectorTests.Norm.cs │ │ │ └── VectorTests.cs │ │ ├── MatrixHelpers.cs │ │ ├── MatrixStorageCombinatorsTests.cs │ │ ├── MatrixStorageSerializationTests.cs │ │ ├── MatrixStructureTheory.Access.cs │ │ ├── MatrixStructureTheory.Functional.cs │ │ ├── MatrixStructureTheory.Reform.cs │ │ ├── MatrixStructureTheory.cs │ │ ├── MatrixTests.cs │ │ ├── Single │ │ │ ├── DenseMatrixTests.cs │ │ │ ├── DenseVectorTests.cs │ │ │ ├── DiagonalMatrixTests.cs │ │ │ ├── Factorization │ │ │ │ ├── CholeskyTests.cs │ │ │ │ ├── EvdTests.cs │ │ │ │ ├── GramSchmidtTests.cs │ │ │ │ ├── LUTests.cs │ │ │ │ ├── QRTests.cs │ │ │ │ ├── SvdTests.cs │ │ │ │ ├── UserCholeskyTests.cs │ │ │ │ ├── UserEvdTests.cs │ │ │ │ ├── UserGramSchmidtTests.cs │ │ │ │ ├── UserLUTests.cs │ │ │ │ ├── UserQRTests.cs │ │ │ │ └── UserSvdTests.cs │ │ │ ├── MatrixLoader.cs │ │ │ ├── MatrixStructureTheory.cs │ │ │ ├── MatrixTests.Arithmetic.cs │ │ │ ├── MatrixTests.cs │ │ │ ├── ReturnTypeTests.cs │ │ │ ├── Solvers │ │ │ │ ├── Iterative │ │ │ │ │ ├── BiCgStabTest.cs │ │ │ │ │ ├── GpBiCgTest.cs │ │ │ │ │ ├── MlkBiCgStabTest.cs │ │ │ │ │ └── TFQMRTest.cs │ │ │ │ ├── IteratorTest.cs │ │ │ │ ├── Preconditioners │ │ │ │ │ ├── DiagonalTest.cs │ │ │ │ │ ├── IluptElementSorterTest.cs │ │ │ │ │ ├── IlutpTest.cs │ │ │ │ │ ├── IncompleteLUTest.cs │ │ │ │ │ ├── PreConditionerTest.cs │ │ │ │ │ └── UnitPreconditionerTest.cs │ │ │ │ └── StopCriterion │ │ │ │ │ ├── DivergenceStopCriteriumTest.cs │ │ │ │ │ ├── FailureStopCriteriumTest.cs │ │ │ │ │ ├── IterationCountStopCriteriumTest.cs │ │ │ │ │ └── ResidualStopCriteriumTest.cs │ │ │ ├── SparseMatrixTests.cs │ │ │ ├── SparseVectorTest.cs │ │ │ ├── TestData.cs │ │ │ ├── UserDefinedMatrix.cs │ │ │ ├── UserDefinedMatrixTests.cs │ │ │ ├── UserDefinedVector.cs │ │ │ ├── UserDefinedVectorTests.cs │ │ │ ├── VectorArithmeticTheory.cs │ │ │ ├── VectorTests.Arithmetic.cs │ │ │ ├── VectorTests.Norm.cs │ │ │ └── VectorTests.cs │ │ ├── TestData.cs │ │ ├── VectorArithmeticTheory.cs │ │ ├── VectorStorageCombinatorsTests.cs │ │ ├── VectorStorageSerializationTests.cs │ │ ├── VectorTests.cs │ │ └── VectorToStringTests.cs │ ├── Numerics.Tests.CUDA.csproj │ ├── Numerics.Tests.MKL.csproj │ ├── Numerics.Tests.OpenBLAS.csproj │ ├── Numerics.Tests.csproj │ ├── OdeSolvers │ │ └── OdeSolverTest.cs │ ├── OptimizationTests │ │ ├── BfgsBMinimizerTests.cs │ │ ├── BfgsMinimizerTests.cs │ │ ├── BfgsTest.cs │ │ ├── ConjugateGradientMinimizerTests.cs │ │ ├── GoldenSectionMinimizerTests.cs │ │ ├── LBfgsMinimizerTests.cs │ │ ├── MghObjectiveFunction.cs │ │ ├── NelderMeadSimplexTests.cs │ │ ├── NewtonMinimizerTests.cs │ │ ├── NonLinearCurveFittingTests.cs │ │ ├── RosenbrockFunctionTests.cs │ │ ├── TestCaseDataExtensions.cs │ │ ├── TestFunctionTests.cs │ │ └── TestFunctions │ │ │ ├── BaseTestFunction.cs │ │ │ ├── BealeFunction.cs │ │ │ ├── BrownAndDennisFunction.cs │ │ │ ├── BrownBadlyScaledFunction.cs │ │ │ ├── FreudensteinAndRothFunction.cs │ │ │ ├── HelicalValleyFunction.cs │ │ │ ├── ITestFunction.cs │ │ │ ├── JennrichAndSampsonFunction.cs │ │ │ ├── MeyerFunction.cs │ │ │ ├── PowellBadlyScaledFunction.cs │ │ │ ├── PowellSingularFunction.cs │ │ │ ├── RosenbrockFunction.cs │ │ │ ├── RosenbrockFunction2.cs │ │ │ └── WoodFunction.cs │ ├── PermutationTest.cs │ ├── PolynomialTests.cs │ ├── PrecisionTest.cs │ ├── Program.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── Providers │ │ ├── FourierTransform │ │ │ └── FourierTransformProviderTests.cs │ │ ├── LinearAlgebra │ │ │ ├── Complex │ │ │ │ └── LinearAlgebraProviderTests.cs │ │ │ ├── Complex32 │ │ │ │ └── LinearAlgebraProviderTests.cs │ │ │ ├── Double │ │ │ │ └── LinearAlgebraProviderTests.cs │ │ │ └── Single │ │ │ │ └── LinearAlgebraProviderTests.cs │ │ └── SparseSolver │ │ │ └── double │ │ │ └── SparseSolverProviderTests.cs │ ├── Random │ │ ├── CryptoRandomSourceTests.cs │ │ ├── Mcg31m1Tests.cs │ │ ├── Mcg59Tests.cs │ │ ├── MersenneTwisterTests.cs │ │ ├── Mrg32k3aTests.cs │ │ ├── PalfTests.cs │ │ ├── RandomExtensionTests.cs │ │ ├── RandomSerializationTests.cs │ │ ├── RandomTests.cs │ │ ├── SystemRandomSourceTests.cs │ │ ├── WH1982Tests.cs │ │ ├── WH2006Tests.cs │ │ ├── XorshiftTests.cs │ │ └── Xoshiro256StarStarTests.cs │ ├── RootFindingTests │ │ ├── BisectionTest.cs │ │ ├── BrentTest.cs │ │ ├── BroydenTest.cs │ │ ├── CubicTest.cs │ │ ├── FindRootsTest.cs │ │ ├── NewtonRaphsonTest.cs │ │ ├── RobustNewtonRaphsonTest.cs │ │ └── SecantTest.cs │ ├── SortingTests.cs │ ├── SpecialFunctionsTests │ │ ├── AiryTests.cs │ │ ├── BesselTests.cs │ │ ├── ErfTests.cs │ │ ├── ExponentialIntegralTests.cs │ │ ├── FactorialTest.cs │ │ ├── GammaTests.cs │ │ ├── HankelTests.cs │ │ ├── KelvinTests.cs │ │ ├── MarcumQTests.cs │ │ ├── MittagLefflerTests.cs │ │ ├── ModifiedBesselTests.cs │ │ ├── ModifiedStruveTests.cs │ │ └── SpecialFunctionsTests.cs │ ├── StatisticsTests │ │ ├── CorrelationTests.cs │ │ ├── DescriptiveStatisticsTests.cs │ │ ├── HistogramTests.cs │ │ ├── KernelDensityTests.cs │ │ ├── MCMCTests │ │ │ ├── HybridMCTest.cs │ │ │ ├── MCMCDiagnosticsTest.cs │ │ │ ├── MetropolisHastingsSamplerTests.cs │ │ │ ├── MetropolisSamplerTests.cs │ │ │ ├── RejectionSamplerTests.cs │ │ │ ├── UnivariateHybridMCTest.cs │ │ │ └── UnivariateSliceSamplerTests.cs │ │ ├── MovingStatisticsTests.cs │ │ ├── PercentileTests.cs │ │ ├── RunningStatisticsTests.cs │ │ ├── RunningWeightedStatisticsTests.cs │ │ ├── StatTestData.cs │ │ ├── StatisticsSerializationTests.cs │ │ ├── StatisticsTests.cs │ │ └── WeightedDescriptiveStatisticsTests.cs │ ├── TrigonometryTest.cs │ ├── UseLinearAlgebraProvider.cs │ └── WindowTest.cs ├── Numerics │ ├── AppSwitches.cs │ ├── ArrayExtensions.cs │ ├── Combinatorics.cs │ ├── Complex32.cs │ ├── ComplexExtensions.cs │ ├── Constants.cs │ ├── Control.cs │ ├── DifferIntegrate.cs │ ├── Differentiate.cs │ ├── Differentiation │ │ ├── FiniteDifferenceCoefficients.cs │ │ ├── NumericalDerivative.cs │ │ ├── NumericalHessian.cs │ │ └── NumericalJacobian.cs │ ├── Distance.cs │ ├── Distributions │ │ ├── Bernoulli.cs │ │ ├── Beta.cs │ │ ├── BetaBinomial.cs │ │ ├── BetaScaled.cs │ │ ├── Binomial.cs │ │ ├── Burr.cs │ │ ├── Categorical.cs │ │ ├── Cauchy.cs │ │ ├── Chi.cs │ │ ├── ChiSquared.cs │ │ ├── ContinuousUniform.cs │ │ ├── ConwayMaxwellPoisson.cs │ │ ├── Dirichlet.cs │ │ ├── DiscreteUniform.cs │ │ ├── Erlang.cs │ │ ├── Exponential.cs │ │ ├── FisherSnedecor.cs │ │ ├── Gamma.cs │ │ ├── Geometric.cs │ │ ├── Hypergeometric.cs │ │ ├── IContinuousDistribution.cs │ │ ├── IDiscreteDistribution.cs │ │ ├── IDistribution.cs │ │ ├── IUnivariateDistribution.cs │ │ ├── InverseGamma.cs │ │ ├── InverseGaussian.cs │ │ ├── InverseWishart.cs │ │ ├── Laplace.cs │ │ ├── LogNormal.cs │ │ ├── Logistic.cs │ │ ├── MatrixNormal.cs │ │ ├── Multinomial.cs │ │ ├── NegativeBinomial.cs │ │ ├── Normal.cs │ │ ├── NormalGamma.cs │ │ ├── Pareto.cs │ │ ├── Poisson.cs │ │ ├── Rayleigh.cs │ │ ├── SkewedGeneralizedError.cs │ │ ├── SkewedGeneralizedT.cs │ │ ├── Stable.cs │ │ ├── StudentT.cs │ │ ├── Triangular.cs │ │ ├── TruncatedPareto.cs │ │ ├── Weibull.cs │ │ ├── Wishart.cs │ │ └── Zipf.cs │ ├── Euclid.cs │ ├── ExcelFunctions.cs │ ├── Exceptions.cs │ ├── Financial │ │ ├── AbsoluteReturnMeasures.cs │ │ └── AbsoluteRiskMeasures.cs │ ├── FindMinimum.cs │ ├── FindRoots.cs │ ├── Fit.cs │ ├── Generate.cs │ ├── GlobalizationHelper.cs │ ├── GoodnessOfFit.cs │ ├── IntegralTransforms │ │ ├── Fourier.cs │ │ ├── FourierOptions.cs │ │ ├── Hartley.Naive.cs │ │ ├── Hartley.cs │ │ └── HartleyOptions.cs │ ├── Integrate.cs │ ├── Integration │ │ ├── DoubleExponentialTransformation.cs │ │ ├── GaussKronrodRule.cs │ │ ├── GaussLegendreRule.cs │ │ ├── GaussRule │ │ │ ├── GaussKronrodPoint.cs │ │ │ ├── GaussKronrodPointFactory.cs │ │ │ ├── GaussLegendrePoint.cs │ │ │ ├── GaussLegendrePointFactory.cs │ │ │ ├── GaussPoint.cs │ │ │ └── GaussPointPair.cs │ │ ├── NewtonCotesTrapeziumRule.cs │ │ └── SimpsonRule.cs │ ├── Interpolate.cs │ ├── Interpolation │ │ ├── Barycentric.cs │ │ ├── BulirschStoerRationalInterpolation.cs │ │ ├── CubicSpline.cs │ │ ├── IInterpolation.cs │ │ ├── LinearSpline.cs │ │ ├── LogLinear.cs │ │ ├── NevillePolynomialInterpolation.cs │ │ ├── QuadraticSpline.cs │ │ ├── SplineBoundaryCondition.cs │ │ ├── StepInterpolation.cs │ │ └── TransformedInterpolation.cs │ ├── LinearAlgebra │ │ ├── Builder.cs │ │ ├── Complex │ │ │ ├── DenseMatrix.cs │ │ │ ├── DenseVector.cs │ │ │ ├── DiagonalMatrix.cs │ │ │ ├── Factorization │ │ │ │ ├── Cholesky.cs │ │ │ │ ├── DenseCholesky.cs │ │ │ │ ├── DenseEvd.cs │ │ │ │ ├── DenseGramSchmidt.cs │ │ │ │ ├── DenseLU.cs │ │ │ │ ├── DenseQR.cs │ │ │ │ ├── DenseSvd.cs │ │ │ │ ├── Evd.cs │ │ │ │ ├── GramSchmidt.cs │ │ │ │ ├── LU.cs │ │ │ │ ├── QR.cs │ │ │ │ ├── Svd.cs │ │ │ │ ├── UserCholesky.cs │ │ │ │ ├── UserEvd.cs │ │ │ │ ├── UserGramSchmidt.cs │ │ │ │ ├── UserLU.cs │ │ │ │ ├── UserQR.cs │ │ │ │ └── UserSvd.cs │ │ │ ├── Matrix.cs │ │ │ ├── Solvers │ │ │ │ ├── BiCgStab.cs │ │ │ │ ├── CompositeSolver.cs │ │ │ │ ├── DiagonalPreconditioner.cs │ │ │ │ ├── GpBiCg.cs │ │ │ │ ├── ILU0Preconditioner.cs │ │ │ │ ├── ILUTPPreconditioner.cs │ │ │ │ ├── MILU0Preconditioner.cs │ │ │ │ ├── MlkBiCgStab.cs │ │ │ │ └── TFQMR.cs │ │ │ ├── SparseMatrix.cs │ │ │ ├── SparseVector.cs │ │ │ └── Vector.cs │ │ ├── Complex32 │ │ │ ├── DenseMatrix.cs │ │ │ ├── DenseVector.cs │ │ │ ├── DiagonalMatrix.cs │ │ │ ├── Factorization │ │ │ │ ├── Cholesky.cs │ │ │ │ ├── DenseCholesky.cs │ │ │ │ ├── DenseEvd.cs │ │ │ │ ├── DenseGramSchmidt.cs │ │ │ │ ├── DenseLU.cs │ │ │ │ ├── DenseQR.cs │ │ │ │ ├── DenseSvd.cs │ │ │ │ ├── Evd.cs │ │ │ │ ├── GramSchmidt.cs │ │ │ │ ├── LU.cs │ │ │ │ ├── QR.cs │ │ │ │ ├── Svd.cs │ │ │ │ ├── UserCholesky.cs │ │ │ │ ├── UserEvd.cs │ │ │ │ ├── UserGramSchmidt.cs │ │ │ │ ├── UserLU.cs │ │ │ │ ├── UserQR.cs │ │ │ │ └── UserSvd.cs │ │ │ ├── Matrix.cs │ │ │ ├── Solvers │ │ │ │ ├── BiCgStab.cs │ │ │ │ ├── CompositeSolver.cs │ │ │ │ ├── DiagonalPreconditioner.cs │ │ │ │ ├── GpBiCg.cs │ │ │ │ ├── ILU0Preconditioner.cs │ │ │ │ ├── ILUTPPreconditioner.cs │ │ │ │ ├── MILU0Preconditioner.cs │ │ │ │ ├── MlkBiCgStab.cs │ │ │ │ └── TFQMR.cs │ │ │ ├── SparseMatrix.cs │ │ │ ├── SparseVector.cs │ │ │ └── Vector.cs │ │ ├── CreateMatrix.cs │ │ ├── CreateVector.cs │ │ ├── Double │ │ │ ├── DenseMatrix.cs │ │ │ ├── DenseVector.cs │ │ │ ├── DiagonalMatrix.cs │ │ │ ├── Factorization │ │ │ │ ├── Cholesky.cs │ │ │ │ ├── DenseCholesky.cs │ │ │ │ ├── DenseEvd.cs │ │ │ │ ├── DenseGramSchmidt.cs │ │ │ │ ├── DenseLU.cs │ │ │ │ ├── DenseQR.cs │ │ │ │ ├── DenseSvd.cs │ │ │ │ ├── Evd.cs │ │ │ │ ├── GramSchmidt.cs │ │ │ │ ├── LU.cs │ │ │ │ ├── QR.cs │ │ │ │ ├── Svd.cs │ │ │ │ ├── UserCholesky.cs │ │ │ │ ├── UserEvd.cs │ │ │ │ ├── UserGramSchmidt.cs │ │ │ │ ├── UserLU.cs │ │ │ │ ├── UserQR.cs │ │ │ │ └── UserSvd.cs │ │ │ ├── Matrix.cs │ │ │ ├── Solvers │ │ │ │ ├── BiCgStab.cs │ │ │ │ ├── CompositeSolver.cs │ │ │ │ ├── DiagonalPreconditioner.cs │ │ │ │ ├── GpBiCg.cs │ │ │ │ ├── ILU0Preconditioner.cs │ │ │ │ ├── ILUTPPreconditioner.cs │ │ │ │ ├── MILU0Preconditioner.cs │ │ │ │ ├── MlkBiCgStab.cs │ │ │ │ └── TFQMR.cs │ │ │ ├── SparseMatrix.cs │ │ │ ├── SparseVector.cs │ │ │ └── Vector.cs │ │ ├── Factorization │ │ │ ├── Cholesky.cs │ │ │ ├── Evd.cs │ │ │ ├── GramSchmidt.cs │ │ │ ├── ISolver.cs │ │ │ ├── LU.cs │ │ │ ├── QR.cs │ │ │ └── Svd.cs │ │ ├── Matrix.Arithmetic.cs │ │ ├── Matrix.BCL.cs │ │ ├── Matrix.Operators.cs │ │ ├── Matrix.Solve.cs │ │ ├── Matrix.cs │ │ ├── MatrixExtensions.cs │ │ ├── Options.cs │ │ ├── Single │ │ │ ├── DenseMatrix.cs │ │ │ ├── DenseVector.cs │ │ │ ├── DiagonalMatrix.cs │ │ │ ├── Factorization │ │ │ │ ├── Cholesky.cs │ │ │ │ ├── DenseCholesky.cs │ │ │ │ ├── DenseEvd.cs │ │ │ │ ├── DenseGramSchmidt.cs │ │ │ │ ├── DenseLU.cs │ │ │ │ ├── DenseQR.cs │ │ │ │ ├── DenseSvd.cs │ │ │ │ ├── Evd.cs │ │ │ │ ├── GramSchmidt.cs │ │ │ │ ├── LU.cs │ │ │ │ ├── QR.cs │ │ │ │ ├── Svd.cs │ │ │ │ ├── UserCholesky.cs │ │ │ │ ├── UserEvd.cs │ │ │ │ ├── UserGramSchmidt.cs │ │ │ │ ├── UserLU.cs │ │ │ │ ├── UserQR.cs │ │ │ │ └── UserSvd.cs │ │ │ ├── Matrix.cs │ │ │ ├── Solvers │ │ │ │ ├── BiCgStab.cs │ │ │ │ ├── CompositeSolver.cs │ │ │ │ ├── DiagonalPreconditioner.cs │ │ │ │ ├── GpBiCg.cs │ │ │ │ ├── ILU0Preconditioner.cs │ │ │ │ ├── ILUTPPreconditioner.cs │ │ │ │ ├── MILU0Preconditioner.cs │ │ │ │ ├── MlkBiCgStab.cs │ │ │ │ └── TFQMR.cs │ │ │ ├── SparseMatrix.cs │ │ │ ├── SparseVector.cs │ │ │ └── Vector.cs │ │ ├── Solvers │ │ │ ├── CancellationStopCriterion.cs │ │ │ ├── DelegateStopCriterion.cs │ │ │ ├── DivergenceStopCriterion.cs │ │ │ ├── FailureStopCriterion.cs │ │ │ ├── IIterationStopCriterion.cs │ │ │ ├── IIterativeSolver.cs │ │ │ ├── IIterativeSolverSetup.cs │ │ │ ├── IPreconditioner.cs │ │ │ ├── IterationCountStopCriterion.cs │ │ │ ├── IterationStatus.cs │ │ │ ├── Iterator.cs │ │ │ ├── ResidualStopCriterion.cs │ │ │ ├── SolverSetup.cs │ │ │ └── UnitPreconditioner.cs │ │ ├── Storage │ │ │ ├── DenseColumnMajorMatrixStorage.cs │ │ │ ├── DenseVectorStorage.cs │ │ │ ├── DiagonalMatrixStorage.cs │ │ │ ├── MatrixStorage.Validation.cs │ │ │ ├── MatrixStorage.cs │ │ │ ├── SparseCompressedRowMatrixStorage.cs │ │ │ ├── SparseVectorStorage.cs │ │ │ ├── VectorStorage.Validation.cs │ │ │ └── VectorStorage.cs │ │ ├── Vector.Arithmetic.cs │ │ ├── Vector.BCL.cs │ │ ├── Vector.Operators.cs │ │ ├── Vector.cs │ │ └── VectorExtensions.cs │ ├── LinearRegression │ │ ├── MultipleRegression.cs │ │ ├── Options.cs │ │ ├── SimpleRegression.cs │ │ ├── Util.cs │ │ └── WeightedRegression.cs │ ├── Numerics.csproj │ ├── OdeSolvers │ │ ├── AdamsBashforth.cs │ │ └── RungeKutta.cs │ ├── Optimization │ │ ├── BfgsBMinimizer.cs │ │ ├── BfgsMinimizer.cs │ │ ├── BfgsMinimizerBase.cs │ │ ├── BfgsSolver.cs │ │ ├── ConjugateGradientMinimizer.cs │ │ ├── Exceptions.cs │ │ ├── ExitCondition.cs │ │ ├── GoldenSectionMinimizer.cs │ │ ├── IObjectiveFunction.cs │ │ ├── IObjectiveModel.cs │ │ ├── IUnconstrainedMinimizer.cs │ │ ├── LevenbergMarquardtMinimizer.cs │ │ ├── LimitedMemoryBfgsMinimizer.cs │ │ ├── LineSearch │ │ │ ├── LineSearchResult.cs │ │ │ ├── StrongWolfeLineSearch.cs │ │ │ ├── WeakWolfeLineSearch.cs │ │ │ └── WolfeLineSearch.cs │ │ ├── MinimizationResult.cs │ │ ├── MinimizationWithLineSearchResult.cs │ │ ├── MinimizerBase.cs │ │ ├── NelderMeadSimplex.cs │ │ ├── NewtonMinimizer.cs │ │ ├── NonlinearMinimizationResult.cs │ │ ├── NonlinearMinimizerBase.cs │ │ ├── ObjectiveFunction.cs │ │ ├── ObjectiveFunctions │ │ │ ├── ForwardDifferenceGradientObjectiveFunction.cs │ │ │ ├── GradientHessianObjectiveFunction.cs │ │ │ ├── GradientObjectiveFunction.cs │ │ │ ├── HessianObjectiveFunction.cs │ │ │ ├── LazyObjectiveFunction.cs │ │ │ ├── LazyObjectiveFunctionBase.cs │ │ │ ├── NonlinearObjectiveFunction.cs │ │ │ ├── ObjectiveFunctionBase.cs │ │ │ ├── ScalarObjectiveFunction.cs │ │ │ ├── ScalarValueObjectiveFunction.cs │ │ │ └── ValueObjectiveFunction.cs │ │ ├── QuadraticGradientProjectionSearch.cs │ │ ├── ScalarMinimizationResult.cs │ │ └── TrustRegion │ │ │ ├── ITrustRegionSubProblem.cs │ │ │ ├── Subproblems │ │ │ ├── DogLegSubproblem.cs │ │ │ ├── NewtonCGSubproblem.cs │ │ │ └── Util.cs │ │ │ ├── TrustRegionDogLegMinimizer.cs │ │ │ ├── TrustRegionMinimizerBase.cs │ │ │ ├── TrustRegionNewtonCGMinimizer.cs │ │ │ └── TrustRegionSubProblem.cs │ ├── Permutation.cs │ ├── Polynomial.cs │ ├── Precision.Comparison.cs │ ├── Precision.Equality.cs │ ├── Precision.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── Providers │ │ ├── FourierTransform │ │ │ ├── FourierTransformControl.cs │ │ │ ├── IFourierTransformProvider.cs │ │ │ ├── ManagedFourierTransformProvider.Bluestein.cs │ │ │ ├── ManagedFourierTransformProvider.Radix2.cs │ │ │ ├── ManagedFourierTransformProvider.Scaling.cs │ │ │ └── ManagedFourierTransformProvider.cs │ │ ├── IProviderCreator.cs │ │ ├── LinearAlgebra │ │ │ ├── ILinearAlgebraProvider.cs │ │ │ ├── LinearAlgebraControl.cs │ │ │ ├── ManagedLinearAlgebraProvider.Complex.cs │ │ │ ├── ManagedLinearAlgebraProvider.Complex32.cs │ │ │ ├── ManagedLinearAlgebraProvider.Double.cs │ │ │ ├── ManagedLinearAlgebraProvider.Single.cs │ │ │ └── ManagedLinearAlgebraProvider.cs │ │ ├── ProviderProbe.cs │ │ └── SparseSolver │ │ │ ├── ISparseSolverProvider.cs │ │ │ ├── ManagedSparseSolverProvider.cs │ │ │ └── SparseSolverControl.cs │ ├── Random │ │ ├── CryptoRandomSource.cs │ │ ├── Mcg31m1.cs │ │ ├── Mcg59.cs │ │ ├── MersenneTwister.cs │ │ ├── Mrg32k3a.cs │ │ ├── Palf.cs │ │ ├── RandomExtensions.cs │ │ ├── RandomSeed.cs │ │ ├── RandomSource.cs │ │ ├── SystemRandomSource.cs │ │ ├── WH1982.cs │ │ ├── WH2006.cs │ │ ├── Xorshift.cs │ │ └── Xoshiro256StarStar.cs │ ├── RootFinding │ │ ├── Bisection.cs │ │ ├── Brent.cs │ │ ├── Broyden.cs │ │ ├── Cubic.cs │ │ ├── NewtonRaphson.cs │ │ ├── RobustNewtonRaphson.cs │ │ ├── Secant.cs │ │ └── ZeroCrossingBracketing.cs │ ├── Series.cs │ ├── Settings.StyleCop │ ├── Sorting.cs │ ├── SpecialFunctions │ │ ├── Airy.cs │ │ ├── Amos │ │ │ ├── Amos.cs │ │ │ └── AmosHelper.cs │ │ ├── Bessel.cs │ │ ├── Beta.cs │ │ ├── Erf.cs │ │ ├── Evaluate.cs │ │ ├── Expm1.cs │ │ ├── ExponentialIntegral.cs │ │ ├── Factorial.cs │ │ ├── Gamma.cs │ │ ├── GeneralizedHyperGeometric.cs │ │ ├── Hankel.cs │ │ ├── Harmonic.cs │ │ ├── Kelvin.cs │ │ ├── Log1p.cs │ │ ├── Logistic.cs │ │ ├── MarcumQ.cs │ │ ├── MittagLeffler.cs │ │ ├── ModifiedBessel.cs │ │ ├── ModifiedStruve.cs │ │ ├── SphericalBessel.cs │ │ ├── Stability.cs │ │ └── TestFunctions.cs │ ├── Statistics │ │ ├── ArrayStatistics.Complex.cs │ │ ├── ArrayStatistics.Int32.cs │ │ ├── ArrayStatistics.Single.cs │ │ ├── ArrayStatistics.cs │ │ ├── Correlation.cs │ │ ├── DescriptiveStatistics.cs │ │ ├── Histogram.cs │ │ ├── KernelDensity.cs │ │ ├── MCMC │ │ │ ├── HybridMC.cs │ │ │ ├── HybridMCGeneric.cs │ │ │ ├── MCMCDiagnostics.cs │ │ │ ├── MCMCSampler.cs │ │ │ ├── MetropolisHastingsSampler.cs │ │ │ ├── MetropolisSampler.cs │ │ │ ├── RejectionSampler.cs │ │ │ ├── UnivariateHybridMC.cs │ │ │ └── UnivariateSliceSampler.cs │ │ ├── MovingStatistics.cs │ │ ├── QuantileDefinition.cs │ │ ├── RankDefinition.cs │ │ ├── RunningStatistics.cs │ │ ├── RunningWeightedStatistics.cs │ │ ├── SortedArrayStatistics.Single.cs │ │ ├── SortedArrayStatistics.cs │ │ ├── Statistics.cs │ │ ├── StreamingStatistics.cs │ │ └── WeightedDescriptiveStatistics.cs │ ├── Threading │ │ └── CommonParallel.cs │ ├── Trigonometry.cs │ └── Window.cs ├── Providers.CUDA │ ├── ArrayExtensions.cs │ ├── CudaControl.cs │ ├── CudaProvider.cs │ ├── CudaProviderCapabilities.cs │ ├── LinearAlgebra │ │ ├── CudaLinearAlgebraControl.cs │ │ ├── CudaLinearAlgebraProvider.Complex.cs │ │ ├── CudaLinearAlgebraProvider.Complex32.cs │ │ ├── CudaLinearAlgebraProvider.Double.cs │ │ ├── CudaLinearAlgebraProvider.Single.cs │ │ └── CudaLinearAlgebraProvider.cs │ ├── Providers.CUDA.csproj │ └── SafeNativeMethods.cs ├── Providers.MKL │ ├── ArrayExtensions.cs │ ├── FourierTransform │ │ ├── MklFourierTransformControl.cs │ │ └── MklFourierTransformProvider.cs │ ├── LinearAlgebra │ │ ├── MklLinearAlgebraControl.cs │ │ ├── MklLinearAlgebraProvider.Complex.cs │ │ ├── MklLinearAlgebraProvider.Complex32.cs │ │ ├── MklLinearAlgebraProvider.Double.cs │ │ ├── MklLinearAlgebraProvider.Single.cs │ │ └── MklLinearAlgebraProvider.cs │ ├── MklControl.cs │ ├── MklProvider.cs │ ├── MklProviderCapabilities.cs │ ├── MklProviderPrecision.cs │ ├── NativeProviderLoader.cs │ ├── Providers.MKL.csproj │ ├── SafeNativeMethods.cs │ └── SparseSolver │ │ ├── MklSparseSolverControl.cs │ │ ├── MklSparseSolverProvider.Complex.cs │ │ ├── MklSparseSolverProvider.Complex32.cs │ │ ├── MklSparseSolverProvider.Double.cs │ │ ├── MklSparseSolverProvider.Single.cs │ │ └── MklSparseSolverProvider.cs ├── Providers.OpenBLAS │ ├── ArrayExtensions.cs │ ├── LinearAlgebra │ │ ├── OpenBlasLinearAlgebraControl.cs │ │ ├── OpenBlasLinearAlgebraProvider.Complex.cs │ │ ├── OpenBlasLinearAlgebraProvider.Complex32.cs │ │ ├── OpenBlasLinearAlgebraProvider.Double.cs │ │ ├── OpenBlasLinearAlgebraProvider.Single.cs │ │ └── OpenBlasLinearAlgebraProvider.cs │ ├── OpenBlasControl.cs │ ├── OpenBlasProvider.cs │ ├── OpenBlasProviderCapabilities.cs │ ├── Providers.OpenBLAS.csproj │ └── SafeNativeMethods.cs └── TestData │ ├── Data.cs │ ├── Properties │ └── AssemblyInfo.cs │ └── TestData.csproj ├── tools └── docu │ ├── Spark.dll │ ├── docu.exe │ ├── docu.exe.config │ └── templates │ ├── !namespace │ ├── !type.htm.spark │ ├── _comment.spark │ ├── _events.spark │ ├── _example.spark │ ├── _fields.spark │ ├── _methods.spark │ ├── _namespaces.spark │ ├── _properties.spark │ ├── _remarks.spark │ ├── _types.spark │ ├── _value.spark │ └── index.htm.spark │ ├── _footer.spark │ ├── _namespaces.spark │ ├── _types.spark │ ├── index.htm.spark │ ├── js │ ├── example.js │ ├── jquery-1.3.2.min.js │ ├── jquery.scrollTo-min.js │ └── navigation.js │ └── main.css └── vagrant-bootstrap.sh /.config/dotnet-tools.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1, 3 | "isRoot": true, 4 | "tools": { 5 | "paket": { 6 | "version": "8.0.3", 7 | "commands": [ 8 | "paket" 9 | ] 10 | }, 11 | "fsharp.formatting.commandtool": { 12 | "version": "11.5.1", 13 | "commands": [ 14 | "fsdocs" 15 | ] 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | 3 | *.cs text diff=csharp 4 | *.msbuild text 5 | *.config text 6 | *.conf text 7 | *.cscfg text 8 | *.csdef text 9 | *.xml text 10 | *.js text 11 | *.ps1 text 12 | 13 | *.DotSettings text eol=lf 14 | *.sh text eol=lf 15 | 16 | *.csproj text merge=union 17 | *.fsproj text merge=union 18 | *.sln text eol=crlf merge=union 19 | 20 | *.jpg binary 21 | *.png binary 22 | *.gif binary 23 | 24 | *.doc diff=astextplain 25 | *.DOC diff=astextplain 26 | *.docx diff=astextplain 27 | *.DOCX diff=astextplain 28 | *.pdf diff=astextplain 29 | *.PDF diff=astextplain 30 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "nuget" # See documentation for possible values 4 | directory: "/" # Location of package manifests 5 | schedule: 6 | interval: "weekly" 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Build Directories 2 | bin/ 3 | obj/ 4 | out/ 5 | output/ 6 | tmp/ 7 | 8 | # User-specific Files 9 | *.user 10 | *.suo 11 | *.sln.docstates 12 | *.userprefs 13 | .vagrant 14 | .vs 15 | .vscode 16 | .idea 17 | .ionide 18 | 19 | # Test & Analysis Results 20 | [Tt]est[Rr]esult*/ 21 | [Bb]uild[Ll]og.* 22 | *.VisualState.xml 23 | TestResult.xml 24 | TestResults.xml 25 | coverage.* 26 | BenchmarkDotNet.Artifacts 27 | *.dotCover 28 | *.psess 29 | *.vsp 30 | *.vspx 31 | *.lnt 32 | *.svclog 33 | *.log 34 | 35 | # Caches 36 | _ReSharper* 37 | _TeamCity* 38 | *.[Rr]e[Ss]harper 39 | *.ide/ 40 | *.[Cc]ache 41 | *.ncb 42 | *.sdf 43 | *.aps 44 | *.opensdf 45 | *.opendb 46 | *.cachefile 47 | *.swp 48 | 49 | # Upgrades 50 | _UpgradeReport_Files/ 51 | Backup*/ 52 | UpgradeLog*.XML 53 | UpgradeLog*.htm 54 | *.bak 55 | *.orig 56 | 57 | # OS 58 | $RECYCLE.BIN/ 59 | .DS_Store 60 | Thumbs.db 61 | ehthumbs.db 62 | Desktop.ini 63 | 64 | 65 | packages/* 66 | !packages/.gitattributes 67 | !packages/TaskParallelLibrary 68 | !packages/FSharp.Core 69 | packages 70 | paket-files 71 | .fake 72 | .fsdocs 73 | /build.fsx.lock 74 | docs/License.md 75 | docs/License-*.md 76 | docs/Contributing.md 77 | docs/Contributors.md 78 | docs/ReleaseNotes.md 79 | docs/ReleaseNotes-*.md 80 | -------------------------------------------------------------------------------- /.mailmap: -------------------------------------------------------------------------------- 1 | Alexander Täschner 2 | Anders Gustafsson 3 | Andriy Bratiychuk 4 | Gauthier Segay 5 | manyue 6 | manyue 7 | Paul Varkey 8 | Phil Cleveland 9 | Thomas Ibel 10 | grovesNL 11 | Ioannis Kaliakatsos 12 | Jong Hyun Kim 13 | Erik Ovegård 14 | Erik Ovegård 15 | Florian Wechsung 16 | -------------------------------------------------------------------------------- /Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | Math.NET Project 4 | Math.NET Numerics 5 | Christoph Ruegg, Marcus Cuda, Jurgen Van Gael 6 | Copyright Math.NET Project 7 | false 8 | MIT 9 | https://numerics.mathdotnet.com/ 10 | icon.png 11 | https://github.com/mathnet/mathnet-numerics 12 | git 13 | en 14 | Release 15 | False 16 | 17 | 18 | true 19 | true 20 | disable 21 | True 22 | 5.0 23 | 24 | 25 | true 26 | $(MSBuildThisFileDirectory)build/MathNet.Numerics.snk 27 | false 28 | .Signed 29 | - Strong Name Edition 30 | This package contains strong-named assemblies for legacy use cases (not recommended). 31 | STRONGNAME 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2002-2022 Math.NET 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /NuGet.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /RELEASENOTES-CUDA.md: -------------------------------------------------------------------------------- 1 | ### 0.1.0-alpha - TBA 2 | * With Nvidia CUDA 7.0.28 3 | * Initial version 4 | -------------------------------------------------------------------------------- /RELEASENOTES-Data.md: -------------------------------------------------------------------------------- 1 | ### 4.1.0 - 2020-12-30 2 | * Support for Math.NET Numerics v4.12 3 | * Resources inlined *~Philipp Huber* 4 | 5 | ### 4.0.0 - 2018-02-14 6 | * Support for Math.NET Numerics v4 7 | * In addition to .NET 4.0 and newer now also targets .NET Standard 1.3 and 2.0. 8 | 9 | ### 4.0.0-beta01 - 2018-02-04 10 | * Support for Math.NET Numerics v4 11 | * In addition to .NET 4.0 and newer now also targets .NET Standard 1.3 and 2.0. 12 | 13 | ### 3.2.1 - 2017-04-29 14 | * BUG: to prevent corrupt files, writers now overwrite files if they exists already 15 | 16 | ### 3.2.0 - 2016-04-11 17 | * Text: reduce memory usage of parsing *~liuzh* 18 | 19 | ### 3.1.1 - 2015-07-13 20 | * MatrixMarket: fix MatrixMarketWriter.WriteVector 21 | 22 | ### 3.1.0 - 2015-01-11 23 | * Text: support for missing values in delimited reader *~Marcus Cuda* 24 | 25 | ### 3.0.0 - 2014-07-23 26 | * Requires at least Math.NET Numerics v3.0.0 27 | * Text: static-only DelimitedReader/Writer api 28 | * Matlab: static/stateless writer api design, consistent with reader 29 | * Matlab: much more efficient reading/writing of sparse data *~Christian Woltering* 30 | * Matlab: intermediate MatlabMatrix objects to support mixed-type matrices 31 | 32 | ### 3.0.0-beta02 - 2014-06-15 33 | * Matlab: MATLAB Reader now static and stateless; easier to use 34 | * Text: MatrixMarket: Compression enum instead of boolean flag 35 | * Require Math.NET Numerics v3.0.0-beta03 (fixes build-version issue) 36 | 37 | ### 3.0.0-beta01 - 2014-04-23 38 | * First v3 beta release 39 | -------------------------------------------------------------------------------- /RELEASENOTES-MKL.md: -------------------------------------------------------------------------------- 1 | ### 3.0.0 - 2022-02-19 2 | * New binary names and package structure with runtime folders 3 | * With Intel oneAPI 2022 4 | * Note that MathNet.Numerics.Providers.MKL.dll is required for this to work with Numerics v5 5 | 6 | ### 3.0.0-beta3 - 2022-02-19 7 | * Fix typo in the binary file name 8 | 9 | ### 3.0.0-beta2 - 2021-12-29 10 | * New binary names and package structure with runtime folders 11 | 12 | ### 2.6.0-beta3 - 2021-12-19 13 | * Experimental build with runtime folders for sdk projects 14 | 15 | ### 2.6.0-beta2 - 2021-12-09 16 | * r15 with Intel oneAPI 2021.4, preview for Numerics v5 with MathNet.Numerics.Pro 17 | * Note that MathNet.Numerics.Providers.MKL.dll is required for this to work with Numerics v5 18 | 19 | ### 2.5.0 - 2021-01-01 20 | * r14 with Intel MKL 2020 Update 4 21 | * MKL Direct Sparse Solver provider *~Jong Hyun Kim* 22 | 23 | ### 2.4.0 - 2020-05-22 24 | * r13 with Intel MKL 2020.0 Update 1 25 | 26 | ### 2.3.0 - 2018-02-14 27 | * r12 with Intel MKL 2018.0 Update 1 28 | 29 | ### 2.2.0 - 2016-10-30 30 | * r11 with Intel MKL 2017.0 31 | * Vector Functions v0.1: vector power 32 | * Fourier Transforms v1.0: basic FFT support 33 | 34 | ### 2.1.0 - 2016-09-08 35 | * r10 with Intel MKL 2017.0 36 | 37 | ### 2.0.0 - 2015-09-26 38 | * r9 with Intel MKL 11.3 39 | * Linear Algebra v2.0: automatic work array/buffer handling (breaking change) 40 | 41 | ### 1.8.0 - 2015-05-09 42 | * r8 with Intel MKL 11.2 Update 3 43 | * New combined NuGet package including both 32 and 64 bit builds and a proper build target (Win only) 44 | 45 | ### 1.7.0 - 2014-12-31 46 | * r7 with Intel MKL 11.2 Update 1 47 | * memory functions *~Marcus Cuda* 48 | 49 | ### 1.6.0 - 2014-06-21 50 | * r6 with Intel MKL 11.1 Update 3 51 | * capability to control max number of threads 52 | 53 | ### 1.5.0 - 2014-06-15 54 | * With Intel MKL 11.1 Update 3 55 | 56 | ### 1.4.0 - 2014-03-01 57 | * With Intel MKL 11.1 Update 2 58 | * Capability querying support 59 | -------------------------------------------------------------------------------- /RELEASENOTES-OpenBLAS.md: -------------------------------------------------------------------------------- 1 | ### 0.3.0-beta1 - 2022-02-21 2 | * New binary names and package structure with runtime folders 3 | 4 | ### 0.2.0 - 2015-09-26 5 | * Initial version 6 | -------------------------------------------------------------------------------- /Vagrantfile: -------------------------------------------------------------------------------- 1 | # -*- mode: ruby -*- 2 | # vi: set ft=ruby : 3 | 4 | VAGRANTFILE_API_VERSION = "2" 5 | 6 | Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| 7 | 8 | config.vm.box = "ubuntu/trusty64" 9 | config.vm.provision :shell, :path => "vagrant-bootstrap.sh" 10 | 11 | # config.ssh.forward_agent = true 12 | # config.vm.synced_folder "../data", "/vagrant_data" 13 | 14 | config.vm.provider "virtualbox" do |v| 15 | v.gui = false 16 | v.memory = 4096 17 | v.cpus = 4 18 | # v.customize ["modifyvm", :id, "--cpuexecutioncap", "75"] 19 | end 20 | 21 | end 22 | -------------------------------------------------------------------------------- /appveyor.yml: -------------------------------------------------------------------------------- 1 | image: Visual Studio 2022 2 | init: 3 | - git config --global core.autocrlf true 4 | install: 5 | # Download .NET Core SDK 6.0.100 and add to PATH 6 | - ps: $urlCurrent = "https://dotnetcli.azureedge.net/dotnet/Sdk/8.0.100/dotnet-sdk-8.0.100-win-x64.zip" 7 | - ps: $env:DOTNET_INSTALL_DIR = "$pwd\.dotnetsdk" 8 | - ps: mkdir $env:DOTNET_INSTALL_DIR -Force | Out-Null 9 | - ps: $tempFileCurrent = [System.IO.Path]::GetTempFileName() 10 | - ps: (New-Object System.Net.WebClient).DownloadFile($urlCurrent, $tempFileCurrent) 11 | - ps: Add-Type -AssemblyName System.IO.Compression.FileSystem; [System.IO.Compression.ZipFile]::ExtractToDirectory($tempFileCurrent, $env:DOTNET_INSTALL_DIR) 12 | - ps: $env:Path = "$env:DOTNET_INSTALL_DIR;$env:Path" 13 | build_script: 14 | - build.cmd Test quick 15 | test: off 16 | deploy: off 17 | shallow_clone: true 18 | clone_depth: 1 19 | environment: 20 | DOTNET_CLI_TELEMETRY_OPTOUT: 1 21 | DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true 22 | -------------------------------------------------------------------------------- /build.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | cls 3 | 4 | dotnet tool restore 5 | dotnet paket restore 6 | 7 | if errorlevel 1 ( 8 | exit /b %errorlevel% 9 | ) 10 | 11 | dotnet run --project ./build/build.fsproj -- -t %* 12 | -------------------------------------------------------------------------------- /build.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -eu 4 | set -o pipefail 5 | 6 | cd "$(dirname "$0")" 7 | 8 | dotnet tool restore 9 | dotnet paket restore 10 | FAKE_DETAILED_ERRORS=true dotnet run --project ./build/build.fsproj -- -t "$@" 11 | -------------------------------------------------------------------------------- /build/.gitignore: -------------------------------------------------------------------------------- 1 | StyleCopViolations.xml 2 | Help 3 | doc 4 | coverage.* 5 | NCoverReport 6 | bin 7 | Release -------------------------------------------------------------------------------- /build/Building.fs: -------------------------------------------------------------------------------- 1 | module Building 2 | 3 | open FSharp.Core 4 | open Fake.Core 5 | open Fake.DotNet 6 | open Fake.DotNet.DotNet.Options 7 | open Fake.IO.FileSystemOperators 8 | 9 | open Model 10 | 11 | let inline private minimal p = withVerbosity (Some DotNet.Verbosity.Minimal) p 12 | let inline private buildOptions args (p:DotNet.BuildOptions) = { p with NoRestore = true; MSBuildParams = args } 13 | let inline private packOptions args (p:DotNet.PackOptions) = { p with NoRestore = true; MSBuildParams = args } 14 | 15 | let private normal = { MSBuild.CliArguments.Create() with NodeReuse = false; Properties = [ ("StrongName", "False") ] } 16 | let private strongNamed = { MSBuild.CliArguments.Create() with NodeReuse = false; Properties = [ ("StrongName", "True") ] } 17 | 18 | let restore (solution:Solution) = DotNet.restore minimal solution.SolutionFile 19 | 20 | let build (solution:Solution) = DotNet.build (minimal >> buildOptions normal) solution.SolutionFile 21 | let buildStrongNamed (solution:Solution) = DotNet.build (minimal >> buildOptions strongNamed) solution.SolutionFile 22 | 23 | let pack (solution:Solution) = DotNet.pack (minimal >> packOptions normal) solution.SolutionFile 24 | let packStrongNamed (solution:Solution) = DotNet.pack (minimal >> packOptions strongNamed) solution.SolutionFile 25 | 26 | let buildVS2022x86 config isIncremental subject = 27 | MSBuild.run 28 | (fun p -> {p with ToolPath = Environment.environVar "VS2022INSTALLDIR" @"MSBuild\Current\Bin\MSBuild.exe"}) 29 | "" 30 | (if isIncremental then "Build" else "Rebuild") 31 | [("Configuration", config); ("Platform","Win32")] 32 | subject 33 | |> ignore 34 | let buildVS2022x64 config isIncremental subject = 35 | MSBuild.run 36 | (fun p -> {p with ToolPath = Environment.environVar "VS2022INSTALLDIR" @"MSBuild\Current\Bin\MSBuild.exe"}) 37 | "" 38 | (if isIncremental then "Build" else "Rebuild") 39 | [("Configuration", config); ("Platform","x64")] 40 | subject 41 | |> ignore 42 | -------------------------------------------------------------------------------- /build/Documentation.fs: -------------------------------------------------------------------------------- 1 | module Documentation 2 | 3 | open FSharp.Core 4 | open Fake.Core 5 | open Fake.DotNet 6 | open Fake.IO 7 | open Fake.IO.FileSystemOperators 8 | open System 9 | 10 | open Model 11 | 12 | let provideDocExtraFiles extraDocs (releases:Release list) = 13 | for (fileName, docName) in extraDocs do Shell.copyFile ("docs" docName) fileName 14 | let menu = releases |> List.map (fun r -> sprintf "[%s](%s)" r.Title (r.ReleaseNotesFile |> String.replace "RELEASENOTES" "ReleaseNotes" |> String.replace ".md" ".html")) |> String.concat " | " 15 | for release in releases do 16 | String.concat Environment.NewLine 17 | [ "# " + release.Title + " Release Notes" 18 | menu 19 | "" 20 | File.readAsString release.ReleaseNotesFile ] 21 | |> File.replaceContent ("docs" (release.ReleaseNotesFile |> String.replace "RELEASENOTES" "ReleaseNotes")) 22 | 23 | let private dotnet command = DotNet.exec id command "" |> ignore 24 | let buildDocs outputDir = dotnet (sprintf """fsdocs build --ignoreprojects --noapidocs --output %s --parameters root "https://numerics.mathdotnet.com/" fsdocs-authors "Christoph Ruegg, Marcus Cuda, Jurgen Van Gael" fsdocs-logo-src "/logo.png" """ outputDir) 25 | let watchDocs outputDir = dotnet (sprintf """fsdocs watch --ignoreprojects --noapidocs --output %s --parameters root "https://numerics.mathdotnet.com/" fsdocs-authors "Christoph Ruegg, Marcus Cuda, Jurgen Van Gael" fsdocs-logo-src "/logo.png" """ outputDir) 26 | -------------------------------------------------------------------------------- /build/MathNet.Numerics.Data.Matlab.nuspec: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | MathNet.Numerics.Data.Matlab 5 | 4.0.0 6 | Math.NET Numerics - MATLAB Data I/O Extensions 7 | Christoph Ruegg, Marcus Cuda 8 | Christoph Ruegg, Marcus Cuda 9 | false 10 | https://numerics.mathdotnet.com/License.html 11 | https://numerics.mathdotnet.com/ 12 | https://www.mathdotnet.com/images/MathNet128.png 13 | MathWorks MATLAB Data Input/Output Extensions for Math.NET Numerics, the numerical foundation of the Math.NET project, aiming to provide methods and algorithms for numerical computations in science, engineering and every day use. 14 | Support for Math.NET Numerics v4 15 | In addition to .Net 4.0 and newer now also targets .Net Standard 1.3 and 2.0. 16 | Copyright Math.NET Project 17 | math numeric data matlab 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /build/MathNet.Numerics.Data.Text.nuspec: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | MathNet.Numerics.Data.Text 5 | 4.0.0 6 | Math.NET Numerics - Text Data I/O Extensions 7 | Christoph Ruegg, Marcus Cuda 8 | Christoph Ruegg, Marcus Cuda 9 | false 10 | https://numerics.mathdotnet.com/License.html 11 | https://numerics.mathdotnet.com/ 12 | https://www.mathdotnet.com/images/MathNet128.png 13 | Text Data Input/Output Extensions for Math.NET Numerics, the numerical foundation of the Math.NET project, aiming to provide methods and algorithms for numerical computations in science, engineering and every day use. 14 | Support for Math.NET Numerics v4 15 | In addition to .Net 4.0 and newer now also targets .Net Standard 1.3 and 2.0. 16 | Copyright Math.NET Project 17 | math numeric data text csv tsv json xml 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /build/MathNet.Numerics.Extension.nuspec: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | @project@ 5 | @build.number@ 6 | @title@ 7 | @summary@ 8 | @description@ 9 | @authors@ 10 | https://numerics.mathdotnet.com/ 11 | https://www.mathdotnet.com/images/MathNet128.png 12 | https://numerics.mathdotnet.com/License.html 13 | false 14 | @tags@ 15 | @releaseNotes@ 16 | @dependencies@ 17 | 18 | @files@ 19 | 20 | -------------------------------------------------------------------------------- /build/MathNet.Numerics.snk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathnet/mathnet-numerics/84e9432bc1e8a6b2ae7acd32cda4175abeaeaed1/build/MathNet.Numerics.snk -------------------------------------------------------------------------------- /build/NativeProvider.targets: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | runtimes/%(RecursiveDir)%(FileName)%(Extension) 13 | PreserveNewest 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /build/Testing.fs: -------------------------------------------------------------------------------- 1 | module Testing 2 | 3 | open FSharp.Core 4 | open Fake.Core 5 | open Fake.DotNet 6 | //open Fake.DotNet.DotNet.Options 7 | 8 | let test testsDir testsProj framework = 9 | //DotNet.test (withWorkingDirectory testsDir >> (fun o -> { o with Framework = Some framework; NoRestore = true; NoBuild = true; Configuration = DotNet.BuildConfiguration.Release })) testsProj 10 | let result = 11 | DotNet.exec 12 | (fun c -> { c with WorkingDirectory = testsDir }) 13 | (sprintf "run --project %s --configuration Release --framework %s --no-restore --no-build" testsProj framework) 14 | "" 15 | if not result.OK then failwithf "Tests Failed: %A" result 16 | 17 | -------------------------------------------------------------------------------- /build/_._: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathnet/mathnet-numerics/84e9432bc1e8a6b2ae7acd32cda4175abeaeaed1/build/_._ -------------------------------------------------------------------------------- /build/build.fsproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net8.0 6 | 3390;$(WarnOn) 7 | false 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /build/build.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.1.32210.238 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "build", "build.fsproj", "{F4109BC0-BEF8-4BD3-B828-B40A25D08F42}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {F4109BC0-BEF8-4BD3-B828-B40A25D08F42}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {F4109BC0-BEF8-4BD3-B828-B40A25D08F42}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {F4109BC0-BEF8-4BD3-B828-B40A25D08F42}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {F4109BC0-BEF8-4BD3-B828-B40A25D08F42}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {0A21EDE9-321C-4AB2-B8DC-FF61A8D01D0A} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /build/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathnet/mathnet-numerics/84e9432bc1e8a6b2ae7acd32cda4175abeaeaed1/build/icon.png -------------------------------------------------------------------------------- /data/Github-Cureos-1.csv: -------------------------------------------------------------------------------- 1 | 0.001,3719,-6.907755279,8.221210094 2 | 0.00103542,3393,-6.872948137,8.129469765 3 | 0.0010721,3094,-6.838135937,8.037220031 4 | 0.0010721,3100,-6.838135937,8.03915739 5 | 0.0015,1251,-6.502290171,7.13169851 6 | 0.002,559.4,-6.214608098,6.326864781 7 | 0.0021455,458.1,-6.144382654,6.127087501 8 | 0.0021455,462.6,-6.144382654,6.13686275 9 | 0.00230297,377.6,-6.073555685,5.933835434 10 | 0.002472,308.5,-6.002727739,5.731721843 11 | 0.002472,314,-6.002727739,5.749392986 12 | 0.0026414,259.7,-5.936446199,5.559527119 13 | 0.0028224,214.5,-5.870167692,5.368309738 14 | 0.0028224,216,-5.870167692,5.375278408 15 | 0.003,181.2,-5.80914299,5.199601394 16 | 0.0036074,105.7,-5.624767988,4.660604893 17 | 0.0036074,110,-5.624767988,4.700480366 18 | 0.004,81.27,-5.521460918,4.397776945 19 | 0.005,42.06,-5.298317367,3.73909717 20 | 0.006,24.46,-5.11599581,3.19703913 21 | 0.008,10.37,-4.828313737,2.338917022 22 | 0.01,5.356,-4.605170186,1.678217428 23 | 0.015,1.693,-4.199705078,0.526502103 24 | 0.02,0.8205,-3.912023005,-0.197841368 25 | 0.03,0.3783,-3.506557897,-0.972067747 26 | 0.04,0.2685,-3.218875825,-1.314904365 27 | 0.05,0.2262,-2.995732274,-1.486335715 28 | 0.06,0.2048,-2.813410717,-1.585721386 29 | 0.08,0.1823,-2.525728644,-1.702101597 30 | 0.1,0.1693,-2.302585093,-1.77608299 31 | 0.15,0.1492,-1.897119985,-1.902467591 32 | 0.2,0.1358,-1.609437912,-1.996572064 33 | 0.3,0.1176,-1.203972804,-2.140466244 34 | 0.4,0.1052,-0.916290732,-2.251891979 35 | 0.5,0.09598,-0.693147181,-2.343615443 36 | 0.6,0.08874,-0.510825624,-2.422044533 37 | 0.8,0.07793,-0.223143551,-2.551944291 38 | 1,0.07007,0,-2.658260537 39 | 1.25,0.06265,0.223143551,-2.770191598 40 | 1.5,0.05701,0.405465108,-2.864528588 41 | 2,0.04896,0.693147181,-3.016751641 42 | 3,0.03931,1.098612289,-3.23627634 43 | 4,0.03369,1.386294361,-3.390554222 44 | 5,0.03,1.609437912,-3.506557897 45 | 6,0.02741,1.791759469,-3.596847369 46 | 8,0.02401,2.079441542,-3.729284869 47 | 10,0.02192,2.302585093,-3.820355817 48 | 15,0.01915,2.708050201,-3.955452563 49 | 20,0.01786,2.995732274,-4.025191704 50 | -------------------------------------------------------------------------------- /data/Matlab/A.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathnet/mathnet-numerics/84e9432bc1e8a6b2ae7acd32cda4175abeaeaed1/data/Matlab/A.mat -------------------------------------------------------------------------------- /data/Matlab/cell-array-nested.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathnet/mathnet-numerics/84e9432bc1e8a6b2ae7acd32cda4175abeaeaed1/data/Matlab/cell-array-nested.mat -------------------------------------------------------------------------------- /data/Matlab/collection-nocompress.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathnet/mathnet-numerics/84e9432bc1e8a6b2ae7acd32cda4175abeaeaed1/data/Matlab/collection-nocompress.mat -------------------------------------------------------------------------------- /data/Matlab/collection.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathnet/mathnet-numerics/84e9432bc1e8a6b2ae7acd32cda4175abeaeaed1/data/Matlab/collection.mat -------------------------------------------------------------------------------- /data/Matlab/complex.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathnet/mathnet-numerics/84e9432bc1e8a6b2ae7acd32cda4175abeaeaed1/data/Matlab/complex.mat -------------------------------------------------------------------------------- /data/Matlab/matrices.txt: -------------------------------------------------------------------------------- 1 | sparse.mat contains: 2 | * a sparse matrix S 3 | * a sparse vector v 4 | 5 | v.mat contains: 6 | * a vector v 7 | 8 | collection.mat contains: 9 | * a matrix A 10 | * a scalar t 11 | * a vector v 12 | * a vector w 13 | 14 | A.mat contains: 15 | * a matrix A 16 | 17 | complex.mat contains: 18 | * dense, complex matrix a 19 | * dense, complex matrix b 20 | * dense, complex matrix c 21 | 22 | sparse_complex.mat contains: 23 | * sparse, complex matrix sa 24 | * sparse, complex matrix sb 25 | * sparse, complex matrix sc 26 | -------------------------------------------------------------------------------- /data/Matlab/sparse-large.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathnet/mathnet-numerics/84e9432bc1e8a6b2ae7acd32cda4175abeaeaed1/data/Matlab/sparse-large.mat -------------------------------------------------------------------------------- /data/Matlab/sparse-small.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathnet/mathnet-numerics/84e9432bc1e8a6b2ae7acd32cda4175abeaeaed1/data/Matlab/sparse-small.mat -------------------------------------------------------------------------------- /data/Matlab/sparse_complex.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathnet/mathnet-numerics/84e9432bc1e8a6b2ae7acd32cda4175abeaeaed1/data/Matlab/sparse_complex.mat -------------------------------------------------------------------------------- /data/Matlab/struct-nested.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathnet/mathnet-numerics/84e9432bc1e8a6b2ae7acd32cda4175abeaeaed1/data/Matlab/struct-nested.mat -------------------------------------------------------------------------------- /data/Matlab/v.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathnet/mathnet-numerics/84e9432bc1e8a6b2ae7acd32cda4175abeaeaed1/data/Matlab/v.mat -------------------------------------------------------------------------------- /data/MatrixMarket/can24_pattern_symmetric_coordinate_24.mtx: -------------------------------------------------------------------------------- 1 | %%MatrixMarket matrix coordinate pattern symmetric 2 | 24 24 92 3 | 1 1 4 | 6 1 5 | 7 1 6 | 13 1 7 | 14 1 8 | 18 1 9 | 19 1 10 | 20 1 11 | 22 1 12 | 2 2 13 | 9 2 14 | 10 2 15 | 14 2 16 | 15 2 17 | 18 2 18 | 3 3 19 | 7 3 20 | 12 3 21 | 21 3 22 | 22 3 23 | 23 3 24 | 4 4 25 | 8 4 26 | 11 4 27 | 16 4 28 | 19 4 29 | 20 4 30 | 5 5 31 | 8 5 32 | 10 5 33 | 15 5 34 | 16 5 35 | 17 5 36 | 6 6 37 | 7 6 38 | 13 6 39 | 14 6 40 | 18 6 41 | 7 7 42 | 12 7 43 | 13 7 44 | 20 7 45 | 22 7 46 | 24 7 47 | 8 8 48 | 10 8 49 | 15 8 50 | 16 8 51 | 17 8 52 | 18 8 53 | 19 8 54 | 9 9 55 | 10 9 56 | 15 9 57 | 10 10 58 | 14 10 59 | 15 10 60 | 18 10 61 | 19 10 62 | 11 11 63 | 19 11 64 | 20 11 65 | 21 11 66 | 22 11 67 | 12 12 68 | 13 12 69 | 22 12 70 | 24 12 71 | 13 13 72 | 24 13 73 | 14 14 74 | 18 14 75 | 15 15 76 | 16 16 77 | 17 16 78 | 19 16 79 | 17 17 80 | 18 18 81 | 19 18 82 | 20 18 83 | 19 19 84 | 20 19 85 | 20 20 86 | 21 20 87 | 22 20 88 | 21 21 89 | 22 21 90 | 23 21 91 | 22 22 92 | 23 22 93 | 23 23 94 | 24 24 95 | -------------------------------------------------------------------------------- /data/MatrixMarket/hilbert_real_symmetric_array_10.mtx: -------------------------------------------------------------------------------- 1 | %%MatrixMarket matrix array real symmetric 2 | %============================================================== 3 | % The Hilbert matrix of order 10 4 | % Generated by MatrixMarketDeli @ Fri Nov 11 17:33:11 EET 2005 5 | %============================================================== 6 | 10 10 7 | 1.0000000000000E+0 8 | 5.0000000000000E-1 9 | 3.3333333333333E-1 10 | 2.5000000000000E-1 11 | 2.0000000000000E-1 12 | 1.6666666666667E-1 13 | 1.4285714285714E-1 14 | 1.2500000000000E-1 15 | 1.1111111111111E-1 16 | 1.0000000000000E-1 17 | 3.3333333333333E-1 18 | 2.5000000000000E-1 19 | 2.0000000000000E-1 20 | 1.6666666666667E-1 21 | 1.4285714285714E-1 22 | 1.2500000000000E-1 23 | 1.1111111111111E-1 24 | 1.0000000000000E-1 25 | 9.0909090909091E-2 26 | 2.0000000000000E-1 27 | 1.6666666666667E-1 28 | 1.4285714285714E-1 29 | 1.2500000000000E-1 30 | 1.1111111111111E-1 31 | 1.0000000000000E-1 32 | 9.0909090909091E-2 33 | 8.3333333333333E-2 34 | 1.4285714285714E-1 35 | 1.2500000000000E-1 36 | 1.1111111111111E-1 37 | 1.0000000000000E-1 38 | 9.0909090909091E-2 39 | 8.3333333333333E-2 40 | 7.6923076923077E-2 41 | 1.1111111111111E-1 42 | 1.0000000000000E-1 43 | 9.0909090909091E-2 44 | 8.3333333333333E-2 45 | 7.6923076923077E-2 46 | 7.1428571428571E-2 47 | 9.0909090909091E-2 48 | 8.3333333333333E-2 49 | 7.6923076923077E-2 50 | 7.1428571428571E-2 51 | 6.6666666666667E-2 52 | 7.6923076923077E-2 53 | 7.1428571428571E-2 54 | 6.6666666666667E-2 55 | 6.2500000000000E-2 56 | 6.6666666666667E-2 57 | 6.2500000000000E-2 58 | 5.8823529411765E-2 59 | 5.8823529411765E-2 60 | 5.5555555555556E-2 61 | 5.2631578947368E-2 62 | -------------------------------------------------------------------------------- /data/MatrixMarket/random_real_general_coordinate_10_20.mtx: -------------------------------------------------------------------------------- 1 | %%MatrixMarket matrix coordinate real general 2 | %============================================================== 3 | % A Random 10x20 matrix with density = 0.25, 4 | % elements from -100.0 to 100.0 5 | % The diagonal is dense 6 | % Generated by MatrixMarketDeli @ Fri Nov 11 17:22:08 EET 2005 7 | %============================================================== 8 | 10 20 50 9 | 8 15 -4.6451483491123E+1 10 | 4 4 -2.8632063827819E+1 11 | 8 14 -1.5213706867772E+1 12 | 8 13 7.4423246543243E+1 13 | 8 12 2.7887491569201E+1 14 | 8 10 1.9460224390033E+1 15 | 8 9 9.7954330827189E+1 16 | 8 8 -4.9325070065588E+0 17 | 3 17 6.1642960953491E+1 18 | 8 3 2.0660149282608E+1 19 | 7 20 1.1013106124705E+1 20 | 3 8 3.6716745726295E+1 21 | 7 18 1.4931179559131E+1 22 | 3 4 7.9316548265485E+1 23 | 3 3 -2.5725327792433E+1 24 | 2 20 9.7109701061597E+1 25 | 7 7 -4.6585107832475E+1 26 | 2 13 -9.1085433962913E+1 27 | 7 1 -9.0521046010583E+1 28 | 2 10 -7.9900350891929E+1 29 | 2 6 -8.1978958323441E+1 30 | 6 16 4.6993511999238E+1 31 | 6 13 7.1058095783918E+1 32 | 2 2 -9.6846771057381E+1 33 | 1 19 -7.3290149915957E+1 34 | 10 19 3.2691966451159E+1 35 | 6 7 -3.8227481374005E+1 36 | 6 6 6.5087993662941E+1 37 | 1 15 7.0730096280286E+1 38 | 1 14 -4.8808933591076E+1 39 | 10 14 -2.6181143470241E+1 40 | 1 10 3.0692981751248E+0 41 | 10 11 -8.2875180734905E+0 42 | 10 10 1.3860350607799E+1 43 | 5 18 6.8804480264382E+0 44 | 1 6 -1.2859773597471E+1 45 | 1 5 -7.8567448719877E+1 46 | 5 14 1.4218193449585E+1 47 | 10 4 3.1661576533386E+1 48 | 1 2 8.0480008211576E+1 49 | 1 1 -9.4637595118467E+0 50 | 5 9 -8.1226636123555E+1 51 | 5 5 -5.7484307268815E+1 52 | 5 4 -1.8133543866265E+1 53 | 5 3 7.6645343914939E+1 54 | 9 13 8.5951254130729E+1 55 | 9 9 4.7959204407134E+1 56 | 9 6 -1.7574151541303E+1 57 | 4 13 -6.4767076502567E+1 58 | 9 1 -8.0637951259290E+1 59 | -------------------------------------------------------------------------------- /data/NIST/BoxBOD.dat: -------------------------------------------------------------------------------- 1 | NIST/ITL StRD 2 | Dataset Name: BoxBOD (BoxBOD.dat) 3 | 4 | File Format: ASCII 5 | Starting Values (lines 41 to 42) 6 | Certified Values (lines 41 to 47) 7 | Data (lines 61 to 66) 8 | 9 | Procedure: Nonlinear Least Squares Regression 10 | 11 | Description: These data are described in detail in Box, Hunter and 12 | Hunter (1978). The response variable is biochemical 13 | oxygen demand (BOD) in mg/l, and the predictor 14 | variable is incubation time in days. 15 | 16 | 17 | Reference: Box, G. P., W. G. Hunter, and J. S. Hunter (1978). 18 | Statistics for Experimenters. 19 | New York, NY: Wiley, pp. 483-487. 20 | 21 | 22 | 23 | 24 | 25 | Data: 1 Response (y = biochemical oxygen demand) 26 | 1 Predictor (x = incubation time) 27 | 6 Observations 28 | Higher Level of Difficulty 29 | Observed Data 30 | 31 | Model: Exponential Class 32 | 2 Parameters (b1 and b2) 33 | 34 | y = b1*(1-exp[-b2*x]) + e 35 | 36 | 37 | 38 | Starting values Certified Values 39 | 40 | Start 1 Start 2 Parameter Standard Deviation 41 | b1 = 1 100 2.1380940889E+02 1.2354515176E+01 42 | b2 = 1 0.75 5.4723748542E-01 1.0455993237E-01 43 | 44 | Residual Sum of Squares: 1.1680088766E+03 45 | Residual Standard Deviation: 1.7088072423E+01 46 | Degrees of Freedom: 4 47 | Number of Observations: 6 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | Data: y x 61 | 109 1 62 | 149 2 63 | 149 3 64 | 191 5 65 | 213 7 66 | 224 10 67 | -------------------------------------------------------------------------------- /data/NIST/Misra1a.dat: -------------------------------------------------------------------------------- 1 | NIST/ITL StRD 2 | Dataset Name: Misra1a (Misra1a.dat) 3 | 4 | File Format: ASCII 5 | Starting Values (lines 41 to 42) 6 | Certified Values (lines 41 to 47) 7 | Data (lines 61 to 74) 8 | 9 | Procedure: Nonlinear Least Squares Regression 10 | 11 | Description: These data are the result of a NIST study regarding 12 | dental research in monomolecular adsorption. The 13 | response variable is volume, and the predictor 14 | variable is pressure. 15 | 16 | Reference: Misra, D., NIST (1978). 17 | Dental Research Monomolecular Adsorption Study. 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | Data: 1 Response Variable (y = volume) 26 | 1 Predictor Variable (x = pressure) 27 | 14 Observations 28 | Lower Level of Difficulty 29 | Observed Data 30 | 31 | Model: Exponential Class 32 | 2 Parameters (b1 and b2) 33 | 34 | y = b1*(1-exp[-b2*x]) + e 35 | 36 | 37 | 38 | Starting values Certified Values 39 | 40 | Start 1 Start 2 Parameter Standard Deviation 41 | b1 = 500 250 2.3894212918E+02 2.7070075241E+00 42 | b2 = 0.0001 0.0005 5.5015643181E-04 7.2668688436E-06 43 | 44 | Residual Sum of Squares: 1.2455138894E-01 45 | Residual Standard Deviation: 1.0187876330E-01 46 | Degrees of Freedom: 12 47 | Number of Observations: 14 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | Data: y x 61 | 10.07E0 77.6E0 62 | 14.73E0 114.9E0 63 | 17.94E0 141.1E0 64 | 23.93E0 190.8E0 65 | 29.61E0 239.9E0 66 | 35.18E0 289.0E0 67 | 40.02E0 332.8E0 68 | 44.82E0 378.4E0 69 | 50.76E0 434.8E0 70 | 55.05E0 477.3E0 71 | 61.01E0 536.8E0 72 | 66.40E0 593.1E0 73 | 75.47E0 689.1E0 74 | 81.78E0 760.0E0 75 | -------------------------------------------------------------------------------- /data/NIST/Misra1b.dat: -------------------------------------------------------------------------------- 1 | NIST/ITL StRD 2 | Dataset Name: Misra1b (Misra1b.dat) 3 | 4 | File Format: ASCII 5 | Starting Values (lines 41 to 42) 6 | Certified Values (lines 41 to 47) 7 | Data (lines 61 to 74) 8 | 9 | Procedure: Nonlinear Least Squares Regression 10 | 11 | Description: These data are the result of a NIST study regarding 12 | dental research in monomolecular adsorption. The 13 | response variable is volume, and the predictor 14 | variable is pressure. 15 | 16 | Reference: Misra, D., NIST (1978). 17 | Dental Research Monomolecular Adsorption Study. 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | Data: 1 Response (y = volume) 26 | 1 Predictor (x = pressure) 27 | 14 Observations 28 | Lower Level of Difficulty 29 | Observed Data 30 | 31 | Model: Miscellaneous Class 32 | 2 Parameters (b1 and b2) 33 | 34 | y = b1 * (1-(1+b2*x/2)**(-2)) + e 35 | 36 | 37 | 38 | Starting values Certified Values 39 | 40 | Start 1 Start 2 Parameter Standard Deviation 41 | b1 = 500 300 3.3799746163E+02 3.1643950207E+00 42 | b2 = 0.0001 0.0002 3.9039091287E-04 4.2547321834E-06 43 | 44 | Residual Sum of Squares: 7.5464681533E-02 45 | Residual Standard Deviation: 7.9301471998E-02 46 | Degrees of Freedom: 12 47 | Number of Observations: 14 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | Data: y x 61 | 10.07E0 77.6E0 62 | 14.73E0 114.9E0 63 | 17.94E0 141.1E0 64 | 23.93E0 190.8E0 65 | 29.61E0 239.9E0 66 | 35.18E0 289.0E0 67 | 40.02E0 332.8E0 68 | 44.82E0 378.4E0 69 | 50.76E0 434.8E0 70 | 55.05E0 477.3E0 71 | 61.01E0 536.8E0 72 | 66.40E0 593.1E0 73 | 75.47E0 689.1E0 74 | 81.78E0 760.0E0 75 | -------------------------------------------------------------------------------- /data/NIST/Misra1c.dat: -------------------------------------------------------------------------------- 1 | NIST/ITL StRD 2 | Dataset Name: Misra1c (Misra1c.dat) 3 | 4 | File Format: ASCII 5 | Starting Values (lines 41 to 42) 6 | Certified Values (lines 41 to 47) 7 | Data (lines 61 to 74) 8 | 9 | Procedure: Nonlinear Least Squares Regression 10 | 11 | Description: These data are the result of a NIST study regarding 12 | dental research in monomolecular adsorption. The 13 | response variable is volume, and the predictor 14 | variable is pressure. 15 | 16 | Reference: Misra, D., NIST (1978). 17 | Dental Research Monomolecular Adsorption. 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | Data: 1 Response (y = volume) 26 | 1 Predictor (x = pressure) 27 | 14 Observations 28 | Average Level of Difficulty 29 | Observed Data 30 | 31 | Model: Miscellaneous Class 32 | 2 Parameters (b1 and b2) 33 | 34 | y = b1 * (1-(1+2*b2*x)**(-.5)) + e 35 | 36 | 37 | 38 | Starting values Certified Values 39 | 40 | Start 1 Start 2 Parameter Standard Deviation 41 | b1 = 500 600 6.3642725809E+02 4.6638326572E+00 42 | b2 = 0.0001 0.0002 2.0813627256E-04 1.7728423155E-06 43 | 44 | Residual Sum of Squares: 4.0966836971E-02 45 | Residual Standard Deviation: 5.8428615257E-02 46 | Degrees of Freedom: 12 47 | Number of Observations: 14 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | Data: y x 61 | 10.07E0 77.6E0 62 | 14.73E0 114.9E0 63 | 17.94E0 141.1E0 64 | 23.93E0 190.8E0 65 | 29.61E0 239.9E0 66 | 35.18E0 289.0E0 67 | 40.02E0 332.8E0 68 | 44.82E0 378.4E0 69 | 50.76E0 434.8E0 70 | 55.05E0 477.3E0 71 | 61.01E0 536.8E0 72 | 66.40E0 593.1E0 73 | 75.47E0 689.1E0 74 | 81.78E0 760.0E0 75 | -------------------------------------------------------------------------------- /data/NIST/Misra1d.dat: -------------------------------------------------------------------------------- 1 | NIST/ITL StRD 2 | Dataset Name: Misra1d (Misra1d.dat) 3 | 4 | File Format: ASCII 5 | Starting Values (lines 41 to 42) 6 | Certified Values (lines 41 to 47) 7 | Data (lines 61 to 74) 8 | 9 | Procedure: Nonlinear Least Squares Regression 10 | 11 | Description: These data are the result of a NIST study regarding 12 | dental research in monomolecular adsorption. The 13 | response variable is volume, and the predictor 14 | variable is pressure. 15 | 16 | Reference: Misra, D., NIST (1978). 17 | Dental Research Monomolecular Adsorption Study. 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | Data: 1 Response (y = volume) 26 | 1 Predictor (x = pressure) 27 | 14 Observations 28 | Average Level of Difficulty 29 | Observed Data 30 | 31 | Model: Miscellaneous Class 32 | 2 Parameters (b1 and b2) 33 | 34 | y = b1*b2*x*((1+b2*x)**(-1)) + e 35 | 36 | 37 | 38 | Starting values Certified Values 39 | 40 | Start 1 Start 2 Parameter Standard Deviation 41 | b1 = 500 450 4.3736970754E+02 3.6489174345E+00 42 | b2 = 0.0001 0.0003 3.0227324449E-04 2.9334354479E-06 43 | 44 | Residual Sum of Squares: 5.6419295283E-02 45 | Residual Standard Deviation: 6.8568272111E-02 46 | Degrees of Freedom: 12 47 | Number of Observations: 14 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | Data: y x 61 | 10.07E0 77.6E0 62 | 14.73E0 114.9E0 63 | 17.94E0 141.1E0 64 | 23.93E0 190.8E0 65 | 29.61E0 239.9E0 66 | 35.18E0 289.0E0 67 | 40.02E0 332.8E0 68 | 44.82E0 378.4E0 69 | 50.76E0 434.8E0 70 | 55.05E0 477.3E0 71 | 61.01E0 536.8E0 72 | 66.40E0 593.1E0 73 | 75.47E0 689.1E0 74 | 81.78E0 760.0E0 75 | -------------------------------------------------------------------------------- /data/NIST/NoInt1.dat: -------------------------------------------------------------------------------- 1 | NIST/ITL StRD 2 | Dataset Name: NoInt1 (NoInt1.dat) 3 | 4 | File Format: ASCII 5 | Certified Values (lines 31 to 44) 6 | Data (lines 61 to 71) 7 | 8 | Procedure: Linear Least Squares Regression 9 | 10 | Reference: Eberhardt, K., NIST. 11 | 12 | Data: 1 Response Variable (y) 13 | 1 Predictor Variable (x) 14 | 11 Observations 15 | Average Level of Difficulty 16 | Generated Data 17 | 18 | Model: Linear Class 19 | 1 Parameter (B1) 20 | 21 | y = B1*x + e 22 | 23 | 24 | 25 | 26 | Certified Regression Statistics 27 | 28 | Standard Deviation 29 | Parameter Estimate of Estimate 30 | 31 | B1 2.07438016528926 0.165289256198347E-01 32 | 33 | Residual 34 | Standard Deviation 3.56753034006338 35 | 36 | R-Squared 0.999365492298663 37 | 38 | Certified Analysis of Variance Table 39 | 40 | Source of Degrees of Sums of Mean 41 | Variation Freedom Squares Squares F Statistic 42 | 43 | Regression 1 200457.727272727 200457.727272727 15750.2500000000 44 | Residual 10 127.272727272727 12.7272727272727 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | Data: y x 61 | 130 60 62 | 131 61 63 | 132 62 64 | 133 63 65 | 134 64 66 | 135 65 67 | 136 66 68 | 137 67 69 | 138 68 70 | 139 69 71 | 140 70 72 | -------------------------------------------------------------------------------- /data/NIST/NoInt2.dat: -------------------------------------------------------------------------------- 1 | NIST/ITL StRD 2 | Dataset Name: NoInt2 (NoInt2.dat) 3 | 4 | File Format: ASCII 5 | Certified Values (lines 31 to 45) 6 | Data (lines 61 to 63) 7 | 8 | Procedure: Linear Least Squares Regression 9 | 10 | Reference: Eberhardt, K., NIST. 11 | 12 | Data: 1 Response Variable (y) 13 | 1 Predictor Variable (x) 14 | 3 Observations 15 | Average Level of Difficulty 16 | Generated Data 17 | 18 | Model: Linear Class 19 | 1 Parameter (B1) 20 | 21 | y = B1*x + e 22 | 23 | 24 | 25 | 26 | Certified Regression Statistics 27 | 28 | Standard Deviation 29 | Parameter Estimate of Estimate 30 | 31 | B1 0.727272727272727 0.420827318078432E-01 32 | 33 | Residual 34 | Standard Deviation 0.369274472937998 35 | 36 | R-Squared 0.993348115299335 37 | 38 | 39 | Certified Analysis of Variance Table 40 | 41 | Source of Degrees of Sums of Mean 42 | Variation Freedom Squares Squares F Statistic 43 | 44 | Regression 1 40.7272727272727 40.7272727272727 298.6666666666667 45 | Residual 2 0.272727272727273 0.136363636363636 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | Data: y x 61 | 3 4 62 | 4 5 63 | 4 6 64 | -------------------------------------------------------------------------------- /data/NIST/NumAcc1.dat: -------------------------------------------------------------------------------- 1 | File Name: NumAcc1.dat 2 | 3 | 4 | Dataset Name: NumAcc1 5 | 6 | Description: This is a constructed/fabricated data set 7 | to test accuracy in summary statistic calculations. 8 | The numbers are large (8-digit integers) and 9 | differ only in the last decimal place. 10 | Note--by construction, this data set has 11 | sample mean = 10000002 (exact) 12 | sample standard deviation = 1 (exact) 13 | sample autocorrelation coef. = -0.5 (exact) 14 | 15 | Stat Category: Univariate: Summary Statistics 16 | 17 | Reference: Simon, Stephen D. and Lesage, James P. (1989). 18 | Assessing the Accuracy of ANOVA Caluclations 19 | in Statistical Software", Computational 20 | Statistics & data Analysis, 8, pp. 325-332. 21 | 22 | Data: Constructed 23 | 1 Response : y 24 | 0 Predictors 25 | 3 Observations 26 | 27 | Model: Lower Level of Difficulty 28 | 2 Parameters : mu, sigma 29 | 1 Response Variable : y 30 | 0 Predictor Variables 31 | 32 | y = mu + e 33 | 34 | 35 | 36 | Certified Values 37 | Sample Mean ybar: 10000002 38 | Sample Standard Deviation (denom. = n-1) s: 1 39 | Sample Autocorrelation Coefficient (lag 1) r(1): -0.5 40 | 41 | Number of Observations: 3 42 | 43 | 44 | Data: Y 45 | --------- 46 | 10000001 47 | 10000003 48 | 10000002 49 | -------------------------------------------------------------------------------- /data/NIST/Rat42.dat: -------------------------------------------------------------------------------- 1 | NIST/ITL StRD 2 | Dataset Name: Rat42 (Rat42.dat) 3 | 4 | File Format: ASCII 5 | Starting Values (lines 41 to 43) 6 | Certified Values (lines 41 to 48) 7 | Data (lines 61 to 69) 8 | 9 | Procedure: Nonlinear Least Squares Regression 10 | 11 | Description: This model and data are an example of fitting 12 | sigmoidal growth curves taken from Ratkowsky (1983). 13 | The response variable is pasture yield, and the 14 | predictor variable is growing time. 15 | 16 | 17 | Reference: Ratkowsky, D.A. (1983). 18 | Nonlinear Regression Modeling. 19 | New York, NY: Marcel Dekker, pp. 61 and 88. 20 | 21 | 22 | 23 | 24 | 25 | Data: 1 Response (y = pasture yield) 26 | 1 Predictor (x = growing time) 27 | 9 Observations 28 | Higher Level of Difficulty 29 | Observed Data 30 | 31 | Model: Exponential Class 32 | 3 Parameters (b1 to b3) 33 | 34 | y = b1 / (1+exp[b2-b3*x]) + e 35 | 36 | 37 | 38 | Starting Values Certified Values 39 | 40 | Start 1 Start 2 Parameter Standard Deviation 41 | b1 = 100 75 7.2462237576E+01 1.7340283401E+00 42 | b2 = 1 2.5 2.6180768402E+00 8.8295217536E-02 43 | b3 = 0.1 0.07 6.7359200066E-02 3.4465663377E-03 44 | 45 | Residual Sum of Squares: 8.0565229338E+00 46 | Residual Standard Deviation: 1.1587725499E+00 47 | Degrees of Freedom: 6 48 | Number of Observations: 9 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | Data: y x 61 | 8.930E0 9.000E0 62 | 10.800E0 14.000E0 63 | 18.590E0 21.000E0 64 | 22.330E0 28.000E0 65 | 39.350E0 42.000E0 66 | 56.110E0 57.000E0 67 | 61.730E0 63.000E0 68 | 64.620E0 70.000E0 69 | 67.080E0 79.000E0 70 | -------------------------------------------------------------------------------- /data/NIST/SiRstvt.dat: -------------------------------------------------------------------------------- 1 | NIST/ITL StRD 2 | Dataset Name: SiRstv (SiRstvt.dat) 3 | 4 | 5 | File Format: ASCII 6 | Certified Values (lines 41 to 47) 7 | Data (lines 61 to 65) 8 | 9 | 10 | Procedure: Analysis of Variance 11 | 12 | 13 | Reference: Ehrstein, James and Croarkin, M. Carroll. 14 | Unpublished NIST dataset. 15 | 16 | 17 | Data: 1 Factor 18 | 5 Treatments 19 | 5 Replicates/Cell 20 | 25 Observations 21 | 3 Constant Leading Digits 22 | Lower Level of Difficulty 23 | Observed Data 24 | 25 | 26 | Model: 6 Parameters (mu,tau_1, ... , tau_5) 27 | y_{ij} = mu + tau_i + epsilon_{ij} 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | Certified Values: 37 | 38 | Source of Sums of Mean 39 | Variation df Squares Squares F Statistic 40 | 41 | Between Instrument 4 5.11462616000000E-02 1.27865654000000E-02 1.18046237440255E+00 42 | Within Instrument 20 2.16636560000000E-01 1.08318280000000E-02 43 | 44 | Certified R-Squared 1.90999039051129E-01 45 | 46 | Certified Residual 47 | Standard Deviation 1.04076068334656E-01 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | Data: 57 | Instrument 58 | 59 | 1 2 3 4 5 60 | 61 | 196.3052 196.3042 196.1303 196.2795 196.2119 62 | 196.1240 196.3825 196.2005 196.1748 196.1051 63 | 196.1890 196.1669 196.2889 196.1494 196.1850 64 | 196.2569 196.3257 196.0343 196.1485 196.0052 65 | 196.3403 196.0422 196.1811 195.9885 196.2090 66 | -------------------------------------------------------------------------------- /docs/Compatibility.md: -------------------------------------------------------------------------------- 1 | Platform Support 2 | ================ 3 | 4 | Supported Platforms: 5 | 6 | - .NET 5.0 or higher, with builds for 5.0. 7 | - .NET Framework 4.6.1 or higher, with builds for 4.6.1 and 4.8. 8 | - .NET Standard 2.0 or higher, with builds for 2.0. 9 | - Mono (via .NET Standard) 10 | - Windows, Linux and Mac. 11 | 12 | 13 | Dependencies 14 | ------------ 15 | 16 | Package Dependencies: 17 | 18 | - .NET 5.0 and higher: None 19 | - .NET Framework 4.6.1: [System.ValueTuple](https://www.nuget.org/packages/System.ValueTuple) 20 | - .NET Framework 4.8 and higher: None 21 | - .Net Standard 2.0 and higher: None 22 | - F#: additionally [FSharp.Core](https://www.nuget.org/packages/FSharp.Core) 23 | -------------------------------------------------------------------------------- /docs/DistanceCanberra.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathnet/mathnet-numerics/84e9432bc1e8a6b2ae7acd32cda4175abeaeaed1/docs/DistanceCanberra.png -------------------------------------------------------------------------------- /docs/DistanceChebyshev.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathnet/mathnet-numerics/84e9432bc1e8a6b2ae7acd32cda4175abeaeaed1/docs/DistanceChebyshev.png -------------------------------------------------------------------------------- /docs/DistanceCosine.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathnet/mathnet-numerics/84e9432bc1e8a6b2ae7acd32cda4175abeaeaed1/docs/DistanceCosine.png -------------------------------------------------------------------------------- /docs/DistanceEuclidean.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathnet/mathnet-numerics/84e9432bc1e8a6b2ae7acd32cda4175abeaeaed1/docs/DistanceEuclidean.png -------------------------------------------------------------------------------- /docs/DistanceMAE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathnet/mathnet-numerics/84e9432bc1e8a6b2ae7acd32cda4175abeaeaed1/docs/DistanceMAE.png -------------------------------------------------------------------------------- /docs/DistanceMSE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathnet/mathnet-numerics/84e9432bc1e8a6b2ae7acd32cda4175abeaeaed1/docs/DistanceMSE.png -------------------------------------------------------------------------------- /docs/DistanceManhattan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathnet/mathnet-numerics/84e9432bc1e8a6b2ae7acd32cda4175abeaeaed1/docs/DistanceManhattan.png -------------------------------------------------------------------------------- /docs/DistanceMinkowski3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathnet/mathnet-numerics/84e9432bc1e8a6b2ae7acd32cda4175abeaeaed1/docs/DistanceMinkowski3.png -------------------------------------------------------------------------------- /docs/DistancePearson.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathnet/mathnet-numerics/84e9432bc1e8a6b2ae7acd32cda4175abeaeaed1/docs/DistancePearson.png -------------------------------------------------------------------------------- /docs/DistanceSAD.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathnet/mathnet-numerics/84e9432bc1e8a6b2ae7acd32cda4175abeaeaed1/docs/DistanceSAD.png -------------------------------------------------------------------------------- /docs/DistanceSSD.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathnet/mathnet-numerics/84e9432bc1e8a6b2ae7acd32cda4175abeaeaed1/docs/DistanceSSD.png -------------------------------------------------------------------------------- /docs/IfSharp-GenerateIS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathnet/mathnet-numerics/84e9432bc1e8a6b2ae7acd32cda4175abeaeaed1/docs/IfSharp-GenerateIS.png -------------------------------------------------------------------------------- /docs/IfSharp-MatrixVector.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathnet/mathnet-numerics/84e9432bc1e8a6b2ae7acd32cda4175abeaeaed1/docs/IfSharp-MatrixVector.png -------------------------------------------------------------------------------- /docs/content/fsdocs-custom.css: -------------------------------------------------------------------------------- 1 | .navbar-nav .nav-link { 2 | padding-top: 0.1rem; 3 | padding-bottom: 0.1rem; 4 | } 5 | 6 | #fsdocs-content li { 7 | margin: 0px 0px 10px 0px; 8 | } 9 | 10 | .masthead h3 { 11 | margin-top: 15px; 12 | margin-bottom: 5px; 13 | font-size: 130%; 14 | text-align: right; 15 | color: #999999; 16 | } 17 | -------------------------------------------------------------------------------- /docs/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathnet/mathnet-numerics/84e9432bc1e8a6b2ae7acd32cda4175abeaeaed1/docs/favicon.ico -------------------------------------------------------------------------------- /docs/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathnet/mathnet-numerics/84e9432bc1e8a6b2ae7acd32cda4175abeaeaed1/docs/logo.png -------------------------------------------------------------------------------- /examples/examples-csharp/IExample.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Math.NET Numerics, part of the Math.NET Project 3 | // http://numerics.mathdotnet.com 4 | // http://github.com/mathnet/mathnet-numerics 5 | // http://mathnetnumerics.codeplex.com 6 | // Copyright (c) 2009-2010 Math.NET 7 | // Permission is hereby granted, free of charge, to any person 8 | // obtaining a copy of this software and associated documentation 9 | // files (the "Software"), to deal in the Software without 10 | // restriction, including without limitation the rights to use, 11 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the 13 | // Software is furnished to do so, subject to the following 14 | // conditions: 15 | // The above copyright notice and this permission notice shall be 16 | // included in all copies or substantial portions of the Software. 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 19 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 21 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 22 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 23 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 24 | // OTHER DEALINGS IN THE SOFTWARE. 25 | // 26 | 27 | namespace Examples 28 | { 29 | /// 30 | /// Defines the base interface for examples. 31 | /// 32 | public interface IExample 33 | { 34 | /// 35 | /// Gets the name of this example 36 | /// 37 | string Name 38 | { 39 | get; 40 | } 41 | 42 | /// 43 | /// Gets the description of this example 44 | /// 45 | string Description 46 | { 47 | get; 48 | } 49 | 50 | /// 51 | /// Run example 52 | /// 53 | void Run(); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /examples/examples-csharp/examples-csharp.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net40;net45;net46;netstandard1.6;netstandard2.0 5 | false 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /examples/examples-csharp/examples-csharp.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27130.2026 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "examples-csharp", "examples-csharp.csproj", "{11FCA895-F757-4083-8271-2035A5709D22}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {11FCA895-F757-4083-8271-2035A5709D22}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {11FCA895-F757-4083-8271-2035A5709D22}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {11FCA895-F757-4083-8271-2035A5709D22}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {11FCA895-F757-4083-8271-2035A5709D22}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {C828D054-1CFC-4684-BA5D-FE8CEA5AECB6} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /examples/examples-fsharp/Apply.fs: -------------------------------------------------------------------------------- 1 | module Apply 2 | 3 | open System.Numerics 4 | open MathNet.Numerics 5 | open MathNet.Numerics.Distributions 6 | open MathNet.Numerics.Random 7 | open MathNet.Numerics.LinearAlgebra 8 | open MathNet.Numerics.LinearAlgebra.Double 9 | 10 | /// The size of the vector we want to map things for. 11 | let N = 1000000 12 | 13 | /// The number of times we repeat a call. 14 | let T = 10 15 | 16 | /// The list of all functions we want to test. 17 | let FunctionList : (string * (float -> float)) [] = 18 | [| ("Cosine", cos); 19 | ("Sine", sin); 20 | ("Tangent", tan); 21 | ("Inverse Cosine", acos); 22 | ("Inverse Sine", asin); 23 | ("Inverse Tangent", atan); 24 | ("Hyperbolic Cosine", cosh); 25 | ("Hyperbolic Sine", sinh); 26 | ("Hyperbolic Tangent", tanh); 27 | ("Abs", abs); 28 | ("Exp", exp); 29 | ("Log", log); 30 | ("Sqrt", sqrt); 31 | ("Error Function", SpecialFunctions.Erf); 32 | ("Error Function Complement", SpecialFunctions.Erfc); 33 | ("Inverse Error Function", SpecialFunctions.ErfInv); 34 | ("Inverse Error Function Complement", SpecialFunctions.ErfcInv) |] 35 | 36 | /// A vector with random entries. 37 | let w = 38 | let dist = Normal(1.0, 10.0, Random.mersenneTwister ()) 39 | DenseVector.random N dist 40 | 41 | /// A stopwatch to time the execution. 42 | let sw = System.Diagnostics.Stopwatch() 43 | 44 | 45 | printfn "%d-dimensional vector for %d iterations:" N T 46 | 47 | for (name, f) in FunctionList do 48 | 49 | let v = w.Clone() 50 | 51 | sw.Restart() 52 | for t in 1 .. T do Vector.mapInPlace f v 53 | sw.Stop() 54 | 55 | printfn "%s:\t\t%d ms" name sw.ElapsedMilliseconds 56 | -------------------------------------------------------------------------------- /examples/examples-fsharp/Histogram.fs: -------------------------------------------------------------------------------- 1 | module Histogram 2 | 3 | open MathNet.Numerics.Statistics 4 | 5 | /// The number of buckets to use in our histogram. 6 | let B = 4 7 | 8 | /// Create a small dataset. 9 | let data = [| 0.5; 1.5; 2.5; 3.5; 4.5; 5.5; 6.5; 7.5; 8.5; 9.5 |] 10 | 11 | /// A histogram with 4 buckets for this dataset. 12 | let hist = new Histogram(data, B) 13 | 14 | // Print some histogram information. 15 | printfn "Histogram.ToString(): %O" hist 16 | for i in 0 .. B-1 do 17 | printfn "Bucket %d contains %f datapoints." i hist.[i].Count 18 | -------------------------------------------------------------------------------- /examples/examples-fsharp/LinearRegression.fs: -------------------------------------------------------------------------------- 1 | module LinearRegression 2 | 3 | open System 4 | open MathNet.Numerics 5 | open MathNet.Numerics.LinearAlgebra 6 | open MathNet.Numerics.LinearAlgebra.Double 7 | open MathNet.Numerics.Distributions 8 | 9 | // Simple Least Squares Linear Regression. For the general principle see 10 | // http://christoph.ruegg.name/blog/2012/9/9/linear-regression-mathnet-numerics.html 11 | 12 | let ``Fitting to a line`` = 13 | printfn "Fitting to a line " 14 | 15 | let offset, slope = Fit.line [| 10.0; 20.0; 30.0 |] [| 15.0; 20.0; 25.0 |] 16 | offset, slope 17 | 18 | 19 | let ``Fitting to an arbitrary linear function from noisy data`` = 20 | printfn "Fitting to an arbitrary linear function from noisy data" 21 | 22 | // define our target function as linear combination of the following two arbitrary functions 23 | let f1 x = Math.Sqrt(Math.Exp(x)) 24 | let f2 x = SpecialFunctions.DiGamma(x*x) 25 | 26 | // sample points 27 | let xdata = [| 1.0 .. 1.0 .. 10.0 |] 28 | 29 | // generate data samples with chosen parameters and with gaussian noise added 30 | let fy (noise:IContinuousDistribution) x = 2.5*f1(x) - 4.0*f2(x) + noise.Sample() 31 | let ydata = xdata |> Array.map (fy (Normal.WithMeanVariance(0.0,2.0))) 32 | 33 | let p = Fit.linear [f1; f2] xdata ydata 34 | p.[0], p.[1] 35 | 36 | 37 | let ``Fitting to an sine from noisy data`` = 38 | printfn "Fitting to an sine from noisy data" 39 | 40 | // sample points 41 | let omega = 1.0 42 | let xdata = [| -1.0; 0.0; 0.1; 0.2; 0.3; 0.4; 0.65; 1.0; 1.2; 2.1; 4.5; 5.0; 6.0; |] 43 | 44 | // generate noisy data for sample points 45 | let rnd = Random(1) 46 | let ydata = xdata |> Array.map (fun x -> 5.0 + 2.0*Math.Sin(omega*x + 0.2) + 2.0*(rnd.NextDouble()-0.5)) 47 | 48 | let p = (xdata, ydata) ||> Fit.linear [(fun _ -> 1.0); (fun z -> Math.Sin(omega*z)); (fun z -> Math.Cos(omega*z))] 49 | 50 | let a = p.[0] 51 | let b = SpecialFunctions.Hypotenuse(p.[1], p.[2]) 52 | let c = Math.Atan2(p.[2], p.[1]) 53 | 54 | (a,b,c) 55 | -------------------------------------------------------------------------------- /examples/examples-fsharp/examples-fsharp.fsproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net45;net46;netstandard1.6;netstandard2.0 5 | false 6 | 4.4.3.0 7 | 4.3.3 8 | true 9 | Library 10 | false 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /examples/examples-fsharp/examples-fsharp.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27130.2026 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "examples-fsharp", "examples-fsharp.fsproj", "{11FCA895-F757-4083-8271-2035A5709D22}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {11FCA895-F757-4083-8271-2035A5709D22}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {11FCA895-F757-4083-8271-2035A5709D22}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {11FCA895-F757-4083-8271-2035A5709D22}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {11FCA895-F757-4083-8271-2035A5709D22}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {C828D054-1CFC-4684-BA5D-FE8CEA5AECB6} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /examples/net45-console-csharp/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /examples/net45-console-csharp/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using System.Numerics; 4 | 5 | using MathNet.Numerics; 6 | using MathNet.Numerics.IntegralTransforms; 7 | using MathNet.Numerics.LinearAlgebra; 8 | 9 | namespace Integration 10 | { 11 | class Program 12 | { 13 | static void Main(string[] args) 14 | { 15 | // Code touching all providers 16 | Control.UseNativeMKL(); 17 | Matrix matrix = CreateMatrix.Random(10, 10, 100); 18 | Vector vector = matrix.Svd().S; 19 | Fourier.Forward(vector.AsArray()); 20 | Console.WriteLine(Control.Describe()); 21 | Console.WriteLine($"DC={vector[0].Magnitude}; Low={vector[1].Magnitude}; Hight={vector[5].Magnitude}"); 22 | 23 | if (Debugger.IsAttached) 24 | { 25 | Console.ReadKey(); 26 | } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /examples/net45-console-csharp/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("net45-console-csharp")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("net45-console-csharp")] 13 | [assembly: AssemblyCopyright("Copyright © 2018")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("3d42354c-ceb7-4b35-856c-4a60e84f33e5")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /examples/net45-console-csharp/net45-console-csharp.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27130.2026 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "net45-console-csharp", "net45-console-csharp.csproj", "{3D42354C-CEB7-4B35-856C-4A60E84F33E5}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {3D42354C-CEB7-4B35-856C-4A60E84F33E5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {3D42354C-CEB7-4B35-856C-4A60E84F33E5}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {3D42354C-CEB7-4B35-856C-4A60E84F33E5}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {3D42354C-CEB7-4B35-856C-4A60E84F33E5}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {90333CC7-17E3-4F3A-B74A-58A80FBA599C} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /examples/net45-console-fsharp/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /examples/net45-console-fsharp/AssemblyInfo.fs: -------------------------------------------------------------------------------- 1 | namespace net45_console_fsharp_nuget.AssemblyInfo 2 | 3 | open System.Reflection 4 | open System.Runtime.CompilerServices 5 | open System.Runtime.InteropServices 6 | 7 | // General Information about an assembly is controlled through the following 8 | // set of attributes. Change these attribute values to modify the information 9 | // associated with an assembly. 10 | [] 11 | [] 12 | [] 13 | [] 14 | [] 15 | [] 16 | [] 17 | [] 18 | 19 | // Setting ComVisible to false makes the types in this assembly not visible 20 | // to COM components. If you need to access a type in this assembly from 21 | // COM, set the ComVisible attribute to true on that type. 22 | [] 23 | 24 | // The following GUID is for the ID of the typelib if this project is exposed to COM 25 | [] 26 | 27 | // Version information for an assembly consists of the following four values: 28 | // 29 | // Major Version 30 | // Minor Version 31 | // Build Number 32 | // Revision 33 | // 34 | // You can specify all the values or you can default the Build and Revision Numbers 35 | // by using the '*' as shown below: 36 | // [] 37 | [] 38 | [] 39 | 40 | do 41 | () -------------------------------------------------------------------------------- /examples/net45-console-fsharp/Program.fs: -------------------------------------------------------------------------------- 1 | open System 2 | open System.Diagnostics 3 | open MathNet.Numerics 4 | open MathNet.Numerics.IntegralTransforms 5 | open MathNet.Numerics.LinearAlgebra 6 | 7 | type Complex = System.Numerics.Complex 8 | 9 | [] 10 | let main argv = 11 | 12 | // Code touching all providers 13 | Control.UseNativeMKL() 14 | let matrix : Matrix = DenseMatrix.randomSeed 10 10 100 15 | let vector = (matrix |> Matrix.svd).S 16 | vector.AsArray() |> Fourier.Forward 17 | printfn "%s" (Control.Describe()) 18 | printfn "DC=%f; Low=%f; Hight=%f" vector.[0].Magnitude vector.[1].Magnitude vector.[5].Magnitude 19 | 20 | if Debugger.IsAttached then 21 | Console.ReadKey() |> ignore 22 | 23 | 0 24 | -------------------------------------------------------------------------------- /examples/net45-console-fsharp/net45-console-fsharp.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27130.2026 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "net45-console-fsharp", "net45-console-fsharp.fsproj", "{57AE8A51-A267-4336-A0E0-2B19FB69D7BD}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {57AE8A51-A267-4336-A0E0-2B19FB69D7BD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {57AE8A51-A267-4336-A0E0-2B19FB69D7BD}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {57AE8A51-A267-4336-A0E0-2B19FB69D7BD}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {57AE8A51-A267-4336-A0E0-2B19FB69D7BD}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {AD34F735-19E3-4492-BA8C-5288DE2DE3F2} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /examples/net45-console-fsharp/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /examples/net471-console-csharp/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /examples/net471-console-csharp/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using System.Numerics; 4 | using MathNet.Numerics; 5 | using MathNet.Numerics.IntegralTransforms; 6 | using MathNet.Numerics.LinearAlgebra; 7 | 8 | namespace Integration 9 | { 10 | class Program 11 | { 12 | static void Main(string[] args) 13 | { 14 | // Code touching all providers 15 | Control.UseNativeMKL(); 16 | Matrix matrix = CreateMatrix.Random(10, 10, 100); 17 | Vector vector = matrix.Svd().S; 18 | Fourier.Forward(vector.AsArray()); 19 | Console.WriteLine(Control.Describe()); 20 | Console.WriteLine($"DC={vector[0].Magnitude}; Low={vector[1].Magnitude}; Hight={vector[5].Magnitude}"); 21 | 22 | if (Debugger.IsAttached) 23 | { 24 | Console.ReadKey(); 25 | } 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /examples/net471-console-csharp/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("net471-console-csharp")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("net471-console-csharp")] 13 | [assembly: AssemblyCopyright("Copyright © 2018")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("00241648-632e-4250-aff4-d61fe68d6dd4")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /examples/net471-console-csharp/net471-console-csharp.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27130.2026 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "net471-console-csharp", "net471-console-csharp.csproj", "{00241648-632E-4250-AFF4-D61FE68D6DD4}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {00241648-632E-4250-AFF4-D61FE68D6DD4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {00241648-632E-4250-AFF4-D61FE68D6DD4}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {00241648-632E-4250-AFF4-D61FE68D6DD4}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {00241648-632E-4250-AFF4-D61FE68D6DD4}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {340791EB-C2C6-4604-9830-82AE33132081} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /examples/net471-console-fsharp/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /examples/net471-console-fsharp/AssemblyInfo.fs: -------------------------------------------------------------------------------- 1 | namespace net471_console_fsharp_nuget.AssemblyInfo 2 | 3 | open System.Reflection 4 | open System.Runtime.CompilerServices 5 | open System.Runtime.InteropServices 6 | 7 | // General Information about an assembly is controlled through the following 8 | // set of attributes. Change these attribute values to modify the information 9 | // associated with an assembly. 10 | [] 11 | [] 12 | [] 13 | [] 14 | [] 15 | [] 16 | [] 17 | [] 18 | 19 | // Setting ComVisible to false makes the types in this assembly not visible 20 | // to COM components. If you need to access a type in this assembly from 21 | // COM, set the ComVisible attribute to true on that type. 22 | [] 23 | 24 | // The following GUID is for the ID of the typelib if this project is exposed to COM 25 | [] 26 | 27 | // Version information for an assembly consists of the following four values: 28 | // 29 | // Major Version 30 | // Minor Version 31 | // Build Number 32 | // Revision 33 | // 34 | // You can specify all the values or you can default the Build and Revision Numbers 35 | // by using the '*' as shown below: 36 | // [] 37 | [] 38 | [] 39 | 40 | do 41 | () -------------------------------------------------------------------------------- /examples/net471-console-fsharp/Program.fs: -------------------------------------------------------------------------------- 1 | open System 2 | open System.Diagnostics 3 | open MathNet.Numerics 4 | open MathNet.Numerics.IntegralTransforms 5 | open MathNet.Numerics.LinearAlgebra 6 | 7 | type Complex = System.Numerics.Complex 8 | 9 | [] 10 | let main argv = 11 | 12 | // Code touching all providers 13 | Control.UseNativeMKL() 14 | let matrix : Matrix = DenseMatrix.randomSeed 10 10 100 15 | let vector = (matrix |> Matrix.svd).S 16 | vector.AsArray() |> Fourier.Forward 17 | printfn "%s" (Control.Describe()) 18 | printfn "DC=%f; Low=%f; Hight=%f" vector.[0].Magnitude vector.[1].Magnitude vector.[5].Magnitude 19 | 20 | if Debugger.IsAttached then 21 | Console.ReadKey() |> ignore 22 | 23 | 0 24 | -------------------------------------------------------------------------------- /examples/net471-console-fsharp/net471-console-fsharp.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27130.2026 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "net471-console-fsharp", "net471-console-fsharp.fsproj", "{D1C0C7CA-6FCF-4C1F-A171-13AC06CC9708}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {D1C0C7CA-6FCF-4C1F-A171-13AC06CC9708}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {D1C0C7CA-6FCF-4C1F-A171-13AC06CC9708}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {D1C0C7CA-6FCF-4C1F-A171-13AC06CC9708}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {D1C0C7CA-6FCF-4C1F-A171-13AC06CC9708}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {FCBC8B65-5683-4390-A0E2-39BE8B288555} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /examples/net471-console-fsharp/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /examples/netcore11-console-csharp/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using MathNet.Numerics; 4 | using MathNet.Numerics.IntegralTransforms; 5 | using MathNet.Numerics.LinearAlgebra; 6 | 7 | using Complex = System.Numerics.Complex; 8 | 9 | namespace Integration 10 | { 11 | class Program 12 | { 13 | static void Main(string[] args) 14 | { 15 | // Code touching all providers 16 | Control.UseManaged(); 17 | Matrix matrix = CreateMatrix.Random(10, 10, 100); 18 | Vector vector = matrix.Svd().S; 19 | Fourier.Forward(vector.AsArray()); 20 | Console.WriteLine(Control.Describe()); 21 | Console.WriteLine($"DC={vector[0].Magnitude}; Low={vector[1].Magnitude}; Hight={vector[5].Magnitude}"); 22 | 23 | if (Debugger.IsAttached) 24 | { 25 | Console.ReadKey(); 26 | } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /examples/netcore11-console-csharp/netcore11-console-csharp.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp1.1 6 | Integration 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /examples/netcore11-console-csharp/netcore11-console-csharp.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27130.2026 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "netcore11-console-csharp", "netcore11-console-csharp.csproj", "{108E9AB0-757E-4A6F-AF7D-012129F34EF0}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {108E9AB0-757E-4A6F-AF7D-012129F34EF0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {108E9AB0-757E-4A6F-AF7D-012129F34EF0}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {108E9AB0-757E-4A6F-AF7D-012129F34EF0}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {108E9AB0-757E-4A6F-AF7D-012129F34EF0}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {09849DBB-34DE-4146-A8DC-0DCB096103BE} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /examples/netcore11-console-fsharp/Program.fs: -------------------------------------------------------------------------------- 1 | open System 2 | open System.Diagnostics 3 | open MathNet.Numerics 4 | open MathNet.Numerics.IntegralTransforms 5 | open MathNet.Numerics.LinearAlgebra 6 | 7 | type Complex = System.Numerics.Complex 8 | 9 | [] 10 | let main argv = 11 | 12 | // Code touching all providers 13 | let matrix : Matrix = DenseMatrix.randomSeed 10 10 100 14 | let vector = (matrix |> Matrix.svd).S 15 | vector.AsArray() |> Fourier.Forward 16 | printfn "%s" (Control.Describe()) 17 | printfn "DC=%f; Low=%f; Hight=%f" vector.[0].Magnitude vector.[1].Magnitude vector.[5].Magnitude 18 | 19 | if Debugger.IsAttached then 20 | Console.ReadKey() |> ignore 21 | 22 | 0 23 | -------------------------------------------------------------------------------- /examples/netcore11-console-fsharp/netcore11-console-fsharp.fsproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | netcoreapp1.1 6 | 4.4.3.0 7 | 4.3.3 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /examples/netcore11-console-fsharp/netcore11-console-fsharp.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27130.2026 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "netcore11-console-fsharp", "netcore11-console-fsharp.fsproj", "{7F0FCBE3-106E-477C-8198-50EDE1729F69}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {7F0FCBE3-106E-477C-8198-50EDE1729F69}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {7F0FCBE3-106E-477C-8198-50EDE1729F69}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {7F0FCBE3-106E-477C-8198-50EDE1729F69}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {7F0FCBE3-106E-477C-8198-50EDE1729F69}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {831812CF-1BE1-414F-9074-90A785F0013F} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /examples/netcore20-console-csharp/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using MathNet.Numerics; 4 | using MathNet.Numerics.IntegralTransforms; 5 | using MathNet.Numerics.LinearAlgebra; 6 | 7 | using Complex = System.Numerics.Complex; 8 | 9 | namespace Integration 10 | { 11 | class Program 12 | { 13 | static void Main(string[] args) 14 | { 15 | // Code touching all providers 16 | Control.UseNativeMKL(); 17 | Matrix matrix = CreateMatrix.Random(10, 10, 100); 18 | Vector vector = matrix.Svd().S; 19 | Fourier.Forward(vector.AsArray()); 20 | Console.WriteLine(Control.Describe()); 21 | Console.WriteLine($"DC={vector[0].Magnitude}; Low={vector[1].Magnitude}; Hight={vector[5].Magnitude}"); 22 | 23 | if (Debugger.IsAttached) 24 | { 25 | Console.ReadKey(); 26 | } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /examples/netcore20-console-csharp/netcore20-console-csharp.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp2.0 6 | Integration 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /examples/netcore20-console-csharp/netcore20-console-csharp.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27130.2026 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "netcore20-console-csharp", "netcore20-console-csharp.csproj", "{B0146BC4-789E-4EC1-9FA8-F93378928B11}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {B0146BC4-789E-4EC1-9FA8-F93378928B11}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {B0146BC4-789E-4EC1-9FA8-F93378928B11}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {B0146BC4-789E-4EC1-9FA8-F93378928B11}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {B0146BC4-789E-4EC1-9FA8-F93378928B11}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {370FB300-76E3-40CC-9399-A1A9DB2F7F9E} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /examples/netcore20-console-fsharp/Program.fs: -------------------------------------------------------------------------------- 1 | open System 2 | open System.Diagnostics 3 | open MathNet.Numerics 4 | open MathNet.Numerics.IntegralTransforms 5 | open MathNet.Numerics.LinearAlgebra 6 | 7 | type Complex = System.Numerics.Complex 8 | 9 | [] 10 | let main argv = 11 | 12 | // Code touching all providers 13 | Control.UseNativeMKL() 14 | let matrix : Matrix = DenseMatrix.randomSeed 10 10 100 15 | let vector = (matrix |> Matrix.svd).S 16 | vector.AsArray() |> Fourier.Forward 17 | printfn "%s" (Control.Describe()) 18 | printfn "DC=%f; Low=%f; Hight=%f" vector.[0].Magnitude vector.[1].Magnitude vector.[5].Magnitude 19 | 20 | if Debugger.IsAttached then 21 | Console.ReadKey() |> ignore 22 | 23 | 0 24 | -------------------------------------------------------------------------------- /examples/netcore20-console-fsharp/netcore20-console-fsharp.fsproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | netcoreapp2.0 6 | 4.4.3.0 7 | 4.3.3 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /examples/netcore20-console-fsharp/netcore20-console-fsharp.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27130.2026 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "netcore20-console-fsharp", "netcore20-console-fsharp.fsproj", "{5B271DEE-042F-4F7E-B7F8-BA60FB466236}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {5B271DEE-042F-4F7E-B7F8-BA60FB466236}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {5B271DEE-042F-4F7E-B7F8-BA60FB466236}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {5B271DEE-042F-4F7E-B7F8-BA60FB466236}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {5B271DEE-042F-4F7E-B7F8-BA60FB466236}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {41F46975-2B6E-4B46-9E01-A17675D97BC8} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /examples/paket.dependencies: -------------------------------------------------------------------------------- 1 | # this folder shall not be in scope of the parent Paket resolution 2 | -------------------------------------------------------------------------------- /global.json: -------------------------------------------------------------------------------- 1 | { 2 | "sdk": { 3 | "version": "8.0.100", 4 | "rollForward": "feature" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /paket.dependencies: -------------------------------------------------------------------------------- 1 | source https://api.nuget.org/v3/index.json 2 | storage: packages 3 | 4 | framework: net8.0,net6.0,net48,net461,netstandard2.0 5 | 6 | group Build 7 | source https://api.nuget.org/v3/index.json 8 | storage: packages 9 | nuget NuGet.CommandLine 10 | -------------------------------------------------------------------------------- /paket.lock: -------------------------------------------------------------------------------- 1 | STORAGE: PACKAGES 2 | RESTRICTION: || (== net461) (== net48) (== net6.0) (== net8.0) (== netstandard2.0) 3 | 4 | GROUP Build 5 | STORAGE: PACKAGES 6 | NUGET 7 | remote: https://api.nuget.org/v3/index.json 8 | NuGet.CommandLine (6.8) 9 | -------------------------------------------------------------------------------- /restore.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | cls 3 | 4 | dotnet tool restore 5 | dotnet paket restore 6 | -------------------------------------------------------------------------------- /restore.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -eu 4 | set -o pipefail 5 | 6 | cd "$(dirname "$0")" 7 | 8 | dotnet tool restore 9 | dotnet paket restore 10 | -------------------------------------------------------------------------------- /src/.gitignore: -------------------------------------------------------------------------------- 1 | Bin 2 | bin 3 | obj 4 | TestResults 5 | _ReSharper* 6 | *.user 7 | *.suo 8 | *.vsdoc 9 | *.cache 10 | *.docstates 11 | *.sdf 12 | *.ReSharper 13 | -------------------------------------------------------------------------------- /src/Benchmark/Benchmark.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net8.0;net6.0;net48 6 | 7.3 7 | Benchmark 8 | Benchmark 9 | false 10 | 5.0.0 11 | alpha02 12 | false 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | all 27 | runtime; build; native; contentfiles; analyzers; buildtransitive 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /src/Benchmark/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using BenchmarkDotNet.Running; 3 | using MathNet.Numerics; 4 | 5 | namespace Benchmark 6 | { 7 | public class Program 8 | { 9 | public static void Main(string[] args) 10 | { 11 | Console.WriteLine(Control.Describe()); 12 | 13 | var switcher = new BenchmarkSwitcher( 14 | new[] 15 | { 16 | typeof(Transforms.FFT), 17 | typeof(LinearAlgebra.DenseMatrixProduct), 18 | typeof(LinearAlgebra.DenseVector), 19 | }); 20 | 21 | switcher.Run(args); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/Data.Matlab/ArrayFlags.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Math.NET Numerics, part of the Math.NET Project 3 | // http://numerics.mathdotnet.com 4 | // http://github.com/mathnet/mathnet-numerics 5 | // http://mathnetnumerics.codeplex.com 6 | // 7 | // Copyright (c) 2009-2013 Math.NET 8 | // 9 | // Permission is hereby granted, free of charge, to any person 10 | // obtaining a copy of this software and associated documentation 11 | // files (the "Software"), to deal in the Software without 12 | // restriction, including without limitation the rights to use, 13 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | // copies of the Software, and to permit persons to whom the 15 | // Software is furnished to do so, subject to the following 16 | // conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be 19 | // included in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 22 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 23 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 24 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 25 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 26 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 27 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 28 | // OTHER DEALINGS IN THE SOFTWARE. 29 | // 30 | 31 | using System; 32 | 33 | namespace MathNet.Numerics.Data.Matlab 34 | { 35 | /// 36 | /// MATLAB Array Flags 37 | /// 38 | [Flags] 39 | internal enum ArrayFlags 40 | { 41 | /// 42 | /// Complex flag 43 | /// 44 | Complex = 8, 45 | 46 | /// 47 | /// Global flag 48 | /// 49 | Global = 4, 50 | 51 | /// 52 | /// Logical flag 53 | /// 54 | Logical = 2 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/Data.Tests/Data.Tests.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | false 6 | net8.0;net48 7 | 7.3 8 | MathNet.Numerics.Data.Tests 9 | MathNet.Numerics.Data.Tests 10 | false 11 | 5.0.0 12 | alpha02 13 | false 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | all 31 | runtime; build; native; contentfiles; analyzers; buildtransitive 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/Data.Tests/Program.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Math.NET Numerics, part of the Math.NET Project 3 | // http://numerics.mathdotnet.com 4 | // http://github.com/mathnet/mathnet-numerics 5 | // 6 | // Copyright (c) 2009-2017 Math.NET 7 | // 8 | // Permission is hereby granted, free of charge, to any person 9 | // obtaining a copy of this software and associated documentation 10 | // files (the "Software"), to deal in the Software without 11 | // restriction, including without limitation the rights to use, 12 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the 14 | // Software is furnished to do so, subject to the following 15 | // conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | // OTHER DEALINGS IN THE SOFTWARE. 28 | // 29 | 30 | using NUnitLite; 31 | using System.Reflection; 32 | 33 | namespace MathNet.Numerics.Data.Tests 34 | { 35 | class Program 36 | { 37 | public static int Main(string[] args) 38 | { 39 | return new AutoRun(typeof(Program).GetTypeInfo().Assembly).Execute(args); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/Data.Tests/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | [assembly: ComVisible(false)] 4 | [assembly: Guid("bb41bee6-eb4c-48c9-8edd-7a5ae2422567")] 5 | -------------------------------------------------------------------------------- /src/Data.Text/Options.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Math.NET Numerics, part of the Math.NET Project 3 | // http://numerics.mathdotnet.com 4 | // http://github.com/mathnet/mathnet-numerics 5 | // http://mathnetnumerics.codeplex.com 6 | // 7 | // Copyright (c) 2009-2014 Math.NET 8 | // 9 | // Permission is hereby granted, free of charge, to any person 10 | // obtaining a copy of this software and associated documentation 11 | // files (the "Software"), to deal in the Software without 12 | // restriction, including without limitation the rights to use, 13 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | // copies of the Software, and to permit persons to whom the 15 | // Software is furnished to do so, subject to the following 16 | // conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be 19 | // included in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 22 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 23 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 24 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 25 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 26 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 27 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 28 | // OTHER DEALINGS IN THE SOFTWARE. 29 | // 30 | 31 | namespace MathNet.Numerics.Data.Text 32 | { 33 | public enum Compression 34 | { 35 | Uncompressed = 0, 36 | GZip = 1 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/FSharp.Tests/AssemblyInfo.fs: -------------------------------------------------------------------------------- 1 | namespace MathNet.Numerics 2 | 3 | open System.Runtime.InteropServices 4 | 5 | [] 6 | [] 7 | 8 | () 9 | -------------------------------------------------------------------------------- /src/FSharp.Tests/FitTests.fs: -------------------------------------------------------------------------------- 1 | namespace MathNet.Numerics.Tests 2 | 3 | open NUnit.Framework 4 | open FsUnit 5 | open FsUnitTyped 6 | 7 | open System 8 | open MathNet.Numerics 9 | 10 | #nowarn "25" 11 | 12 | module FitTests = 13 | 14 | [] 15 | let ``When fitting to an exact line should return exact parameters``() = 16 | let f z = 4.0 - 1.5*z 17 | let x = Array.append [| 1.0 .. 2.0 .. 10.0 |] [| -1.0 .. -1.0 .. -5.0 |] 18 | let y = x |> Array.map f 19 | 20 | // LeastSquares.FitToLine(x,y) 21 | let struct (a, b) = Fit.line x y 22 | a |> should (equalWithin 1.0e-12) 4.0 23 | b |> should (equalWithin 1.0e-12) -1.5 24 | 25 | let fres = Fit.lineFunc x y 26 | in x |> Array.iter (fun x -> fres x |> should (equalWithin 1.0e-12) (f x)) 27 | 28 | [] 29 | let ``Can fit to arbitrary linear combination``() = 30 | 31 | // Mathematica: Fit[{{1,4.986},{2,2.347},{3,2.061},{4,-2.995},{5,-2.352},{6,-5.782}}, {1, sin(x), cos(x)}, x] 32 | // -> 4.02159 sin(x) - 1.46962 cos(x) - 0.287476 33 | 34 | let x = [| 1.0 .. 6.0 |] 35 | let y = [| 4.986; 2.347; 2.061; -2.995; -2.352; -5.782 |] 36 | 37 | // LeastSquares.FitToLinearCombination(x, y, (fun z -> 1.0), (fun z -> Math.Sin(z)), (fun z -> Math.Cos(z))) 38 | let [a;b;c] = (x,y) ||> Fit.linear [(fun _ -> 1.0); Math.Sin; Math.Cos] 39 | a |> should (equalWithin 1.0e-4) -0.287476 40 | b |> should (equalWithin 1.0e-4) 4.02159 41 | c |> should (equalWithin 1.0e-4) -1.46962 42 | 43 | let fres = Fit.linearFunc [(fun z -> 1.0); (fun z -> Math.Sin(z)); (fun z -> Math.Cos(z))] x y 44 | in x |> Array.iter (fun x -> fres x |> should (equalWithin 1.0e-4) (4.02159*Math.Sin(x) - 1.46962*Math.Cos(x) - 0.287476)) 45 | -------------------------------------------------------------------------------- /src/FSharp.Tests/Main.fs: -------------------------------------------------------------------------------- 1 | namespace MathNet.Numerics.Tests 2 | 3 | open NUnit.Framework 4 | open NUnitLite 5 | open System.Reflection 6 | 7 | type T = { Dummy : string } 8 | 9 | module Program = 10 | 11 | [] 12 | let main args = 13 | (new AutoRun(typeof.GetTypeInfo().Assembly)).Execute(args) 14 | -------------------------------------------------------------------------------- /src/FSharp.Tests/SparseVectorTests.fs: -------------------------------------------------------------------------------- 1 | namespace MathNet.Numerics.Tests 2 | 3 | open NUnit.Framework 4 | open FsUnitTyped 5 | 6 | open MathNet.Numerics.LinearAlgebra 7 | 8 | /// Unit tests for the sparse vector type. 9 | module SparseVectorTests = 10 | 11 | /// A small uniform vector. 12 | let smallv = DenseVector.raw [|0.0;0.3;0.0;0.0;0.0|] 13 | 14 | [] 15 | let ``SparseVector.ofListi`` () = SparseVector.ofListi 5 [ (1,0.3) ] |> shouldEqual smallv 16 | 17 | [] 18 | let ``SparseVector.ofSeqi`` () = SparseVector.ofSeqi 5 (List.toSeq [ (1,0.3) ]) |> shouldEqual smallv 19 | -------------------------------------------------------------------------------- /src/FSharp/AssemblyInfo.fs: -------------------------------------------------------------------------------- 1 | // 2 | // Math.NET Numerics, part of the Math.NET Project 3 | // http://numerics.mathdotnet.com 4 | // http://github.com/mathnet/mathnet-numerics 5 | // 6 | // Copyright (c) 2009 Math.NET 7 | // 8 | // Permission is hereby granted, free of charge, to any person 9 | // obtaining a copy of this software and associated documentation 10 | // files (the "Software"), to deal in the Software without 11 | // restriction, including without limitation the rights to use, 12 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the 14 | // Software is furnished to do so, subject to the following 15 | // conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | // OTHER DEALINGS IN THE SOFTWARE. 28 | // 29 | 30 | namespace MathNet.Numerics 31 | 32 | open System.Runtime.InteropServices 33 | 34 | [] 35 | [] 36 | 37 | () 38 | -------------------------------------------------------------------------------- /src/FSharp/BigIntegerExtensions.fs: -------------------------------------------------------------------------------- 1 | namespace System.Numerics 2 | 3 | open System 4 | 5 | [] 6 | module BigIntegerExtensions = 7 | // 8 | let rec private parseImpl (str : string) len acc i = 9 | if i = len then 10 | acc 11 | else 12 | let d = int str.[i] - int '0' 13 | if 0 <= d && d <= 9 then 14 | parseImpl str len (10I * acc + (bigint d)) (i + 1) 15 | else 16 | raise <| FormatException ("The value could not be parsed.") 17 | 18 | type BigInteger with 19 | // 20 | static member Parse (str : string) = 21 | let len = str.Length 22 | if len = 0 then 23 | raise <| FormatException ("The value could not be parsed.") 24 | 25 | if str.[0] = '-' then 26 | -(parseImpl str len 0I 1) 27 | else 28 | parseImpl str len 0I 0 29 | -------------------------------------------------------------------------------- /src/NativeProviders/.gitignore: -------------------------------------------------------------------------------- 1 | *.aps 2 | Debug 3 | Release 4 | ipch 5 | *.opensdf -------------------------------------------------------------------------------- /src/NativeProviders/ATLAS/blas.h: -------------------------------------------------------------------------------- 1 | #ifndef BLAS_H 2 | #define BLAS_H 3 | 4 | #include "cblas.h" 5 | 6 | typedef struct { float real; float imag; } Complex8; 7 | typedef struct { double real; double imag; } Complex16; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/NativeProviders/ATLAS/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by resource.rc 4 | 5 | // Next default values for new objects 6 | // 7 | #ifdef APSTUDIO_INVOKED 8 | #ifndef APSTUDIO_READONLY_SYMBOLS 9 | #define _APS_NEXT_RESOURCE_VALUE 101 10 | #define _APS_NEXT_COMMAND_VALUE 40001 11 | #define _APS_NEXT_CONTROL_VALUE 1001 12 | #define _APS_NEXT_SYMED_VALUE 101 13 | #endif 14 | #endif 15 | -------------------------------------------------------------------------------- /src/NativeProviders/CUDA/capabilities.cpp: -------------------------------------------------------------------------------- 1 | #include "wrapper_common.h" 2 | #include "cublas_v2.h" 3 | #include "cusolverDn.h" 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif /* __cplusplus */ 8 | 9 | /* 10 | Capability is supported if >0 11 | 12 | Actual number can be increased over time to indicate 13 | extensions/revisions (that do not break compatibility) 14 | */ 15 | DLLEXPORT int query_capability(const int capability) 16 | { 17 | switch (capability) 18 | { 19 | 20 | // SANITY CHECKS 21 | case 0: return 0; 22 | case 1: return -1; 23 | 24 | // PLATFORM 25 | case 8: 26 | #ifdef _M_IX86 27 | return 1; 28 | #else 29 | return 0; 30 | #endif 31 | case 9: 32 | #ifdef _M_X64 33 | return 1; 34 | #else 35 | return 0; 36 | #endif 37 | case 10: 38 | #ifdef _M_IA64 39 | return 1; 40 | #else 41 | return 0; 42 | #endif 43 | 44 | // COMMON/SHARED 45 | case 64: return 1; // revision 46 | 47 | // LINEAR ALGEBRA 48 | case 128: return 1; // basic dense linear algebra (major - breaking) 49 | case 129: return 0; // basic dense linear algebra (minor - non-breaking) 50 | 51 | // OPTIMIZATION 52 | case 256: return 0; // basic optimization 53 | 54 | // FFT 55 | case 384: return 0; // basic FFT 56 | 57 | default: return 0; // unknown or not supported 58 | 59 | } 60 | } 61 | 62 | DLLEXPORT cublasStatus_t createBLASHandle(cublasHandle_t *blasHandle){ 63 | return cublasCreate(blasHandle); 64 | } 65 | 66 | DLLEXPORT cublasStatus_t destroyBLASHandle(cublasHandle_t blasHandle){ 67 | return cublasDestroy(blasHandle); 68 | } 69 | 70 | DLLEXPORT cusolverStatus_t createSolverHandle(cusolverDnHandle_t *solverHandle){ 71 | return cusolverDnCreate(solverHandle); 72 | } 73 | 74 | DLLEXPORT cusolverStatus_t destroySolverHandle(cusolverDnHandle_t solverHandle){ 75 | return cusolverDnDestroy(solverHandle); 76 | } 77 | 78 | #ifdef __cplusplus 79 | } 80 | #endif /* __cplusplus */ 81 | -------------------------------------------------------------------------------- /src/NativeProviders/CUDA/memory.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathnet/mathnet-numerics/84e9432bc1e8a6b2ae7acd32cda4175abeaeaed1/src/NativeProviders/CUDA/memory.c -------------------------------------------------------------------------------- /src/NativeProviders/CUDA/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by resource.rc 4 | 5 | // Next default values for new objects 6 | // 7 | #ifdef APSTUDIO_INVOKED 8 | #ifndef APSTUDIO_READONLY_SYMBOLS 9 | #define _APS_NEXT_RESOURCE_VALUE 101 10 | #define _APS_NEXT_COMMAND_VALUE 40001 11 | #define _APS_NEXT_CONTROL_VALUE 1001 12 | #define _APS_NEXT_SYMED_VALUE 101 13 | #endif 14 | #endif 15 | -------------------------------------------------------------------------------- /src/NativeProviders/Common/WindowsDLL.cpp: -------------------------------------------------------------------------------- 1 | #ifndef VC_EXTRALEAN 2 | #define VC_EXTRALEAN 3 | #endif 4 | #include "windows.h" 5 | 6 | BOOL APIENTRY DllMain( HANDLE, DWORD, LPVOID ){ 7 | return TRUE; 8 | } 9 | -------------------------------------------------------------------------------- /src/NativeProviders/Common/lapack_common.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | const int INSUFFICIENT_MEMORY = -999999; 6 | 7 | #ifndef LAPACK_MEMORY 8 | #define LAPACK_MEMORY 9 | #include 10 | 11 | template using array_ptr = std::unique_ptr; 12 | 13 | template 14 | inline array_ptr array_new(const int size) 15 | { 16 | return array_ptr(new T[size]); 17 | } 18 | 19 | #endif 20 | 21 | template 22 | inline array_ptr array_clone(const int size, const T* array) 23 | { 24 | auto clone = array_new(size); 25 | memcpy(clone.get(), array, size * sizeof(T)); 26 | return clone; 27 | } 28 | 29 | inline void shift_ipiv_down(int m, int ipiv[]) 30 | { 31 | for(auto i = 0; i < m; ++i ) 32 | { 33 | ipiv[i] -= 1; 34 | } 35 | } 36 | 37 | inline void shift_ipiv_up(int m, int ipiv[]) 38 | { 39 | for(auto i = 0; i < m; ++i ) 40 | { 41 | ipiv[i] += 1; 42 | } 43 | } 44 | 45 | template 46 | inline T* Clone(const int m, const int n, const T* a) 47 | { 48 | auto clone = new T[m*n]; 49 | memcpy(clone, a, m*n*sizeof(T)); 50 | return clone; 51 | } 52 | 53 | template 54 | inline void copyBtoX (int m, int n, int bn, T b[], T x[]) 55 | { 56 | for (auto i = 0; i < n; ++i) 57 | { 58 | for (auto j = 0; j < bn; ++j) 59 | { 60 | x[j * n + i] = b[j * m + i]; 61 | } 62 | } 63 | } 64 | 65 | -------------------------------------------------------------------------------- /src/NativeProviders/Common/wrapper_common.h: -------------------------------------------------------------------------------- 1 | #ifndef WRAPPER_COMMON_H 2 | #define WRAPPER_COMMON_H 3 | 4 | #ifndef __MS_VC_INSTALL_PATH 5 | #define __MS_VC_INSTALL_PATH C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.15.26726 6 | #endif 7 | 8 | #ifdef _WINDOWS 9 | #define DLLEXPORT __declspec( dllexport ) 10 | #else 11 | #define DLLEXPORT 12 | #endif 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /src/NativeProviders/Linux/mkl_build.sh: -------------------------------------------------------------------------------- 1 | Note: g++ multilib must be installed 2 | export VERSION=2023.1.0 3 | export INTEL=/opt/intel 4 | export MKL=$INTEL/oneapi/mkl/$VERSION 5 | export OPENMP=$INTEL/oneapi/compiler/$VERSION/linux/compiler/lib 6 | export OUT=../../../out/MKL/Linux 7 | 8 | mkdir -p $OUT/x64 9 | mkdir -p $OUT/x86 10 | 11 | g++ -std=c++11 -D_M_X64 -DGCC -m64 --shared -fPIC -o $OUT/x64/libMathNetNumericsMKL.so -I$MKL/include -I../Common -I../MKL ../MKL/memory.c ../MKL/capabilities.cpp ../MKL/vector_functions.c ../Common/blas.c ../Common/lapack.cpp ../MKL/fft.cpp -Wl,--start-group $MKL/lib/intel64/libmkl_intel_lp64.a $MKL/lib/intel64/libmkl_intel_thread.a $MKL/lib/intel64/libmkl_core.a -Wl,--end-group -L$OPENMP/intel64_lin -liomp5 -lpthread -lm 12 | 13 | cp $OPENMP/intel64_lin/libiomp5.so $OUT/x64/ 14 | 15 | g++ -std=c++11 -D_M_IX86 -DGCC -m32 --shared -fPIC -o $OUT/x86/libMathNetNumericsMKL.so -I$MKL/include -I../Common -I../MKL ../MKL/memory.c ../MKL/capabilities.cpp ../MKL/vector_functions.c ../Common/blas.c ../Common/lapack.cpp ../MKL/fft.cpp -Wl,--start-group $MKL/lib/ia32/libmkl_intel.a $MKL/lib/ia32/libmkl_intel_thread.a $MKL/lib/ia32/libmkl_core.a -Wl,--end-group -L$OPENMP/ia32_lin -liomp5 -lpthread -lm 16 | 17 | cp $OPENMP/ia32_lin/libiomp5.so $OUT/x86/ 18 | -------------------------------------------------------------------------------- /src/NativeProviders/Linux/readme.txt: -------------------------------------------------------------------------------- 1 | 1) Install MKL. 2 | 3 | There are many options. At time of writing this is a good source: 4 | https://www.intel.com/content/www/us/en/developer/tools/oneapi/onemkl-download.html 5 | 6 | 2) Install g++: 7 | sudo apt-get install g++ g++-multilib libc6-dev-i386 8 | 9 | 3) Build: 10 | ./mkl_build.sh 11 | PS: you may have to update MKL's version number inside the script. See VERSION environment variable. 12 | -------------------------------------------------------------------------------- /src/NativeProviders/MKL/blas.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "mkl_cblas.h" 4 | 5 | #define blas_int MKL_INT 6 | #define blas_complex_float MKL_Complex8 7 | #define blas_complex_double MKL_Complex16 8 | -------------------------------------------------------------------------------- /src/NativeProviders/MKL/dss.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "mkl_dss.h" 4 | #include "mkl_types.h" 5 | 6 | #define dss_int MKL_INT 7 | #define dss_complex_float MKL_Complex8 8 | #define dss_complex_double MKL_Complex16 9 | 10 | -------------------------------------------------------------------------------- /src/NativeProviders/MKL/lapack.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #define MKL_Complex8 std::complex 7 | #define MKL_Complex16 std::complex 8 | #define LAPACK_MEMORY 9 | 10 | #include "mkl.h" 11 | 12 | const int ALIGNMENT = 64; 13 | 14 | struct array_free 15 | { 16 | void operator()(void* x) { mkl_free(x); } 17 | }; 18 | 19 | template using array_ptr = std::unique_ptr; 20 | 21 | template 22 | inline array_ptr array_new(const int size) 23 | { 24 | auto ret = static_cast(mkl_malloc(size * sizeof(T), ALIGNMENT)); 25 | 26 | if (!ret) 27 | { 28 | throw new std::bad_alloc(); 29 | } 30 | 31 | return array_ptr(ret); 32 | } 33 | -------------------------------------------------------------------------------- /src/NativeProviders/MKL/memory.c: -------------------------------------------------------------------------------- 1 | #include "wrapper_common.h" 2 | #include "mkl.h" 3 | 4 | #if __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | DLLEXPORT void free_buffers(void) { 9 | mkl_free_buffers(); 10 | } 11 | 12 | DLLEXPORT void thread_free_buffers(void) { 13 | mkl_thread_free_buffers(); 14 | } 15 | 16 | DLLEXPORT int disable_fast_mm(void) { 17 | return mkl_disable_fast_mm(); 18 | } 19 | 20 | DLLEXPORT MKL_INT64 mem_stat(int* AllocatedBuffers) { 21 | return mkl_mem_stat(AllocatedBuffers); 22 | } 23 | 24 | DLLEXPORT MKL_INT64 peak_mem_usage(int mode) { 25 | return mkl_peak_mem_usage(mode); 26 | } 27 | 28 | #if __cplusplus 29 | } 30 | #endif 31 | -------------------------------------------------------------------------------- /src/NativeProviders/MKL/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by resource.rc 4 | 5 | // Next default values for new objects 6 | // 7 | #ifdef APSTUDIO_INVOKED 8 | #ifndef APSTUDIO_READONLY_SYMBOLS 9 | #define _APS_NEXT_RESOURCE_VALUE 101 10 | #define _APS_NEXT_COMMAND_VALUE 40001 11 | #define _APS_NEXT_CONTROL_VALUE 1001 12 | #define _APS_NEXT_SYMED_VALUE 101 13 | #endif 14 | #endif 15 | -------------------------------------------------------------------------------- /src/NativeProviders/OSX/mkl_build.sh: -------------------------------------------------------------------------------- 1 | export INTEL=/opt/intel 2 | export MKL=$INTEL/mkl 3 | export OPENMP=$INTEL/lib 4 | export OUT=../../../out/MKL/OSX 5 | 6 | mkdir -p $OUT/x64 7 | mkdir -p $OUT/x86 8 | 9 | clang++ -std=c++11 -D_M_X64 -DGCC -m64 --shared -fPIC -o $OUT/x64/libMathNetNumericsMKL.dylib -I$MKL/include -I../Common -I../MKL ../MKL/memory.c ../MKL/capabilities.cpp ../MKL/vector_functions.c ../Common/blas.c ../Common/lapack.cpp ../MKL/fft.cpp $MKL/lib/libmkl_intel_lp64.a $MKL/lib/libmkl_core.a $MKL/lib/libmkl_intel_thread.a -L$OPENMP -liomp5 -lpthread -lm 10 | 11 | cp $OPENMP/libiomp5.dylib $OUT/x64/ 12 | 13 | clang++ -std=c++11 -D_M_IX86 -DGCC -m32 --shared -fPIC -o $OUT/x86/libMathNetNumericsMKL.dylib -I$MKL/include -I../Common -I../MKL ../MKL/memory.c ../MKL/capabilities.cpp ../MKL/vector_functions.c ../Common/blas.c ../Common/lapack.cpp ../MKL/fft.cpp $MKL/lib/libmkl_intel_lp64.a $MKL/lib/libmkl_core.a $MKL/lib/libmkl_intel_thread.a -L$OPENMP -liomp5 -lpthread -lm 14 | 15 | cp $OPENMP/libiomp5.dylib $OUT/x86/ 16 | -------------------------------------------------------------------------------- /src/NativeProviders/OpenBLAS/blas.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "cblas.h" 4 | 5 | #define blas_int blasint 6 | #define blas_complex_float openblas_complex_float 7 | #define blas_complex_double openblas_complex_double 8 | -------------------------------------------------------------------------------- /src/NativeProviders/OpenBLAS/capabilities.cpp: -------------------------------------------------------------------------------- 1 | #include "wrapper_common.h" 2 | #include "cblas.h" 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif /* __cplusplus */ 7 | 8 | /* 9 | Capability is supported if >0 10 | 11 | Actual number can be increased over time to indicate 12 | extensions/revisions (that do not break compatibility) 13 | */ 14 | DLLEXPORT int query_capability(const int capability) 15 | { 16 | switch (capability) 17 | { 18 | 19 | // SANITY CHECKS 20 | case 0: return 0; 21 | case 1: return -1; 22 | 23 | // PLATFORM 24 | case 8: 25 | #ifdef _M_IX86 26 | return 1; 27 | #else 28 | return 0; 29 | #endif 30 | case 9: 31 | #ifdef _M_X64 32 | return 1; 33 | #else 34 | return 0; 35 | #endif 36 | case 10: 37 | #ifdef _M_IA64 38 | return 1; 39 | #else 40 | return 0; 41 | #endif 42 | 43 | // COMMON/SHARED 44 | case 64: return 1; // revision 45 | case 66: return 1; // threading control 46 | 47 | // LINEAR ALGEBRA 48 | case 128: return 1; // basic dense linear algebra (major - breaking) 49 | case 129: return 0; // basic dense linear algebra (minor - non-breaking) 50 | 51 | default: return 0; // unknown or not supported 52 | 53 | } 54 | } 55 | 56 | DLLEXPORT void set_max_threads(const blasint num_threads) 57 | { 58 | openblas_set_num_threads(num_threads); 59 | } 60 | 61 | DLLEXPORT char* get_build_config() 62 | { 63 | return openblas_get_config(); 64 | } 65 | 66 | DLLEXPORT char* get_cpu_core() 67 | { 68 | return openblas_get_corename(); 69 | } 70 | 71 | DLLEXPORT int get_parallel_type() 72 | { 73 | return openblas_get_parallel(); 74 | } 75 | 76 | #ifdef __cplusplus 77 | } 78 | #endif /* __cplusplus */ 79 | -------------------------------------------------------------------------------- /src/NativeProviders/OpenBLAS/lapack.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define LAPACK_COMPLEX_CUSTOM 4 | #include 5 | #define lapack_complex_float std::complex 6 | #define lapack_complex_double std::complex 7 | 8 | #include "cblas.h" 9 | #include "lapacke.h" 10 | -------------------------------------------------------------------------------- /src/NativeProviders/OpenBLAS/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by resource.rc 4 | 5 | // Next default values for new objects 6 | // 7 | #ifdef APSTUDIO_INVOKED 8 | #ifndef APSTUDIO_READONLY_SYMBOLS 9 | #define _APS_NEXT_RESOURCE_VALUE 101 10 | #define _APS_NEXT_COMMAND_VALUE 40001 11 | #define _APS_NEXT_CONTROL_VALUE 1001 12 | #define _APS_NEXT_SYMED_VALUE 101 13 | #endif 14 | #endif 15 | -------------------------------------------------------------------------------- /src/NativeProviders/Windows/ATLAS/ATLASWrapper.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Resource Files 20 | 21 | 22 | 23 | 24 | Source Files 25 | 26 | 27 | Source Files 28 | 29 | 30 | Source Files 31 | 32 | 33 | 34 | 35 | Header Files 36 | 37 | 38 | 39 | 40 | Resource Files 41 | 42 | 43 | -------------------------------------------------------------------------------- /src/NativeProviders/Windows/ATLASEx/ATLASWrapper.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav 15 | 16 | 17 | 18 | 19 | Header Files 20 | 21 | 22 | Header Files 23 | 24 | 25 | 26 | 27 | Resource Files 28 | 29 | 30 | 31 | 32 | Source Files 33 | 34 | 35 | Source Files 36 | 37 | 38 | Source Files 39 | 40 | 41 | -------------------------------------------------------------------------------- /src/NativeProviders/Windows/CUDA/CUDAWrapper.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Resource Files 20 | 21 | 22 | 23 | 24 | Source Files 25 | 26 | 27 | Source Files 28 | 29 | 30 | Source Files 31 | 32 | 33 | Source Files 34 | 35 | 36 | 37 | 38 | Header Files 39 | 40 | 41 | 42 | 43 | Resource Files 44 | 45 | 46 | -------------------------------------------------------------------------------- /src/Numerics.Tests/IntegrationTests/IntegrationTest.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathnet/mathnet-numerics/84e9432bc1e8a6b2ae7acd32cda4175abeaeaed1/src/Numerics.Tests/IntegrationTests/IntegrationTest.cs -------------------------------------------------------------------------------- /src/Numerics.Tests/LinearAlgebraTests/VectorToStringTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using MathNet.Numerics.LinearAlgebra; 3 | using NUnit.Framework; 4 | 5 | namespace MathNet.Numerics.Tests.LinearAlgebraTests 6 | { 7 | [TestFixture] 8 | public class VectorToStringTests 9 | { 10 | Vector v1 = Vector.Build.Dense(1, i => (i + 1)*Constants.Pi); 11 | Vector v2 = Vector.Build.Dense(2, i => (i + 1)*Constants.Pi); 12 | Vector v100 = Vector.Build.Dense(100, i => (i + 1)*Constants.Pi); 13 | readonly string NL = Environment.NewLine; 14 | 15 | [Test] 16 | public void MinimumLimits() 17 | { 18 | System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture; 19 | 20 | Assert.That(v1.ToVectorString(3, 16, "G6"), Is.EqualTo("3.14159" + NL)); 21 | Assert.That(v2.ToVectorString(3, 16, "G6"), Is.EqualTo("3.14159" + NL + "6.28319" + NL)); 22 | Assert.That(v100.ToVectorString(3, 16, "G6"), Is.EqualTo("3.14159" + NL + " .." + NL + "314.159" + NL)); 23 | } 24 | 25 | [Test] 26 | public void GitHubIssue387() 27 | { 28 | System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture; 29 | 30 | Vector v = Vector.Build.DenseOfArray(new[] 31 | { 32 | 0.607142857142857, 33 | 1.17857142857143 34 | }); 35 | 36 | Assert.That(v.ToVectorString(12, 12, "..", " ", "\n", x => x.ToString()), Is.EqualTo("0.607142857142857\n 1.17857142857143\n")); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/Numerics.Tests/Numerics.Tests.CUDA.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | false 6 | net6.0;net48 7 | MathNet.Numerics.Tests.CUDA 8 | MathNet.Numerics.Tests 9 | false 10 | 5.0.0 11 | alpha02 12 | false 13 | CUDA 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | all 33 | runtime; build; native; contentfiles; analyzers; buildtransitive 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /src/Numerics.Tests/Numerics.Tests.MKL.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | false 6 | net6.0;net48 7 | MathNet.Numerics.Tests.MKL 8 | MathNet.Numerics.Tests 9 | false 10 | 5.0.0 11 | alpha02 12 | false 13 | MKL 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | all 33 | runtime; build; native; contentfiles; analyzers; buildtransitive 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /src/Numerics.Tests/Numerics.Tests.OpenBLAS.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | false 6 | net6.0;net48 7 | MathNet.Numerics.Tests.OpenBLAS 8 | MathNet.Numerics.Tests 9 | false 10 | 5.0.0 11 | alpha02 12 | false 13 | OPENBLAS 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | all 33 | runtime; build; native; contentfiles; analyzers; buildtransitive 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /src/Numerics.Tests/Numerics.Tests.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | false 6 | net8.0;net48 7 | 7.3 8 | MathNet.Numerics.Tests 9 | MathNet.Numerics.Tests 10 | false 11 | 5.0.0 12 | alpha02 13 | false 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | all 32 | runtime; build; native; contentfiles; analyzers; buildtransitive 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /src/Numerics.Tests/OptimizationTests/TestCaseDataExtensions.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Math.NET Numerics, part of the Math.NET Project 3 | // http://numerics.mathdotnet.com 4 | // http://github.com/mathnet/mathnet-numerics 5 | // 6 | // Copyright (c) 2009-2017 Math.NET 7 | // 8 | // Permission is hereby granted, free of charge, to any person 9 | // obtaining a copy of this software and associated documentation 10 | // files (the "Software"), to deal in the Software without 11 | // restriction, including without limitation the rights to use, 12 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the 14 | // Software is furnished to do so, subject to the following 15 | // conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | // OTHER DEALINGS IN THE SOFTWARE. 28 | // 29 | 30 | using NUnit.Framework; 31 | 32 | namespace MathNet.Numerics.Tests.OptimizationTests 33 | { 34 | internal static class TestCaseDataExtensions 35 | { 36 | public static TestCaseData IgnoreIf(this TestCaseData input, bool do_ignore, string reason) 37 | { 38 | if (do_ignore) 39 | return input.Ignore(reason); 40 | else 41 | return input; 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/Numerics.Tests/Program.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Math.NET Numerics, part of the Math.NET Project 3 | // http://numerics.mathdotnet.com 4 | // http://github.com/mathnet/mathnet-numerics 5 | // 6 | // Copyright (c) 2009-2017 Math.NET 7 | // 8 | // Permission is hereby granted, free of charge, to any person 9 | // obtaining a copy of this software and associated documentation 10 | // files (the "Software"), to deal in the Software without 11 | // restriction, including without limitation the rights to use, 12 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the 14 | // Software is furnished to do so, subject to the following 15 | // conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | // OTHER DEALINGS IN THE SOFTWARE. 28 | // 29 | 30 | using NUnitLite; 31 | using System.Reflection; 32 | 33 | namespace MathNet.Numerics.Tests 34 | { 35 | class Program 36 | { 37 | public static int Main(string[] args) 38 | { 39 | return new AutoRun(typeof(Program).GetTypeInfo().Assembly).Execute(args); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/Numerics.Tests/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | using MathNet.Numerics.Tests; 3 | 4 | [assembly: ComVisible(false)] 5 | [assembly: Guid("04157581-63f3-447b-a277-83c6e69126a4")] 6 | 7 | [assembly: UseLinearAlgebraProvider] 8 | -------------------------------------------------------------------------------- /src/Numerics.Tests/Random/CryptoRandomSourceTests.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Math.NET Numerics, part of the Math.NET Project 3 | // http://numerics.mathdotnet.com 4 | // http://github.com/mathnet/mathnet-numerics 5 | // 6 | // Copyright (c) 2009-2016 Math.NET 7 | // 8 | // Permission is hereby granted, free of charge, to any person 9 | // obtaining a copy of this software and associated documentation 10 | // files (the "Software"), to deal in the Software without 11 | // restriction, including without limitation the rights to use, 12 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the 14 | // Software is furnished to do so, subject to the following 15 | // conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | // OTHER DEALINGS IN THE SOFTWARE. 28 | // 29 | 30 | using MathNet.Numerics.Random; 31 | using NUnit.Framework; 32 | 33 | namespace MathNet.Numerics.Tests.Random 34 | { 35 | /// 36 | /// Tests for a random number generator based on the class in the .NET library 37 | /// 38 | [TestFixture, Category("Random")] 39 | public class CryptoRandomSourceTests : RandomTests 40 | { 41 | /// 42 | /// Initializes a new instance of the SystemCryptoRandomNumberGeneratorTests class. 43 | /// 44 | public CryptoRandomSourceTests() : base(typeof (CryptoRandomSource)) 45 | { 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/Numerics.Tests/Random/SystemRandomSourceTests.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Math.NET Numerics, part of the Math.NET Project 3 | // http://numerics.mathdotnet.com 4 | // http://github.com/mathnet/mathnet-numerics 5 | // 6 | // Copyright (c) 2009-2016 Math.NET 7 | // 8 | // Permission is hereby granted, free of charge, to any person 9 | // obtaining a copy of this software and associated documentation 10 | // files (the "Software"), to deal in the Software without 11 | // restriction, including without limitation the rights to use, 12 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the 14 | // Software is furnished to do so, subject to the following 15 | // conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | // OTHER DEALINGS IN THE SOFTWARE. 28 | // 29 | 30 | using MathNet.Numerics.Random; 31 | using NUnit.Framework; 32 | 33 | namespace MathNet.Numerics.Tests.Random 34 | { 35 | /// 36 | /// Tests for System.Random. 37 | /// 38 | [TestFixture, Category("Random")] 39 | public class SystemRandomSourceTests : RandomTests 40 | { 41 | public SystemRandomSourceTests() : base(typeof(SystemRandomSource)) 42 | { 43 | } 44 | 45 | [Test] 46 | public void StaticSamplesConsistent() 47 | { 48 | Assert.That(SystemRandomSource.Doubles(1000, 1), Is.EqualTo(new SystemRandomSource(1).NextDoubles(1000)).Within(1e-12).AsCollection); 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/Numerics.Tests/WindowTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using NUnit.Framework; 7 | 8 | namespace MathNet.Numerics.Tests 9 | { 10 | [TestFixture, Category("WindowFunctions")] 11 | public class WindowTest 12 | { 13 | 14 | [Test] 15 | public void TukeyWin0() 16 | { 17 | 18 | var expected = new[] { 1, 1, 1, 1, 1, 1 }; 19 | var actual = Window.Tukey(6, 0); 20 | 21 | Assert.That(actual, Is.EqualTo(expected).Within(0.00005)); 22 | 23 | } 24 | 25 | [Test] 26 | public void TukeyWin1() 27 | { 28 | 29 | var expected = new[] { 0, 0.3455, 0.9045, 0.9045, 0.3455, 0 }; 30 | var actual = Window.Tukey(6, 1); 31 | 32 | Assert.That(actual, Is.EqualTo(expected).Within(0.00005)); 33 | 34 | } 35 | 36 | [Test] 37 | public void TukeyWin25() 38 | { 39 | 40 | var expected = new[] { 0, 0.9698, 1, 1, 1, 1, 1, 1, 0.9698, 0 }; 41 | var actual = Window.Tukey(10, 0.25); 42 | 43 | Assert.That(actual, Is.EqualTo(expected).Within(0.00005)); 44 | 45 | } 46 | 47 | [Test] 48 | public void TukeyWin75() 49 | { 50 | 51 | var expected = new[] { 0, 0.2014, 0.6434, 0.9698, 1, 1, 0.9698, 0.6434, 0.2014, 0 }; 52 | var actual = Window.Tukey(10, 0.75F); 53 | 54 | Assert.That(actual, Is.EqualTo(expected).Within(0.00005)); 55 | 56 | } 57 | 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/Numerics/Distributions/IDistribution.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Math.NET Numerics, part of the Math.NET Project 3 | // http://numerics.mathdotnet.com 4 | // http://github.com/mathnet/mathnet-numerics 5 | // 6 | // Copyright (c) 2009-2013 Math.NET 7 | // 8 | // Permission is hereby granted, free of charge, to any person 9 | // obtaining a copy of this software and associated documentation 10 | // files (the "Software"), to deal in the Software without 11 | // restriction, including without limitation the rights to use, 12 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the 14 | // Software is furnished to do so, subject to the following 15 | // conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | // OTHER DEALINGS IN THE SOFTWARE. 28 | // 29 | 30 | namespace MathNet.Numerics.Distributions 31 | { 32 | /// 33 | /// Probability Distribution. 34 | /// 35 | /// 36 | /// 37 | public interface IDistribution 38 | { 39 | /// 40 | /// Gets or sets the random number generator which is used to draw random samples. 41 | /// 42 | System.Random RandomSource { get; set; } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/Numerics/Integration/GaussRule/GaussKronrodPointFactory.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace MathNet.Numerics.Integration.GaussRule 4 | { 5 | /// 6 | /// Creates a Gauss-Kronrod point. 7 | /// 8 | internal static class GaussKronrodPointFactory 9 | { 10 | [ThreadStatic] 11 | static GaussPointPair _gaussKronrodPoint; 12 | 13 | /// 14 | /// Getter for the GaussKronrodPoint. 15 | /// 16 | /// Defines an Nth order Gauss-Kronrod rule. Precomputed Gauss-Kronrod abscissas/weights for orders 15, 21, 31, 41, 51, 61 are used, otherwise they're calculated on the fly. 17 | /// Object containing the non-negative abscissas/weights, and order. 18 | public static GaussPointPair GetGaussPoint(int order) 19 | { 20 | // Try to get the GaussKronrodPoint from the cached static field. 21 | bool gaussKronrodPointIsCached = _gaussKronrodPoint != null && _gaussKronrodPoint.Order == order; 22 | if (!gaussKronrodPointIsCached) 23 | { 24 | // Try to find the GaussKronrodPoint in the precomputed dictionary. 25 | if (!GaussKronrodPoint.PreComputed.TryGetValue(order, out _gaussKronrodPoint)) 26 | { 27 | _gaussKronrodPoint = GaussKronrodPoint.Generate(order, 1E-10); 28 | } 29 | } 30 | 31 | return _gaussKronrodPoint; 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/Numerics/Integration/GaussRule/GaussPointPair.cs: -------------------------------------------------------------------------------- 1 | namespace MathNet.Numerics.Integration.GaussRule 2 | { 3 | /// 4 | /// Contains two GaussPoint. 5 | /// 6 | internal class GaussPointPair 7 | { 8 | internal int Order { get; } 9 | 10 | internal double[] Abscissas { get; } 11 | 12 | internal double[] Weights { get; } 13 | 14 | internal int SecondOrder { get; } 15 | 16 | internal double[] SecondAbscissas { get; } 17 | 18 | internal double[] SecondWeights { get; } 19 | 20 | internal double IntervalBegin { get; } 21 | 22 | internal double IntervalEnd { get; } 23 | 24 | internal GaussPointPair(double intervalBegin, double intervalEnd, int order, double[] abscissas, double[] weights, int secondOrder, double[] secondAbscissas, double[] secondWeights) 25 | { 26 | IntervalBegin = intervalBegin; 27 | IntervalEnd = intervalEnd; 28 | Order = order; 29 | Abscissas = abscissas; 30 | Weights = weights; 31 | SecondOrder = secondOrder; 32 | SecondAbscissas = secondAbscissas; 33 | SecondWeights = secondWeights; 34 | } 35 | 36 | internal GaussPointPair(int order, double[] abscissas, double[] weights, int secondOrder, double[] secondWeights) 37 | : this(-1, 1, order, abscissas, weights, secondOrder, null, secondWeights) 38 | { } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/Numerics/LinearAlgebra/Solvers/IterationStatus.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Math.NET Numerics, part of the Math.NET Project 3 | // http://numerics.mathdotnet.com 4 | // http://github.com/mathnet/mathnet-numerics 5 | // 6 | // Copyright (c) 2009-2014 Math.NET 7 | // 8 | // Permission is hereby granted, free of charge, to any person 9 | // obtaining a copy of this software and associated documentation 10 | // files (the "Software"), to deal in the Software without 11 | // restriction, including without limitation the rights to use, 12 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the 14 | // Software is furnished to do so, subject to the following 15 | // conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | // OTHER DEALINGS IN THE SOFTWARE. 28 | // 29 | 30 | namespace MathNet.Numerics.LinearAlgebra.Solvers 31 | { 32 | /// 33 | /// Iterative Calculation Status 34 | /// 35 | public enum IterationStatus 36 | { 37 | Continue = 0, 38 | Converged, 39 | Diverged, 40 | StoppedWithoutConvergence, 41 | Cancelled, 42 | Failure 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/Numerics/LinearRegression/Options.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Math.NET Numerics, part of the Math.NET Project 3 | // http://numerics.mathdotnet.com 4 | // http://github.com/mathnet/mathnet-numerics 5 | // 6 | // Copyright (c) 2009-2014 Math.NET 7 | // 8 | // Permission is hereby granted, free of charge, to any person 9 | // obtaining a copy of this software and associated documentation 10 | // files (the "Software"), to deal in the Software without 11 | // restriction, including without limitation the rights to use, 12 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the 14 | // Software is furnished to do so, subject to the following 15 | // conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | // OTHER DEALINGS IN THE SOFTWARE. 28 | // 29 | 30 | namespace MathNet.Numerics.LinearRegression 31 | { 32 | public enum DirectRegressionMethod 33 | { 34 | NormalEquations = 0, 35 | QR, 36 | Svd 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/Numerics/Optimization/ExitCondition.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Math.NET Numerics, part of the Math.NET Project 3 | // http://numerics.mathdotnet.com 4 | // http://github.com/mathnet/mathnet-numerics 5 | // 6 | // Copyright (c) 2009-2017 Math.NET 7 | // 8 | // Permission is hereby granted, free of charge, to any person 9 | // obtaining a copy of this software and associated documentation 10 | // files (the "Software"), to deal in the Software without 11 | // restriction, including without limitation the rights to use, 12 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the 14 | // Software is furnished to do so, subject to the following 15 | // conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | // OTHER DEALINGS IN THE SOFTWARE. 28 | // 29 | 30 | namespace MathNet.Numerics.Optimization 31 | { 32 | public enum ExitCondition 33 | { 34 | None, 35 | InvalidValues, 36 | ExceedIterations, 37 | RelativePoints, 38 | RelativeGradient, 39 | LackOfProgress, 40 | AbsoluteGradient, 41 | WeakWolfeCriteria, 42 | BoundTolerance, 43 | StrongWolfeCriteria, 44 | Converged, 45 | ManuallyStopped 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/Numerics/Optimization/IUnconstrainedMinimizer.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Math.NET Numerics, part of the Math.NET Project 3 | // http://numerics.mathdotnet.com 4 | // http://github.com/mathnet/mathnet-numerics 5 | // 6 | // Copyright (c) 2009-2017 Math.NET 7 | // 8 | // Permission is hereby granted, free of charge, to any person 9 | // obtaining a copy of this software and associated documentation 10 | // files (the "Software"), to deal in the Software without 11 | // restriction, including without limitation the rights to use, 12 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the 14 | // Software is furnished to do so, subject to the following 15 | // conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | // OTHER DEALINGS IN THE SOFTWARE. 28 | // 29 | 30 | using MathNet.Numerics.LinearAlgebra; 31 | 32 | namespace MathNet.Numerics.Optimization 33 | { 34 | public interface IUnconstrainedMinimizer 35 | { 36 | MinimizationResult FindMinimum(IObjectiveFunction objective, Vector initialGuess); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/Numerics/Optimization/LineSearch/LineSearchResult.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Math.NET Numerics, part of the Math.NET Project 3 | // http://numerics.mathdotnet.com 4 | // http://github.com/mathnet/mathnet-numerics 5 | // 6 | // Copyright (c) 2009-2017 Math.NET 7 | // 8 | // Permission is hereby granted, free of charge, to any person 9 | // obtaining a copy of this software and associated documentation 10 | // files (the "Software"), to deal in the Software without 11 | // restriction, including without limitation the rights to use, 12 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the 14 | // Software is furnished to do so, subject to the following 15 | // conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | // OTHER DEALINGS IN THE SOFTWARE. 28 | // 29 | 30 | namespace MathNet.Numerics.Optimization.LineSearch 31 | { 32 | public class LineSearchResult : MinimizationResult 33 | { 34 | public double FinalStep { get; } 35 | 36 | public LineSearchResult(IObjectiveFunction functionInfo, int iterations, double finalStep, ExitCondition reasonForExit) 37 | : base(functionInfo, iterations, reasonForExit) 38 | { 39 | FinalStep = finalStep; 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/Numerics/Optimization/LineSearch/StrongWolfeLineSearch.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Math.NET Numerics, part of the Math.NET Project 3 | // http://numerics.mathdotnet.com 4 | // http://github.com/mathnet/mathnet-numerics 5 | // 6 | // Copyright (c) 2009-2017 Math.NET 7 | // 8 | // Permission is hereby granted, free of charge, to any person 9 | // obtaining a copy of this software and associated documentation 10 | // files (the "Software"), to deal in the Software without 11 | // restriction, including without limitation the rights to use, 12 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the 14 | // Software is furnished to do so, subject to the following 15 | // conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | // OTHER DEALINGS IN THE SOFTWARE. 28 | // 29 | 30 | using System; 31 | 32 | namespace MathNet.Numerics.Optimization.LineSearch 33 | { 34 | public class StrongWolfeLineSearch : WolfeLineSearch 35 | { 36 | public StrongWolfeLineSearch(double c1, double c2, double parameterTolerance, int maxIterations = 10) 37 | : base(c1, c2, parameterTolerance, maxIterations) 38 | { 39 | // Argument validation in base class 40 | } 41 | 42 | protected override ExitCondition WolfeExitCondition => ExitCondition.StrongWolfeCriteria; 43 | 44 | protected override bool WolfeCondition(double stepDd, double initialDd) 45 | { 46 | return Math.Abs(stepDd) > C2 * Math.Abs(initialDd); 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/Numerics/Optimization/MinimizationResult.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Math.NET Numerics, part of the Math.NET Project 3 | // http://numerics.mathdotnet.com 4 | // http://github.com/mathnet/mathnet-numerics 5 | // 6 | // Copyright (c) 2009-2017 Math.NET 7 | // 8 | // Permission is hereby granted, free of charge, to any person 9 | // obtaining a copy of this software and associated documentation 10 | // files (the "Software"), to deal in the Software without 11 | // restriction, including without limitation the rights to use, 12 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the 14 | // Software is furnished to do so, subject to the following 15 | // conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | // OTHER DEALINGS IN THE SOFTWARE. 28 | // 29 | 30 | using MathNet.Numerics.LinearAlgebra; 31 | 32 | namespace MathNet.Numerics.Optimization 33 | { 34 | public class MinimizationResult 35 | { 36 | public Vector MinimizingPoint => FunctionInfoAtMinimum.Point; 37 | public IObjectiveFunction FunctionInfoAtMinimum { get; } 38 | public int Iterations { get; } 39 | public ExitCondition ReasonForExit { get; } 40 | 41 | public MinimizationResult(IObjectiveFunction functionInfo, int iterations, ExitCondition reasonForExit) 42 | { 43 | FunctionInfoAtMinimum = functionInfo; 44 | Iterations = iterations; 45 | ReasonForExit = reasonForExit; 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/Numerics/Optimization/MinimizationWithLineSearchResult.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Math.NET Numerics, part of the Math.NET Project 3 | // http://numerics.mathdotnet.com 4 | // http://github.com/mathnet/mathnet-numerics 5 | // 6 | // Copyright (c) 2009-2017 Math.NET 7 | // 8 | // Permission is hereby granted, free of charge, to any person 9 | // obtaining a copy of this software and associated documentation 10 | // files (the "Software"), to deal in the Software without 11 | // restriction, including without limitation the rights to use, 12 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the 14 | // Software is furnished to do so, subject to the following 15 | // conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | // OTHER DEALINGS IN THE SOFTWARE. 28 | // 29 | 30 | namespace MathNet.Numerics.Optimization 31 | { 32 | public class MinimizationWithLineSearchResult : MinimizationResult 33 | { 34 | public int TotalLineSearchIterations { get; } 35 | public int IterationsWithNonTrivialLineSearch { get; } 36 | 37 | public MinimizationWithLineSearchResult(IObjectiveFunction functionInfo, int iterations, ExitCondition reasonForExit, int totalLineSearchIterations, int iterationsWithNonTrivialLineSearch) 38 | : base(functionInfo, iterations, reasonForExit) 39 | { 40 | TotalLineSearchIterations = totalLineSearchIterations; 41 | IterationsWithNonTrivialLineSearch = iterationsWithNonTrivialLineSearch; 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/Numerics/Optimization/ScalarMinimizationResult.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Math.NET Numerics, part of the Math.NET Project 3 | // http://numerics.mathdotnet.com 4 | // http://github.com/mathnet/mathnet-numerics 5 | // 6 | // Copyright (c) 2009-2017 Math.NET 7 | // 8 | // Permission is hereby granted, free of charge, to any person 9 | // obtaining a copy of this software and associated documentation 10 | // files (the "Software"), to deal in the Software without 11 | // restriction, including without limitation the rights to use, 12 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the 14 | // Software is furnished to do so, subject to the following 15 | // conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | // OTHER DEALINGS IN THE SOFTWARE. 28 | // 29 | 30 | namespace MathNet.Numerics.Optimization 31 | { 32 | public class ScalarMinimizationResult 33 | { 34 | public double MinimizingPoint => FunctionInfoAtMinimum.Point; 35 | public IScalarObjectiveFunctionEvaluation FunctionInfoAtMinimum { get; } 36 | public int Iterations { get; } 37 | public ExitCondition ReasonForExit { get; } 38 | 39 | public ScalarMinimizationResult(IScalarObjectiveFunctionEvaluation functionInfo, int iterations, ExitCondition reasonForExit) 40 | { 41 | FunctionInfoAtMinimum = functionInfo; 42 | Iterations = iterations; 43 | ReasonForExit = reasonForExit; 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/Numerics/Optimization/TrustRegion/ITrustRegionSubProblem.cs: -------------------------------------------------------------------------------- 1 | using MathNet.Numerics.LinearAlgebra; 2 | 3 | namespace MathNet.Numerics.Optimization.TrustRegion 4 | { 5 | public interface ITrustRegionSubproblem 6 | { 7 | Vector Pstep { get; } 8 | bool HitBoundary { get; } 9 | 10 | void Solve(IObjectiveModel objective, double radius); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/Numerics/Optimization/TrustRegion/Subproblems/DogLegSubproblem.cs: -------------------------------------------------------------------------------- 1 | using MathNet.Numerics.LinearAlgebra; 2 | 3 | namespace MathNet.Numerics.Optimization.TrustRegion.Subproblems 4 | { 5 | internal class DogLegSubproblem : ITrustRegionSubproblem 6 | { 7 | public Vector Pstep { get; private set; } 8 | 9 | public bool HitBoundary { get; private set; } 10 | 11 | public void Solve(IObjectiveModel objective, double delta) 12 | { 13 | var Gradient = objective.Gradient; 14 | var Hessian = objective.Hessian; 15 | 16 | // newton point, the Gauss–Newton step by solving the normal equations 17 | var Pgn = -Hessian.PseudoInverse() * Gradient; // Hessian.Solve(Gradient) fails so many times... 18 | 19 | // cauchy point, steepest descent direction is given by 20 | var alpha = Gradient.DotProduct(Gradient) / (Hessian * Gradient).DotProduct(Gradient); 21 | var Psd = -alpha * Gradient; 22 | 23 | // update step and prectted reduction 24 | if (Pgn.L2Norm() <= delta) 25 | { 26 | // Pgn is inside trust region radius 27 | HitBoundary = false; 28 | Pstep = Pgn; 29 | } 30 | else if (alpha * Psd.L2Norm() >= delta) 31 | { 32 | // Psd is outside trust region radius 33 | HitBoundary = true; 34 | Pstep = delta / Psd.L2Norm() * Psd; 35 | } 36 | else 37 | { 38 | // Pstep is intersection of the trust region boundary 39 | HitBoundary = true; 40 | var beta = Util.FindBeta(alpha, Psd, Pgn, delta).Item2; 41 | Pstep = alpha * Psd + beta * (Pgn - alpha * Psd); 42 | } 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/Numerics/Optimization/TrustRegion/Subproblems/Util.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using MathNet.Numerics.LinearAlgebra; 3 | 4 | namespace MathNet.Numerics.Optimization.TrustRegion.Subproblems 5 | { 6 | internal static class Util 7 | { 8 | public static (double, double) FindBeta(double alpha, Vector sd, Vector gn, double delta) 9 | { 10 | // Pstep is intersection of the trust region boundary 11 | // Pstep = α*Psd + β*(Pgn - α*Psd) 12 | // find r so that ||Pstep|| = Δ 13 | // z = α*Psd, d = (Pgn - z) 14 | // (d^2)β^2 + (2*z*d)β + (z^2 - Δ^2) = 0 15 | // 16 | // positive β is used for the quadratic formula 17 | 18 | var z = alpha * sd; 19 | var d = gn - z; 20 | 21 | var a = d.DotProduct(d); 22 | var b = 2.0 * z.DotProduct(d); 23 | var c = z.DotProduct(z) - delta * delta; 24 | 25 | var aux = b + ((b >= 0) ? 1.0 : -1.0) * Math.Sqrt(b * b - 4.0 * a * c); 26 | var beta1 = -aux / 2.0 / a; 27 | var beta2 = -2.0 * c / aux; 28 | 29 | // return sorted beta 30 | return beta1 < beta2 ? (beta1, beta2) : (beta2, beta1); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/Numerics/Optimization/TrustRegion/TrustRegionDogLegMinimizer.cs: -------------------------------------------------------------------------------- 1 | namespace MathNet.Numerics.Optimization.TrustRegion 2 | { 3 | public sealed class TrustRegionDogLegMinimizer : TrustRegionMinimizerBase 4 | { 5 | /// 6 | /// Non-linear least square fitting by the trust region dogleg algorithm. 7 | /// 8 | public TrustRegionDogLegMinimizer(double gradientTolerance = 1E-8, double stepTolerance = 1E-8, double functionTolerance = 1E-8, double radiusTolerance = 1E-8, int maximumIterations = -1) 9 | : base(TrustRegionSubproblem.DogLeg(), gradientTolerance, stepTolerance, functionTolerance, radiusTolerance, maximumIterations) 10 | { } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/Numerics/Optimization/TrustRegion/TrustRegionNewtonCGMinimizer.cs: -------------------------------------------------------------------------------- 1 | namespace MathNet.Numerics.Optimization.TrustRegion 2 | { 3 | public sealed class TrustRegionNewtonCGMinimizer : TrustRegionMinimizerBase 4 | { 5 | /// 6 | /// Non-linear least square fitting by the trust region Newton-Conjugate-Gradient algorithm. 7 | /// 8 | public TrustRegionNewtonCGMinimizer(double gradientTolerance = 1E-8, double stepTolerance = 1E-8, double functionTolerance = 1E-8, double radiusTolerance = 1E-8, int maximumIterations = -1) 9 | : base(TrustRegionSubproblem.NewtonCG(), gradientTolerance, stepTolerance, functionTolerance, radiusTolerance, maximumIterations) 10 | { } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/Numerics/Optimization/TrustRegion/TrustRegionSubProblem.cs: -------------------------------------------------------------------------------- 1 | using MathNet.Numerics.Optimization.TrustRegion.Subproblems; 2 | 3 | namespace MathNet.Numerics.Optimization.TrustRegion 4 | { 5 | public static class TrustRegionSubproblem 6 | { 7 | public static ITrustRegionSubproblem DogLeg() 8 | { 9 | return new DogLegSubproblem(); 10 | } 11 | 12 | public static ITrustRegionSubproblem NewtonCG() 13 | { 14 | return new NewtonCGSubproblem(); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Numerics/Providers/IProviderCreator.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Math.NET Numerics, part of the Math.NET Project 3 | // https://numerics.mathdotnet.com 4 | // https://github.com/mathnet/mathnet-numerics 5 | // 6 | // Copyright (c) 2009-2021 Math.NET 7 | // 8 | // Permission is hereby granted, free of charge, to any person 9 | // obtaining a copy of this software and associated documentation 10 | // files (the "Software"), to deal in the Software without 11 | // restriction, including without limitation the rights to use, 12 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the 14 | // Software is furnished to do so, subject to the following 15 | // conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | // OTHER DEALINGS IN THE SOFTWARE. 28 | // 29 | 30 | namespace MathNet.Numerics.Providers 31 | { 32 | public interface IProviderCreator where T : class 33 | { 34 | T CreateProvider(); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/Numerics/Random/RandomSeed.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace MathNet.Numerics.Random 4 | { 5 | public static class RandomSeed 6 | { 7 | static readonly object Lock = new object(); 8 | static readonly System.Security.Cryptography.RandomNumberGenerator MasterRng = System.Security.Cryptography.RandomNumberGenerator.Create(); 9 | 10 | /// 11 | /// Provides a time-dependent seed value, matching the default behavior of System.Random. 12 | /// WARNING: There is no randomness in this seed and quick repeated calls can cause 13 | /// the same seed value. Do not use for cryptography! 14 | /// 15 | public static int Time() 16 | { 17 | return Environment.TickCount; 18 | } 19 | 20 | /// 21 | /// Provides a seed based on time and unique GUIDs. 22 | /// WARNING: There is only low randomness in this seed, but at least quick repeated 23 | /// calls will result in different seed values. Do not use for cryptography! 24 | /// 25 | public static int Guid() 26 | { 27 | return Environment.TickCount ^ System.Guid.NewGuid().GetHashCode(); 28 | } 29 | 30 | /// 31 | /// Provides a seed based on an internal random number generator (crypto if available), time and unique GUIDs. 32 | /// WARNING: There is only medium randomness in this seed, but quick repeated 33 | /// calls will result in different seed values. Do not use for cryptography! 34 | /// 35 | public static int Robust() 36 | { 37 | lock (Lock) 38 | { 39 | var bytes = new byte[4]; 40 | MasterRng.GetBytes(bytes); 41 | return BitConverter.ToInt32(bytes, 0); 42 | } 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/Numerics/Statistics/QuantileDefinition.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Math.NET Numerics, part of the Math.NET Project 3 | // http://numerics.mathdotnet.com 4 | // http://github.com/mathnet/mathnet-numerics 5 | // 6 | // Copyright (c) 2009-2013 Math.NET 7 | // 8 | // Permission is hereby granted, free of charge, to any person 9 | // obtaining a copy of this software and associated documentation 10 | // files (the "Software"), to deal in the Software without 11 | // restriction, including without limitation the rights to use, 12 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the 14 | // Software is furnished to do so, subject to the following 15 | // conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | // OTHER DEALINGS IN THE SOFTWARE. 28 | // 29 | 30 | namespace MathNet.Numerics.Statistics 31 | { 32 | public enum QuantileDefinition 33 | { 34 | R1 = 1, SAS3 = 1, EmpiricalInvCDF = 1, 35 | R2 = 2, SAS5 = 2, EmpiricalInvCDFAverage = 2, 36 | R3 = 3, SAS2 = 3, Nearest = 3, 37 | R4 = 4, SAS1 = 4, California = 4, 38 | R5 = 5, Hydrology = 5, Hazen = 5, 39 | R6 = 6, SAS4 = 6, Nist = 6, Weibull = 6, SPSS = 6, 40 | R7 = 7, Excel = 7, Mode = 7, S = 7, 41 | R8 = 8, Median = 8, Default = 8, 42 | R9 = 9, Normal = 9, 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/Numerics/Statistics/RankDefinition.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Math.NET Numerics, part of the Math.NET Project 3 | // http://numerics.mathdotnet.com 4 | // http://github.com/mathnet/mathnet-numerics 5 | // 6 | // Copyright (c) 2009-2013 Math.NET 7 | // 8 | // Permission is hereby granted, free of charge, to any person 9 | // obtaining a copy of this software and associated documentation 10 | // files (the "Software"), to deal in the Software without 11 | // restriction, including without limitation the rights to use, 12 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the 14 | // Software is furnished to do so, subject to the following 15 | // conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | // OTHER DEALINGS IN THE SOFTWARE. 28 | // 29 | 30 | namespace MathNet.Numerics.Statistics 31 | { 32 | public enum RankDefinition 33 | { 34 | /// Replace ties with their mean (non-integer ranks). Default. 35 | Average = 1, 36 | Default = 1, 37 | 38 | /// Replace ties with their minimum (typical sports ranking). 39 | Min = 2, 40 | Sports = 2, 41 | 42 | /// Replace ties with their maximum. 43 | Max = 3, 44 | 45 | /// Permutation with increasing values at each index of ties. 46 | First = 4, 47 | 48 | EmpiricalCDF = 5 49 | } 50 | } -------------------------------------------------------------------------------- /src/Providers.CUDA/CudaProviderCapabilities.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Math.NET Numerics, part of the Math.NET Project 3 | // http://numerics.mathdotnet.com 4 | // http://github.com/mathnet/mathnet-numerics 5 | // 6 | // Copyright (c) 2009-2016 Math.NET 7 | // 8 | // Permission is hereby granted, free of charge, to any person 9 | // obtaining a copy of this software and associated documentation 10 | // files (the "Software"), to deal in the Software without 11 | // restriction, including without limitation the rights to use, 12 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the 14 | // Software is furnished to do so, subject to the following 15 | // conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | // OTHER DEALINGS IN THE SOFTWARE. 28 | // 29 | 30 | namespace MathNet.Numerics.Providers.CUDA 31 | { 32 | internal enum ProviderPlatform : int 33 | { 34 | x86 = 8, 35 | x64 = 9, 36 | ia64 = 10, 37 | } 38 | 39 | internal enum ProviderConfig : int 40 | { 41 | Revision = 64, 42 | } 43 | 44 | internal enum ProviderCapability : int 45 | { 46 | LinearAlgebraMajor = 128, 47 | LinearAlgebraMinor = 129, 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/Providers.MKL/Providers.MKL.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Library 5 | net8.0;net6.0;net48;netstandard2.0 6 | 7.3 7 | MathNet.Numerics.Providers.MKL 8 | MathNet.Numerics.Providers.MKL 9 | true 10 | MathNet.Numerics.Providers.MKL 11 | MathNet.Numerics.Providers.MKL.Signed 12 | 6.0.0 13 | beta2 14 | Math.NET Numerics MKL Provider$(TitleSuffix) 15 | 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.$(DescriptionSuffix) 16 | intermediate beta, mainly to verify we can still do releases 17 | many contributions, proper release notes with attributions will follow. thank you all! 18 | false 19 | true 20 | 1701;1702;1705;1591;1573 21 | 22 | 23 | 24 | 25 | 26 | 27 | all 28 | runtime; build; native; contentfiles; analyzers; buildtransitive 29 | 30 | 31 | all 32 | runtime; build; native; contentfiles; analyzers; buildtransitive 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /src/Providers.OpenBLAS/OpenBlasProviderCapabilities.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Math.NET Numerics, part of the Math.NET Project 3 | // http://numerics.mathdotnet.com 4 | // http://github.com/mathnet/mathnet-numerics 5 | // 6 | // Copyright (c) 2009-2016 Math.NET 7 | // 8 | // Permission is hereby granted, free of charge, to any person 9 | // obtaining a copy of this software and associated documentation 10 | // files (the "Software"), to deal in the Software without 11 | // restriction, including without limitation the rights to use, 12 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the 14 | // Software is furnished to do so, subject to the following 15 | // conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | // OTHER DEALINGS IN THE SOFTWARE. 28 | // 29 | 30 | namespace MathNet.Numerics.Providers.OpenBLAS 31 | { 32 | internal enum ProviderPlatform : int 33 | { 34 | x86 = 8, 35 | x64 = 9, 36 | ia64 = 10, 37 | arm = 11, 38 | } 39 | 40 | internal enum ProviderConfig : int 41 | { 42 | Revision = 64, 43 | Threading = 66, 44 | } 45 | 46 | internal enum ProviderCapability : int 47 | { 48 | LinearAlgebraMajor = 128, 49 | LinearAlgebraMinor = 129 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/TestData/Data.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.IO; 3 | using System.Reflection; 4 | 5 | namespace MathNet.Numerics.TestData 6 | { 7 | public static class Data 8 | { 9 | static readonly Assembly DataAssembly = typeof (Data).Assembly; 10 | 11 | public static Stream ReadStream(string name) 12 | { 13 | return DataAssembly.GetManifestResourceStream("MathNet.Numerics.TestData.Data." + name); 14 | } 15 | 16 | public static TextReader ReadText(string name) 17 | { 18 | var stream = ReadStream(name); 19 | return new StreamReader(stream); 20 | } 21 | 22 | public static string[] ReadAllLines(string name) 23 | { 24 | List lines = new List(); 25 | 26 | using (TextReader reader = ReadText(name)) 27 | { 28 | string line; 29 | while ((line = reader.ReadLine()) != null) 30 | { 31 | lines.Add(line); 32 | } 33 | } 34 | 35 | return lines.ToArray(); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/TestData/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | [assembly: ComVisible(false)] 4 | [assembly: Guid("a4a6a08e-5265-4608-a43d-e4f2e210ba2d")] 5 | -------------------------------------------------------------------------------- /tools/docu/Spark.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathnet/mathnet-numerics/84e9432bc1e8a6b2ae7acd32cda4175abeaeaed1/tools/docu/Spark.dll -------------------------------------------------------------------------------- /tools/docu/docu.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathnet/mathnet-numerics/84e9432bc1e8a6b2ae7acd32cda4175abeaeaed1/tools/docu/docu.exe -------------------------------------------------------------------------------- /tools/docu/docu.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /tools/docu/templates/!namespace/_comment.spark: -------------------------------------------------------------------------------- 1 | ${Format(content)} -------------------------------------------------------------------------------- /tools/docu/templates/!namespace/_events.spark: -------------------------------------------------------------------------------- 1 |  2 |

${title}

3 | 4 |
5 |

${h(ev.Name)}

6 |
7 | 8 | 9 | 10 |
11 |
12 |
-------------------------------------------------------------------------------- /tools/docu/templates/!namespace/_example.spark: -------------------------------------------------------------------------------- 1 | 
2 | Show Example 3 |
${Format(content)}
4 |
-------------------------------------------------------------------------------- /tools/docu/templates/!namespace/_fields.spark: -------------------------------------------------------------------------------- 1 |  2 |

${title}

3 | 4 |
5 |

${h(field.ReturnType.PrettyName)} ${h(field.Name)}

6 |
7 | 8 | 9 | 10 | 11 | 14 | 15 |
12 | return ${Format(field.ReturnType)} 13 |
16 | 17 |
18 |
19 |
-------------------------------------------------------------------------------- /tools/docu/templates/!namespace/_methods.spark: -------------------------------------------------------------------------------- 1 |  2 |

${title}

3 | 4 |
5 |

${Format(method.ReturnType)} ${h(method.PrettyName)}(${OutputMethodParams(method)})

6 |
7 | 8 | 9 | 10 |
11 | Obsolete: ${method.ObsoleteReason} 12 |
13 |
14 | 15 | 16 | 17 | 18 |
19 |
Parameters
20 | 21 | 22 |
${Format(param.Reference)} ${param.Name}
23 |

24 |
25 |
26 | 27 |
28 |
Return
29 |
${Format(method.ReturnType)}
30 |

31 |
32 | 33 | 34 | 35 |
36 |
37 |
-------------------------------------------------------------------------------- /tools/docu/templates/!namespace/_namespaces.spark: -------------------------------------------------------------------------------- 1 | 
2 |

Namespaces

3 |
4 |
    5 |
  • 6 | 7 | ${Format(ns, class => "current")} 8 | 9 | ${Format(ns)} 10 | 11 |
  • 12 |
13 |
14 |
-------------------------------------------------------------------------------- /tools/docu/templates/!namespace/_properties.spark: -------------------------------------------------------------------------------- 1 |  2 |

${title}

3 | 4 |
5 |

${Format(property.ReturnType)} ${h(property.Name)} get; set;

6 |
7 | 8 | 9 | 10 |
11 | Obsolete: ${property.ObsoleteReason} 12 |
13 |
14 | 15 |
16 |
Property type
17 |
${Format(property.ReturnType)}
18 |

19 |
20 | 21 | 22 |
23 |
24 |
-------------------------------------------------------------------------------- /tools/docu/templates/!namespace/_remarks.spark: -------------------------------------------------------------------------------- 1 | 
2 | ${Format(content)} 3 |
-------------------------------------------------------------------------------- /tools/docu/templates/!namespace/_types.spark: -------------------------------------------------------------------------------- 1 | 
2 |

Types in ${Namespace.PrettyName}

3 |
4 |
    5 |
  • 6 | 7 | ${Format(type, class => "current")} 8 | 9 | ${Format(type)} 10 | 11 |
  • 12 |
13 |
14 |
-------------------------------------------------------------------------------- /tools/docu/templates/!namespace/_value.spark: -------------------------------------------------------------------------------- 1 | 
2 | Value: ${Format(content)} 3 |
-------------------------------------------------------------------------------- /tools/docu/templates/!namespace/index.htm.spark: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | ${Namespace.Name} - ${WriteProductName(Assemblies[0])} Documentation 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |

Namespace ${Namespace.Name}

16 |
17 |
18 | 19 |

Classes

20 |
    21 | 22 |
  • ${Format(type)}
  • 23 |
    24 |
25 |
26 | 27 | 28 |

Interfaces

29 |
    30 | 31 |
  • ${Format(type)}
  • 32 |
    33 |
34 |
35 |

This namespace is empty.

36 |
37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /tools/docu/templates/_footer.spark: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /tools/docu/templates/_namespaces.spark: -------------------------------------------------------------------------------- 1 | 
2 |

Namespaces

3 |
4 |
    5 |
  • ${Format(ns)}
  • 6 |
7 |
8 |
-------------------------------------------------------------------------------- /tools/docu/templates/_types.spark: -------------------------------------------------------------------------------- 1 | 
2 |

All Types

3 |
4 |
    5 | 6 |
  • ${Format(type)}
  • 7 |
    8 |
9 |
10 |
-------------------------------------------------------------------------------- /tools/docu/templates/index.htm.spark: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | ${WriteProductName(Assemblies[0])} Documentation 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |

${WriteProductName(Assemblies[0])} Documentation

13 |
14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /tools/docu/templates/js/example.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function() { 2 | $('div.example').each(function(i, div) { 3 | var a = $('a', div); 4 | var pre = $('pre', div); 5 | 6 | a.pre = pre; 7 | a.preVisible = false; 8 | pre.hide(); 9 | a.click(function() { 10 | if (a.preVisible) { 11 | a.pre.hide(); 12 | a.text('Show Example'); 13 | a.preVisible = false; 14 | } else { 15 | a.pre.show(); 16 | a.text('Hide Example'); 17 | a.preVisible = true; 18 | } 19 | }); 20 | }); 21 | }); -------------------------------------------------------------------------------- /tools/docu/templates/js/navigation.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function() { 2 | var scroll = function(selector) { 3 | var currentItem = $(selector + ' .current'); 4 | 5 | if (currentItem) 6 | $(selector + ' div.scroll').scrollTo(currentItem); 7 | }; 8 | 9 | scroll('#namespaces'); 10 | scroll('#types'); 11 | }); -------------------------------------------------------------------------------- /vagrant-bootstrap.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF 4 | echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list 5 | 6 | apt-get update 7 | apt-get -y upgrade 8 | 9 | apt-get -y install mono-complete 10 | apt-get -y install mono-tools-devel 11 | apt-get -y install referenceassemblies-pcl 12 | apt-get -y install fsharp 13 | 14 | apt-get -y autoremove 15 | 16 | mozroots --import --sync 17 | --------------------------------------------------------------------------------