We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
blkdiagM uses BlockDiagonals to generate Arrays fast, however now, it only supports square matrices.
A1 = ones(2,2); A2 = 2*ones(3,2); A3 = 3*ones(2,3); B = blkdiagM(A1,A2,A3) B = 7×7 1 1 0 0 0 0 0 1 1 0 0 0 0 0 0 0 2 2 0 0 0 0 0 2 2 0 0 0 0 0 2 2 0 0 0 0 0 0 0 3 3 3 0 0 0 0 3 3 3
The text was updated successfully, but these errors were encountered:
Manual blkdiagM was written with non-square support. Until BlockDiagonals adds returning Arrays and also supports non-square matrices
function blkdiagM(in...) argNum=length(in) inSize1=collect( size.(in,1) ) outSize1 = vcat( [0], cumsum(inSize1,dims=1) ) inSize2=collect( size.(in,2) ) outSize2 = vcat( [0], cumsum(inSize2,dims=1) ) out = zeros(last(outSize1),last(outSize2)); for k=1:argNum out[outSize1[k]+1:outSize1[k+1],outSize2[k]+1:outSize2[k+1]] = in[k]; end return out end
Sorry, something went wrong.
Is fixed in a57a52e using https://github.com/aminya/BlockDiagonals.jl
No branches or pull requests
blkdiagM uses BlockDiagonals to generate Arrays fast, however now, it only supports square matrices.
Different tasks of this to do plan:
Achievement check:
The text was updated successfully, but these errors were encountered: