MutableArithmetics: An API for mutable operations
Benoît Legat · JuliaCon Proceedings · 2024
Arithmetic operations defined in Julia do not modify their arguments.However, in many situations, a variable represents an accumulator that can be modified in-place to contain the result, e.g., when summing the elements of an array.Moreover, for types that support mutation, mutating the value may have a significant performance benefit over creating a new instance.This paper presents an interface that allows algorithms to exploit mutability in arithmetic operations in a generic manner.