-
Notifications
You must be signed in to change notification settings - Fork 58
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
Ensure MatElem subtypes T have T(R::Ring, r::Int, c::Int)
constructor
#1791
base: master
Are you sure you want to change the base?
Changes from all commits
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 |
---|---|---|
|
@@ -4697,7 +4697,10 @@ | |
rows::Ptr{Ptr{QQFieldElem}} | ||
view_parent | ||
|
||
# used by windows, not finalised!! | ||
# MatElem interface | ||
QQMatrix(::QQField, r::Int, c::Int) = QQMatrix(r, c) | ||
|
||
# Used by view, not finalised!! | ||
function QQMatrix() | ||
return new() | ||
end | ||
|
@@ -4740,6 +4743,9 @@ | |
rows::Ptr{Ptr{ZZRingElem}} | ||
view_parent | ||
|
||
# MatElem interface | ||
ZZMatrix(::ZZRing, r::Int, c::Int) = ZZMatrix(r, c) | ||
|
||
# Used by view, not finalised!! | ||
function ZZMatrix() | ||
return new() | ||
|
@@ -4785,10 +4791,16 @@ | |
base_ring::zzModRing | ||
view_parent | ||
|
||
# MatElem interface | ||
function zzModMatrix(R::zzModRing, r::Int, c::Int) | ||
z = zzModMatrix(r, c, R.n) | ||
z.base_ring = R | ||
return z | ||
end | ||
|
||
# Used by view, not finalised!! | ||
function zzModMatrix() | ||
z = new() | ||
return z | ||
return new() | ||
end | ||
|
||
function zzModMatrix(r::Int, c::Int, n::UInt) | ||
|
@@ -4929,10 +4941,16 @@ | |
base_ring::ZZModRing | ||
view_parent | ||
|
||
# MatElem interface | ||
function ZZModMatrix(R::ZZModRing, r::Int, c::Int) | ||
z = ZZModMatrix(r, c, R.ninv) | ||
z.base_ring = R | ||
return z | ||
end | ||
|
||
# Used by view, not finalised!! | ||
function ZZModMatrix() | ||
z = new() | ||
return z | ||
return new() | ||
end | ||
|
||
function ZZModMatrix(r::Int, c::Int, ctx::fmpz_mod_ctx_struct) | ||
|
@@ -5087,10 +5105,16 @@ | |
base_ring::FpField | ||
view_parent | ||
|
||
# MatElem interface | ||
function FpMatrix(R::FpField, r::Int, c::Int) | ||
z = FpMatrix(r, c, R.ninv) | ||
z.base_ring = R | ||
return z | ||
end | ||
|
||
# Used by view, not finalised!! | ||
function FpMatrix() | ||
z = new() | ||
return z | ||
return new() | ||
end | ||
|
||
function FpMatrix(r::Int, c::Int, ctx::fmpz_mod_ctx_struct) | ||
|
@@ -5197,10 +5221,16 @@ | |
base_ring::fpField | ||
view_parent | ||
|
||
# MatElem interface | ||
function fpMatrix(R::fpField, r::Int, c::Int) | ||
z = fpMatrix(r, c, R.n) | ||
z.base_ring = R | ||
return z | ||
end | ||
|
||
# Used by view, not finalised!! | ||
function fpMatrix() | ||
z = new() | ||
return z | ||
return new() | ||
end | ||
|
||
function fpMatrix(r::Int, c::Int, n::UInt) | ||
|
@@ -5775,7 +5805,12 @@ | |
base_ring::FqField | ||
view_parent | ||
|
||
# used by windows, not finalised!! | ||
# MatElem interface | ||
function FqMatrix(R::FqField, r::Int, c::Int) | ||
return FqMatrix(r, c, R) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For (One could also argue that we should just use the I think @thofma added the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The reason is that I copy & pasted it from some other matrix constructor in Nemo. There is no deeper reason. It is not part of the API, so can be changed/augmented/removed. |
||
end | ||
|
||
# Used by view, not finalised!! | ||
function FqMatrix() | ||
return new() | ||
end | ||
|
@@ -5941,7 +5976,12 @@ | |
base_ring::FqPolyRepField | ||
view_parent | ||
|
||
# used by windows, not finalised!! | ||
# MatElem interface | ||
function FqPolyRepMatrix(R::FqPolyRepField, r::Int, c::Int) | ||
return FqPolyRepMatrix(r, c, R) | ||
end | ||
|
||
# Used by view, not finalised!! | ||
function FqPolyRepMatrix() | ||
return new() | ||
end | ||
|
@@ -6074,7 +6114,12 @@ | |
base_ring::fqPolyRepField | ||
view_parent | ||
|
||
# used by windows, not finalised!! | ||
# MatElem interface | ||
function fqPolyRepMatrix(R::fqPolyRepField, r::Int, c::Int) | ||
return fqPolyRepMatrix(r, c, R) | ||
end | ||
|
||
# Used by view, not finalised!! | ||
function fqPolyRepMatrix() | ||
return new() | ||
end | ||
|
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.
In the future this and its many siblings could be replaced by a single default method