-
Notifications
You must be signed in to change notification settings - Fork 73
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
Changes from 1 commit
d0efdf4
06c5bab
1103e30
3bbe379
1f97847
9369964
da2d2ea
e5a24d4
7437ac0
74045d8
15c8c9a
b379297
12ff76f
603a2a6
3e114bd
3ef99ac
5d734bd
677d2d3
f435653
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -823,7 +823,7 @@ end | |||||
| # | ||||||
| ############################################################################### | ||||||
|
|
||||||
| function +(x::MatrixElem{T}, y::MatrixElem{T}) where {T <: NCRingElement} | ||||||
| function +(x::T, y::T) where {T <: MatrixElem} | ||||||
| check_parent(x, y) | ||||||
| r = similar(x) | ||||||
| for i = 1:nrows(x) | ||||||
|
|
@@ -834,7 +834,7 @@ function +(x::MatrixElem{T}, y::MatrixElem{T}) where {T <: NCRingElement} | |||||
| return r | ||||||
| end | ||||||
|
|
||||||
| function -(x::MatrixElem{T}, y::MatrixElem{T}) where {T <: NCRingElement} | ||||||
| function -(x::T, y::T) where {T <: MatrixElem} | ||||||
| check_parent(x, y) | ||||||
| r = similar(x) | ||||||
| for i = 1:nrows(x) | ||||||
|
|
@@ -845,7 +845,7 @@ function -(x::MatrixElem{T}, y::MatrixElem{T}) where {T <: NCRingElement} | |||||
| return r | ||||||
| end | ||||||
|
|
||||||
| function *(x::MatElem{T}, y::MatElem{T}) where {T <: NCRingElement} | ||||||
| function *(x::T, y::T) where {T <: MatrixElem} | ||||||
|
||||||
| 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.
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.
Strange: I thought I had already written that the suggested change triggers a StackOverflowError: namely
Views: Error During Test at /home/zez25zuh/OSCAR/TMP/AbstractAlgebra.jl/ext/TestExt/Rings-conformance-tests.jl:706
Test threw exception
Expression: N1 * N2 == matrix(R, 2, 2, BigInt[14, 20, 20, 29])
StackOverflowError:
Stacktrace:
[1] Array
@ ./boot.jl:479 [inlined]
[2] MatSpaceElem
@ ~/OSCAR/TMP/AbstractAlgebra.jl/src/generic/GenericTypes.jl:1114 [inlined]
[3] _change_base_ring
@ ~/OSCAR/TMP/AbstractAlgebra.jl/src/Matrix.jl:6546 [inlined]
[4] change_base_ring(R::AbstractAlgebra.Integers{BigInt}, M::AbstractAlgebra.Generic.MatSpaceElem{BigInt})
@ AbstractAlgebra ~/OSCAR/TMP/AbstractAlgebra.jl/src/Matrix.jl:6555
[5] promote
@ ~/OSCAR/TMP/AbstractAlgebra.jl/src/Matrix.jl:1170 [inlined]
[6] *(x::AbstractAlgebra.Generic.MatSpaceView{BigInt, Tuple{UnitRange{Int64}, Base.Slice{Base.OneTo{Int64}}}, false}, y::AbstractAlgebra.Generic.MatSpaceElem{BigInt}) (repeats 79980 times)
@ AbstractAlgebra ~/OSCAR/TMP/AbstractAlgebra.jl/src/Matrix.jl:1178
All tests pass with the code in its current state: 2025-12-10 16:38 CET
Uh oh!
There was an error while loading. Please reload this page.