📄 addtoheap.m
字号:
function H = addtoheap(F, H)%------------------------------------------------------------------------------%% Appends 2D gridfunction to 1D storage (heap) H.%% Note: because of reasons of efficiency we opt for columnwise storage as% in Matlab. This is also how Fortran stores matrices.%% See also: storeR, storeQ.%% Design and implementation by:% Dr. Paul M. de Zeeuw <Paul.de.Zeeuw@cwi.nl> http://homepages.cwi.nl/~pauldz/% Last Revision: May 5, 2002.% Copyright 2002 Stichting CWI, Amsterdam%------------------------------------------------------------------------------[nH, mH] = size(H);if ~isempty(H) if mH ~= 1 error(' addtoheap - heap should be column vector ') endend% [nF, mF] = size(F);% H = [H reshape(F, 1, nF*mF)]; i.e. storage as rowvector until dd020505% H = [H reshape(F, nF*mF, 1)]; i.e. storage as columnvector, but the following% is straightforward and equivalent:H = [H; F(:)];%------------------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -