Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some sparse matrix constructors allow negative matrix dimensions #10411

Closed
jiahao opened this issue Mar 5, 2015 · 0 comments · Fixed by #10418
Closed

Some sparse matrix constructors allow negative matrix dimensions #10411

jiahao opened this issue Mar 5, 2015 · 0 comments · Fixed by #10418
Labels
bug Indicates an unexpected problem or unintended behavior sparse Sparse arrays

Comments

@jiahao
Copy link
Member

jiahao commented Mar 5, 2015

Some others give confusing errors.

julia> A=spzeros(-2,2) #???
-2x2 sparse matrix with 0 Float64 entries:

julia> sprand(-2,2,0.2) #Confusing error
ERROR: InexactError()
 in sprand at sparse/sparsematrix.jl:367
 in sprand at sparse/sparsematrix.jl:398

julia> speye(-2,2) # OK
ERROR: invalid Array dimensions
 in call at ./base.jl:275
 in speye at sparse/sparsematrix.jl:422
 in speye at sparse/sparsematrix.jl:414
@simonster simonster added bug Indicates an unexpected problem or unintended behavior sparse Sparse arrays labels Mar 5, 2015
tanmaykm added a commit to tanmaykm/julia that referenced this issue Mar 6, 2015
tanmaykm added a commit to tanmaykm/julia that referenced this issue Mar 7, 2015
tanmaykm added a commit to tanmaykm/julia that referenced this issue Mar 10, 2015
tanmaykm added a commit to tanmaykm/julia that referenced this issue Mar 11, 2015
tanmaykm added a commit that referenced this issue Mar 19, 2015
(cherry picked from commit c3b8ba2)
ref PR #10418

Conflicts:
	base/sparse/sparsematrix.jl
	test/sparsedir/sparse.jl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior sparse Sparse arrays
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants