Mercurial > repos > public > sbplib
comparison +blockmatrix/fromMatrixTest.m @ 579:a5f1b0267dba feature/grids
Be less strict about what is considered a block matrix
Empty blocks of different sizes are now allowed as well as empty block dimensions
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Thu, 07 Sep 2017 09:21:04 +0200 |
parents | 40dda96c8c9c |
children |
comparison
equal
deleted
inserted
replaced
578:1fe16b34f114 | 579:a5f1b0267dba |
---|---|
44 { | 44 { |
45 [17 24], [1 8 15]; | 45 [17 24], [1 8 15]; |
46 [23 5; 4 6; 10 12; 11 18], [7 14 16; 13 20 22; 19 21 3; 25 2 9]; | 46 [23 5; 4 6; 10 12; 11 18], [7 14 16; 13 20 22; 19 21 3; 25 2 9]; |
47 }; | 47 }; |
48 }, | 48 }, |
49 { | |
50 { | |
51 magic(3), | |
52 {[1 0 2],[1 2 0]} | |
53 }, | |
54 mat2cell(magic(3),[1 0 2],[1 2 0]) | |
55 }, | |
56 { | |
57 { | |
58 zeros(0,1), | |
59 {0,1}, | |
60 }, | |
61 {zeros(0,1)} | |
62 }, | |
49 }; | 63 }; |
50 for i = 1:length(cases) | 64 for i = 1:length(cases) |
51 out = convertToFull(blockmatrix.fromMatrix(cases{i}{1}{:})); | 65 out = convertToFull(blockmatrix.fromMatrix(cases{i}{1}{:})); |
52 expected = cases{i}{2}; | 66 expected = cases{i}{2}; |
53 testCase.verifyEqual(out,expected); | 67 testCase.verifyEqual(out,expected); |