nmatrix
nmatrix copied to clipboard
#symmetric? and #hermitian? for non-dense matrices
It is probably not very hard to add Yale and List matrix support to #symmetric? and #hermitian?. It should go in nm_symmetric and nm_hermitian in ruby_nmatrix.c as far as I can tell. The dense methods are in dense.cpp and might be useful to look at when writing the code.
There is also a Ruby version for #hermitian? (but none for #symmetric?) in math.rb, which does not defer to the C++ version and is, I think, redundant, see https://github.com/SciRuby/nmatrix/pull/335.
Here it says Model it after yale/transp.template.c but there's no yale/transp.template.c file.
It is probably not very hard to add Yale and List matrix support to #symmetric?
I am not familiar with dense/non-dense representations. What does Yale and List matrix representation mean? Is it the same as non-dense representation? Is Yale and List matrix a part of Non-dense representation? What's the best place to get started with these storage types?
And thanks for making it easier by mentioning where the implementation code should go?
@lokeshh
I am not familiar with dense/non-dense representations. What does Yale and List matrix representation mean? Is it the same as non-dense representation? Is Yale and List matrix a part of Non-dense representation? What's the best place to get started with these storage types?
Sorry, I have little understanding of sparse matrix formats. I found a stackoverflow question about the Yale format that @mohawkjohn has authored 4 years ago. So, maybe the Yale matrix format discussed therein is what NMatrix is using? I guess you will have to do some research.
Ok, so I am getting started with implementing the methods for list type first. Then I will move to the yale type.
Is it fine to generate a PR even though it's not ready to be merged? I think it would be better to get some feedback along the way.
Its fine. Just mark it WIP.