Mercurial > repos > public > sbplib
view diags.m @ 511:57f3493f851b feature/quantumTriangles
Added sqrt of Ji in the right places, not sure about the interfaces, will not test it properly now
author | Ylva Rydin <ylva.rydin@telia.com> |
---|---|
date | Thu, 08 Jun 2017 10:33:36 +0200 |
parents | 0b87863cb29c |
children |
line wrap: on
line source
function A = diags(B,d,m,n) assert(size(B,1) == m); A = repmat(B(:,1)*0, [1, n]); for i = 1:size(B,2) A(:,d(i)+ (1:m)) = A(:,d(i)+ (1:m)) + diag(B(:,i)); end end