Google Groups

Re: [julia-dev] Re: Magic incantations and immutable arrays


Krzysztof Kamieniecki Apr 26, 2012 11:15 AM
Posted in group: julia-dev
Yes I did mean swapping the references.

My sentence should have read "For instance calling X := X[remix] .^ A + B without some complex work coding on the part of the library requires that the result X is a new block of memory (With the hit of allocating (I will probably have a horde of temporaries), and possible cache performance problems)"

On Thursday, April 26, 2012 1:26:21 PM UTC-4, Peder Axensten wrote:
A swap function?
Put the calculation results into a temporary and then swap (references, not values) X and temp -- the old X values vanishes when temp goes out of scope.

Hälsar Peder

26 apr 2012 kl. 14:56 skrev Krzysztof Kamieniecki:

> For instance calling X := X[remix] .^ A + B without complex work this requires that the result X is a new block of memory (With the hit of allocating (I will probably have a horde of temporaries), and possible cache performance problems)