Skip to content

Commit

Permalink
Add single-argument method for chksquare.
Browse files Browse the repository at this point in the history
  • Loading branch information
dmbates committed Jul 9, 2014
1 parent b8c530c commit 97ee80f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions base/linalg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,12 @@ function chkstride1(A::StridedVecOrMat...)
end

#Check that matrix is square
function chksquare(A::AbstractMatrix)
m,n = size(A)
m == n || throw(DimensionMismatch("Matrix is not square"))
m
end

function chksquare(A...)
sizes=Int[]
for a in A
Expand Down

0 comments on commit 97ee80f

Please sign in to comment.