Skip to content

specialized arithmetic and in-place functions #35

@kalmarek

Description

@kalmarek

by doing promote stuff simple arithmetic allocates a lot:

julia> z = ArbComplex(2)
2.0 + 0im

julia> @time z+1;
  0.000023 seconds (11 allocations: 600 bytes)

by exploiting arbs acb_add_si this can be cut to

julia> @time z+1;
  0.000010 seconds (5 allocations: 272 bytes)

Mutable arithmetic/ funcions

I'd like to see three-argument arithmetic (along the lines of mul!(out, x, y)). (related: #6)

For all the functions wrapped through @eval (ex. most of elementary.jl) we could easily expose the two argument versions

f!(out, args...) = ... #ccall to arb
function f(args...)
    res = ... #allocate the result;
    f!(res, args...)
    return res
end

Again, this for the purpose of writing more functions and cutting on the allocations/time (especially handy when evaluating the integrand)

will you accept such changes?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions