Last active
October 23, 2018 04:47
-
-
Save cako/6b45d34eda9b4498ed8014a7659eaedb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using LinearMaps | |
using Test | |
function f1(source) | |
dest = zeros(9) | |
tmp = reshape(source, 5, 2) | |
return dest | |
end | |
function f2(source) | |
dest = zeros(6) | |
tmp = reshape(source, 3, 3) | |
return dest | |
end | |
function f3(source) | |
dest = zeros(4) | |
tmp = reshape(source, 3, 2) | |
return dest | |
end | |
function f4(source) | |
dest = zeros(18) | |
tmp = reshape(source, 1, 4) | |
return dest | |
end | |
L1 = LinearMap(f1, 9, 10) | |
L2 = LinearMap(f2, 6, 9) | |
L3 = LinearMap(f3, 4, 6) | |
L4 = LinearMap(f4, 18, 4) | |
A = L4*L3*L2*L1 | |
@test A*ones(10) == L4*(L3*(L2*(L1*ones(10)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment