Skip to content

feature: implement MutableArithmetics #2

@nsajko

Description

@nsajko

# In-place arithmetic operations
# Julia doesn't have += as a base function - it's syntax sugar for a = a + b
# We'll create optimized in-place functions that users can call directly
"""
add!(A::NDSparseArray, B::NDSparseArray)
In-place addition of sparse array `B` to sparse array `A`.
Modifies `A` and returns it. More efficient than `A = A + B`.
"""
function add!(A::NDSparseArray{T, N}, B::NDSparseArray{S, N}) where {T, S, N}

Instead of introducing new functions, you could implement MutableArithmetics.jl for NDSparseArray. That would allow more interoperability, as code that makes use of MutableArithmetics would benefit from the in-place optimizations you implement without having to know about your package.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions