Skip to content

Commit bbae540

Browse files
authored
Std Measures (#61)
* drop testvalue from proxy stuff * Std stuff * include stdmeasure * formatting * formatting * typeo(f) * version bump
1 parent f931737 commit bbae540

File tree

8 files changed

+10
-9
lines changed

8 files changed

+10
-9
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "MeasureBase"
22
uuid = "fa1605e6-acd5-459c-a1e6-7e635759db14"
33
authors = ["Chad Scherrer <[email protected]> and contributors"]
4-
version = "0.9.4"
4+
version = "0.9.5"
55

66
[deps]
77
Compat = "34da2185-b29b-5c13-b0c7-acf172513d20"

src/MeasureBase.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ include("combinators/smart-constructors.jl")
124124
include("combinators/powerweighted.jl")
125125
include("combinators/conditional.jl")
126126

127+
include("standard/stdmeasure.jl")
127128
include("standard/stdnormal.jl")
128129
include("standard/stduniform.jl")
129130
include("standard/stdexponential.jl")

src/proxies.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,5 @@ macro useproxy(M)
1919
@inline $MeasureBase.basemeasure::$M) = basemeasure(proxy(μ))
2020

2121
@inline $MeasureBase.basemeasure_depth::$M) = basemeasure_depth(proxy(μ))
22-
23-
@inline $MeasureBase.testvalue::$M) = testvalue(proxy(μ))
2422
end
2523
end

src/standard/stdexponential.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
struct StdExponential <: AbstractMeasure end
1+
struct StdExponential <: StdMeasure end
22

33
export StdExponential
44

src/standard/stdmeasure.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
abstract type StdMeasure <: AbstractMeasure end
2+
3+
StdMeasure(::typeof(rand)) = StdUniform()
4+
StdMeasure(::typeof(randn)) = StdNormal()
5+
StdMeasure(::typeof(randexp)) = StdExponential()

src/standard/stdnormal.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
struct StdNormal <: AbstractMeasure end
1+
struct StdNormal <: StdMeasure end
22

33
export StdNormal
44

src/standard/stduniform.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
struct StdUniform <: AbstractMeasure end
1+
struct StdUniform <: StdMeasure end
22

33
export StdUniform
44

test/runtests.jl

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,23 +37,20 @@ test_measures = [
3737
Dirac(0) + Dirac(1)
3838
Dirac(0.0) + Lebesgue(ℝ)
3939
SpikeMixture(Lebesgue(ℝ), 0.2)
40-
4140
StdNormal()
4241
StdNormal()^3
4342
StdNormal()^(2, 3)
4443
3 * StdNormal()
4544
0.2 * StdNormal() + 0.8 * Dirac(0.0)
4645
Dirac(0.0) + StdNormal()
4746
SpikeMixture(StdNormal(), 0.2)
48-
4947
StdUniform()
5048
StdUniform()^3
5149
StdUniform()^(2, 3)
5250
3 * StdUniform()
5351
0.2 * StdUniform() + 0.8 * Dirac(0.0)
5452
Dirac(0.0) + StdUniform()
5553
SpikeMixture(StdUniform(), 0.2)
56-
5754
StdExponential()^3
5855
StdExponential()^(2, 3)
5956
3 * StdExponential()

0 commit comments

Comments
 (0)