Skip to content

Commit 146e135

Browse files
authored
Merge pull request #21 from JuliaStochOpt/bl/broadcastable
Defined broadcastable
2 parents febf431 + ff7a10a commit 146e135

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/attributes.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ attributes (properties) of transitions in the stochastic program.
2424
"""
2525
abstract type AbstractTransitionAttribute end
2626

27+
if VERSION >= v"0.7-"
28+
Base.broadcastable(attr::Union{AbstractStochasticProgramAttribute,
29+
AbstractNodeAttribute,
30+
AbstractTransitionAttribute}) = Ref(attr)
31+
end
32+
2733
"""
2834
get(sp::AbstractStochasticProgram, attr::AbstractStochasticProgramAttribute)
2935

src/stochprog.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ using LightGraphs
88
Stochastic program instance.
99
"""
1010
abstract type AbstractStochasticProgram <: LightGraphs.AbstractGraph{Int} end
11+
if VERSION >= v"0.7-"
12+
Base.broadcastable(sp::AbstractStochasticProgram) = Ref(sp)
13+
end
1114

1215
"""
1316
stochasticprogram(args...)

0 commit comments

Comments
 (0)