-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Use Braille to display adjoint and transposed sparse matrices #36177
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
Use Braille to display adjoint and transposed sparse matrices #36177
Conversation
|
|
||
| const brailleBlocks = UInt16['⠁', '⠂', '⠄', '⡀', '⠈', '⠐', '⠠', '⢀'] | ||
| function _show_with_braille_patterns(io::IOContext, S::AbstractSparseMatrixCSC) | ||
| function _show_with_braille_patterns(io::IOContext, S::AbstractSparseMatrixCSCInclAdjointAndTranspose) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This linear algebra aliases are getting kind of ridiculous. Not a critique, just a humorous observation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I'm aware of that, I also don't like it.
If anybody has a better solution, feel free to suggest something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not to be tackled in this PR!
| _show_with_braille_patterns(io, S) | ||
| end | ||
|
|
||
| function Base.show(io::IOContext, S::Union{Adjoint{<:Any,<:AbstractSparseMatrixCSC},Transpose{<:Any,<:AbstractSparseMatrixCSC}}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the method which I'm unable to replace with
function Base.show(io::IOContext, S::AbstractSparseMatrixCSCInclAdjointAndTranspose)See the error in the description of the PR.
|
Any update on this? |
08e0504 to
61667d1
Compare
|
I have done a rebase to resolve the conflicts. |
|
Would be nice to rebase to master and see if we can get this ready for merging. |
2b909fc to
ee35f7d
Compare
|
I haven't deeply reviewed the code, but broadly speaking, it looks good to me. Those really long type names make me cringe just a little bit - but there's nothing we can do about all that right now. :-) |
|
Yeah, definitely agree. Will merge later today if there are no more comments. |
This PR fixes #34268.
Adjoint and transposed sparse matrices are now printed with Braille, similar to regular sparse matrices.
For some reason, merging the two identical
Base.showmethods into a methodby using our introduced
consttype, results in weird error, which arises when trying to print a sparse matrix:It took me so much time to figure that out, and I still don't know why this happened...
So that's the reason why I have that identical (except from the signature)
Base.showmethod twice.