Mercurial > repos > public > sbplib
comparison +blockmatrix/multiply.m @ 832:5573913a0949 feature/burgers1d
Merged with default, and updated +scheme/Burgers1D accordingly
author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
---|---|
date | Tue, 11 Sep 2018 15:58:35 +0200 |
parents | 288138d9586d |
children |
comparison
equal
deleted
inserted
replaced
831:d0934d1143b7 | 832:5573913a0949 |
---|---|
1 function C = multiply(A, B) | |
2 [n_a, m_a] = size(A); | |
3 [n_b, m_b] = size(B); | |
4 | |
5 assert(m_a == n_b, 'Dimensions do not agree.') | |
6 | |
7 C = cell(n_a, m_b); | |
8 | |
9 for i = 1:n_a | |
10 for j = 1:m_b | |
11 C{i,j} = sparse(size(A{i,1},1), size(B{1,j},2)); | |
12 for k = 1:n_b | |
13 C{i,j} = C{i,j} + A{i,k}*B{k,j}; | |
14 end | |
15 end | |
16 end | |
17 end |