Skip to content

Commit

Permalink
Merge pull request #21 from JuliaStochOpt/bl/broadcastable
Browse files Browse the repository at this point in the history
Defined broadcastable
  • Loading branch information
blegat authored Oct 10, 2018
2 parents febf431 + ff7a10a commit 146e135
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/attributes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ attributes (properties) of transitions in the stochastic program.
"""
abstract type AbstractTransitionAttribute end

if VERSION >= v"0.7-"
Base.broadcastable(attr::Union{AbstractStochasticProgramAttribute,
AbstractNodeAttribute,
AbstractTransitionAttribute}) = Ref(attr)
end

"""
get(sp::AbstractStochasticProgram, attr::AbstractStochasticProgramAttribute)
Expand Down
3 changes: 3 additions & 0 deletions src/stochprog.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ using LightGraphs
Stochastic program instance.
"""
abstract type AbstractStochasticProgram <: LightGraphs.AbstractGraph{Int} end
if VERSION >= v"0.7-"
Base.broadcastable(sp::AbstractStochasticProgram) = Ref(sp)
end

"""
stochasticprogram(args...)
Expand Down

0 comments on commit 146e135

Please sign in to comment.