File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -18,4 +18,33 @@ Base.@kwdef struct HypoRecipeCompute{
1818 certainhypo:: CH = nothing
1919 """ subsection indices to select which params should be used for this hypothesis evaluation """
2020 activehypo:: Vector{Int} = Int[]
21- end
21+ end
22+
23+
24+ function Base. isapprox (
25+ a:: HypoRecipe ,
26+ b:: HypoRecipe
27+ )
28+ if ! (isnothing (a. hypotheses) && isnothing (B. hypotheses))
29+ return isapprox (a. hypotheses. p, b. hypotheses. p)
30+ end
31+ if ! (isnothing (a. certainhypo) && isnothing (B. certainhypo))
32+ return isapprox (a. certainhypo, b. certainhypo)
33+ end
34+
35+ if 0 < length (a. activehypo)
36+ if length (a. activehypo) == length (b. activehypo)
37+ return isapprox (a. activehypo, b. activehypo)
38+ else
39+ return false
40+ end
41+ end
42+
43+ return true
44+ end
45+
46+
47+ Base.== (
48+ a:: HypoRecipe ,
49+ b:: HypoRecipe
50+ ) = isapprox (a,b)
You can’t perform that action at this time.
0 commit comments