VVAR class: a fast "virtual" variable class for MATLAB.

버전 1.1.0.0 (7.12 KB) 작성자: Malcolm Lidierth
VVAR can be used to pre-allocate arrays much faster than using zeros
다운로드 수: 414
업데이트 날짜: 2011/12/21

라이선스 보기

VVAR uses a pre-existing "scratch" file to store variables and can be used to pre-allocate a huge array much faster than using zeros. On a MacBook Pro with 64 bit MATLAB and 4Gb RAM, creating an 8Gb double array with VVAR was 100x faster than using zeros (1.24s vs 122.3s).

Upper limits on array size are system and MATLAB version dependent. See the MATLAB documenation.

Note that speed improvements are seen only when the array is too large for the available memory and forces virtual memory use.

With some caveats, VVAR instances can be used in much the same way as MATLAB primitive array types, e.g.
x=VVAR(10000,10000)
% x curently contains garbage (not zeros) so
%...
%... fill x with data ...
%...
% Then filter each column e.g.:
for k=1:size(x,2)
x(:,k)=filtfilt(b, a, x(:,k));
end

A VVAR instance is simply a wrapper for the standard MATLAB memmapfile class that uses "nakhur" techniques to trick MATLAB into believing the VVAR instance is a MATLAB numeric matrix. This is achieved by having standard MATLAB methods return non-standard results. Effectively, the VVAR class instance pretends to be the primitive data that it represents so that the methods return results relevant to the contents of the instance not the instance itself e.g. with the instance above, isreal(x) returns true while size(x) returns [10000,10000]. Numel is not overloaded so numel(x) returns 1.

VVAR supports the full range of indexing options: subreferencing, linear and logical indexing etc.

Part of Project Waterloo from King's College London - see http://sigtool.sourceforge.net/

인용 양식

Malcolm Lidierth (2024). VVAR class: a fast "virtual" variable class for MATLAB. (https://www.mathworks.com/matlabcentral/fileexchange/34276-vvar-class-a-fast-virtual-variable-class-for-matlab), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2008a
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Performance and Memory에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
버전 게시됨 릴리스 정보
1.1.0.0

Minor improvements

1.0.0.0