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

warn in SparseMatrixExp constructor that the type is sparse #306

Closed
mforets opened this issue Mar 29, 2018 · 0 comments
Closed

warn in SparseMatrixExp constructor that the type is sparse #306

mforets opened this issue Mar 29, 2018 · 0 comments
Assignees
Labels
documentation 📖 Documentation and manual usability 🖱️ Simplifies the usage or interface

Comments

@mforets
Copy link
Member

mforets commented Mar 29, 2018

the lazy matrix exponential is only defined for sparse matrices; we could have a better error message than:

julia> A = SparseMatrixExp(rand(2, 2))
ERROR: MethodError: Cannot `convert` an object of type Array{Float64,2} to an object of type LazySets.SparseMatrixExp
This may have arisen from a call to the constructor LazySets.SparseMatrixExp(...),
since type constructors fall back to convert methods.
Stacktrace:
 [1] LazySets.SparseMatrixExp(::Array{Float64,2}) at ./sysimg.jl:77

something along the lines:

SparseMatrixExp(M::Matrix{N}) where {N} =
        error("only sparse matrices can be used to create a `SparseMatrixExp`")

an example in the docstring would also help.

@mforets mforets self-assigned this Mar 29, 2018
@mforets mforets added usability 🖱️ Simplifies the usage or interface documentation 📖 Documentation and manual labels Mar 29, 2018
mforets added a commit that referenced this issue Mar 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation 📖 Documentation and manual usability 🖱️ Simplifies the usage or interface
Projects
None yet
Development

No branches or pull requests

1 participant