inplace_

Version 1.0.0.0 (8,66 KB) von Luca Citi
Matlab versions of the c/c++ operators +=, *= (plus circshift) working in-place and avoiding unneces
657 Downloads
Aktualisiert 13. Okt 2006

Lizenz anzeigen

To date I implemented a few functions I needed, i.e. some C-like operators and circshift:
inplace(x, y, '+=');
inplace(x, y, '.*=');
inplace(x, ns, 'circshift');
that do not allocate memory and compared to the matlab equivalent
x = x + y;
x = x .* y;
x = circshift(x, ns);
are (when working with arrays above 300-400 MB) much faster (tenths of second instead of a few minutes) because the pc does not start swapping to the disk.
The matlab equivalents are currently optimized (performed in-place) only in M-code, but not at the command line.
See http://blogs.mathworks.com/loren/?p=36 for a discussion about it.
IMPORTANT: this piece of code infringes the recommendation that mex files should not overwrite input data.

Zitieren als

Luca Citi (2026). inplace_ (https://de.mathworks.com/matlabcentral/fileexchange/12626-inplace_), MATLAB Central File Exchange. Abgerufen.

Kompatibilität der MATLAB-Version
Erstellt mit R14SP2
Kompatibel mit allen Versionen
Plattform-Kompatibilität
Windows macOS Linux
Kategorien
Mehr zu Dates and Time finden Sie in Help Center und MATLAB Answers
Version Veröffentlicht Versionshinweise
1.0.0.0