Skip to content

Instantly share code, notes, and snippets.

@cako
Last active October 23, 2018 04:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cako/6b45d34eda9b4498ed8014a7659eaedb to your computer and use it in GitHub Desktop.
Save cako/6b45d34eda9b4498ed8014a7659eaedb to your computer and use it in GitHub Desktop.
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