Browse Source

Examples: upgrade dependencies, uncomment api usage which is now available again

spatial
Christoph Ruegg 9 years ago
parent
commit
aab2d77b3e
  1. 2
      examples/examples-csharp/examples-csharp.csproj
  2. 22
      examples/examples-fsharp/RandomAndDistributions.fs
  3. 4
      examples/examples-fsharp/examples-fsharp.fsproj

2
examples/examples-csharp/examples-csharp.csproj

@ -6,7 +6,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="MathNet.Numerics" Version="4.0.0-beta05" /> <PackageReference Include="MathNet.Numerics" Version="4.0.0-beta06" />
</ItemGroup> </ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard1.6'"> <ItemGroup Condition="'$(TargetFramework)' == 'netstandard1.6'">
<PackageReference Include="NETStandard.Library" Version="2.0.1" /> <PackageReference Include="NETStandard.Library" Version="2.0.1" />

22
examples/examples-fsharp/RandomAndDistributions.fs

@ -102,7 +102,7 @@ boolean argument at creation or by setting `Control.ThreadSafeRandomNumberGenera
let a = Random.system () let a = Random.system ()
let b = Random.systemSeed (RandomSeed.Guid()) let b = Random.systemSeed (RandomSeed.Guid())
//let c = Random.crypto () let c = Random.crypto ()
let d = Random.mersenneTwister () let d = Random.mersenneTwister ()
let e = Random.mersenneTwisterWith 1000 true (* thread-safe *) let e = Random.mersenneTwisterWith 1000 true (* thread-safe *)
let f = Random.xorshift () let f = Random.xorshift ()
@ -133,7 +133,7 @@ as last argument. A few more examples, this time in F#:
// some probability distributions // some probability distributions
let normal = Normal.WithMeanVariance(3.0, 1.5, g) let normal = Normal.WithMeanVariance(3.0, 1.5, g)
let exponential = Exponential(2.4) let exponential = Exponential(2.4)
//let gamma = Gamma(2.0, 1.5, Random.crypto()) let gamma = Gamma(2.0, 1.5, Random.crypto())
let cauchy = Cauchy(0.0, 1.0, Random.mrg32k3aWith 10 false) let cauchy = Cauchy(0.0, 1.0, Random.mrg32k3aWith 10 false)
let poisson = Poisson(3.0) let poisson = Poisson(3.0)
let geometric = Geometric(0.8, Random.system()) let geometric = Geometric(0.8, Random.system())
@ -141,8 +141,8 @@ let geometric = Geometric(0.8, Random.system())
// sample some random rumbers from these distributions // sample some random rumbers from these distributions
let continuous = let continuous =
[ yield normal.Sample() [ yield normal.Sample()
yield exponential.Sample() ] yield exponential.Sample()
// yield! gamma.Samples() |> Seq.take 10 ] yield! gamma.Samples() |> Seq.take 10 ]
let discrete = let discrete =
[ poisson.Sample() [ poisson.Sample()
@ -167,13 +167,13 @@ some of them are also available with the `Ln`-suffix.
*) *)
// distribution properties of the gamma we've configured above // distribution properties of the gamma we've configured above
//let gammaStats = let gammaStats =
// ( gamma.Mean, ( gamma.Mean,
// gamma.Variance, gamma.Variance,
// gamma.StdDev, gamma.StdDev,
// gamma.Entropy, gamma.Entropy,
// gamma.Skewness, gamma.Skewness,
// gamma.Mode ) gamma.Mode )
// probability distribution functions of the normal we've configured above. // probability distribution functions of the normal we've configured above.
let nd = normal.Density(4.0) (* pdf *) let nd = normal.Density(4.0) (* pdf *)

4
examples/examples-fsharp/examples-fsharp.fsproj

@ -23,8 +23,8 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Update="FSharp.Core" Version="4.2.3" /> <PackageReference Update="FSharp.Core" Version="4.2.3" />
<PackageReference Include="MathNet.Numerics" Version="4.0.0-beta05" /> <PackageReference Include="MathNet.Numerics" Version="4.0.0-beta06" />
<PackageReference Include="MathNet.Numerics.FSharp" Version="4.0.0-beta05" /> <PackageReference Include="MathNet.Numerics.FSharp" Version="4.0.0-beta06" />
</ItemGroup> </ItemGroup>
</Project> </Project>

Loading…
Cancel
Save