diff --git a/Project.toml b/Project.toml index 5270dd68..48298903 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "Arblib" uuid = "fb37089c-8514-4489-9461-98f9c8763369" authors = ["Marek Kaluba ", "Sascha Timme ", "Joel Dahne "] -version = "0.7.3" +version = "0.8.0" [deps] Arb_jll = "d9960996-1013-53c9-9ba4-74a4155039c3" diff --git a/src/precision.jl b/src/precision.jl index a54be0e0..a9451f98 100644 --- a/src/precision.jl +++ b/src/precision.jl @@ -17,6 +17,8 @@ Base.precision(x::ArbTypes) = x.prec Base.precision(x::MagLike) = DEFAULT_PRECISION[] # disambiguation Base.precision(::MagOrRef) = DEFAULT_PRECISION[] +# ArbSeries and AcbSeries don't store their precision +Base.precision(x::Union{ArbSeries,AcbSeries}) = precision(x.poly) @inline _precision(x::Union{ArbTypes,BigFloat}) = precision(x) @inline _precision(z::Complex) = max(_precision(real(z)), _precision(imag(z))) @@ -60,7 +62,7 @@ Base.setprecision(A::T, prec::Integer) where {T<:Union{AcbMatrix,AcbRefMatrix}} Base.setprecision(poly::ArbPoly, prec::Integer) = ArbPoly(poly.arb_poly; prec) Base.setprecision(series::ArbSeries, prec::Integer) = - ArbSeries(series.arb_poly, degree = degree(series); prec) + ArbSeries(series, degree = degree(series); prec) Base.setprecision(poly::AcbPoly, prec::Integer) = AcbPoly(poly.acb_poly; prec) Base.setprecision(series::AcbSeries, prec::Integer) = - AcbSeries(series.acb_poly, degree = degree(series); prec) + AcbSeries(series, degree = degree(series); prec) diff --git a/src/types.jl b/src/types.jl index 2a0baaa1..6f48c9b2 100644 --- a/src/types.jl +++ b/src/types.jl @@ -91,14 +91,16 @@ end """ ArbSeries <: Number + +This type should be considered experimental, the interface for it +might change in the future. """ struct ArbSeries <: Number - arb_poly::arb_poly_struct + poly::ArbPoly degree::Int - prec::Int ArbSeries(; degree::Integer = 0, prec::Integer = DEFAULT_PRECISION[]) = - fit_length!(new(arb_poly_struct(), degree, prec), degree + 1) + fit_length!(new(ArbPoly(; prec), degree), degree + 1) end """ @@ -113,14 +115,16 @@ end """ AcbSeries <: Number + +This type should be considered experimental, the interface for it +might change in the future. """ struct AcbSeries <: Number - acb_poly::acb_poly_struct + poly::AcbPoly degree::Int - prec::Int AcbSeries(; degree::Integer = 0, prec::Integer = DEFAULT_PRECISION[]) = - fit_length!(new(acb_poly_struct(), degree, prec), degree + 1) + fit_length!(new(AcbPoly(; prec), degree), degree + 1) end """ @@ -235,6 +239,10 @@ for (T, prefix) in ( end end +# ArbSeries and AcbSeries requires a different cstruct implementation +cstruct(x::ArbSeries) = cstruct(x.poly) +cstruct(x::AcbSeries) = cstruct(x.poly) + # handle Ref types for prefix in [:mag, :arf, :arb, :acb] T = Symbol(uppercasefirst(string(prefix)))