Skip to content

Commit

Permalink
Merge pull request #175 from JuliaLang/anj/checksquare
Browse files Browse the repository at this point in the history
Add compatibility function Compat.LinAlg.checksquare
  • Loading branch information
andreasnoack committed Feb 24, 2016
2 parents aa23cb9 + ae4b9e5 commit edec13d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ Currently, the `@compat` macro supports the following syntaxes:

* `Base.tty_size` (which was not exported) is now `displaysize` in Julia 0.5.

* `Compat.LinAlg.checksquare` [#14601](https://github.com/JuliaLang/julia/pull/14601)

## New macros

* `@inline` and `@noinline` have been added. On 0.3, these are "no-ops," meaning they don't actually do anything.
Expand Down
8 changes: 8 additions & 0 deletions src/Compat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -859,4 +859,12 @@ else # if VERSION < v"0.5.0-dev+1182"

end

module LinAlg
if VERSION < v"0.5.0-dev+2022"
const checksquare = Base.LinAlg.chksquare
else
import Base.LinAlg.checksquare
end
end

end # module
4 changes: 4 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -820,3 +820,7 @@ end
end

@test typeof(displaysize()) == @compat(Tuple{Int, Int})

@test Compat.LinAlg.checksquare(randn(4,4)) == 4
@test Compat.LinAlg.checksquare(randn(4,4), randn(3,3)) == [4,3]
@test_throws DimensionMismatch Compat.LinAlg.checksquare(randn(4,3))

0 comments on commit edec13d

Please sign in to comment.