Mercurial > repos > public > sbplib
view +blockmatrix/isBlockmatrix.m @ 888:8732d6bd9890 feature/timesteppers
Add general Runge-Kutta class
- Add a general Runge-Kutta class which time integrates the solution based on coefficients obtained from a Butcher tableau
- Add butcher tableau which returns coefficents for the specified Runge-Kutta method
- Remove RungKutta4proper, since obsolete
author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
---|---|
date | Thu, 15 Nov 2018 17:10:01 -0800 |
parents | a5f1b0267dba |
children |
line wrap: on
line source
function b = isBlockmatrix(bm) if ~iscell(bm) b = false; return end % Make sure all blocks are numerical matrices for i = 1:length(bm) if ~isnumeric(bm{i}) b = false; return end end [N,M] = size(bm); % Make sure column dimensions agree for i = 1:N d = []; for j = 1:M d_ij = size(bm{i,j},1); if d_ij == 0 continue end if isempty(d) d = d_ij; continue end if d ~= d_ij b = false; return end end end % Make sure row dimensions agree for j = 1:M d = []; for i = 1:N d_ij = size(bm{i,j},2); if d_ij == 0 continue end if isempty(d) d = d_ij; continue end if d ~= d_ij b = false; return end end end b = true; end