InPlace.jl

InPlace.jl - in-place operations where possible
Author tkluck
Popularity
5 Stars
Updated Last
2 Years Ago
Started In
October 2018

InPlace.jl - in-place operations where possible

Build Status Test coverage
Coverage Status

Synopsis

using InPlace
a = big"1"
b = a
@inplace b += 2
a   # is now also equal to 3

Description

This package exposes a single macro, @inplace, which applies the operation in its expression argument in-place on the left-hand side (if it is mutable).

Examples:

@inplace a = f(args...)
@inplace a += expr

In the case where a is mutable, it is an implementation detail whether its value is actually modified. For this reason, one should use this operation only on values for which the current stackframe holds the only reference; e.g. by using deepcopy.

In this version of the package, it is only the +,- (unary and binary) and * operations that are done in-place, and only for BigInt operands.

References

This package was created for speeding up PolynomialRings.jl.

Required Packages

No packages found.

Used By Packages