-
Notifications
You must be signed in to change notification settings - Fork 72
WIP: rewrite MatRing to wrap a native matrix #2207
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
base: master
Are you sure you want to change the base?
Conversation
|
Comment/Question about matrix multiplication (and probably other binary operators): the current proposal is for a function |
|
I think the mixed-type cases must be removed. So if we still need this, it should be |
Sorry, it was my misreading/misremembering of the code. Anyway, the only cases of interest are the two "homogeneous" cases. Thanks for the feedback! I'll deal with it tomorrow. Then the "real" function takes two |
|
Yes, sounds good. I think |
| # | ||
| ############################################################################### | ||
|
|
||
| function *(x::MatRingElem{T}, y::MatRingElem{T}) where {T <: NCRingElement} |
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.
@JohnAAbbott to partially answer your question: this function is removed in this PR
| end | ||
|
|
||
| function *(x::MatElem{T}, y::MatElem{T}) where {T <: NCRingElement} | ||
| function *(x::T, y::T) where {T <: MatrixElem} |
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.
@JohnAAbbott ... while this was restricted to the "both arguments have the same type.
But yeah it really should be
| function *(x::T, y::T) where {T <: MatrixElem} | |
| function *(x::T, y::T) where {T <: MatElem} |
and then there should be MatRingElem methods for *, +, - etc. which delegate to the the underlying "plain" matrix.
I.e., also the existing changes in this PR in lines 826 and 837 of this file need to be furhter modified.
| struct MatRingElem{T <: NCRingElement} <: AbstractAlgebra.MatRingElem{T} | ||
| base_ring::NCRing | ||
| entries::Matrix{T} | ||
| data::MatElem{T} |
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.
An access for this could be matrix(m::MatRingElem) = m.data
That would be consisting for the existing matrix(x::MatrixGroupElem) method in OSCAR which also works like that.
This is code trying to address issue #1955 which I wrote last December but never finished.
@JohnAAbbott I am putting it here because it might be useful for you, e.g. you could use it as a basis and complete it (feel free to work on this PR, or copy it to a new one). Or perhaps you prefer to start from scratch, but then it might still be helpful to check what I've done here.
This is incomplete in that I am sure tests will fail and things are missing. A lot of code which is currently defined for
MatrixElemmay have to be changed (but it may also be possible to delay that for the time being -- e.g. changingdetto delegate todetof the wrapped matrix is strictly speaking an optimization?)