From edaa988b4449b0fc252979dbb73844a34c74cd0f Mon Sep 17 00:00:00 2001 From: Adam Jozefiak Date: Wed, 6 May 2020 12:49:08 -0700 Subject: [PATCH 1/3] fixed BandedBlockBandedMatrix interface change in jointoperators --- src/jointoperators.jl | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/jointoperators.jl b/src/jointoperators.jl index 0170c62..5b701ea 100644 --- a/src/jointoperators.jl +++ b/src/jointoperators.jl @@ -2,7 +2,7 @@ jointoperator_bc(operators, Q::Array) Returns a discretized operator that solves systems of differential equations defined by -`operators` with transitions by `Q` where `operators` is an N-length collection of +`operators` with transitions by `Q` where `operators` is an N-length collection of discretized operators with boundary conditions applied and `Q` is N by N intensity matrix. # Examples @@ -47,23 +47,23 @@ function jointoperator_bc(operators, Q::Array) N = length(operators) # check if all operators are square - @assert all(operator->(size(operator,1) == size(operator,2)), + @assert all(operator->(size(operator,1) == size(operator,2)), operators) # check if all operators have same size - @assert all(operator->(size(operator) == size(operators[1])), + @assert all(operator->(size(operator) == size(operators[1])), operators) - # check if the size of transition matrix is - # same as the number of operators + # check if the size of transition matrix is + # same as the number of operators @assert size(Q,1) == size(Q,2) == N - # extract operators and append them to form a diagonal block tridiagonal + # extract operators and append them to form a diagonal block tridiagonal Ls = blockdiag(sparse.(operators)...) - Ls = BandedBlockBandedMatrix(Ls, (M*ones(Int64, N), M*ones(Int64, N)), (0,0), (1,1)) + Ls = BandedBlockBandedMatrix(Ls, M*ones(Int64, N), M*ones(Int64, N), (0,0), (1,1)) # construct a kronecker product of Q times I_M - Qs = BandedBlockBandedMatrix(Kron(Q, Eye(M))) + Qs = BandedBlockBandedMatrix(Kron(Q, Eye(M)), M*ones(Int64, N), M*ones(Int64, N), (0,0), (1,1)) return (Ls + Qs) end From 7a7d75e535aecf6150bca5d8b3a82ee5e3698a5b Mon Sep 17 00:00:00 2001 From: Adam Jozefiak Date: Wed, 6 May 2020 14:40:31 -0700 Subject: [PATCH 2/3] modify bandwidth for Qs --- src/jointoperators.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jointoperators.jl b/src/jointoperators.jl index 5b701ea..062a33b 100644 --- a/src/jointoperators.jl +++ b/src/jointoperators.jl @@ -63,7 +63,7 @@ function jointoperator_bc(operators, Q::Array) Ls = BandedBlockBandedMatrix(Ls, M*ones(Int64, N), M*ones(Int64, N), (0,0), (1,1)) # construct a kronecker product of Q times I_M - Qs = BandedBlockBandedMatrix(Kron(Q, Eye(M)), M*ones(Int64, N), M*ones(Int64, N), (0,0), (1,1)) + Qs = BandedBlockBandedMatrix(Kron(Q, Eye(M)), M*ones(Int64, N), M*ones(Int64, N), (0,0), (0,0)) return (Ls + Qs) end From 58973aa8d109acee3d465309cbfb0a3e05fbf7f1 Mon Sep 17 00:00:00 2001 From: Adam Jozefiak Date: Wed, 6 May 2020 15:32:26 -0700 Subject: [PATCH 3/3] fix Qs in jointoperator --- src/jointoperators.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jointoperators.jl b/src/jointoperators.jl index 062a33b..5c992d1 100644 --- a/src/jointoperators.jl +++ b/src/jointoperators.jl @@ -63,7 +63,7 @@ function jointoperator_bc(operators, Q::Array) Ls = BandedBlockBandedMatrix(Ls, M*ones(Int64, N), M*ones(Int64, N), (0,0), (1,1)) # construct a kronecker product of Q times I_M - Qs = BandedBlockBandedMatrix(Kron(Q, Eye(M)), M*ones(Int64, N), M*ones(Int64, N), (0,0), (0,0)) + Qs = BandedBlockBandedMatrix(Kron(Q, Eye(M)), M*ones(Int64, N), M*ones(Int64, N), (1,1), (0,0)) return (Ls + Qs) end