I’m playing with MonteCarloMeasurements but running up against limitations around comparisons.
julia> a = Particles(1000, Uniform(0.0,10.0))
Part1000(5.0 ± 2.89)
julia> b = Particles(1000, Uniform(0.0, 10.0))
Part1000(5.0 ± 2.89)
julia> a>b
ERROR: Comparison operators are not well defined for uncertain values and are currently turned off. Call `unsafe_comparisons(true)` to enable comparison operators for particles using the current reduction function mean. Change this function using `set_comparison_function(f)`.
Stacktrace:
[1] _comparison_operator at C:\Users\klaffedk\.julia\packages\MonteCarloMeasurements\7ez8R\src\particles.jl:333 [inlined]
[2] <(::Particles{Float64,1000}, ::Particles{Float64,1000}) at C:\Users\klaffedk\.julia\packages\MonteCarloMeasurements\7ez8R\src\particles.jl:345
[3] >(::Particles{Float64,1000}, ::Particles{Float64,1000}) at .\operators.jl:294
[4] top-level scope at none:0
julia> min(a,b)
Part1000(3.282 ± 2.33)
Why does min(a,b)
seem to work? Isn’t it ultimately doing comparisons?
I’m trying to figure out if MonteCarloMeasurements.jl can be used for a real world problem which includes saturation effects.
[Edit] P.S. I was able to rewrite my actual function with min and max and move forward, but I would still like to understand why.