Skip to content
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

Turn _arb_set and _acb_set into set! methods #1909

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 45 additions & 45 deletions src/arb/ArbTypes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -100,19 +100,19 @@

function RealFieldElem(x::Union{Real, ZZRingElem, QQFieldElem, AbstractString, RealFieldElem}, p::Int)
z = RealFieldElem()
_arb_set(z, x, p)
set!(z, x, p)
return z
end

function RealFieldElem(x::Union{Real, ZZRingElem})
z = RealFieldElem()
_arb_set(z, x)
set!(z, x)
return z
end

function RealFieldElem(mid::RealFieldElem, rad::RealFieldElem)
z = RealFieldElem()
ccall((:arb_set, libflint), Nothing, (Ref{RealFieldElem}, Ref{RealFieldElem}), z, mid)
set!(z, mid)
ccall((:arb_add_error, libflint), Nothing, (Ref{RealFieldElem}, Ref{RealFieldElem}), z, rad)
return z
end
Expand Down Expand Up @@ -158,19 +158,19 @@

function ArbFieldElem(x::Union{Real, ZZRingElem, QQFieldElem, AbstractString, ArbFieldElem}, p::Int)
z = ArbFieldElem()
_arb_set(z, x, p)
set!(z, x, p)
return z
end

function ArbFieldElem(x::Union{Real, ZZRingElem, ArbFieldElem})
z = ArbFieldElem()
_arb_set(z, x)
set!(z, x)
return z
end

function ArbFieldElem(mid::ArbFieldElem, rad::ArbFieldElem)
z = ArbFieldElem()
ccall((:arb_set, libflint), Nothing, (Ref{ArbFieldElem}, Ref{ArbFieldElem}), z, mid)
set!(z, mid)
ccall((:arb_add_error, libflint), Nothing, (Ref{ArbFieldElem}, Ref{ArbFieldElem}), z, rad)
return z
end
Expand Down Expand Up @@ -219,19 +219,19 @@

function ComplexFieldElem(x::Union{Number, ZZRingElem, RealFieldElem, ComplexFieldElem})
z = ComplexFieldElem()
_acb_set(z, x)
set!(z, x)

Check warning on line 222 in src/arb/ArbTypes.jl

View check run for this annotation

Codecov / codecov/patch

src/arb/ArbTypes.jl#L222

Added line #L222 was not covered by tests
return z
end

function ComplexFieldElem(x::Union{Number, ZZRingElem, QQFieldElem, RealFieldElem, ComplexFieldElem, AbstractString}, p::Int)
z = ComplexFieldElem()
_acb_set(z, x, p)
set!(z, x, p)
return z
end

function ComplexFieldElem(x::T, y::T, p::Int) where {T <: Union{Real, ZZRingElem, QQFieldElem, AbstractString, RealFieldElem}}
z = ComplexFieldElem()
_acb_set(z, x, y, p)
set!(z, (x, y), p)
return z
end
end
Expand Down Expand Up @@ -370,25 +370,25 @@

function AcbFieldElem(x::Union{Number, ZZRingElem, ArbFieldElem, AcbFieldElem})
z = AcbFieldElem()
_acb_set(z, x)
set!(z, x)

Check warning on line 373 in src/arb/ArbTypes.jl

View check run for this annotation

Codecov / codecov/patch

src/arb/ArbTypes.jl#L373

Added line #L373 was not covered by tests
return z
end

function AcbFieldElem(x::Union{Number, ZZRingElem, QQFieldElem, ArbFieldElem, AcbFieldElem, AbstractString}, p::Int)
z = AcbFieldElem()
_acb_set(z, x, p)
set!(z, x, p)
return z
end

#function AcbFieldElem{T <: Union{Int, UInt, Float64, ZZRingElem, BigFloat, ArbFieldElem}}(x::T, y::T)
# z = AcbFieldElem()
# _acb_set(z, x, y)
# set!(z, x, y)
# return z
#end

function AcbFieldElem(x::T, y::T, p::Int) where {T <: Union{Real, ZZRingElem, QQFieldElem, AbstractString, ArbFieldElem}}
z = AcbFieldElem()
_acb_set(z, x, y, p)
set!(z, (x, y), p)
return z
end
end
Expand Down Expand Up @@ -822,7 +822,7 @@
GC.@preserve z for i = 1:r
for j = 1:c
el = mat_entry_ptr(z, i, j)
_arb_set(el, arr[i, j])
set!(el, arr[i, j])

Check warning on line 825 in src/arb/ArbTypes.jl

View check run for this annotation

Codecov / codecov/patch

src/arb/ArbTypes.jl#L825

Added line #L825 was not covered by tests
end
end
return z
Expand All @@ -833,7 +833,7 @@
GC.@preserve z for i = 1:r
for j = 1:c
el = mat_entry_ptr(z, i, j)
_arb_set(el, arr[(i-1)*c+j])
set!(el, arr[(i-1)*c+j])

Check warning on line 836 in src/arb/ArbTypes.jl

View check run for this annotation

Codecov / codecov/patch

src/arb/ArbTypes.jl#L836

Added line #L836 was not covered by tests
end
end
return z
Expand All @@ -844,7 +844,7 @@
GC.@preserve z for i = 1:r
for j = 1:c
el = mat_entry_ptr(z, i, j)
_arb_set(el, arr[i, j], prec)
set!(el, arr[i, j], prec)
end
end
return z
Expand All @@ -855,7 +855,7 @@
GC.@preserve z for i = 1:r
for j = 1:c
el = mat_entry_ptr(z, i, j)
_arb_set(el, arr[(i-1)*c+j], prec)
set!(el, arr[(i-1)*c+j], prec)
end
end
return z
Expand Down Expand Up @@ -910,7 +910,7 @@
GC.@preserve z for i = 1:r
for j = 1:c
el = mat_entry_ptr(z, i, j)
_arb_set(el, arr[i, j])
set!(el, arr[i, j])

Check warning on line 913 in src/arb/ArbTypes.jl

View check run for this annotation

Codecov / codecov/patch

src/arb/ArbTypes.jl#L913

Added line #L913 was not covered by tests
end
end
return z
Expand All @@ -921,7 +921,7 @@
GC.@preserve z for i = 1:r
for j = 1:c
el = mat_entry_ptr(z, i, j)
_arb_set(el, arr[(i-1)*c+j])
set!(el, arr[(i-1)*c+j])

Check warning on line 924 in src/arb/ArbTypes.jl

View check run for this annotation

Codecov / codecov/patch

src/arb/ArbTypes.jl#L924

Added line #L924 was not covered by tests
end
end
return z
Expand All @@ -932,7 +932,7 @@
GC.@preserve z for i = 1:r
for j = 1:c
el = mat_entry_ptr(z, i, j)
_arb_set(el, arr[i, j], prec)
set!(el, arr[i, j], prec)
end
end
return z
Expand All @@ -943,7 +943,7 @@
GC.@preserve z for i = 1:r
for j = 1:c
el = mat_entry_ptr(z, i, j)
_arb_set(el, arr[(i-1)*c+j], prec)
set!(el, arr[(i-1)*c+j], prec)
end
end
return z
Expand Down Expand Up @@ -1016,7 +1016,7 @@
GC.@preserve z for i = 1:r
for j = 1:c
el = mat_entry_ptr(z, i, j)
_acb_set(el, arr[i, j])
set!(el, arr[i, j])

Check warning on line 1019 in src/arb/ArbTypes.jl

View check run for this annotation

Codecov / codecov/patch

src/arb/ArbTypes.jl#L1019

Added line #L1019 was not covered by tests
end
end
return z
Expand All @@ -1027,7 +1027,7 @@
GC.@preserve z for i = 1:r
for j = 1:c
el = mat_entry_ptr(z, i, j)
_acb_set(el, arr[i, j])
set!(el, arr[i, j])

Check warning on line 1030 in src/arb/ArbTypes.jl

View check run for this annotation

Codecov / codecov/patch

src/arb/ArbTypes.jl#L1030

Added line #L1030 was not covered by tests
end
end
return z
Expand All @@ -1038,7 +1038,7 @@
GC.@preserve z for i = 1:r
for j = 1:c
el = mat_entry_ptr(z, i, j)
_acb_set(el, arr[(i-1)*c+j])
set!(el, arr[(i-1)*c+j])

Check warning on line 1041 in src/arb/ArbTypes.jl

View check run for this annotation

Codecov / codecov/patch

src/arb/ArbTypes.jl#L1041

Added line #L1041 was not covered by tests
end
end
return z
Expand All @@ -1049,7 +1049,7 @@
GC.@preserve z for i = 1:r
for j = 1:c
el = mat_entry_ptr(z, i, j)
_acb_set(el, arr[(i-1)*c+j])
set!(el, arr[(i-1)*c+j])

Check warning on line 1052 in src/arb/ArbTypes.jl

View check run for this annotation

Codecov / codecov/patch

src/arb/ArbTypes.jl#L1052

Added line #L1052 was not covered by tests
end
end
return z
Expand All @@ -1060,7 +1060,7 @@
GC.@preserve z for i = 1:r
for j = 1:c
el = mat_entry_ptr(z, i, j)
_acb_set(el, arr[i, j], prec)
set!(el, arr[i, j], prec)
end
end
return z
Expand All @@ -1071,7 +1071,7 @@
GC.@preserve z for i = 1:r
for j = 1:c
el = mat_entry_ptr(z, i, j)
_acb_set(el, arr[i, j], prec)
set!(el, arr[i, j], prec)
end
end
return z
Expand All @@ -1082,7 +1082,7 @@
GC.@preserve z for i = 1:r
for j = 1:c
el = mat_entry_ptr(z, i, j)
_acb_set(el, arr[(i-1)*c+j], prec)
set!(el, arr[(i-1)*c+j], prec)
end
end
return z
Expand All @@ -1093,7 +1093,7 @@
GC.@preserve z for i = 1:r
for j = 1:c
el = mat_entry_ptr(z, i, j)
_acb_set(el, arr[(i-1)*c+j], prec)
set!(el, arr[(i-1)*c+j], prec)
end
end
return z
Expand All @@ -1104,7 +1104,7 @@
GC.@preserve z for i = 1:r
for j = 1:c
el = mat_entry_ptr(z, i, j)
_acb_set(el, arr[i, j][1], arr[i,j][2], prec)
set!(el, arr[i, j][1], arr[i,j][2], prec)

Check warning on line 1107 in src/arb/ArbTypes.jl

View check run for this annotation

Codecov / codecov/patch

src/arb/ArbTypes.jl#L1107

Added line #L1107 was not covered by tests
end
end
return z
Expand All @@ -1115,7 +1115,7 @@
GC.@preserve z for i = 1:r
for j = 1:c
el = mat_entry_ptr(z, i, j)
_acb_set(el, arr[i, j][1], arr[i,j][2], prec)
set!(el, arr[i, j][1], arr[i,j][2], prec)

Check warning on line 1118 in src/arb/ArbTypes.jl

View check run for this annotation

Codecov / codecov/patch

src/arb/ArbTypes.jl#L1118

Added line #L1118 was not covered by tests
end
end
return z
Expand All @@ -1126,7 +1126,7 @@
GC.@preserve z for i = 1:r
for j = 1:c
el = mat_entry_ptr(z, i, j)
_acb_set(el, arr[(i-1)*c+j][1], arr[(i-1)*c+j][2], prec)
set!(el, arr[(i-1)*c+j][1], arr[(i-1)*c+j][2], prec)

Check warning on line 1129 in src/arb/ArbTypes.jl

View check run for this annotation

Codecov / codecov/patch

src/arb/ArbTypes.jl#L1129

Added line #L1129 was not covered by tests
end
end
return z
Expand All @@ -1137,7 +1137,7 @@
GC.@preserve z for i = 1:r
for j = 1:c
el = mat_entry_ptr(z, i, j)
_acb_set(el, arr[(i-1)*c+j][1], arr[(i-1)*c+j][2], prec)
set!(el, arr[(i-1)*c+j][1], arr[(i-1)*c+j][2], prec)

Check warning on line 1140 in src/arb/ArbTypes.jl

View check run for this annotation

Codecov / codecov/patch

src/arb/ArbTypes.jl#L1140

Added line #L1140 was not covered by tests
end
end
return z
Expand Down Expand Up @@ -1206,7 +1206,7 @@
GC.@preserve z for i = 1:r
for j = 1:c
el = mat_entry_ptr(z, i, j)
_acb_set(el, arr[i, j])
set!(el, arr[i, j])

Check warning on line 1209 in src/arb/ArbTypes.jl

View check run for this annotation

Codecov / codecov/patch

src/arb/ArbTypes.jl#L1209

Added line #L1209 was not covered by tests
end
end
return z
Expand All @@ -1217,7 +1217,7 @@
GC.@preserve z for i = 1:r
for j = 1:c
el = mat_entry_ptr(z, i, j)
_acb_set(el, arr[i, j])
set!(el, arr[i, j])

Check warning on line 1220 in src/arb/ArbTypes.jl

View check run for this annotation

Codecov / codecov/patch

src/arb/ArbTypes.jl#L1220

Added line #L1220 was not covered by tests
end
end
return z
Expand All @@ -1228,7 +1228,7 @@
GC.@preserve z for i = 1:r
for j = 1:c
el = mat_entry_ptr(z, i, j)
_acb_set(el, arr[(i-1)*c+j])
set!(el, arr[(i-1)*c+j])

Check warning on line 1231 in src/arb/ArbTypes.jl

View check run for this annotation

Codecov / codecov/patch

src/arb/ArbTypes.jl#L1231

Added line #L1231 was not covered by tests
end
end
return z
Expand All @@ -1239,7 +1239,7 @@
GC.@preserve z for i = 1:r
for j = 1:c
el = mat_entry_ptr(z, i, j)
_acb_set(el, arr[(i-1)*c+j])
set!(el, arr[(i-1)*c+j])

Check warning on line 1242 in src/arb/ArbTypes.jl

View check run for this annotation

Codecov / codecov/patch

src/arb/ArbTypes.jl#L1242

Added line #L1242 was not covered by tests
end
end
return z
Expand All @@ -1250,7 +1250,7 @@
GC.@preserve z for i = 1:r
for j = 1:c
el = mat_entry_ptr(z, i, j)
_acb_set(el, arr[i, j], prec)
set!(el, arr[i, j], prec)
end
end
return z
Expand All @@ -1261,7 +1261,7 @@
GC.@preserve z for i = 1:r
for j = 1:c
el = mat_entry_ptr(z, i, j)
_acb_set(el, arr[i, j], prec)
set!(el, arr[i, j], prec)
end
end
return z
Expand All @@ -1272,7 +1272,7 @@
GC.@preserve z for i = 1:r
for j = 1:c
el = mat_entry_ptr(z, i, j)
_acb_set(el, arr[(i-1)*c+j], prec)
set!(el, arr[(i-1)*c+j], prec)
end
end
return z
Expand All @@ -1283,7 +1283,7 @@
GC.@preserve z for i = 1:r
for j = 1:c
el = mat_entry_ptr(z, i, j)
_acb_set(el, arr[(i-1)*c+j], prec)
set!(el, arr[(i-1)*c+j], prec)
end
end
return z
Expand All @@ -1294,7 +1294,7 @@
GC.@preserve z for i = 1:r
for j = 1:c
el = mat_entry_ptr(z, i, j)
_acb_set(el, arr[i, j][1], arr[i,j][2], prec)
set!(el, arr[i, j][1], arr[i,j][2], prec)

Check warning on line 1297 in src/arb/ArbTypes.jl

View check run for this annotation

Codecov / codecov/patch

src/arb/ArbTypes.jl#L1297

Added line #L1297 was not covered by tests
end
end
return z
Expand All @@ -1305,7 +1305,7 @@
GC.@preserve z for i = 1:r
for j = 1:c
el = mat_entry_ptr(z, i, j)
_acb_set(el, arr[i, j][1], arr[i,j][2], prec)
set!(el, arr[i, j][1], arr[i,j][2], prec)

Check warning on line 1308 in src/arb/ArbTypes.jl

View check run for this annotation

Codecov / codecov/patch

src/arb/ArbTypes.jl#L1308

Added line #L1308 was not covered by tests
end
end
return z
Expand All @@ -1316,7 +1316,7 @@
GC.@preserve z for i = 1:r
for j = 1:c
el = mat_entry_ptr(z, i, j)
_acb_set(el, arr[(i-1)*c+j][1], arr[(i-1)*c+j][2], prec)
set!(el, arr[(i-1)*c+j][1], arr[(i-1)*c+j][2], prec)

Check warning on line 1319 in src/arb/ArbTypes.jl

View check run for this annotation

Codecov / codecov/patch

src/arb/ArbTypes.jl#L1319

Added line #L1319 was not covered by tests
end
end
return z
Expand All @@ -1327,7 +1327,7 @@
GC.@preserve z for i = 1:r
for j = 1:c
el = mat_entry_ptr(z, i, j)
_acb_set(el, arr[(i-1)*c+j][1], arr[(i-1)*c+j][2], prec)
set!(el, arr[(i-1)*c+j][1], arr[(i-1)*c+j][2], prec)

Check warning on line 1330 in src/arb/ArbTypes.jl

View check run for this annotation

Codecov / codecov/patch

src/arb/ArbTypes.jl#L1330

Added line #L1330 was not covered by tests
end
end
return z
Expand Down
Loading
Loading