Skip to content

Commit

Permalink
Add (hopefully temporary) workaround for JuliaLang/julia#19595
Browse files Browse the repository at this point in the history
To avoid hitting JuliaLang/julia#19595, + and - are overloaded for the
problematic case in a rather ad-hoc fashion.
  • Loading branch information
martinholters committed Dec 19, 2016
1 parent dd6db79 commit 1eb2776
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/ACME.jl
Original file line number Diff line number Diff line change
Expand Up @@ -645,4 +645,11 @@ consecranges(lengths) = map(range, cumsum([1; lengths[1:end-1]]), lengths)
matsplit(m, rowsizes, colsizes=[size(m)[2]]) =
[m[rs, cs] for rs in consecranges(rowsizes), cs in consecranges(colsizes)]

if VERSION >= v"0.6.0-dev.1553"
# workaround for JuliaLang/julia#19595
import Base: +, -
+(x1::SparseMatrixCSC{Real}, x2::SparseMatrixCSC{Real}) = broadcast!(+, similar(x1), x1, x2)
-(x1::SparseMatrixCSC{Real}, x2::SparseMatrixCSC{Real}) = broadcast!(-, similar(x1), x1, x2)
end

end # module

0 comments on commit 1eb2776

Please sign in to comment.