We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
similar(::NemoMatrix, ::Ring)
julia> s = matrix(QQ, 2, 2, [1,2,3,4]) [1 2] [3 4] julia> t = similar(s, ZZ) [#undef #undef] [#undef #undef] julia> typeof(s) QQMatrix julia> typeof(t) AbstractAlgebra.Generic.MatSpaceElem{ZZRingElem}
I would expect t to be of type dense_matrix_type(ZZ) = ZZMatrix instead.
t
dense_matrix_type(ZZ)
ZZMatrix
This is due to this line in AbstractAlgebra, but I am not sure how to easily fix this. https://github.com/Nemocas/AbstractAlgebra.jl/blob/762eab1920547d2e4c3f3e77a4976fff119bf206/src/Matrix.jl#L348 (#1791 should make it easier to fix)
The text was updated successfully, but these errors were encountered:
T(R::Ring, r::Int, c::Int)
While dense_matrix_type(R)(R, r, c) does not currently work, this does:
dense_matrix_type(R)(R, r, c)
parent_type(dense_matrix_type(R))(R, r, c)()
Thus we could replace
M = Matrix{TT}(undef, (r, c)) z = x isa MatElem ? Generic.MatSpaceElem{TT}(R, M) : Generic.MatRingElem{TT}(R, M)
by something like this, at least for now:
if x isa MatElem return parent_type(dense_matrix_type(R))(R, r, c)() end M = Matrix{TT}(undef, (r, c)) return Generic.MatRingElem{TT}(R, M)
Sorry, something went wrong.
Or zero_matrix(R, r, c), my all time favorite.
zero_matrix(R, r, c)
No branches or pull requests
I would expect
t
to be of typedense_matrix_type(ZZ)
=ZZMatrix
instead.This is due to this line in AbstractAlgebra, but I am not sure how to easily fix this.
https://github.com/Nemocas/AbstractAlgebra.jl/blob/762eab1920547d2e4c3f3e77a4976fff119bf206/src/Matrix.jl#L348
(#1791 should make it easier to fix)
The text was updated successfully, but these errors were encountered: