Skip to content

Commit 29697a8

Browse files
authored
add some istrues (#109)
1 parent 6a5faff commit 29697a8

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/combinators/pointwise.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ end
1515

1616
@inbounds function insupport(d::PointwiseProductMeasure, p)
1717
prior, ℓ = d
18-
insupport(prior, p) && insupport(ℓ, p)
18+
istrue(insupport(prior, p)) && istrue(insupport(ℓ, p))
1919
end
2020

2121
@inline function logdensity_def(d::PointwiseProductMeasure, p)

src/density-core.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ known to be in the support of both, it can be more efficient to call
8989
)
9090
inμ = insupport(μ, x)
9191
inν = insupport(ν, x)
92-
inμ || return convert(T, ifelse(inν, -Inf, NaN))
93-
inν || return convert(T, Inf)
92+
istrue(inμ) || return convert(T, ifelse(inν, -Inf, NaN))
93+
istrue(inν) || return convert(T, Inf)
9494

9595
return unsafe_logdensity_rel(μ, ν, x)
9696
end

src/interface.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ using Reexport
44

55
@reexport using MeasureBase
66

7-
using MeasureBase: basemeasure_depth, proxy
7+
using MeasureBase: basemeasure_depth, proxy, istrue
88
using MeasureBase: insupport, basemeasure_sequence, commonbase
99
using MeasureBase: transport_to, NoTransport
1010

@@ -119,7 +119,7 @@ function test_smf(μ, n = 100)
119119
@assert issorted(p)
120120
x = invsmf.(μ, p)
121121
@test issorted(x)
122-
@test all(insupport(μ), x)
122+
@test all(istrue insupport(μ), x)
123123

124124
@test all((Finv F).(x) .≈ x)
125125

0 commit comments

Comments
 (0)